Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dx11] Add underlying DX11 device, memory allocation, and some tests #3971

Merged
merged 9 commits into from
Jan 21, 2022

Conversation

quadpixels
Copy link
Contributor

@quadpixels quadpixels commented Jan 7, 2022

Related issue = #992

This change adds an underlying DX11 device, memory allocation, and some tests.

The tests for the Device functionalities make it easier to confirm the functionalities are working without having to touch the rest of the code base (such as Program) or having to run a .py Taichi program.

I wonder if backend-specific tests are a good approach?

This change adds the actual D3D11 device class (ID3D11Device and
ID3D11DeviceContext) from <d3d11.h>.

Tested: Tested with unit test and saw the Dx11Device and the D3D11
device it creates can be successfully created. Enabled Graphics Debug
and confirmed there are no remaining live objects when the test is
finished.
This class fetches information from the D3D11 info queue. This enables
us to count the number of live D3D11 objects. This is most meant for
usage with unit tests and during development.

Tested: Tested with unit tests
This change adds Dx11Device::allocate_memory and
Dx11Device::dealloc_memory.

Tested: Tested with unit tests. The D3D11 objects (Buffer and UAV) are
created and released as expected.
@netlify
Copy link

netlify bot commented Jan 7, 2022

✔️ Deploy Preview for jovial-fermat-aa59dc canceled.

🔨 Explore the source changes: faa5b47

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/61d813fbca6b0600081fe473

@bobcao3
Copy link
Collaborator

bobcao3 commented Jan 17, 2022

I'm so sorry I didn't see this! Please for the future PRs directly request a review from me

@bobcao3 bobcao3 self-requested a review January 17, 2022 11:17
Copy link
Collaborator

@bobcao3 bobcao3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than the nitpick on the global states. Like the added test as well

@bobcao3 bobcao3 requested a review from k-ye January 17, 2022 11:21
@bobcao3
Copy link
Collaborator

bobcao3 commented Jan 17, 2022

/format

@vercel
Copy link

vercel bot commented Jan 17, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/taichi-api-docs-preview/taichi/9jeJdV4uPvhopUJFiJQvAmU6uEm2
✅ Preview: Canceled

[Deployment for 4de9795 canceled]

@netlify
Copy link

netlify bot commented Jan 17, 2022

✔️ Deploy Preview for docsite-preview ready!

🔨 Explore the source changes: 4de9795

🔍 Inspect the deploy log: https://app.netlify.com/sites/docsite-preview/deploys/61e92e17ebf1a80008099caf

😎 Browse the preview: https://deploy-preview-3971--docsite-preview.netlify.app

@bobcao3
Copy link
Collaborator

bobcao3 commented Jan 17, 2022

/rerun

@bobcao3
Copy link
Collaborator

bobcao3 commented Jan 19, 2022

/rerun

This change makes kD3d11DebugEnabled a constant.

Tested: rebuilt-and ran unit test with either kD3d11DebugEnabled set to
ON or OFF.
Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I wonder if backend-specific tests are a good approach?

I think so :-)

taichi/backends/dx/dx_info_queue.h Outdated Show resolved Hide resolved
Co-authored-by: Ye Kuang <k-ye@users.noreply.github.com>
@bobcao3
Copy link
Collaborator

bobcao3 commented Jan 20, 2022

/format

@bobcao3 bobcao3 merged commit 9643518 into taichi-dev:master Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants