DPC++ Runtime
Runtime libraries for oneAPI DPC++
allowlist.hpp
Go to the documentation of this file.
1 //==-------------- allowlist.hpp - SYCL_DEVICE_ALLOWLIST -------------------==//
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 <detail/plugin.hpp>
13 #include <sycl/detail/pi.hpp>
14 
15 #include <map>
16 #include <vector>
17 
18 namespace sycl {
20 namespace detail {
21 
22 using DeviceDescT = std::map<std::string, std::string>;
23 using AllowListParsedT = std::vector<DeviceDescT>;
24 
25 AllowListParsedT parseAllowList(const std::string &AllowListRaw);
26 
27 bool deviceIsAllowed(const DeviceDescT &DeviceDesc,
28  const AllowListParsedT &AllowListParsed);
29 
30 void applyAllowList(std::vector<RT::PiDevice> &PiDevices,
31  RT::PiPlatform PiPlatform, const plugin &Plugin);
32 
33 } // namespace detail
34 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
35 } // namespace sycl
The plugin class provides a unified interface to the underlying low-level runtimes for the device-agn...
Definition: plugin.hpp:90
#define __SYCL_INLINE_VER_NAMESPACE(X)
::pi_platform PiPlatform
Definition: pi.hpp:109
void applyAllowList(std::vector< RT::PiDevice > &PiDevices, RT::PiPlatform PiPlatform, const plugin &Plugin)
Definition: allowlist.cpp:336
std::map< std::string, std::string > DeviceDescT
Definition: allowlist.hpp:22
AllowListParsedT parseAllowList(const std::string &AllowListRaw)
Definition: allowlist.cpp:53
bool deviceIsAllowed(const DeviceDescT &DeviceDesc, const AllowListParsedT &AllowListParsed)
Definition: allowlist.cpp:282
std::vector< DeviceDescT > AllowListParsedT
Definition: allowlist.hpp:23
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14
C++ wrapper of extern "C" PI interfaces.