mirror of https://github.com/davisking/dlib.git
Added get_num_devices()
This commit is contained in:
parent
603d474352
commit
2703a72dfe
|
@ -27,6 +27,14 @@ namespace dlib
|
|||
return dev;
|
||||
}
|
||||
|
||||
int get_num_devices (
|
||||
)
|
||||
{
|
||||
int num_devices;
|
||||
CHECK_CUDA(cudaGetDeviceCount(&num_devices));
|
||||
return num_devices;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
|
||||
__global__ void _cuda_multiply1(float* d, const float* s1, const float* s2, size_t n)
|
||||
|
|
|
@ -22,6 +22,9 @@ namespace dlib
|
|||
int get_device (
|
||||
);
|
||||
|
||||
int get_num_devices (
|
||||
);
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
|
||||
void multiply (
|
||||
|
@ -165,6 +168,9 @@ namespace dlib
|
|||
inline int get_device (
|
||||
){ return 0; }
|
||||
|
||||
int get_num_devices (
|
||||
) { return 1; }
|
||||
|
||||
#endif // DLIB_USE_CUDA
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue