42 #include "TpetraCore_config.h"
43 #include "Tpetra_Details_assumeMpiIsCudaAware.hpp"
55 #ifdef TPETRA_ASSUME_CUDA_AWARE_MPI
56 const bool configureTimeDefault =
true;
58 const bool configureTimeDefault =
false;
59 #endif // TPETRA_ASSUME_CUDA_AWARE_MPI
60 const char envVarName[] =
"TPETRA_ASSUME_CUDA_AWARE_MPI";
63 *out <<
"Test whether users want Trilinos to assume that its MPI "
64 "implementation is CUDA aware." << endl;
68 const char* envVarVal = std::getenv (envVarName);
69 if (envVarVal == NULL) {
71 *out <<
" - Did not find environment variable \"" << envVarName
73 <<
" - Return configure-time default: "
74 << (configureTimeDefault ?
"true" :
"false") <<
"." << endl;
76 return configureTimeDefault;
80 *out <<
" - Found environment variable \"" << envVarName <<
"\"."
81 << endl <<
" - Its value is \"" << envVarVal <<
"\"." << endl;
83 const std::string varVal ([=] {
84 std::string varVal_nc (envVarVal);
85 for (
auto& c : varVal_nc) {
103 const char* falseVals[] = {
"0",
"NO",
"OFF",
"FALSE"};
104 for (
auto falseVal : falseVals) {
105 if (varVal == falseVal) {
107 *out <<
" - Report value of environment variable as \"false\"."
113 const char* trueVals[] = {
"",
"1",
"YES",
"ON",
"TRUE"};
114 for (
auto trueVal : trueVals) {
115 if (varVal == trueVal) {
117 *out <<
" - Report value of environment variable as \"true\"."
125 *out <<
" - Found environment variable, but didn't know how to "
126 <<
"interpret its value." << endl
127 <<
" - Return configure-time default: "
128 << (configureTimeDefault ?
"true" :
"false") << endl;
130 return configureTimeDefault;
bool assumeMpiIsCudaAware(std::ostream *out)
Whether to assume that MPI is CUDA aware.