From 79689e07cf57bc1c8d67815814d0257f6d87e657 Mon Sep 17 00:00:00 2001 From: Arturo Vargas Date: Thu, 26 Dec 2024 11:31:32 -0800 Subject: [PATCH] improve guards --- CMakeLists.txt | 4 +--- examples/plugin/CMakeLists.txt | 10 ++++++---- examples/plugin/raja-caliper.cpp | 2 -- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8945f778a1..beb2abf449 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,12 +154,10 @@ endif () set (raja_depends) -if (DEFINED caliper_DIR) - +if (RAJA_ENABLE_CALIPER) set (raja_depends ${raja_depends} caliper) - find_package(caliper REQUIRED NO_DEFAULT_PATH PATHS ${caliper_DIR} diff --git a/examples/plugin/CMakeLists.txt b/examples/plugin/CMakeLists.txt index 430af3a270..10a36e9df1 100644 --- a/examples/plugin/CMakeLists.txt +++ b/examples/plugin/CMakeLists.txt @@ -5,9 +5,11 @@ # SPDX-License-Identifier: (BSD-3-Clause) ################################################################################ -raja_add_executable( - NAME raja-caliper - SOURCES raja-caliper.cpp caliper-plugin.cpp) +if(RAJA_ENABLE_CALIPER) + raja_add_executable( + NAME raja-caliper + SOURCES raja-caliper.cpp caliper-plugin.cpp) +endif() raja_add_executable( NAME plugin-example @@ -17,7 +19,7 @@ if (RAJA_ENABLE_RUNTIME_PLUGINS) raja_add_executable( NAME plugin-example-dynamic SOURCES test-plugin-dynamic.cpp) - + raja_add_plugin_library(NAME timer_plugin SHARED TRUE SOURCES timer-plugin.cpp) diff --git a/examples/plugin/raja-caliper.cpp b/examples/plugin/raja-caliper.cpp index 68b1baf5c0..4b686bff79 100644 --- a/examples/plugin/raja-caliper.cpp +++ b/examples/plugin/raja-caliper.cpp @@ -109,7 +109,6 @@ int main(int RAJA_UNUSED_ARG(argc), char **RAJA_UNUSED_ARG(argv[])) std::cout << "\n Running RAJA sequential daxpy...\n"; std::memcpy( a, a0, N * sizeof(double) ); -#if 1 { timer.reset(); timer.start(); @@ -123,7 +122,6 @@ int main(int RAJA_UNUSED_ARG(argc), char **RAJA_UNUSED_ARG(argv[])) RAJA::Timer::ElapsedType etime = timer.elapsed(); std::cout << "C-version elapsed time : " << etime << " seconds" << std::endl; } -#endif checkResult(a, aref, N); //printResult(a, N);