有人知道如何使用Cuda检查代码是在GPU还是CPU上运行?
__device__ __host__ double count_something(double variable) { if (RUN_ON_GPU) { use_cuda_variables(); } else { use_cpu_variables(); } }
c++ cuda
c++ ×1
cuda ×1