Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/kokkos_ext/execution_space/test_operation_state.cpp
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
8 changes: 8 additions & 0 deletions tests/kokkos_ext/execution_space/test_parallel_for.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#include <bit>

#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"
Expand Down
8 changes: 8 additions & 0 deletions tests/kokkos_ext/execution_space/test_scoped_region.cpp
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
1 change: 1 addition & 0 deletions tests/kokkos_ext/graph/test_inter_op.cpp
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion tests/native/APIWrappers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ template <typename Functor>
struct GraphNodeKernel : public GraphNode
{
PREFIXED_API(KernelNodeParams) params;
std::vector<void*> inputs;
std::array<void*, 1> inputs {};

//! @warning The user is responsible for keeping the @c functor alive.
GraphNodeKernel(const Functor& functor, const size_t shape);
Expand Down
3 changes: 1 addition & 2 deletions tests/native/APIWrappers_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ GraphNodeKernel<Functor>::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;

Expand Down
11 changes: 10 additions & 1 deletion tests/native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Comment thread
maartenarnst marked this conversation as resolved.
# 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})
Expand Down
1 change: 1 addition & 0 deletions tests/native/test_APIWrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ TEST(APIWrappers, view_get_host_copy)
const View<double> data(stream, 2<<6);

const auto mirror = data.get_host_copy(stream);
stream.fence();

ASSERT_EQ(mirror.size(), 2<<6);
}
Expand Down
1 change: 1 addition & 0 deletions tests/native/test_graph_capture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ PRAGMA_DIAGNOSTIC_POP

const auto mirror = dense.get_host_copy(stream);
stream.fence();

ASSERT_EQ(mirror, (std::vector<value_t>{2., 3., 4., 5., 6.}));
}

Expand Down
1 change: 1 addition & 0 deletions tests/native/test_node_enable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tests/nvexec/adaptors/test_stream_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion tests/nvexec/adaptors/test_when_all.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/stdexec/adaptors/test_customization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Domain<'W'>>{}) | ADD_THEN(0)
| ADD_THEN(1) | ::stdexec::continues_on(pool.get_scheduler()) | ADD_THEN(2)
Expand Down
4 changes: 2 additions & 2 deletions tests/stdexec/adaptors/test_starts_on.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ TEST_F(StartsOnTest, twice_with_just_a_bulk) {
::stdexec::sender auto chain =
::stdexec::just(std::vector<size_t>(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.
Expand Down
4 changes: 2 additions & 2 deletions tests/stdexec/adaptors/test_when_all.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand All @@ -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)),
Expand Down
2 changes: 1 addition & 1 deletion tests/stdexec/factories/test_read_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/stdexec/test_HelloWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down