preliminary interface to detect whether a viable GPU is present

This commit is contained in:
Axel Kohlmeyer
2021-05-10 09:16:51 -04:00
parent de3a49ac4f
commit fbdcfb2f72
3 changed files with 22 additions and 0 deletions

View File

@ -1026,6 +1026,15 @@ Device<PRECISION,ACC_PRECISION> global_device;
}
using namespace LAMMPS_AL;
bool lmp_has_device()
{
auto tmpgpu = new UCL_Device();
int num = tmpgpu->num_platforms();
delete tmpgpu;
return num > 0;
}
int lmp_init_device(MPI_Comm world, MPI_Comm replica, const int ngpu,
const int first_gpu_id, const int gpu_mode,
const double particle_split, const int t_per_atom,