-
Notifications
You must be signed in to change notification settings - Fork 71
Vk cuda interop #1061
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
base: master
Are you sure you want to change the base?
Vk cuda interop #1061
Changes from 84 commits
0cd109a
bbe25ab
d74349e
38ed6db
95338cd
3e9dfd2
1ae7747
a3150dc
5018be7
5251b4d
d655b19
454710b
4645bc4
3172ae7
f9b8b4f
a2357e2
0d9c3d8
89f5ae5
152830f
ea3b49b
77b92ab
68f740f
1c93a91
ae0e177
c83942a
2e45702
741252f
fe75ce0
78fc0df
5d19c5b
f23b30c
e50c85e
a9c2d85
e7ff325
c244b77
d24acf9
ff82800
7b48605
24ba36e
5b4fc27
fb66f3a
47ba7e4
d15d00c
ea36189
f04dcdb
cea9d9e
3ea3e9d
130cd1e
c624053
9127faa
059d1d5
ff5a9cd
2eb8fee
6605beb
af35f4f
2479fb2
f297cc2
3df125b
2e2ca3f
8c4c91e
fcec268
ac18781
d73c851
2c75ed8
3e905e9
963a3d6
0de37b0
d50d709
763d173
d71e52d
cfad816
b22168e
5bd64ae
bd0f8a2
6d47b90
0257d9a
0999994
6f4b889
129ceac
2c08464
e993757
dcf0552
f6bf989
0d237c0
f4ce3dc
78845ae
ab9a7e5
bf8eeb3
f701ac6
a520d57
4bddc57
6f68e66
49bcb2c
d85657e
6e8c4f9
881e9b8
5dd1134
e514df7
e53c838
1417905
045432e
8a119dd
e018545
c6ef6ee
d559a2c
38705b9
23e6ef5
a640183
5bf0e2d
d745421
ffba3d4
745f1b9
ec259cb
fce838b
9f2d5fe
ed8a1d6
f2f62ce
9c504a1
0df7507
21d3b7c
dfca17e
525315e
d8d4c3b
fe3fd66
d5dfade
2d53e9a
0243ed0
4ea20f7
85fbf7f
6008285
82d82a2
828211c
e913518
f74efe8
920f2ef
2744182
5b336ca
29700f9
f18a7c6
5ed47a8
6af5ab8
874177d
b3b3c77
85fcc1a
1911eb0
30e8e3f
d872e3a
fe2d650
8ed5f77
0fdaa3c
4e1a697
f7de243
3932dbe
02dea2d
395959b
3917859
3bff2f7
f960afe
03b5a30
e7f2c93
2bfb534
051cb01
6f595ba
3d2b603
23a6673
d60c2aa
5afbf9e
5de3c41
19152c1
6f7ae49
77c0824
b08a019
9ff9a95
3ace53b
4c17cdb
4401405
6c758c8
f8dbc40
428c09a
462351f
fe21b9a
63f1907
2634e75
8eb1495
5bba75d
687376f
c185122
5140daa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| +10 −5 | Makefile | |
| +137 −65 | jitify.hpp | |
| +72 −0 | jitify_test.cu | |
| +586 −0 | nvrtc_cli.cpp | |
| +58 −0 | nvrtc_cli_test.sh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| // Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O. | ||
| // This file is part of the "Nabla Engine". | ||
| // For conditions of distribution and use, see copyright notice in nabla.h | ||
| #ifndef _NBL_VIDEO_C_CUDA_EXPORTABLE_MEMORY_H_ | ||
| #define _NBL_VIDEO_C_CUDA_EXPORTABLE_MEMORY_H_ | ||
|
|
||
|
|
||
| #ifdef _NBL_COMPILE_WITH_CUDA_ | ||
|
|
||
| #include "cuda.h" | ||
| #include "nvrtc.h" | ||
| #if CUDA_VERSION < 9000 | ||
| #error "Need CUDA 9.0 SDK or higher." | ||
| #endif | ||
|
|
||
| // useful includes in the future | ||
| //#include "cudaEGL.h" | ||
| //#include "cudaVDPAU.h" | ||
|
|
||
| namespace nbl::video | ||
| { | ||
|
|
||
| class CCUDADevice; | ||
|
|
||
| class NBL_API2 CCUDAExportableMemory : public core::IReferenceCounted | ||
| { | ||
| public: | ||
|
|
||
| struct SCreationParams | ||
| { | ||
| size_t size; | ||
| uint32_t alignment; | ||
| CUmemLocationType location; | ||
| }; | ||
|
|
||
| struct SCachedCreationParams : SCreationParams | ||
| { | ||
| size_t granularSize; | ||
| CUdeviceptr ptr; | ||
| external_handle_t externalHandle; | ||
| }; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get your split between the two structs, CreationPArams usually inherits from cached, because the idea is that Creation Params contains extra data, and Cached is the subset you want to keep. In your case everything is cached creation params, so the creation params should inherit and be empty or just be an alias |
||
|
|
||
| CCUDAExportableMemory(core::smart_refctd_ptr<CCUDADevice> device, SCachedCreationParams&& params) | ||
| : m_device(std::move(device)) | ||
| , m_params(std::move(params)) | ||
| {} | ||
| ~CCUDAExportableMemory() override; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. public constructors for an object which should only be creatable via a factory public destructor for IReferenceCounted |
||
|
|
||
| CUdeviceptr getDeviceptr() const { return m_params.ptr; } | ||
|
|
||
| const SCreationParams& getCreationParams() const { return m_params; } | ||
|
|
||
| core::smart_refctd_ptr<IDeviceMemoryAllocation> exportAsMemory(ILogicalDevice* device, IDeviceMemoryBacked* dedication = nullptr) const; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. documentation, I find this confusing, esp the dedication parameter |
||
|
|
||
| private: | ||
|
|
||
| core::smart_refctd_ptr<CCUDADevice> m_device; | ||
| SCachedCreationParams m_params; | ||
| }; | ||
|
|
||
| } | ||
|
|
||
| #endif // _NBL_COMPILE_WITH_CUDA_ | ||
|
|
||
| #endif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refcountedit the destructor shall always be protected and not publicCCUDADeviceobject is through a factory of some sortThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the destructor is still public.....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done