-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement AccIsEnabled #2267
implement AccIsEnabled #2267
Conversation
3e77f13
to
a596bda
Compare
7ef2c29
to
e41ddc4
Compare
[question] Where will this be used? |
To make it easier to write tests. An example from PR #2180 using TagList = std::tuple<
alpaka::TagCpuSerial,
alpaka::TagCpuThreads,
alpaka::TagCpuTbbBlocks,
alpaka::TagCpuOmp2Blocks,
alpaka::TagCpuOmp2Threads,
alpaka::TagGpuCudaRt,
alpaka::TagGpuHipRt,
alpaka::TagCpuSycl,
alpaka::TagFpgaSyclIntel,
alpaka::TagGpuSyclIntel>;
using TagTagList = alpaka::meta::CartesianProduct<std::tuple, TagList, TagList>;
TEMPLATE_LIST_TEST_CASE("printDefines", "[mem][visibility]", TagTagList)
{
using Tag1 = std::tuple_element_t<0, TestType>;
using Tag2 = std::tuple_element_t<1, TestType>;
if constexpr(alpaka::AccIsEnabled<Tag1>::value && alpaka::AccIsEnabled<Tag2>::value)
{
SUCCEED(Tag1::get_name() << " + " << Tag2::get_name());
using Acc1 = alpaka::TagToAcc<Tag1, Dim, Idx>;
using Acc2 = alpaka::TagToAcc<Tag2, Dim, Idx>;
// ...
if constexpr((isCPUTag<Tag1>() && isCPUTag<Tag2>()) || std::is_same_v<Tag1, Tag2>)
{
STATIC_REQUIRE(alpaka::hasSameMemView(dev1, bufDev2));
STATIC_REQUIRE(alpaka::hasSameMemView(dev2, bufDev1));
}
else
{
STATIC_REQUIRE_FALSE(alpaka::hasSameMemView(dev1, bufDev2));
STATIC_REQUIRE_FALSE(alpaka::hasSameMemView(dev2, bufDev1));
}
} |
During the VC today, @psychocoderHPC gave some improvements for this PR:
|
e41ddc4
to
007e948
Compare
short doxygen introduction: https://www.doxygen.nl/manual/docblocks.html |
c405d2d
to
21c090a
Compare
@psychocoderHPC ready to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one open point we need to discuss.
21c090a
to
153fe2c
Compare
- the value of AccIsEnabled indicates whether an accelerator is enabled for a specific tag - AccTags list which contains all tags - EnabledAccTags contains all tags, where the related Acc is enabled - isCpuTag returns true, if the related Acc is bounded the cpuplatform - enable relaxed template template argument matching for Clang base compiler
153fe2c
to
2f5a529
Compare
The value of AccIsEnabled indicates whether an accelerator is enabled for a specific tag.