Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/__driver/driver_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ __get_driver_entry_point(const char* __name, [[maybe_unused]] int __major = 12,
return __result;
}

[[nodiscard]] _CCCL_HOST_API inline ::CUdevice __deviceGetAttribute(::CUdevice_attribute __attr, ::CUdevice __device)
[[nodiscard]] _CCCL_HOST_API inline int __deviceGetAttribute(::CUdevice_attribute __attr, ::CUdevice __device)
{
static auto __driver_fn = _CCCLRT_GET_DRIVER_FUNCTION(cuDeviceGetAttribute);
int __result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,22 @@ void test_memory_pool_impl(

bool test_memory_pool()
{
test_memory_pool_impl(cudaMemAllocationTypePinned, cudaMemLocationTypeDevice, false, true, false);
if (cuda::__driver::__deviceGetAttribute(::CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED, 0))
{
test_memory_pool_impl(cudaMemAllocationTypePinned, cudaMemLocationTypeDevice, false, true, false);

#if _CCCL_CTK_AT_LEAST(12, 2)
test_memory_pool_impl(cudaMemAllocationTypePinned, cudaMemLocationTypeHost, true, false, false);
test_memory_pool_impl(cudaMemAllocationTypePinned, cudaMemLocationTypeHost, true, false, false);
#endif // _CCCL_CTK_AT_LEAST(12, 2)
#if _CCCL_CTK_AT_LEAST(13, 0)
// TODO(fbusato): check if this can be improved in future releases
test_memory_pool_impl(cudaMemAllocationTypeManaged, cudaMemLocationTypeHost, true, false, true);
test_memory_pool_impl(cudaMemAllocationTypeManaged, cudaMemLocationTypeDevice, false, true, true);
// TODO(fbusato): check if this can be improved in future releases
if (cuda::__driver::__deviceGetAttribute(::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, 0))
{
// TODO(fbusato): check if this can be improved in future releases
test_memory_pool_impl(cudaMemAllocationTypeManaged, cudaMemLocationTypeHost, true, false, true);
test_memory_pool_impl(cudaMemAllocationTypeManaged, cudaMemLocationTypeDevice, false, true, true);
}
}
#endif // _CCCL_CTK_AT_LEAST(13, 0)
return true;
}
Expand Down
Loading