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