From 2b1a93bd15b044e9ddd39c5d3670c0e4024d4403 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 11 Jan 2021 23:12:05 -0500 Subject: [PATCH] expand accelerator output options --- src/info.cpp | 64 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/src/info.cpp b/src/info.cpp index d18bd68171..f9394a1433 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -322,14 +322,51 @@ void Info::command(int narg, char **arg) fputs("\nAccelerator configuration:\n\n",out); std::string mesg; if (has_package("GPU")) { - mesg = "GPU package API: "; - if (has_accelerator_feature("GPU","api","cuda")) mesg += "CUDA\n"; - if (has_accelerator_feature("GPU","api","hip")) mesg += "HIP\n"; - if (has_accelerator_feature("GPU","api","opencl")) mesg += "OpenCL\n"; - mesg += "GPU package precision: "; - if (has_accelerator_feature("GPU","precision","single")) mesg += "single\n"; - if (has_accelerator_feature("GPU","precision","mixed")) mesg += "mixed\n"; - if (has_accelerator_feature("GPU","precision","double")) mesg += "double\n"; + mesg = "GPU package API:"; + if (has_accelerator_feature("GPU","api","cuda")) mesg += " CUDA"; + if (has_accelerator_feature("GPU","api","hip")) mesg += " HIP"; + if (has_accelerator_feature("GPU","api","opencl")) mesg += " OpenCL"; + mesg += "\nGPU package precision:"; + if (has_accelerator_feature("GPU","precision","single")) mesg += " single"; + if (has_accelerator_feature("GPU","precision","mixed")) mesg += " mixed"; + 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); } } @@ -1176,6 +1213,13 @@ bool Info::has_accelerator_feature(const std::string &package, if (setting == "double") return true; else return false; } + if (category == "api") { +#if defined(_OPENMP) + if (setting == "openmp") return true; + else return false; +#endif + return false; + } } #endif #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 return false; } + if (category == "api") { + if (setting == "openmp") return true; + else return false; + } } #endif return false;