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));
return 0;
}
cudaDeviceProp properties;
result = cudaGetDeviceProperties(&properties, device_id);
int multiprocessor_count;
result = cudaDeviceGetAttribute(&multiprocessor_count,
cudaDevAttrMultiProcessorCount, device_id);
if (result != cudaSuccess) {
CUTLASS_TRACE_HOST(
" cudaGetDeviceProperties() returned error "
" cudaDeviceGetAttribute() returned error "
<< cudaGetErrorString(result));
return 0;
}
return properties.multiProcessorCount;
return multiprocessor_count;
}
};