From 902964fb27fe0311308c9f054cab11b5e1a5ce89 Mon Sep 17 00:00:00 2001 From: Kevin Huck Date: Wed, 20 Mar 2024 13:39:44 -0700 Subject: [PATCH] Fixing errors in unit tests on apple --- src/apex/utils.hpp | 5 ++--- src/examples/PeriodicPlugin/policy_test.cpp | 2 +- src/unit_tests/Kokkos/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/apex/utils.hpp b/src/apex/utils.hpp index 68150d4a..a8c16051 100644 --- a/src/apex/utils.hpp +++ b/src/apex/utils.hpp @@ -239,11 +239,10 @@ inline unsigned int my_hardware_concurrency() { #if defined(_MSC_VER) return std::thread::hardware_concurrency(); -#else -/* +#elif defined(__APPLE__) unsigned int cores = std::thread::hardware_concurrency(); return cores ? cores : sysconf(_SC_NPROCESSORS_ONLN); -*/ +#else static std::vector cores{parseDiscreteValues(getCpusAllowed("/proc/self/status"))}; return cores.size(); diff --git a/src/examples/PeriodicPlugin/policy_test.cpp b/src/examples/PeriodicPlugin/policy_test.cpp index 0612b766..93a79fb4 100644 --- a/src/examples/PeriodicPlugin/policy_test.cpp +++ b/src/examples/PeriodicPlugin/policy_test.cpp @@ -23,7 +23,7 @@ void foo(int i) { int main (int argc, char *argv[]) { - int iters = 100; + int iters = 50; int nthreads = 4; if (argc == 1) { diff --git a/src/unit_tests/Kokkos/CMakeLists.txt b/src/unit_tests/Kokkos/CMakeLists.txt index 95605d9f..38d10724 100644 --- a/src/unit_tests/Kokkos/CMakeLists.txt +++ b/src/unit_tests/Kokkos/CMakeLists.txt @@ -16,7 +16,7 @@ foreach(example_program ${example_programs}) set(sources ${example_program}.cpp) source_group("Source Files" FILES ${sources}) add_executable("${example_program}_kokkos" ${sources}) - target_link_libraries ("${example_program}_kokkos" apex kokkos ${LIBS}) + target_link_libraries ("${example_program}_kokkos" apex ${Kokkos_LIBRARY} ${LIBS}) if (OPENMP_FOUND) set_target_properties("${example_program}_kokkos" PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS}) endif (OPENMP_FOUND)