Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SimeonEhrig committed May 13, 2024
1 parent bf12b95 commit 2d3eda4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
1 change: 0 additions & 1 deletion include/alpaka/alpaka.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@
#include "alpaka/meta/Integral.hpp"
#include "alpaka/meta/IsArrayOrVector.hpp"
#include "alpaka/meta/IsStrictBase.hpp"
#include "alpaka/meta/IsTuple.hpp"
#include "alpaka/meta/NdLoop.hpp"
#include "alpaka/meta/NonZero.hpp"
#include "alpaka/meta/Set.hpp"
Expand Down
23 changes: 22 additions & 1 deletion test/unit/mem/src/Visibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,27 @@
using Dim = alpaka::DimInt<1>;
using Idx = std::size_t;

// TODO(SimeonEhrig): Replace implementation. Instead using a list, specialize `alpaka::Platform` for
// tags to get the Memory Visiblity

//! \brief check if the accelerator related to the tag is bounded to the cpu platform
//! \tparam TTag alpaka tag type
template<typename TTag, typename = void>
struct isCpuTag : std::false_type
{
};

template<typename TTag>
struct isCpuTag<
TTag,
std::enable_if_t<
// TAGCpuSycl is not included because it has it's own platform
std::is_same_v<TTag, alpaka::TagCpuSerial> || std::is_same_v<TTag, alpaka::TagCpuThreads>
|| std::is_same_v<TTag, alpaka::TagCpuTbbBlocks> || std::is_same_v<TTag, alpaka::TagCpuOmp2Blocks>
|| std::is_same_v<TTag, alpaka::TagCpuOmp2Threads>>> : std::true_type
{
};

template<typename TTagMemView, typename = void>
struct AccIsEnabledMemVisibilities : std::false_type
{
Expand Down Expand Up @@ -82,7 +103,7 @@ TEMPLATE_LIST_TEST_CASE("testHasSameMemView", "[mem][visibility]", EnabledTagTag
// therefore all cpu accelerators can access the memory of other cpu accelerators
// if the accelerator is not a cpu accelerator, both accelerators needs to be the
// same to support access to the memory of each other
if constexpr((alpaka::isCpuTag<Tag1>::value && alpaka::isCpuTag<Tag2>::value) || std::is_same_v<Tag1, Tag2>)
if constexpr((isCpuTag<Tag1>::value && isCpuTag<Tag2>::value) || std::is_same_v<Tag1, Tag2>)
{
STATIC_REQUIRE(alpaka::hasSameMemView(plt1, bufDev2));
STATIC_REQUIRE(alpaka::hasSameMemView(plt2, bufDev1));
Expand Down

0 comments on commit 2d3eda4

Please sign in to comment.