diff --git a/tests/kokkos_ext/execution_space/test_operation_state.cpp b/tests/kokkos_ext/execution_space/test_operation_state.cpp index 43ebbd85..3a41998d 100644 --- a/tests/kokkos_ext/execution_space/test_operation_state.cpp +++ b/tests/kokkos_ext/execution_space/test_operation_state.cpp @@ -1,3 +1,11 @@ +#include "tests/IgnoreWarnings.hpp" +PRAGMA_DIAGNOSTIC_PUSH +PRAGMA_DIAGNOSTIC_IGNORED_DEPRECATED_ATTRIBUTES +PRAGMA_DIAGNOSTIC_IGNORED("-Wshadow") +PRAGMA_DIAGNOSTIC_IGNORED("-Wsuggest-override") +#include "stdexec/execution.hpp" +PRAGMA_DIAGNOSTIC_POP + #include "kokkos_ext/impl/execution_space/operation_state.hpp" #include "kokkos_ext/impl/execution_space/parallel_for.hpp" diff --git a/tests/kokkos_ext/execution_space/test_parallel_for.cpp b/tests/kokkos_ext/execution_space/test_parallel_for.cpp index 30cef85b..ded0caa1 100644 --- a/tests/kokkos_ext/execution_space/test_parallel_for.cpp +++ b/tests/kokkos_ext/execution_space/test_parallel_for.cpp @@ -1,5 +1,13 @@ #include +#include "tests/IgnoreWarnings.hpp" +PRAGMA_DIAGNOSTIC_PUSH +PRAGMA_DIAGNOSTIC_IGNORED_DEPRECATED_ATTRIBUTES +PRAGMA_DIAGNOSTIC_IGNORED("-Wshadow") +PRAGMA_DIAGNOSTIC_IGNORED("-Wsuggest-override") +#include "stdexec/execution.hpp" +PRAGMA_DIAGNOSTIC_POP + #include "kokkos_ext/impl/execution_space/parallel_for.hpp" #include "kokkos-utils/callbacks/RecorderListener.hpp" diff --git a/tests/kokkos_ext/execution_space/test_scoped_region.cpp b/tests/kokkos_ext/execution_space/test_scoped_region.cpp index db6cafdc..4bd57269 100644 --- a/tests/kokkos_ext/execution_space/test_scoped_region.cpp +++ b/tests/kokkos_ext/execution_space/test_scoped_region.cpp @@ -1,3 +1,11 @@ +#include "tests/IgnoreWarnings.hpp" +PRAGMA_DIAGNOSTIC_PUSH +PRAGMA_DIAGNOSTIC_IGNORED_DEPRECATED_ATTRIBUTES +PRAGMA_DIAGNOSTIC_IGNORED("-Wshadow") +PRAGMA_DIAGNOSTIC_IGNORED("-Wsuggest-override") +#include "stdexec/execution.hpp" +PRAGMA_DIAGNOSTIC_POP + #include "kokkos-utils/callbacks/RecorderListener.hpp" #include "kokkos-utils/tests/scoped/callbacks/Manager.hpp" diff --git a/tests/kokkos_ext/graph/test_inter_op.cpp b/tests/kokkos_ext/graph/test_inter_op.cpp index 10ddadd3..10bd5763 100644 --- a/tests/kokkos_ext/graph/test_inter_op.cpp +++ b/tests/kokkos_ext/graph/test_inter_op.cpp @@ -1,5 +1,6 @@ #include "tests/IgnoreWarnings.hpp" PRAGMA_DIAGNOSTIC_PUSH +PRAGMA_DIAGNOSTIC_IGNORED_DEPRECATED_ATTRIBUTES PRAGMA_DIAGNOSTIC_IGNORED("-Wdeprecated-copy") PRAGMA_DIAGNOSTIC_IGNORED("-Wshadow") PRAGMA_DIAGNOSTIC_IGNORED("-Wsuggest-override") diff --git a/tests/native/APIWrappers.hpp b/tests/native/APIWrappers.hpp index d73902f0..56f7fc84 100644 --- a/tests/native/APIWrappers.hpp +++ b/tests/native/APIWrappers.hpp @@ -155,7 +155,7 @@ template struct GraphNodeKernel : public GraphNode { PREFIXED_API(KernelNodeParams) params; - std::vector inputs; + std::array inputs {}; //! @warning The user is responsible for keeping the @c functor alive. GraphNodeKernel(const Functor& functor, const size_t shape); diff --git a/tests/native/APIWrappers_def.hpp b/tests/native/APIWrappers_def.hpp index c6f49d36..ad59d494 100644 --- a/tests/native/APIWrappers_def.hpp +++ b/tests/native/APIWrappers_def.hpp @@ -226,8 +226,7 @@ GraphNodeKernel::GraphNodeKernel(const Functor& functor, const size_t s params = {}; - inputs.resize(1); - inputs[0] = (void*)&functor; + inputs.at(0) = (void * )&functor; constexpr size_t max_block_size = 1024; diff --git a/tests/native/CMakeLists.txt b/tests/native/CMakeLists.txt index 88ac4ba7..a0146dd3 100644 --- a/tests/native/CMakeLists.txt +++ b/tests/native/CMakeLists.txt @@ -8,13 +8,22 @@ set(launcher) if(CUDA IN_LIST Kokkos_DEVICES) set(enabled_backend GRAPH_DISPATCHING_ENABLE_CUDA) - set(launcher compute-sanitizer --leak-check=full) + # Using 'compute-sanitizer' may trigger a weird supposedly false positive error with nvcc on blackwell120. + # See https://forums.developer.nvidia.com/t/compute-sanitizer-and-cuda-graph-false-positives. + if(Kokkos_CXX_COMPILER_ID STREQUAL "NVIDIA" AND BLACKWELL120 IN_LIST Kokkos_ARCH) + set(launcher) + else() + set(launcher compute-sanitizer --leak-check=full) + endif() elseif(HIP IN_LIST Kokkos_DEVICES) set(enabled_backend GRAPH_DISPATCHING_ENABLE_HIP) set(launcher) elseif(NOT DEFINED ENABLE_DOXYGEN) message(FATAL_ERROR "Unsupported device backend.") endif() +if(launcher) + message(STATUS "Launcher for native tests set to '${launcher}'") +endif() # Tests that work for both Cuda and HIP. add_one_test(NAME APIWrappers COMPILE_DEFINITIONS ${enabled_backend} LAUNCHER ${launcher}) diff --git a/tests/native/test_APIWrappers.cpp b/tests/native/test_APIWrappers.cpp index a9d4737b..fc16e0de 100644 --- a/tests/native/test_APIWrappers.cpp +++ b/tests/native/test_APIWrappers.cpp @@ -66,6 +66,7 @@ TEST(APIWrappers, view_get_host_copy) const View data(stream, 2<<6); const auto mirror = data.get_host_copy(stream); + stream.fence(); ASSERT_EQ(mirror.size(), 2<<6); } diff --git a/tests/native/test_graph_capture.cpp b/tests/native/test_graph_capture.cpp index 268a31af..36ac46fc 100644 --- a/tests/native/test_graph_capture.cpp +++ b/tests/native/test_graph_capture.cpp @@ -125,6 +125,7 @@ PRAGMA_DIAGNOSTIC_POP const auto mirror = dense.get_host_copy(stream); stream.fence(); + ASSERT_EQ(mirror, (std::vector{2., 3., 4., 5., 6.})); } diff --git a/tests/native/test_node_enable.cpp b/tests/native/test_node_enable.cpp index 102117b6..da770cf7 100644 --- a/tests/native/test_node_enable.cpp +++ b/tests/native/test_node_enable.cpp @@ -54,6 +54,7 @@ TEST_P(cuda, node_enable) } const auto mirror = data.get_host_copy(stream); + stream.fence(); ASSERT_EQ(mirror.at(0), expected); diff --git a/tests/nvexec/adaptors/test_stream_context.cpp b/tests/nvexec/adaptors/test_stream_context.cpp index b5317481..817f6b4e 100644 --- a/tests/nvexec/adaptors/test_stream_context.cpp +++ b/tests/nvexec/adaptors/test_stream_context.cpp @@ -157,7 +157,7 @@ TEST_F(StreamContextTest, move_to_static_thread_pool) { const view_t witness(Kokkos::view_alloc("witness")); - exec::static_thread_pool pool{1}; + exec::static_thread_pool pool{1}; // NOLINT(misc-const-correctness) auto chain = ::stdexec::schedule(stream_ctx.get_scheduler()) diff --git a/tests/nvexec/adaptors/test_when_all.cpp b/tests/nvexec/adaptors/test_when_all.cpp index b21e239c..6af80afb 100644 --- a/tests/nvexec/adaptors/test_when_all.cpp +++ b/tests/nvexec/adaptors/test_when_all.cpp @@ -48,7 +48,7 @@ TEST_F(StreamContextTest, same_type_children) { //! @test Check @c ::stdexec::when_all with one branch on stream scheduler and one on static thread pool scheduler. TEST_F(StreamContextTest, different_type_children) { - ::exec::static_thread_pool thread_ctx{1}; + ::exec::static_thread_pool thread_ctx{1}; // NOLINT(misc-const-correctness) auto schd_thread = thread_ctx.get_scheduler(); auto schd_stream = stream_ctx.get_scheduler(); diff --git a/tests/stdexec/adaptors/test_customization.cpp b/tests/stdexec/adaptors/test_customization.cpp index 517fcda4..2f64c2d5 100644 --- a/tests/stdexec/adaptors/test_customization.cpp +++ b/tests/stdexec/adaptors/test_customization.cpp @@ -367,7 +367,7 @@ TEST_F(CustomizationTest, on_in_the_middle_otherwise_custom_scheduler) { TEST_F(CustomizationTest, on) { SETUP_TRACE(8, {'W', 'L'}, {'W', 'L'}, DEFAULT_PAIR, DEFAULT_PAIR, {'Y', 'L'}, DEFAULT_PAIR, {'Z', 'L'}, {'Z', 'L'}) - exec::static_thread_pool pool{1}; + exec::static_thread_pool pool{1}; // NOLINT(misc-const-correctness) ::stdexec::sender auto chain = ::stdexec::schedule(DomainSpecificScheduler>{}) | ADD_THEN(0) | ADD_THEN(1) | ::stdexec::continues_on(pool.get_scheduler()) | ADD_THEN(2) diff --git a/tests/stdexec/adaptors/test_starts_on.cpp b/tests/stdexec/adaptors/test_starts_on.cpp index e8261ebd..b362482e 100644 --- a/tests/stdexec/adaptors/test_starts_on.cpp +++ b/tests/stdexec/adaptors/test_starts_on.cpp @@ -50,8 +50,8 @@ TEST_F(StartsOnTest, twice_with_just_a_bulk) { ::stdexec::sender auto chain = ::stdexec::just(std::vector(size, 0)) | ::stdexec::bulk(::stdexec::par, size, [](const auto index, auto& data) { - data[index] = - ::utils::get_thread_id(); // NOLINT(cppcoreguidelines-pro-bounds-avoid-unchecked-container-access) + data[index] = // NOLINT(cppcoreguidelines-pro-bounds-avoid-unchecked-container-access) + ::utils::get_thread_id(); }); //! Run on pool A. diff --git a/tests/stdexec/adaptors/test_when_all.cpp b/tests/stdexec/adaptors/test_when_all.cpp index c76322df..c1c214e0 100644 --- a/tests/stdexec/adaptors/test_when_all.cpp +++ b/tests/stdexec/adaptors/test_when_all.cpp @@ -31,7 +31,7 @@ namespace tests::stdexec::adaptors { //! @test Same as https://github.com/NVIDIA/stdexec/blob/970dbace4ad52a38c9b18665d077f14159792b23/test/stdexec/algos/adaptors/test_when_all.cpp#L253. TEST(when_all, propagates_completion_domain_from_same_type_children) { - ::exec::static_thread_pool pool_A{1}, pool_B{1}; + ::exec::static_thread_pool pool_A{1}, pool_B{1}; // NOLINT(misc-const-correctness) ::stdexec::sender auto sndr = ::stdexec::when_all( ::stdexec::starts_on(pool_A.get_scheduler(), ::stdexec::just(13)), @@ -52,7 +52,7 @@ TEST(when_all, propagates_completion_domain_from_same_type_children) { * @warning As stated in @cite P2999R3 (Section 2.1.1, "Dispatching via execution domain tags"), @c stdexec::when_all only accepts a set of senders when they all share a common domain. */ TEST(when_all, propagates_completion_domain_from_different_type_children) { - ::exec::static_thread_pool pool{1}; + ::exec::static_thread_pool pool{1}; // NOLINT(misc-const-correctness) ::stdexec::sender auto sndr = ::stdexec::when_all( ::stdexec::starts_on(::stdexec::inline_scheduler{}, ::stdexec::just(13)), diff --git a/tests/stdexec/factories/test_read_env.cpp b/tests/stdexec/factories/test_read_env.cpp index f274ea25..d5dc5151 100644 --- a/tests/stdexec/factories/test_read_env.cpp +++ b/tests/stdexec/factories/test_read_env.cpp @@ -40,7 +40,7 @@ TEST(read_env, get_scheduler_default) { //! @test Use @c stdexec::read_env to retrieve the static thread pool scheduler type. TEST(read_env, get_scheduler_static_thread_pool) { - ::exec::static_thread_pool pool{1}; + ::exec::static_thread_pool pool{1}; // NOLINT(misc-const-correctness) ::stdexec::sync_wait(::stdexec::schedule(pool.get_scheduler()) | ::stdexec::let_value([] { return ::stdexec::read_env(::stdexec::get_scheduler) diff --git a/tests/stdexec/test_HelloWorld.cpp b/tests/stdexec/test_HelloWorld.cpp index c4fa3c0e..09ab7318 100644 --- a/tests/stdexec/test_HelloWorld.cpp +++ b/tests/stdexec/test_HelloWorld.cpp @@ -59,7 +59,7 @@ ::stdexec::sender auto tester(Sender&& start) { TEST(stdexec, hello_world) { //! Retrieve the NUMA configuration, and get the number of CPUs on the first node for sizing the thread pool. const exec::numa_policy numa(exec::no_numa_policy{}); - exec::static_thread_pool context(numa.num_cpus(0)); + exec::static_thread_pool context(numa.num_cpus(0)); // NOLINT(misc-const-correctness) //! Get a scheduler from the thread pool. ::stdexec::scheduler auto scheduler = context.get_scheduler();