DPC++ Runtime
Runtime libraries for oneAPI DPC++
fpga_device_selector.hpp
Go to the documentation of this file.
1 //==- fpga_device_selector.hpp --- SYCL FPGA device selector shortcut -----==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 
11 #include <CL/sycl/device.hpp>
13 
14 #include <string>
15 
17 namespace sycl {
18 
19 // Forward declaration
20 class platform;
21 
22 namespace ext {
23 namespace intel {
24 
26 private:
27  std::string device_platform_name;
28 
29 public:
30  platform_selector(const std::string &platform_name)
31  : device_platform_name(platform_name) {}
32 
33  int operator()(const device &device) const override {
34  const platform &pf = device.get_platform();
35  const std::string &platform_name = pf.get_info<info::platform::name>();
36  if (platform_name == device_platform_name) {
37  return 10000;
38  }
39  return -1;
40  }
41 };
42 
43 static constexpr auto EMULATION_PLATFORM_NAME =
44  "Intel(R) FPGA Emulation Platform for OpenCL(TM)";
45 static constexpr auto HARDWARE_PLATFORM_NAME =
46  "Intel(R) FPGA SDK for OpenCL(TM)";
47 
49 public:
51 };
52 
54 public:
56 };
57 
58 } // namespace intel
59 } // namespace ext
60 
61 } // namespace sycl
62 } // __SYCL_INLINE_NAMESPACE(cl)
cl::sycl::ext::intel::platform_selector::operator()
int operator()(const device &device) const override
Definition: fpga_device_selector.hpp:33
cl::sycl::device_selector
The device_selector class provides ability to choose the best SYCL device based on heuristics specifi...
Definition: device_selector.hpp:28
cl::sycl::ext::intel::platform_selector
Definition: fpga_device_selector.hpp:25
cl::sycl::ext::intel::fpga_selector::fpga_selector
fpga_selector()
Definition: fpga_device_selector.hpp:50
cl::sycl::ext::intel::HARDWARE_PLATFORM_NAME
static constexpr auto HARDWARE_PLATFORM_NAME
Definition: fpga_device_selector.hpp:45
cl::sycl::ext::intel::fpga_selector
Definition: fpga_device_selector.hpp:48
device_selector.hpp
device.hpp
cl::sycl::device::get_platform
platform get_platform() const
Get associated SYCL platform.
Definition: device.cpp:110
cl::sycl::platform::get_info
info::param_traits< info::platform, param >::return_type get_info() const
Queries this SYCL platform for info.
Definition: platform.cpp:54
sycl
Definition: invoke_simd.hpp:68
cl::sycl::ext::intel::fpga_emulator_selector::fpga_emulator_selector
fpga_emulator_selector()
Definition: fpga_device_selector.hpp:55
cl::sycl::device
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Definition: device.hpp:35
cl::sycl::ext::intel::EMULATION_PLATFORM_NAME
static constexpr auto EMULATION_PLATFORM_NAME
Definition: fpga_device_selector.hpp:43
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
cl::sycl::platform
Encapsulates a SYCL platform on which kernels may be executed.
Definition: platform.hpp:34
cl::sycl::ext::intel::platform_selector::platform_selector
platform_selector(const std::string &platform_name)
Definition: fpga_device_selector.hpp:30
cl::sycl::ext::intel::fpga_emulator_selector
Definition: fpga_device_selector.hpp:53
cl::sycl::info::platform
platform
Definition: info_desc.hpp:31
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12