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 {
19 inline namespace _V1 {
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<sycl::detail::pi::PiDevice> &PiDevices,
32  const PluginPtr &Plugin);
33 
34 } // namespace detail
35 } // namespace _V1
36 } // namespace sycl
::pi_platform PiPlatform
Definition: pi.hpp:129
std::map< std::string, std::string > DeviceDescT
Definition: allowlist.hpp:22
AllowListParsedT parseAllowList(const std::string &AllowListRaw)
Definition: allowlist.cpp:54
bool deviceIsAllowed(const DeviceDescT &DeviceDesc, const AllowListParsedT &AllowListParsed)
Definition: allowlist.cpp:292
std::shared_ptr< plugin > PluginPtr
Definition: pi.hpp:48
std::string string
Definition: handler.hpp:426
void applyAllowList(std::vector< sycl::detail::pi::PiDevice > &PiDevices, sycl::detail::pi::PiPlatform PiPlatform, const PluginPtr &Plugin)
Definition: allowlist.cpp:346
std::vector< DeviceDescT > AllowListParsedT
Definition: allowlist.hpp:23
Definition: access.hpp:18
C++ wrapper of extern "C" PI interfaces.