alpaka
Abstraction Library for Parallel Kernel Acceleration
PlatformGpuSyclIntel.hpp
Go to the documentation of this file.
1 /* Copyright 2024 Jan Stephan, Luca Ferragina, Andrea Bocci, Aurora Perego
2  * SPDX-License-Identifier: MPL-2.0
3  */
4 
5 #pragma once
6 
8 #include "alpaka/dev/Traits.hpp"
10 
11 #if defined(ALPAKA_ACC_SYCL_ENABLED) && defined(ALPAKA_SYCL_ONEAPI_GPU)
12 
13 # include <sycl/sycl.hpp>
14 
15 namespace alpaka
16 {
17  namespace detail
18  {
19  template<>
20  struct SYCLDeviceSelector<TagGpuSyclIntel>
21  {
22  auto operator()(sycl::device const& dev) const -> int
23  {
24  auto const& vendor = dev.get_info<sycl::info::device::vendor>();
25  auto const is_intel_gpu = dev.is_gpu() && (vendor.find("Intel(R) Corporation") != std::string::npos);
26 
27  return is_intel_gpu ? 1 : -1;
28  }
29  };
30  } // namespace detail
31 
32  //! The SYCL device manager.
33  using PlatformGpuSyclIntel = PlatformGenericSycl<TagGpuSyclIntel>;
34 } // namespace alpaka
35 
36 #endif
The alpaka accelerator library.