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 {
18 
19 // Forward declarations
20 class device;
21 
22 namespace ext {
23 namespace oneapi {
24 namespace detail {
25 
26 typedef struct sycl::detail::device_filter filter;
27 
29 public:
30  filter_selector_impl(const std::string &filter);
31  int operator()(const device &dev) const;
32  void reset() const;
33 
34 private:
35  static constexpr int REJECT_DEVICE_SCORE = -1;
36  mutable std::vector<filter> mFilters;
37  default_selector mRanker;
38  mutable int mNumDevicesSeen;
39  int mNumTotalDevices;
40  mutable bool mMatchFound;
41 };
42 } // namespace detail
43 } // namespace oneapi
44 } // namespace ext
45 
46 namespace __SYCL2020_DEPRECATED("use 'ext::oneapi' instead") ONEAPI {
47 using namespace ext::oneapi;
48 }
49 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
50 } // namespace sycl
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Definition: device.hpp:49
#define __SYCL_INLINE_VER_NAMESPACE(X)
#define __SYCL2020_DEPRECATED(message)
static constexpr int REJECT_DEVICE_SCORE
struct sycl::detail::device_filter filter
std::uint8_t instead
Definition: aliases.hpp:69
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14