expand accelerator output options

This commit is contained in:
Axel Kohlmeyer
2021-01-11 23:12:05 -05:00
parent 56909e88b1
commit 2b1a93bd15

View File

@ -322,14 +322,51 @@ void Info::command(int narg, char **arg)
fputs("\nAccelerator configuration:\n\n",out); fputs("\nAccelerator configuration:\n\n",out);
std::string mesg; std::string mesg;
if (has_package("GPU")) { if (has_package("GPU")) {
mesg = "GPU package API: "; mesg = "GPU package API:";
if (has_accelerator_feature("GPU","api","cuda")) mesg += "CUDA\n"; if (has_accelerator_feature("GPU","api","cuda")) mesg += " CUDA";
if (has_accelerator_feature("GPU","api","hip")) mesg += "HIP\n"; if (has_accelerator_feature("GPU","api","hip")) mesg += " HIP";
if (has_accelerator_feature("GPU","api","opencl")) mesg += "OpenCL\n"; if (has_accelerator_feature("GPU","api","opencl")) mesg += " OpenCL";
mesg += "GPU package precision: "; mesg += "\nGPU package precision:";
if (has_accelerator_feature("GPU","precision","single")) mesg += "single\n"; if (has_accelerator_feature("GPU","precision","single")) mesg += " single";
if (has_accelerator_feature("GPU","precision","mixed")) mesg += "mixed\n"; if (has_accelerator_feature("GPU","precision","mixed")) mesg += " mixed";
if (has_accelerator_feature("GPU","precision","double")) mesg += "double\n"; if (has_accelerator_feature("GPU","precision","double")) mesg += " double";
mesg += "\n";
fputs(mesg.c_str(),out);
}
if (has_package("KOKKOS")) {
mesg = "KOKKOS package API:";
if (has_accelerator_feature("KOKKOS","api","cuda")) mesg += " CUDA";
if (has_accelerator_feature("KOKKOS","api","hip")) mesg += " HIP";
if (has_accelerator_feature("KOKKOS","api","knl")) mesg += " KNL";
if (has_accelerator_feature("KOKKOS","api","opencl")) mesg += " OpenCL";
if (has_accelerator_feature("KOKKOS","api","openmp")) mesg += " OpenMP";
if (has_accelerator_feature("KOKKOS","api","pthreads")) mesg += " Pthreads";
mesg += "\nKOKKOS package precision:";
if (has_accelerator_feature("KOKKOS","precision","single")) mesg += " single";
if (has_accelerator_feature("KOKKOS","precision","mixed")) mesg += " mixed";
if (has_accelerator_feature("KOKKOS","precision","double")) mesg += " double";
mesg += "\n";
fputs(mesg.c_str(),out);
}
if (has_package("USER-OMP")) {
mesg = "USER-OMP package API:";
if (has_accelerator_feature("OPENMP","api","openmp")) mesg += " OpenMP";
mesg += "\nUSER-OMP package precision:";
if (has_accelerator_feature("OPENMP","precision","single")) mesg += " single";
if (has_accelerator_feature("OPENMP","precision","mixed")) mesg += " mixed";
if (has_accelerator_feature("OPENMP","precision","double")) mesg += " double";
mesg += "\n";
fputs(mesg.c_str(),out);
}
if (has_package("USER-INTEL")) {
mesg = "USER-INTEL package API:";
if (has_accelerator_feature("INTEL","api","knl")) mesg += " KNL";
if (has_accelerator_feature("INTEL","api","openmp")) mesg += " OpenMP";
mesg += "\nUSER-INTEL package precision:";
if (has_accelerator_feature("INTEL","precision","single")) mesg += " single";
if (has_accelerator_feature("INTEL","precision","mixed")) mesg += " mixed";
if (has_accelerator_feature("INTEL","precision","double")) mesg += " double";
mesg += "\n";
fputs(mesg.c_str(),out); fputs(mesg.c_str(),out);
} }
} }
@ -1176,6 +1213,13 @@ bool Info::has_accelerator_feature(const std::string &package,
if (setting == "double") return true; if (setting == "double") return true;
else return false; else return false;
} }
if (category == "api") {
#if defined(_OPENMP)
if (setting == "openmp") return true;
else return false;
#endif
return false;
}
} }
#endif #endif
#if defined(LMP_USER_INTEL) #if defined(LMP_USER_INTEL)
@ -1186,6 +1230,10 @@ bool Info::has_accelerator_feature(const std::string &package,
else if (setting == "single")return true; else if (setting == "single")return true;
else return false; else return false;
} }
if (category == "api") {
if (setting == "openmp") return true;
else return false;
}
} }
#endif #endif
return false; return false;