Get SM count with cudaDeviceGetAttribute in KernelHardwareInfo (#927)

This commit is contained in:
Adnan Akhundov 2023-04-28 19:23:23 +02:00 committed by GitHub
parent df02482f1d
commit fe2f491dd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,15 +56,16 @@ struct KernelHardwareInfo {
<< cudaGetErrorString(result)); << cudaGetErrorString(result));
return 0; return 0;
} }
cudaDeviceProp properties; int multiprocessor_count;
result = cudaGetDeviceProperties(&properties, device_id); result = cudaDeviceGetAttribute(&multiprocessor_count,
cudaDevAttrMultiProcessorCount, device_id);
if (result != cudaSuccess) { if (result != cudaSuccess) {
CUTLASS_TRACE_HOST( CUTLASS_TRACE_HOST(
" cudaGetDeviceProperties() returned error " " cudaDeviceGetAttribute() returned error "
<< cudaGetErrorString(result)); << cudaGetErrorString(result));
return 0; return 0;
} }
return properties.multiProcessorCount; return multiprocessor_count;
} }
}; };