Skip to content

Commit

Permalink
Emit env variable warning print only if not set
Browse files Browse the repository at this point in the history
Emit KOKKOS_PROFILE_LIBRARY environment variable warning print only if not set rather than printing whenever KOKKOS_TOOLS_LIBS is not found.
  • Loading branch information
vlkale authored Aug 24, 2023
1 parent e402f48 commit 8730fa6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions common/kernel-filter/kp_kernel_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,16 @@ extern "C" void kokkosp_init_library(const int loadSeq,
char* profileLibrary = getenv("KOKKOS_TOOLS_LIBS");
if (NULL == profileLibrary) { // check for backward compatibility with
// old environment variable
printf(
"Checking KOKKOS_PROFILE_LIBRARY. WARNING: This is a deprecated "
"variable. Please use KOKKOS_TOOLS_LIBS.\n");
printf("KokkosP: KOKKOS_TOOLS_LIBS not set.\n");
profileLibrary = getenv("KOKKOS_PROFILE_LIBRARY");
if (NULL == profileLibrary) {
printf("KokkosP: No library to call in %s\n", profileLibrary);
exit(-1);
}
else {
printf("KokkosP: Found that KOKKOS_PROFILE_LIBRARY is set and it will be used.\n");
printf("KokkosP: Note that KOKKOS_PROFILE_LIBRARY is a deprecated variable. "
"Please use KOKKOS_TOOLS_LIBS in the future.\n");
} // end check for backward compatability

char* envBuffer =
Expand Down

0 comments on commit 8730fa6

Please sign in to comment.