You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
344 B
18 lines
344 B
7 years ago
|
|
||
|
#include <cuda.h>
|
||
|
#include <cuda_runtime.h>
|
||
|
#include <iostream>
|
||
|
|
||
|
int __host__ cu2_sq_func(int x)
|
||
|
{
|
||
|
cudaError_t err;
|
||
|
int nDevices = 0;
|
||
|
err = cudaGetDeviceCount(&nDevices);
|
||
|
if (err != cudaSuccess) {
|
||
|
std::cerr << "nDevices: " << nDevices << std::endl;
|
||
|
std::cerr << "err: " << err << std::endl;
|
||
|
return 1;
|
||
|
}
|
||
|
return x * x;
|
||
|
}
|