From 481278d6f457d13bb6a2492b85bea7c07c8e00c8 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Tue, 21 Nov 2023 18:16:33 +0100 Subject: [PATCH] Trim device names Fixes: #2187 --- include/alpaka/dev/Traits.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/alpaka/dev/Traits.hpp b/include/alpaka/dev/Traits.hpp index 16de5b48f8a5..610ea967128d 100644 --- a/include/alpaka/dev/Traits.hpp +++ b/include/alpaka/dev/Traits.hpp @@ -7,6 +7,8 @@ #include "alpaka/core/Common.hpp" #include "alpaka/core/Concepts.hpp" +#include + #include #include #include @@ -65,11 +67,13 @@ namespace alpaka return trait::GetDev::getDev(t); } - //! \return The device name. + //! \return The device name with leading/trailing space characters trimmed off. template ALPAKA_FN_HOST auto getName(TDev const& dev) -> std::string { - return trait::GetName::getName(dev); + auto name = trait::GetName::getName(dev); + boost::algorithm::trim(name); + return name; } //! \return The memory on the device in Bytes. Returns 0 if querying memory