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