Use cudaDeviceGetAttribute instead of cudaGetDeviceProperties (#5570)

This commit is contained in:
Rory Mitchell 2020-04-21 14:58:29 +12:00 committed by GitHub
parent 73142041b9
commit a734f52807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
/**