diff --git a/example/bufferCopy/src/bufferCopy.cpp b/example/bufferCopy/src/bufferCopy.cpp index 06e4200af6a..324c7e72f7c 100644 --- a/example/bufferCopy/src/bufferCopy.cpp +++ b/example/bufferCopy/src/bufferCopy.cpp @@ -239,6 +239,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/complex/src/complex.cpp b/example/complex/src/complex.cpp index 6c507f78b04..cad098eb1bf 100644 --- a/example/complex/src/complex.cpp +++ b/example/complex/src/complex.cpp @@ -80,6 +80,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/conv2DWithMdspan/src/conv2DWithMdspan.cpp b/example/conv2DWithMdspan/src/conv2DWithMdspan.cpp index 4a3f58f7c0e..d368c01b12d 100644 --- a/example/conv2DWithMdspan/src/conv2DWithMdspan.cpp +++ b/example/conv2DWithMdspan/src/conv2DWithMdspan.cpp @@ -230,6 +230,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/convolution1D/src/convolution1D.cpp b/example/convolution1D/src/convolution1D.cpp index c39b4c07944..9ad774aec32 100644 --- a/example/convolution1D/src/convolution1D.cpp +++ b/example/convolution1D/src/convolution1D.cpp @@ -190,6 +190,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/convolution2D/src/convolution2D.cpp b/example/convolution2D/src/convolution2D.cpp index ed7c311956e..c7a318f629b 100644 --- a/example/convolution2D/src/convolution2D.cpp +++ b/example/convolution2D/src/convolution2D.cpp @@ -394,6 +394,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/counterBasedRng/src/counterBasedRng.cpp b/example/counterBasedRng/src/counterBasedRng.cpp index d2f1fc8dc95..0f37d784f2e 100644 --- a/example/counterBasedRng/src/counterBasedRng.cpp +++ b/example/counterBasedRng/src/counterBasedRng.cpp @@ -226,6 +226,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/heatEquation/src/heatEquation.cpp b/example/heatEquation/src/heatEquation.cpp index 3ebcad172b6..371f3932a34 100644 --- a/example/heatEquation/src/heatEquation.cpp +++ b/example/heatEquation/src/heatEquation.cpp @@ -186,6 +186,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/heatEquation2D/src/heatEquation2D.cpp b/example/heatEquation2D/src/heatEquation2D.cpp index 04af0cdc3fa..8631c3617ea 100644 --- a/example/heatEquation2D/src/heatEquation2D.cpp +++ b/example/heatEquation2D/src/heatEquation2D.cpp @@ -204,6 +204,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/helloWorld/src/helloWorld.cpp b/example/helloWorld/src/helloWorld.cpp index 40ef657571d..d5d28282fb0 100644 --- a/example/helloWorld/src/helloWorld.cpp +++ b/example/helloWorld/src/helloWorld.cpp @@ -161,6 +161,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/helloWorldLambda/src/helloWorldLambda.cpp b/example/helloWorldLambda/src/helloWorldLambda.cpp index 4c951b2a952..cc9be311653 100644 --- a/example/helloWorldLambda/src/helloWorldLambda.cpp +++ b/example/helloWorldLambda/src/helloWorldLambda.cpp @@ -134,6 +134,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/kernelSpecialization/src/kernelSpecialization.cpp b/example/kernelSpecialization/src/kernelSpecialization.cpp index 9c640df4234..acaeefb63e9 100644 --- a/example/kernelSpecialization/src/kernelSpecialization.cpp +++ b/example/kernelSpecialization/src/kernelSpecialization.cpp @@ -95,6 +95,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/matrixMulWithMdspan/src/matrixMulMdSpan.cpp b/example/matrixMulWithMdspan/src/matrixMulMdSpan.cpp index c55fe078a47..28d9c844326 100644 --- a/example/matrixMulWithMdspan/src/matrixMulMdSpan.cpp +++ b/example/matrixMulWithMdspan/src/matrixMulMdSpan.cpp @@ -192,6 +192,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/monteCarloIntegration/src/monteCarloIntegration.cpp b/example/monteCarloIntegration/src/monteCarloIntegration.cpp index cd8d9d9a01d..ef6be2112bc 100644 --- a/example/monteCarloIntegration/src/monteCarloIntegration.cpp +++ b/example/monteCarloIntegration/src/monteCarloIntegration.cpp @@ -139,6 +139,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/parallelLoopPatterns/src/parallelLoopPatterns.cpp b/example/parallelLoopPatterns/src/parallelLoopPatterns.cpp index b4d06d25899..da87b868650 100644 --- a/example/parallelLoopPatterns/src/parallelLoopPatterns.cpp +++ b/example/parallelLoopPatterns/src/parallelLoopPatterns.cpp @@ -435,6 +435,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/randomCells2D/src/randomCells2D.cpp b/example/randomCells2D/src/randomCells2D.cpp index 18b992bbcd3..3bbdaadd71d 100644 --- a/example/randomCells2D/src/randomCells2D.cpp +++ b/example/randomCells2D/src/randomCells2D.cpp @@ -309,6 +309,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/randomStrategies/src/randomStrategies.cpp b/example/randomStrategies/src/randomStrategies.cpp index b8b5ac214c0..d38db9c3d86 100644 --- a/example/randomStrategies/src/randomStrategies.cpp +++ b/example/randomStrategies/src/randomStrategies.cpp @@ -340,6 +340,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/tagSpecialization/src/tagSpecialization.cpp b/example/tagSpecialization/src/tagSpecialization.cpp index 735d0678220..a8672e45dea 100644 --- a/example/tagSpecialization/src/tagSpecialization.cpp +++ b/example/tagSpecialization/src/tagSpecialization.cpp @@ -119,6 +119,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/example/vectorAdd/src/vectorAdd.cpp b/example/vectorAdd/src/vectorAdd.cpp index 944001b607b..1d50ea32c55 100644 --- a/example/vectorAdd/src/vectorAdd.cpp +++ b/example/vectorAdd/src/vectorAdd.cpp @@ -190,6 +190,8 @@ auto example(TAccTag const&) -> int auto main() -> int { + std::cout << "Check enabled accelerator tags:" << std::endl; + alpaka::printTagNames(); // Execute the example once for each enabled accelerator. // If you would like to execute it for a single accelerator only you can use the following code. // \code{.cpp} diff --git a/include/alpaka/acc/Tag.hpp b/include/alpaka/acc/Tag.hpp index 03f854a678d..5639c04879f 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 namespace alpaka @@ -88,4 +89,28 @@ namespace alpaka alpaka::TagFpgaSyclIntel, alpaka::TagGpuSyclIntel>; + //! \brief Function to print the names of each tag in the given tuple of tags + //! \tparam TTuple is the type of the tuple of tags + template + void printTagNames() + { + // Check if the tuple is empty using std::tuple_size_v + if(std::tuple_size_v == 0) + { + std::cout << "No Tags!"; + } + else + { + std::cout << "Tags: "; + // Print tags with comma in between + std::apply( + [](auto... args) + { + auto index = std::tuple_size_v; + ((std::cout << args.get_name() << (--index > 0u ? "," : "")), ...); + }, + TTuple{}); + } + std::cout << std::endl; + } } // namespace alpaka