相关疑难解决方法(0)

检查代码是在GPU还是CPU上运行

有人知道如何使用Cuda检查代码是在GPU还是CPU上运行?

__device__ __host__  double count_something(double variable) {
  if (RUN_ON_GPU) {
    use_cuda_variables();
  } else {
    use_cpu_variables();
  }
}
Run Code Online (Sandbox Code Playgroud)

c++ cuda

7
推荐指数
2
解决办法
1451
查看次数

标签 统计

c++ ×1

cuda ×1