Debian Codegraph @

Tests/Cuda/ObjectLibrary/static.cu

raw
1
2 #include <iostream>
3
4 #include <cuda.h>
5 #include <cuda_runtime.h>
6
7 int __host__ cu1_sq_func(int x)
8 {
9 cudaError_t err;
10 int nDevices = 0;
11 err = cudaGetDeviceCount(&nDevices);
12 if (err != cudaSuccess) {
13 std::cerr << "nDevices: " << nDevices << std::endl;
14 std::cerr << "err: " << err << std::endl;
15 return 1;
16 }
17 return x * x;
18 }