Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed Oct 16, 2024
1 parent cfbca51 commit f84d93e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 29 deletions.
8 changes: 4 additions & 4 deletions containers/unit_tests/TestDynRankViewTypedefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ namespace TestIntAtomic {
using expected_ref_type = desul::AtomicRef<int, desul::MemoryOrderRelaxed, desul::MemoryScopeDevice>;
#endif
// clang-format on
static_assert(test_view_typedefs<layout_type, space, memory_traits,
host_mirror_space, int, expected_ref_type>(
ViewParams<int, Kokkos::MemoryTraits<Kokkos::Atomic>>{}));
// clang-format off
static_assert(test_view_typedefs<layout_type, space, memory_traits,
host_mirror_space, int, expected_ref_type>(
ViewParams<int, Kokkos::MemoryTraits<Kokkos::Atomic>>{}));
// clang-format off
}
// clang-format on
} // namespace
9 changes: 4 additions & 5 deletions core/src/Kokkos_View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class View : public Impl::BasicViewFromTraits<DataType, Properties...>::type {
typename traits::device_type, typename traits::hooks_policy,
typename traits::memory_traits>;

// Compatible HostMirror view
// Compatible HostMirror view
using host_mirror_type =
View<typename traits::non_const_data_type, typename traits::array_layout,
Device<DefaultHostExecutionSpace,
Expand Down Expand Up @@ -264,8 +264,8 @@ class View : public Impl::BasicViewFromTraits<DataType, Properties...>::type {
size_t>
stride(iType r) const {
// base class doesn't have constraint
// FIXME: Eventually we need to deprecate this behavior and just use
// BasicView implementation
// FIXME: Eventually we need to deprecate this behavior and just use
// BasicView implementation
return base_t::stride(r);
}

Expand Down Expand Up @@ -313,8 +313,7 @@ class View : public Impl::BasicViewFromTraits<DataType, Properties...>::type {

KOKKOS_INLINE_FUNCTION
const Kokkos::Impl::SharedAllocationTracker& impl_track() const {
if constexpr ( traits::is_managed )
{
if constexpr (traits::is_managed) {
return base_t::data_handle().tracker();
} else {
return {};
Expand Down
15 changes: 8 additions & 7 deletions core/src/View/Kokkos_BasicView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,14 @@ class BasicView {
public:
using mdspan_type =
mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>;
using extents_type = typename mdspan_type::extents_type;
using layout_type = typename mdspan_type::layout_type;
using accessor_type = typename mdspan_type::accessor_type;
using mapping_type = typename mdspan_type::mapping_type;
using element_type = typename mdspan_type::element_type;
using value_type = typename mdspan_type::value_type;
// FIXME: backwards compatibility, should be changed to the same as mdspan index_type
using extents_type = typename mdspan_type::extents_type;
using layout_type = typename mdspan_type::layout_type;
using accessor_type = typename mdspan_type::accessor_type;
using mapping_type = typename mdspan_type::mapping_type;
using element_type = typename mdspan_type::element_type;
using value_type = typename mdspan_type::value_type;
// FIXME: backwards compatibility, should be changed to the same as mdspan
// index_type
using index_type = typename mdspan_type::size_type;
using size_type = typename mdspan_type::size_type;
using rank_type = typename mdspan_type::rank_type;
Expand Down
19 changes: 9 additions & 10 deletions core/unit_test/TestViewTypedefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,18 @@ namespace TestIntAtomic {
std::conditional_t<!has_unified_mem_space, Kokkos::HostSpace,
// otherwise its the following Device type
Kokkos::Device<Kokkos::DefaultHostExecutionSpace, typename Kokkos::DefaultExecutionSpace::memory_space>>>;
// clang-format on
static_assert(
test_view_typedefs<
layout_type, space, memory_traits, host_mirror_space, int,
// clang-format on
static_assert(test_view_typedefs<
layout_type, space, memory_traits, host_mirror_space, int,
#ifdef KOKKOS_ENABLE_IMPL_VIEW_LEGACY
Kokkos::Impl::AtomicDataElement<
Kokkos::ViewTraits<int, Kokkos::MemoryTraits<Kokkos::Atomic>>>
Kokkos::Impl::AtomicDataElement<
Kokkos::ViewTraits<int, Kokkos::MemoryTraits<Kokkos::Atomic>>>
#else
desul::AtomicRef<int, desul::MemoryOrderRelaxed,
desul::MemoryScopeDevice>
desul::AtomicRef<int, desul::MemoryOrderRelaxed,
desul::MemoryScopeDevice>
#endif
>(ViewParams<int, Kokkos::MemoryTraits<Kokkos::Atomic>>{}));
// clang-format off
>(ViewParams<int, Kokkos::MemoryTraits<Kokkos::Atomic>>{}));
// clang-format off
}
// clang-format on
} // namespace
6 changes: 3 additions & 3 deletions core/unit_test/cuda/TestCuda_Spaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,16 @@ struct TestViewCudaTexture {
EXPECT_TRUE(
(std::is_same<typename T::reference_type, const double>::value));
#else
EXPECT_TRUE(
(std::is_same<typename T::reference_type, double &>::value));
EXPECT_TRUE((std::is_same<typename T::reference_type, double &>::value));
#endif

EXPECT_TRUE(V::reference_type_is_lvalue_reference); // An ordinary view.
#ifdef KOKKOS_ENABLE_IMPL_VIEW_LEGACY
EXPECT_FALSE(T::reference_type_is_lvalue_reference); // Texture fetch
// returns by value.
#else
EXPECT_TRUE(T::reference_type_is_lvalue_reference); // Returns by value for now.
EXPECT_TRUE(
T::reference_type_is_lvalue_reference); // Returns by value for now.
#endif

TestViewCudaTexture self;
Expand Down

0 comments on commit f84d93e

Please sign in to comment.