Skip to content

Commit

Permalink
Renamed and test CheckedRelaxedAtomicAccessor
Browse files Browse the repository at this point in the history
  • Loading branch information
crtrott committed Oct 2, 2024
1 parent 817843d commit 079bbe8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/View/MDSpan/Kokkos_MDSpan_Accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ using CheckedReferenceCountedAccessor =

template <class ElementType, class MemorySpace,
class MemoryScope = desul::MemoryScopeDevice>
using checked_atomic_accessor_relaxed =
using CheckedRelaxedAtomicAccessor =
SpaceAwareAccessor<MemorySpace, AtomicAccessorRelaxed<ElementType>>;

template <class ElementType, class MemorySpace,
Expand Down
6 changes: 6 additions & 0 deletions core/unit_test/view/TestBasicView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,14 @@ void test_atomic_accessor() {
T, typename ExecutionSpace::memory_space>;
using view_type =
Kokkos::BasicView<T, extents_type, layout_type, accessor_type>;
using um_accessor_type = Kokkos::Impl::CheckedRelaxedAtomicAccessor<
T, typename ExecutionSpace::memory_space>;
using um_view_type =
Kokkos::BasicView<T, extents_type, layout_type, um_accessor_type>;

extents_type extents{};
auto view = view_type("test_view", extents);
um_view_type um_view(view);

EXPECT_TRUE(view.data_handle().has_record());
EXPECT_NE(view.data_handle().get(), nullptr);
Expand All @@ -243,6 +248,7 @@ void test_atomic_accessor() {
make_spanning_mdrange_policy_from_extents<ExecutionSpace>(extents);

Kokkos::parallel_for(mdrange_policy, MDRangeTestFunctor<view_type>{view});
Kokkos::parallel_for(mdrange_policy, MDRangeTestFunctor<view_type>{um_view});
}

TEST(TEST_CATEGORY, basic_view_atomic_accessor) {
Expand Down

0 comments on commit 079bbe8

Please sign in to comment.