Skip to content

Commit fbc40da

Browse files
committed
Merge branch 'dev/mattd/update-simple-cc-check' into 'master'
[nvvm] Test the compute capability minor number prior to using the result value. See merge request cuda-samples/cuda-samples!128
2 parents a5267b8 + 1b36fef commit fbc40da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Samples/7_libNVVM/simple/simple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ static CUdevice cudaDeviceInit(int *devMajor, int *devMinor)
7474

7575
// Obtain the device's compute capability.
7676
checkCudaErrors(cuDeviceGetAttribute(devMajor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevice));
77+
checkCudaErrors(cuDeviceGetAttribute(devMinor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevice));
7778
if (*devMajor < 7 && *devMinor < 5) {
7879
fprintf(stderr, "Device 0 is not sm_75 or later\n");
7980
exit(EXIT_FAILURE);
8081
}
81-
checkCudaErrors(cuDeviceGetAttribute(devMinor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevice));
8282

8383
return cuDevice;
8484
}

0 commit comments

Comments
 (0)