Skip to content

Commit

Permalink
Merge pull request trilinos#11445 from dalg24/compadre_do_not_define_…
Browse files Browse the repository at this point in the history
…kokkos_macro

Compadre: Do not define `KOKKOS_*` macros, add `COMPADRE_` prefix
  • Loading branch information
kuberry authored Jan 11, 2023
2 parents 315efaf + 344688e commit ef5d8ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions packages/compadre/src/Compadre_KokkosParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using namespace Compadre;
// for InitArguments, pass them directly in to Kokkos
KokkosParser::KokkosParser(KokkosInitArguments args, bool print_status) {
this->ksg = !Kokkos::is_initialized()
#ifdef KOKKOS_GREATEREQUAL_3_7
#ifdef COMPADRE_KOKKOS_GREATEREQUAL_3_7
&& !Kokkos::is_finalized()
#endif
?
Expand All @@ -16,7 +16,7 @@ KokkosParser::KokkosParser(KokkosInitArguments args, bool print_status) {
// for command line arguments, pass them directly in to Kokkos
KokkosParser::KokkosParser(int narg, char* args[], bool print_status) {
this->ksg = !Kokkos::is_initialized()
#ifdef KOKKOS_GREATEREQUAL_3_7
#ifdef COMPADRE_KOKKOS_GREATEREQUAL_3_7
&& !Kokkos::is_finalized()
#endif
?
Expand All @@ -33,7 +33,7 @@ KokkosParser::KokkosParser(std::vector<std::string> stdvec_args, bool print_stat
int narg = (int)stdvec_args.size();

this->ksg = !Kokkos::is_initialized()
#ifdef KOKKOS_GREATEREQUAL_3_7
#ifdef COMPADRE_KOKKOS_GREATEREQUAL_3_7
&& !Kokkos::is_finalized()
#endif
?
Expand Down
12 changes: 6 additions & 6 deletions packages/compadre/src/Compadre_Typedefs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ typedef typename pool_type::generator_type generator_type;
// KOKKOS_VERSION / 100 % 100 is the minor version
// KOKKOS_VERSION / 10000 is the major version
#ifdef KOKKOS_VERSION
#define KOKKOS_VERSION_MAJOR KOKKOS_VERSION / 10000
#define KOKKOS_VERSION_MINOR KOKKOS_VERSION / 100 % 100
#if KOKKOS_VERSION_MAJOR < 4
#if KOKKOS_VERSION_MINOR >= 7
#define COMPADRE_KOKKOS_VERSION_MAJOR KOKKOS_VERSION / 10000
#define COMPADRE_KOKKOS_VERSION_MINOR KOKKOS_VERSION / 100 % 100
#if COMPADRE_KOKKOS_VERSION_MAJOR < 4
#if COMPADRE_KOKKOS_VERSION_MINOR >= 7
using KokkosInitArguments = Kokkos::InitializationSettings;
#define KOKKOS_GREATEREQUAL_3_7
#define COMPADRE_KOKKOS_GREATEREQUAL_3_7
constexpr char KOKKOS_THREADS_ARG[] = "--kokkos-num-threads";
#elif KOKKOS_VERSION_MINOR < 7
#elif COMPADRE_KOKKOS_VERSION_MINOR < 7
using KokkosInitArguments = Kokkos::InitArguments;
constexpr char KOKKOS_THREADS_ARG[] = "--kokkos-threads";
#endif
Expand Down

0 comments on commit ef5d8ab

Please sign in to comment.