alpaka
Abstraction Library for Parallel Kernel Acceleration
PlatformFpgaSyclIntel.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_FPGA)
12 
13 # include <sycl/sycl.hpp>
14 
15 namespace alpaka
16 {
17  namespace detail
18  {
19  // Prevent clang from annoying us with warnings about emitting too many vtables. These are discarded by the
20  // linker anyway.
21 # if BOOST_COMP_CLANG
22 # pragma clang diagnostic push
23 # pragma clang diagnostic ignored "-Wweak-vtables"
24 # endif
25  template<>
26  struct SYCLDeviceSelector<TagFpgaSyclIntel>
27  {
28 # ifdef ALPAKA_FPGA_EMULATION
29  static constexpr auto platform_name = "Intel(R) FPGA Emulation Platform for OpenCL(TM)";
30 # else
31  static constexpr auto platform_name = "Intel(R) FPGA SDK for OpenCL(TM)";
32 # endif
33 
34  auto operator()(sycl::device const& dev) const -> int
35  {
36  auto const& platform = dev.get_platform().get_info<sycl::info::platform::name>();
37  auto const is_intel_fpga = dev.is_accelerator() && (platform == platform_name);
38 
39  return is_intel_fpga ? 1 : -1;
40  }
41  };
42 # if BOOST_COMP_CLANG
43 # pragma clang diagnostic pop
44 # endif
45  } // namespace detail
46 
47  //! The SYCL device manager.
48  using PlatformFpgaSyclIntel = PlatformGenericSycl<TagFpgaSyclIntel>;
49 } // namespace alpaka
50 
51 #endif
The alpaka accelerator library.