diff --git a/example/heatEquation2D/src/heatEquation2D.cpp b/example/heatEquation2D/src/heatEquation2D.cpp index b186e9ec6db..a90aa47fcc1 100644 --- a/example/heatEquation2D/src/heatEquation2D.cpp +++ b/example/heatEquation2D/src/heatEquation2D.cpp @@ -215,5 +215,7 @@ auto main() -> int // TagCpuSerial, TagGpuHipRt, TagGpuCudaRt, TagCpuOmp2Blocks, TagCpuTbbBlocks, // TagCpuOmp2Threads, TagCpuSycl, TagCpuTbbBlocks, TagCpuThreads, // TagFpgaSyclIntel, TagGenericSycl, TagGpuSyclIntel + + alpaka::printAccTags(); return alpaka::executeForEachAccTag([=](auto const& tag) { return example(tag); }); } diff --git a/include/alpaka/acc/Tag.hpp b/include/alpaka/acc/Tag.hpp index f7880afd6f1..7ad166059f6 100644 --- a/include/alpaka/acc/Tag.hpp +++ b/include/alpaka/acc/Tag.hpp @@ -7,6 +7,7 @@ #include "alpaka/core/BoostPredef.hpp" #include +#include #include #define CREATE_ACC_TAG(tag_name) \ @@ -69,4 +70,21 @@ namespace alpaka alpaka::TagFpgaSyclIntel, alpaka::TagGpuSyclIntel>; + //! \brief Function to print the names of each tag in the given tuple of acc tags + //! \tparam TTuple is the type of the tuple of tags + template + void printAccTags() + { + // Check if the tuple is empty using std::tuple_size + if(std::tuple_size{} == 0) + { + std::cout << "No Acc Tags!"; + } + else + { + std::cout << "Acc Tags: "; + std::apply([](auto... args) { ((std::cout << args.get_name() << " "), ...); }, TTuple{}); + } + std::cout << std::endl; + } } // namespace alpaka