From 6007f452e4c06ad45b1568bfb72cf9d07c5b993f Mon Sep 17 00:00:00 2001 From: Rory Mitchell Date: Mon, 20 Apr 2020 18:47:38 -0700 Subject: [PATCH] Use cudaDeviceGetAttribute instead of cudaGetDeviceProperties --- src/common/device_helpers.cuh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/device_helpers.cuh b/src/common/device_helpers.cuh index 3024b589f538..ba5bb0c08998 100644 --- a/src/common/device_helpers.cuh +++ b/src/common/device_helpers.cuh @@ -108,9 +108,11 @@ inline size_t TotalMemory(int device_idx) { */ inline size_t MaxSharedMemory(int device_idx) { - cudaDeviceProp prop; - dh::safe_cuda(cudaGetDeviceProperties(&prop, device_idx)); - return prop.sharedMemPerBlock; + int max_shared_memory = 0; + dh::safe_cuda(cudaDeviceGetAttribute + (&max_shared_memory, cudaDevAttrMaxSharedMemoryPerBlock, + device_idx)); + return size_t(max_shared_memory); } inline void CheckComputeCapability() {