
Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
17 lines
381 B
Plaintext
17 lines
381 B
Plaintext
#include <iostream>
|
|
|
|
#include <cuda.h>
|
|
|
|
extern "C" int use_cuda(void)
|
|
{
|
|
int nDevices = 0;
|
|
cudaError_t err = cudaGetDeviceCount(&nDevices);
|
|
if (err != cudaSuccess) {
|
|
std::cerr << "Failed to retrieve the number of CUDA enabled devices"
|
|
<< std::endl;
|
|
return 1;
|
|
}
|
|
std::cout << "Found " << nDevices << " CUDA enabled devices" << std::endl;
|
|
return 0;
|
|
}
|