Bug 5184356: Update the computeMode for remaining 3 samples

This commit is contained in:
shawnz
2025-04-11 10:40:35 +08:00
parent 02fdb070ad
commit 01a62e2bc0
3 changed files with 9 additions and 3 deletions

View File

@@ -287,7 +287,9 @@ int main(int argc, char **argv)
exit(EXIT_WAIVED);
}
if (device_prop.computeMode == cudaComputeModeProhibited) {
int computeMode;
checkCudaErrors(cudaDeviceGetAttribute(&computeMode, cudaDevAttrComputeMode, dev_id));
if (computeMode == cudaComputeModeProhibited) {
// This sample requires being run with a default or process exclusive mode
fprintf(stderr,
"This sample requires a device in either default or process "