finalize available GPU hardware introspection functions
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
#include <map>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#if (LAL_USE_OMP == 1)
|
||||
#include <omp.h>
|
||||
#endif
|
||||
@ -1027,12 +1028,19 @@ Device<PRECISION,ACC_PRECISION> global_device;
|
||||
|
||||
using namespace LAMMPS_AL;
|
||||
|
||||
bool lmp_has_device()
|
||||
bool lmp_has_gpu_device()
|
||||
{
|
||||
auto tmpgpu = new UCL_Device();
|
||||
int num = tmpgpu->num_platforms();
|
||||
delete tmpgpu;
|
||||
return num > 0;
|
||||
UCL_Device gpu;
|
||||
return (gpu.num_platforms() > 0);
|
||||
}
|
||||
|
||||
std::string lmp_gpu_device_info()
|
||||
{
|
||||
std::ostringstream out;
|
||||
UCL_Device gpu;
|
||||
if (gpu.num_platforms() > 0)
|
||||
gpu.print_all(out);
|
||||
return out.str();
|
||||
}
|
||||
|
||||
int lmp_init_device(MPI_Comm world, MPI_Comm replica, const int ngpu,
|
||||
|
||||
Reference in New Issue
Block a user