Skip to content

Commit a734f52

Browse files
authored
Use cudaDeviceGetAttribute instead of cudaGetDeviceProperties (#5570)
1 parent 7314204 commit a734f52

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/common/device_helpers.cuh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@ inline size_t TotalMemory(int device_idx) {
108108
*/
109109

110110
inline size_t MaxSharedMemory(int device_idx) {
111-
cudaDeviceProp prop;
112-
dh::safe_cuda(cudaGetDeviceProperties(&prop, device_idx));
113-
return prop.sharedMemPerBlock;
111+
int max_shared_memory = 0;
112+
dh::safe_cuda(cudaDeviceGetAttribute
113+
(&max_shared_memory, cudaDevAttrMaxSharedMemoryPerBlock,
114+
device_idx));
115+
return size_t(max_shared_memory);
114116
}
115117

116118
/**

0 commit comments

Comments
 (0)