#include <stdio.h>
#include "CudaUtils.h"
#include <cuda.h>
Go to the source code of this file.
Definition at line 38 of file DeviceCUDAkernel.cu.
References cudaCheck, and cudaDie().
41 allocate_device<int>(&d_cuda_arch, 1);
43 read_CUDA_ARCH_kernel <<< 1, 1 >>> (d_cuda_arch);
44 cudaError_t err = cudaGetLastError();
45 if (err != cudaSuccess) {
47 sprintf(str,
"Error executing CUDA kernel read_CUDA_ARCH_kernel in file %s\nError string: %s\nPossible cause: Device compute capability is less than the compute capability the code was compiled for.\n",
48 __FILE__,cudaGetErrorString(err));
53 copy_DtoH_sync<int>(d_cuda_arch, &h_cuda_arch, 1);
54 deallocate_device<int>(&d_cuda_arch);
void cudaDie(const char *msg, cudaError_t err=cudaSuccess)
__global__ void read_CUDA_ARCH_kernel |
( |
int * |
cuda_arch | ) |
|
Definition at line 7 of file DeviceCUDAkernel.cu.
8 if (threadIdx.x == 0) {
10 #if __CUDA_ARCH__ == 100
12 #elif __CUDA_ARCH__ == 110
14 #elif __CUDA_ARCH__ == 120
16 #elif __CUDA_ARCH__ == 130
18 #elif __CUDA_ARCH__ == 200
20 #elif __CUDA_ARCH__ == 210
22 #elif __CUDA_ARCH__ == 300
24 #elif __CUDA_ARCH__ == 350
26 #elif __CUDA_ARCH__ == 500