DPC++ Runtime
Runtime libraries for oneAPI DPC++
filter_selector.hpp
Go to the documentation of this file.
1 //==------ filter_selector.hpp - ONEAPI filter selector -------*- C++ --*---==//
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 <sycl/detail/export.hpp> // for __SYCL_EXPORT
12 #include <sycl/device.hpp> // for device
13 #include <sycl/device_selector.hpp> // for device_selector
14 
15 #include <memory> // for shared_ptr
16 #include <string> // for string
17 
18 // 4.6.1 Device selection class
19 
20 namespace sycl {
21 inline namespace _V1 {
22 
23 // Forward declarations
24 class device;
25 class device_selector;
26 
27 namespace ext::oneapi {
28 namespace detail {
29 class filter_selector_impl;
30 } // namespace detail
31 
32 class __SYCL_EXPORT filter_selector : public device_selector {
33 public:
34  filter_selector(const std::string &filter);
35  int operator()(const device &dev) const override;
36  void reset() const;
37  device select_device() const override;
38 
39 private:
40  std::shared_ptr<detail::filter_selector_impl> impl;
41 };
42 } // namespace ext::oneapi
43 
44 #ifdef __SYCL_INTERNAL_API
45 namespace __SYCL2020_DEPRECATED("use 'ext::oneapi' instead") ONEAPI {
46 using namespace ext::oneapi;
47 class __SYCL_EXPORT filter_selector : public ext::oneapi::filter_selector {
48 public:
49  filter_selector(const std::string &filter);
50  int operator()(const device &dev) const override;
51  void reset() const;
52  device select_device() const override;
53 };
54 } // namespace __SYCL2020_DEPRECATED("use 'ext::oneapi' instead")ONEAPI
55 #endif // __SYCL_INTERNAL_API
56 } // namespace _V1
57 } // namespace sycl
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Definition: device.hpp:64
device select_device(const DSelectorInvocableType &DeviceSelectorInvocable)
signed char __SYCL2020_DEPRECATED
Definition: aliases.hpp:94
std::uint8_t instead
Definition: aliases.hpp:93
Definition: access.hpp:18