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/device_selector.hpp>
12 
13 #include <memory>
14 #include <string>
15 
16 // 4.6.1 Device selection class
17 
18 namespace sycl {
20 
21 // Forward declarations
22 class device;
23 class device_selector;
24 
25 namespace ext {
26 namespace oneapi {
27 namespace detail {
28 class filter_selector_impl;
29 } // namespace detail
30 
31 class __SYCL_EXPORT filter_selector : public device_selector {
32 public:
33  filter_selector(const std::string &filter);
34  int operator()(const device &dev) const override;
35  void reset() const;
36  device select_device() const override;
37 
38 private:
39  std::shared_ptr<detail::filter_selector_impl> impl;
40 };
41 } // namespace oneapi
42 } // namespace ext
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 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
57 } // namespace sycl
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Definition: device.hpp:47
#define __SYCL_INLINE_VER_NAMESPACE(X)
#define __SYCL2020_DEPRECATED(message)
device select_device(const DSelectorInvocableType &DeviceSelectorInvocable)
struct sycl::detail::device_filter filter
std::uint8_t instead
Definition: aliases.hpp:69
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14