19 lines
345 B
Plaintext
Raw Normal View History

2017-04-14 19:02:05 +02:00
2020-02-01 23:06:01 +01:00
#include <iostream>
2017-04-14 19:02:05 +02:00
#include <cuda.h>
#include <cuda_runtime.h>
2018-04-23 21:13:27 +02:00
int __host__ cu1_sq_func(int x)
2017-04-14 19:02:05 +02:00
{
cudaError_t err;
int nDevices = 0;
err = cudaGetDeviceCount(&nDevices);
if (err != cudaSuccess) {
2017-07-20 19:35:53 +02:00
std::cerr << "nDevices: " << nDevices << std::endl;
std::cerr << "err: " << err << std::endl;
2017-04-14 19:02:05 +02:00
return 1;
}
return x * x;
}