| tAdd support for CUDA compute capabilities 4.x, 6.2, and 7.x - sphere - GPU-bas… | |
| git clone git://src.adamsgaard.dk/sphere | |
| Log | |
| Files | |
| Refs | |
| LICENSE | |
| --- | |
| commit 116df3bcf276dec7fca4fc44a8b91c39db229f66 | |
| parent 167ae1fe9a881f423cdffd2f3737ce6e9de69f78 | |
| Author: Anders Damsgaard <[email protected]> | |
| Date: Sat, 27 Apr 2019 14:27:26 +0200 | |
| Add support for CUDA compute capabilities 4.x, 6.2, and 7.x | |
| Diffstat: | |
| M src/device.cu | 7 +++++++ | |
| 1 file changed, 7 insertions(+), 0 deletions(-) | |
| --- | |
| diff --git a/src/device.cu b/src/device.cu | |
| t@@ -31,6 +31,7 @@ | |
| // Returns the number of cores per streaming multiprocessor, which is | |
| // a function of the device compute capability | |
| +// https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#compute-ca… | |
| int cudaCoresPerSM(int major, int minor) | |
| { | |
| if (major == 1) | |
| t@@ -41,12 +42,18 @@ int cudaCoresPerSM(int major, int minor) | |
| return 48; | |
| else if (major == 3) | |
| return 192; | |
| + else if (major == 4) | |
| + return 128; | |
| else if (major == 5) | |
| return 128; | |
| else if (major == 6 && minor == 0) | |
| return 64; | |
| else if (major == 6 && minor == 1) | |
| return 128; | |
| + else if (major == 6 && minor == 2) | |
| + return 128; | |
| + else if (major == 7) | |
| + return 32; | |
| else | |
| printf("Error in cudaCoresPerSM Device compute capability value " | |
| "(%d.%d) not recognized.", major, minor); |