Skip to content

Commit

Permalink
Fixes #572, regards #519: External memory and CUDA 10.x:
Browse files Browse the repository at this point in the history
* Not including any code regarding external memory for CUDA versions earlier than 10.0, as it is not supported
* External memory handle kinds not supported before CUDA 10.2 are now only included start with that version
  • Loading branch information
eyalroz committed Jan 8, 2024
1 parent 8edefaa commit 84f9383
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cuda/api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
#include "api/launch_configuration.hpp"
#include "api/kernel_launch.hpp"
#include "api/virtual_memory.hpp"
#if CUDA_VERSION >= 10000
#include "api/external.hpp"
#endif // CUDA_VERSION >= 10000

#include "api/multi_wrapper_impls/pointer.hpp"
#include "api/multi_wrapper_impls/array.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/cuda/api/external.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ enum kind_t : ::std::underlying_type<CUexternalMemoryHandleType_enum>::type {
opaque_globally_shared_windows_handle = CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT,
direct3d_12_heap = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP,
direct3d_12_committed_resource = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE,
#if CUDA_VERSION >= 10200
direct3d_resource_shared_windows_handle = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE,
direct3d_resource_globally_shared_handle = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT,
nvscibuf_object = CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF
#endif // CUDA_VERSION >= 10200
};

using descriptor_t = CUDA_EXTERNAL_MEMORY_HANDLE_DESC;
Expand Down
3 changes: 3 additions & 0 deletions src/cuda/api/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ enum class barrier_scope_t : typename ::std::underlying_type<CUstreamMemoryBarri
};
#endif // CUDA_VERSION >= 11700

#if CUDA_VERSION >= 10000
/**
* Representation of memory resources external to CUDA
*/
Expand All @@ -834,6 +835,8 @@ struct subregion_spec_t {

} // namespace external

#endif // CUDA_VERSION >= 10000

} // namespace memory

/**
Expand Down

0 comments on commit 84f9383

Please sign in to comment.