From a32d56322df0eab234e93dc48b3918e962f040eb Mon Sep 17 00:00:00 2001 From: James Brodman Date: Thu, 27 Aug 2020 17:25:03 -0400 Subject: [PATCH] Fix get_backend() to work for host platform impls. Signed-off-by: James Brodman --- sycl/source/detail/platform_impl.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sycl/source/detail/platform_impl.hpp b/sycl/source/detail/platform_impl.hpp index b5c596866f842..4a7ee4f4bde5d 100644 --- a/sycl/source/detail/platform_impl.hpp +++ b/sycl/source/detail/platform_impl.hpp @@ -106,7 +106,16 @@ class platform_impl { static vector_class get_platforms(); // \return the Backend associated with this platform. - backend get_backend() const noexcept { return getPlugin().getBackend(); } + backend get_backend() const noexcept { + backend Result; + if (is_host()) + Result = backend::host; + else { + Result = getPlugin().getBackend(); + } + + return Result; + } // \return the Plugin associated with this platform. const plugin &getPlugin() const {