DPC++ Runtime
Runtime libraries for oneAPI DPC++
filter_selector_impl.hpp
Go to the documentation of this file.
1 //==-- filter_selector_impl.hpp - oneapi filter selector impl--*- 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 
12 #include <sycl/device_selector.hpp>
13 
14 #include <vector>
15 
16 namespace sycl {
17 inline namespace _V1 {
18 
19 // Forward declarations
20 class device;
21 
22 namespace ext {
23 namespace oneapi {
24 namespace detail {
25 
26 #ifdef __INTEL_PREVIEW_BREAKING_CHANGES
27 typedef struct sycl::detail::ods_target filter;
28 #else
29 typedef struct sycl::detail::device_filter filter;
30 #endif
31 
33 public:
35  int operator()(const device &dev) const;
36  void reset() const;
37 
38 private:
39  static constexpr int REJECT_DEVICE_SCORE = -1;
40  mutable std::vector<filter> mFilters;
41  mutable int mNumDevicesSeen;
42  int mNumTotalDevices;
43  mutable bool mMatchFound;
44 };
45 } // namespace detail
46 } // namespace oneapi
47 } // namespace ext
48 
49 namespace __SYCL2020_DEPRECATED("use 'ext::oneapi' instead") ONEAPI {
50 using namespace ext::oneapi;
51 }
52 } // namespace _V1
53 } // namespace sycl
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Definition: device.hpp:66
std::string string
Definition: handler.hpp:426
struct sycl::detail::device_filter filter
std::uint8_t instead
Definition: aliases.hpp:93
signed char __SYCL2020_DEPRECATED
Definition: aliases.hpp:94
Definition: access.hpp:18