DPC++ Runtime
Runtime libraries for oneAPI DPC++
config.hpp
Go to the documentation of this file.
1 //==---------------- config.hpp - SYCL config -------------------*- 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/backend_types.hpp>
13 #include <sycl/detail/defines.hpp>
15 #include <sycl/detail/pi.hpp>
16 #include <sycl/exception.hpp>
17 #include <sycl/info/info_desc.hpp>
18 
19 #include <algorithm>
20 #include <array>
21 #include <cstdlib>
22 #include <mutex>
23 #include <string>
24 #include <utility>
25 
26 namespace sycl {
27 inline namespace _V1 {
28 namespace detail {
29 
30 #ifdef DISABLE_CONFIG_FROM_ENV
31 constexpr bool ConfigFromEnvEnabled = false;
32 #else
33 constexpr bool ConfigFromEnvEnabled = true;
34 #endif // DISABLE_CONFIG_FROM_ENV
35 
36 #ifdef DISABLE_CONFIG_FROM_CONFIG_FILE
37 constexpr bool ConfigFromFileEnabled = false;
38 #else
39 constexpr bool ConfigFromFileEnabled = true;
40 #endif // DISABLE_CONFIG_FROM_CONFIG_FILE
41 
42 #ifdef DISABLE_CONFIG_FROM_COMPILE_TIME
43 constexpr bool ConfigFromCompileDefEnabled = false;
44 #else
45 constexpr bool ConfigFromCompileDefEnabled = true;
46 #endif // DISABLE_CONFIG_FROM_COMPILE_TIME
47 
48 constexpr int MAX_CONFIG_NAME = 256;
49 constexpr int MAX_CONFIG_VALUE = 1024;
50 
51 // Enum of config IDs for accessing other arrays
52 enum ConfigID {
53  START = 0,
54 #define CONFIG(name, ...) name,
55 #include "config.def"
56 #undef CONFIG
58 };
59 
60 // Consider strings starting with __ as unset
61 constexpr const char *getStrOrNullptr(const char *Str) {
62  return (Str[0] == '_' && Str[1] == '_') ? nullptr : Str;
63 }
64 
65 // Intializes configs from the configuration file
66 void readConfig(bool ForceInitialization = false);
67 
68 template <ConfigID Config> class SYCLConfigBase;
69 
70 #define CONFIG(Name, MaxSize, CompileTimeDef) \
71  template <> class SYCLConfigBase<Name> { \
72  public: \
73  /*Preallocated storage for config value which is extracted from a config \
74  * file*/ \
75  static char MStorage[MaxSize + 1]; \
76  /*Points to the storage if config is set in the file, nullptr otherwise*/ \
77  static const char *MValueFromFile; \
78  /*The name of the config*/ \
79  static const char *const MConfigName; \
80  /*Points to the value which is set during compilation, nullptr otherwise. \
81  * Detection of whether a value is set or not is based on checking the \
82  * beginning of the string, if it starts with double underscore(__) the \
83  * value is not set.*/ \
84  static const char *const MCompileTimeDef; \
85  \
86  static const char *getRawValue() { \
87  if (ConfigFromEnvEnabled) \
88  if (const char *ValStr = getenv(MConfigName)) \
89  return ValStr; \
90  \
91  if (ConfigFromFileEnabled) { \
92  readConfig(); \
93  if (MValueFromFile) \
94  return MValueFromFile; \
95  } \
96  \
97  if (ConfigFromCompileDefEnabled && MCompileTimeDef) \
98  return MCompileTimeDef; \
99  \
100  return nullptr; \
101  } \
102  };
103 #include "config.def"
104 #undef CONFIG
105 
106 #define INVALID_CONFIG_EXCEPTION(BASE, MSG) \
107  sycl::exception(sycl::make_error_code(sycl::errc::invalid), \
108  "Invalid value for " + std::string{BASE::MConfigName} + \
109  " environment variable: " + MSG)
110 
111 template <ConfigID Config> class SYCLConfig {
113 
114 public:
115  static const char *get() { return getCachedValue(); }
116 
117  static void reset() { (void)getCachedValue(/*ResetCache=*/true); }
118 
119  static const char *getName() { return BaseT::MConfigName; }
120 
121 private:
122  static const char *getCachedValue(bool ResetCache = false) {
123  static const char *ValStr = BaseT::getRawValue();
124  if (ResetCache)
125  ValStr = BaseT::getRawValue();
126  return ValStr;
127  }
128 };
129 
130 template <> class SYCLConfig<SYCL_PI_TRACE> {
132 
133 public:
134  static int get() {
135  static bool Initialized = false;
136  // We don't use TraceLevel enum here because user can provide any bitmask
137  // which can correspond to several enum values.
138  static int Level = 0; // No tracing by default
139 
140  // Configuration parameters are processed only once, like reading a string
141  // from environment and converting it into a typed object.
142  if (Initialized)
143  return Level;
144 
145  const char *ValStr = BaseT::getRawValue();
146  Level = (ValStr ? std::atoi(ValStr) : 0);
147  Initialized = true;
148  return Level;
149  }
150 };
151 
152 template <> class SYCLConfig<SYCL_RT_WARNING_LEVEL> {
154 
155 public:
156  static unsigned int get() { return getCachedValue(); }
157 
158  static void reset() { (void)getCachedValue(true); }
159 
160 private:
161  static unsigned int getCachedValue(bool ResetCache = false) {
162  const auto Parser = []() {
163  const char *ValStr = BaseT::getRawValue();
164  int SignedLevel = ValStr ? std::atoi(ValStr) : 0;
165  return SignedLevel >= 0 ? SignedLevel : 0;
166  };
167 
168  static unsigned int Level = Parser();
169  if (ResetCache)
170  Level = Parser();
171 
172  return Level;
173  }
174 };
175 
176 template <> class SYCLConfig<SYCL_PARALLEL_FOR_RANGE_ROUNDING_TRACE> {
178 
179 public:
180  static bool get() {
181  static const char *ValStr = BaseT::getRawValue();
182  return ValStr != nullptr;
183  }
184 };
185 
186 template <> class SYCLConfig<SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING> {
188 
189 public:
190  static bool get() {
191  static const char *ValStr = BaseT::getRawValue();
192  return ValStr != nullptr;
193  }
194 };
195 
196 template <> class SYCLConfig<SYCL_PARALLEL_FOR_RANGE_ROUNDING_PARAMS> {
198 
199 private:
200 public:
201  static void GetSettings(size_t &MinFactor, size_t &GoodFactor,
202  size_t &MinRange) {
203  static const char *RoundParams = BaseT::getRawValue();
204  if (RoundParams == nullptr)
205  return;
206 
207  static bool ProcessedFactors = false;
208  static size_t MF;
209  static size_t GF;
210  static size_t MR;
211  if (!ProcessedFactors) {
212  // Parse optional parameters of this form (all values required):
213  // MinRound:PreferredRound:MinRange
214  std::string Params(RoundParams);
215  size_t Pos = Params.find(':');
216  if (Pos != std::string::npos) {
217  MF = std::stoi(Params.substr(0, Pos));
218  Params.erase(0, Pos + 1);
219  Pos = Params.find(':');
220  if (Pos != std::string::npos) {
221  GF = std::stoi(Params.substr(0, Pos));
222  Params.erase(0, Pos + 1);
223  MR = std::stoi(Params);
224  }
225  }
226  ProcessedFactors = true;
227  }
228  MinFactor = MF;
229  GoodFactor = GF;
230  MinRange = MR;
231  }
232 };
233 
234 // Array is used by SYCL_DEVICE_FILTER and SYCL_DEVICE_ALLOWLIST and
235 // ONEAPI_DEVICE_SELECTOR
236 const std::array<std::pair<std::string, info::device_type>, 6> &
238 
239 // Array is used by SYCL_DEVICE_FILTER and SYCL_DEVICE_ALLOWLIST and
240 // ONEAPI_DEVICE_SELECTOR
241 const std::array<std::pair<std::string, backend>, 8> &getSyclBeMap();
242 
243 // ---------------------------------------
244 // ONEAPI_DEVICE_SELECTOR support
245 template <> class SYCLConfig<ONEAPI_DEVICE_SELECTOR> {
247 
248 public:
249  static ods_target_list *get() {
250  // Configuration parameters are processed only once, like reading a string
251  // from environment and converting it into a typed object.
252  static bool Initialized = false;
253  static ods_target_list *DeviceTargets = nullptr;
254 
255  if (Initialized) {
256  return DeviceTargets;
257  }
258  const char *ValStr = BaseT::getRawValue();
259  if (ValStr) {
260  DeviceTargets =
262  }
263  Initialized = true;
264  return DeviceTargets;
265  }
266 };
267 
268 // ---------------------------------------
269 // SYCL_DEVICE_FILTER support
270 
271 template <>
272 class __SYCL2020_DEPRECATED("Use SYCLConfig<ONEAPI_DEVICE_SELECTOR> instead")
273  SYCLConfig<SYCL_DEVICE_FILTER> {
275 
276 public:
277  static device_filter_list *get() {
278  static bool Initialized = false;
279  static device_filter_list *FilterList = nullptr;
280 
281  // Configuration parameters are processed only once, like reading a string
282  // from environment and converting it into a typed object.
283  if (Initialized) {
284  return FilterList;
285  }
286 
287  const char *ValStr = BaseT::getRawValue();
288  if (ValStr) {
289 
290  std::cerr
291  << "\nWARNING: The enviroment variable SYCL_DEVICE_FILTER"
292  " is deprecated. Please use ONEAPI_DEVICE_SELECTOR instead.\n"
293  "For more details, please refer to:\n"
294  "https://github.com/intel/llvm/blob/sycl/sycl/doc/"
295  "EnvironmentVariables.md#oneapi_device_selector\n\n";
296 
297  FilterList = &GlobalHandler::instance().getDeviceFilterList(ValStr);
298  }
299 
300  // As mentioned above, configuration parameters are processed only once.
301  // If multiple threads are checking this env var at the same time,
302  // they will end up setting the configration to the same value.
303  // If other threads check after one thread already set configration,
304  // the threads will get the same value as the first thread.
305  Initialized = true;
306  return FilterList;
307  }
308 };
309 
310 template <> class SYCLConfig<SYCL_ENABLE_DEFAULT_CONTEXTS> {
312 
313 public:
314  static bool get() {
315 #ifdef WIN32
316  constexpr bool DefaultValue = false;
317 #else
318  constexpr bool DefaultValue = true;
319 #endif
320 
321  const char *ValStr = getCachedValue();
322 
323  if (!ValStr)
324  return DefaultValue;
325 
326  return ValStr[0] == '1';
327  }
328 
329  static void reset() { (void)getCachedValue(/*ResetCache=*/true); }
330 
331  static void resetWithValue(const char *Val) {
332  (void)getCachedValue(/*ResetCache=*/true, Val);
333  }
334 
335  static const char *getName() { return BaseT::MConfigName; }
336 
337 private:
338  static const char *getCachedValue(bool ResetCache = false,
339  const char *Val = nullptr) {
340  static const char *ValStr = BaseT::getRawValue();
341  if (ResetCache) {
342  ValStr = (Val != nullptr) ? Val : BaseT::getRawValue();
343  }
344  return ValStr;
345  }
346 };
347 
348 template <> class SYCLConfig<SYCL_QUEUE_THREAD_POOL_SIZE> {
350 
351 public:
352  static int get() {
353  static int Value = [] {
354  const char *ValueStr = BaseT::getRawValue();
355 
356  int Result = 1;
357 
358  if (ValueStr)
359  try {
360  Result = std::stoi(ValueStr);
361  } catch (...) {
362  throw invalid_parameter_error(
363  "Invalid value for SYCL_QUEUE_THREAD_POOL_SIZE environment "
364  "variable: value should be a number",
365  PI_ERROR_INVALID_VALUE);
366  }
367 
368  if (Result < 1)
369  throw invalid_parameter_error(
370  "Invalid value for SYCL_QUEUE_THREAD_POOL_SIZE environment "
371  "variable: value should be larger than zero",
372  PI_ERROR_INVALID_VALUE);
373 
374  return Result;
375  }();
376 
377  return Value;
378  }
379 };
380 
381 template <> class SYCLConfig<SYCL_CACHE_PERSISTENT> {
383 
384 public:
385  static constexpr bool Default = false; // default is disabled
386 
387  static bool get() { return getCachedValue(); }
388 
389  static void reset() { (void)getCachedValue(/*ResetCache=*/true); }
390 
391  static const char *getName() { return BaseT::MConfigName; }
392 
393 private:
394  static bool parseValue() {
395  // Check if deprecated opt-out env var is used, then warn.
397  std::cerr
399  << " environment variable is deprecated "
400  << "and has no effect. By default, persistent device code caching is "
401  << (Default ? "enabled." : "disabled.") << " Use " << getName()
402  << "=1/0 to enable/disable.\n";
403  }
404 
405  const char *ValStr = BaseT::getRawValue();
406  if (!ValStr)
407  return Default;
408  if (strlen(ValStr) != 1 || (ValStr[0] != '0' && ValStr[0] != '1')) {
409  std::string Msg =
410  std::string{"Invalid value for bool configuration variable "} +
411  getName() + std::string{": "} + ValStr;
412  throw runtime_error(Msg, PI_ERROR_INVALID_OPERATION);
413  }
414  return ValStr[0] == '1';
415  }
416 
417  static bool getCachedValue(bool ResetCache = false) {
418  static bool Val = parseValue();
419  if (ResetCache)
420  Val = parseValue();
421  return Val;
422  }
423 };
424 
425 template <> class SYCLConfig<SYCL_CACHE_DIR> {
427 
428 public:
429  static std::string get() { return getCachedValue(); }
430 
431  static void reset() { (void)getCachedValue(/*ResetCache=*/true); }
432 
433  static const char *getName() { return BaseT::MConfigName; }
434 
435 private:
436  // If environment variables are not available return an empty string to
437  // identify that cache is not available.
438  static std::string parseValue() {
439  const char *RootDir = BaseT::getRawValue();
440  if (RootDir)
441  return RootDir;
442 
443  constexpr char DeviceCodeCacheDir[] = "/libsycl_cache";
444 
445 #if defined(__SYCL_RT_OS_LINUX)
446  const char *CacheDir = std::getenv("XDG_CACHE_HOME");
447  const char *HomeDir = std::getenv("HOME");
448  if (!CacheDir && !HomeDir)
449  return {};
450  std::string Res{
451  std::string(CacheDir ? CacheDir : (std::string(HomeDir) + "/.cache")) +
452  DeviceCodeCacheDir};
453 #else
454  const char *AppDataDir = std::getenv("AppData");
455  if (!AppDataDir)
456  return {};
457  std::string Res{std::string(AppDataDir) + DeviceCodeCacheDir};
458 #endif
459  return Res;
460  }
461 
462  static std::string getCachedValue(bool ResetCache = false) {
463  static std::string Val = parseValue();
464  if (ResetCache)
465  Val = parseValue();
466  return Val;
467  }
468 };
469 
470 template <> class SYCLConfig<SYCL_REDUCTION_PREFERRED_WORKGROUP_SIZE> {
472 
473  struct ParsedValue {
474  size_t CPU = 0;
475  size_t GPU = 0;
476  size_t Accelerator = 0;
477  };
478 
479 public:
480  static size_t get(info::device_type DeviceType) {
481  ParsedValue Value = getCachedValue();
482  return getRefByDeviceType(Value, DeviceType);
483  }
484 
485  static void reset() { (void)getCachedValue(/*ResetCache=*/true); }
486 
487  static const char *getName() { return BaseT::MConfigName; }
488 
489 private:
490  static size_t &getRefByDeviceType(ParsedValue &Value,
491  info::device_type DeviceType) {
492  switch (DeviceType) {
494  return Value.CPU;
496  return Value.GPU;
498  return Value.Accelerator;
499  default:
500  // Expect to get here if user used wrong device type. Include wildcard
501  // in the message even though it's handled in the caller.
503  BaseT, "Device types must be \"cpu\", \"gpu\", \"acc\", or \"*\".");
504  }
505  }
506 
507  static ParsedValue parseValue() {
508  const char *ValueRaw = BaseT::getRawValue();
509  ParsedValue Result{};
510 
511  // Default to 0 to signify an unset value.
512  if (!ValueRaw)
513  return Result;
514 
515  std::string ValueStr{ValueRaw};
516  auto DeviceTypeMap = getSyclDeviceTypeMap();
517 
518  // Iterate over all configurations.
519  size_t Start = 0, End = 0;
520  do {
521  End = ValueStr.find(',', Start);
522  if (End == std::string::npos)
523  End = ValueStr.size();
524 
525  // Get a substring of the current configuration pair.
526  std::string DeviceConfigStr = ValueStr.substr(Start, End - Start);
527 
528  // Find the delimiter in the configuration pair.
529  size_t ConfigDelimLoc = DeviceConfigStr.find(':');
530  if (ConfigDelimLoc == std::string::npos)
532  BaseT, "Device-value pair \"" + DeviceConfigStr +
533  "\" does not contain the ':' delimiter.");
534 
535  // Split configuration pair into its constituents.
536  std::string DeviceConfigTypeStr =
537  DeviceConfigStr.substr(0, ConfigDelimLoc);
538  std::string DeviceConfigValueStr = DeviceConfigStr.substr(
539  ConfigDelimLoc + 1, DeviceConfigStr.size() - ConfigDelimLoc - 1);
540 
541  // Find the device type in the "device type map".
542  auto DeviceTypeIter = std::find_if(
543  std::begin(DeviceTypeMap), std::end(DeviceTypeMap),
544  [&](auto Element) { return DeviceConfigTypeStr == Element.first; });
545  if (DeviceTypeIter == DeviceTypeMap.end())
547  BaseT,
548  "\"" + DeviceConfigTypeStr + "\" is not a recognized device type.");
549 
550  // Parse the configuration value.
551  int DeviceConfigValue = 1;
552  try {
553  DeviceConfigValue = std::stoi(DeviceConfigValueStr);
554  } catch (...) {
556  BaseT, "Value \"" + DeviceConfigValueStr + "\" must be a number");
557  }
558 
559  if (DeviceConfigValue < 1)
560  throw INVALID_CONFIG_EXCEPTION(BaseT,
561  "Value \"" + DeviceConfigValueStr +
562  "\" must be larger than zero");
563 
564  if (DeviceTypeIter->second == info::device_type::all) {
565  // Set all configuration values if we got the device-type wildcard.
566  Result.GPU = DeviceConfigValue;
567  Result.CPU = DeviceConfigValue;
568  Result.Accelerator = DeviceConfigValue;
569  } else {
570  // Try setting the corresponding configuration.
571  getRefByDeviceType(Result, DeviceTypeIter->second) = DeviceConfigValue;
572  }
573 
574  // Move to the start of the next configuration. If the start is outside
575  // the full value string we are done.
576  Start = End + 1;
577  } while (Start < ValueStr.size());
578  return Result;
579  }
580 
581  static ParsedValue getCachedValue(bool ResetCache = false) {
582  static ParsedValue Val = parseValue();
583  if (ResetCache)
584  Val = parseValue();
585  return Val;
586  }
587 };
588 
589 template <> class SYCLConfig<SYCL_ENABLE_FUSION_CACHING> {
591 
592 public:
593  static bool get() {
594  constexpr bool DefaultValue = true;
595 
596  const char *ValStr = getCachedValue();
597 
598  if (!ValStr)
599  return DefaultValue;
600 
601  return ValStr[0] == '1';
602  }
603 
604  static void reset() { (void)getCachedValue(/*ResetCache=*/true); }
605 
606  static const char *getName() { return BaseT::MConfigName; }
607 
608 private:
609  static const char *getCachedValue(bool ResetCache = false) {
610  static const char *ValStr = BaseT::getRawValue();
611  if (ResetCache)
612  ValStr = BaseT::getRawValue();
613  return ValStr;
614  }
615 };
616 
617 template <> class SYCLConfig<SYCL_CACHE_IN_MEM> {
619 
620 public:
621  static constexpr bool Default = true; // default is true
622  static bool get() { return getCachedValue(); }
623  static const char *getName() { return BaseT::MConfigName; }
624 
625 private:
626  static bool parseValue() {
627  const char *ValStr = BaseT::getRawValue();
628  if (!ValStr)
629  return Default;
630  if (strlen(ValStr) != 1 || (ValStr[0] != '0' && ValStr[0] != '1')) {
631  std::string Msg =
632  std::string{"Invalid value for bool configuration variable "} +
633  getName() + std::string{": "} + ValStr;
634  throw runtime_error(Msg, PI_ERROR_INVALID_OPERATION);
635  }
636  return ValStr[0] == '1';
637  }
638 
639  static bool getCachedValue() {
640  static bool Val = parseValue();
641  return Val;
642  }
643 };
644 
645 #undef INVALID_CONFIG_EXCEPTION
646 
647 } // namespace detail
648 } // namespace _V1
649 } // namespace sycl
sycl::_V1::detail::SYCLConfig< SYCL_PARALLEL_FOR_RANGE_ROUNDING_TRACE >::get
static bool get()
Definition: config.hpp:180
sycl::_V1::detail::ConfigFromEnvEnabled
constexpr bool ConfigFromEnvEnabled
Definition: config.hpp:33
sycl::_V1::detail::SYCLConfig< SYCL_ENABLE_FUSION_CACHING >::getName
static const char * getName()
Definition: config.hpp:606
sycl::_V1::detail::SYCLConfig< SYCL_REDUCTION_PREFERRED_WORKGROUP_SIZE >::get
static size_t get(info::device_type DeviceType)
Definition: config.hpp:480
sycl::_V1::__SYCL2020_DEPRECATED
signed char __SYCL2020_DEPRECATED
Definition: aliases.hpp:94
sycl::_V1::detail::SYCLConfig< SYCL_ENABLE_FUSION_CACHING >::reset
static void reset()
Definition: config.hpp:604
sycl::_V1::instead
std::uint8_t instead
Definition: aliases.hpp:93
sycl::_V1::detail::ConfigID
ConfigID
Definition: config.hpp:52
sycl::_V1::detail::SYCLConfig< ONEAPI_DEVICE_SELECTOR >::get
static ods_target_list * get()
Definition: config.hpp:249
device_filter.hpp
sycl::_V1::detail::getSyclBeMap
const std::array< std::pair< std::string, backend >, 8 > & getSyclBeMap()
Definition: config.cpp:180
sycl::_V1::get
pointer_t get() const
Definition: multi_ptr.hpp:974
sycl::_V1::detail::SYCLConfig< SYCL_RT_WARNING_LEVEL >::reset
static void reset()
Definition: config.hpp:158
sycl::_V1::detail::GlobalHandler::instance
static GlobalHandler & instance()
Definition: global_handler.cpp:123
sycl::_V1::detail::ConfigFromCompileDefEnabled
constexpr bool ConfigFromCompileDefEnabled
Definition: config.hpp:45
sycl::_V1::detail::SYCLConfig< SYCL_CACHE_DIR >::get
static std::string get()
Definition: config.hpp:429
sycl::_V1::detail::SYCLConfig
Definition: config.hpp:111
sycl
Definition: access.hpp:18
sycl::_V1::detail::SYCLConfig< SYCL_REDUCTION_PREFERRED_WORKGROUP_SIZE >::getName
static const char * getName()
Definition: config.hpp:487
sycl::_V1::info::device_type::gpu
@ gpu
pi.hpp
sycl::_V1::detail::SYCLConfig< SYCL_CACHE_IN_MEM >::get
static bool get()
Definition: config.hpp:622
sycl::_V1::detail::MAX_CONFIG_VALUE
constexpr int MAX_CONFIG_VALUE
Definition: config.hpp:49
sycl::_V1::detail::SYCLConfig< SYCL_PARALLEL_FOR_RANGE_ROUNDING_PARAMS >::GetSettings
static void GetSettings(size_t &MinFactor, size_t &GoodFactor, size_t &MinRange)
Definition: config.hpp:201
sycl::_V1::detail::GlobalHandler::getOneapiDeviceSelectorTargets
ods_target_list & getOneapiDeviceSelectorTargets(const std::string &InitValue)
Definition: global_handler.cpp:211
sycl::_V1::detail::SYCLConfig< SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING >::get
static bool get()
Definition: config.hpp:190
sycl::_V1::detail::MAX_CONFIG_NAME
constexpr int MAX_CONFIG_NAME
Definition: config.hpp:48
sycl::_V1::detail::GlobalHandler::getDeviceFilterList
device_filter_list & getDeviceFilterList(const std::string &InitValue)
Definition: global_handler.cpp:206
defines.hpp
sycl::_V1::detail::SYCLConfig< SYCL_CACHE_IN_MEM >::getName
static const char * getName()
Definition: config.hpp:623
std::cerr
__SYCL_EXTERN_STREAM_ATTRS ostream cerr
Linked to standard error (unbuffered)
sycl::_V1::detail::getStrOrNullptr
constexpr const char * getStrOrNullptr(const char *Str)
Definition: config.hpp:61
global_handler.hpp
sycl::_V1::info::device_type
device_type
Definition: info_desc.hpp:53
sycl::_V1::info::device_type::all
@ all
sycl::_V1::detail::SYCLConfig< SYCL_QUEUE_THREAD_POOL_SIZE >::get
static int get()
Definition: config.hpp:352
sycl::_V1::info::device_type::cpu
@ cpu
sycl::_V1::detail::SYCLConfig< SYCL_REDUCTION_PREFERRED_WORKGROUP_SIZE >::reset
static void reset()
Definition: config.hpp:485
backend_types.hpp
sycl::_V1::detail::device_filter_list
Definition: device_filter.hpp:84
sycl::_V1::detail::getSyclDeviceTypeMap
const std::array< std::pair< std::string, info::device_type >, 6 > & getSyclDeviceTypeMap()
Definition: config.cpp:167
exception.hpp
sycl::_V1::detail::END
@ END
Definition: config.hpp:57
sycl::_V1::detail::readConfig
void readConfig(bool ForceInitialization)
Definition: config.cpp:53
sycl::_V1::detail::SYCLConfig< SYCL_CACHE_DIR >::getName
static const char * getName()
Definition: config.hpp:433
sycl::_V1::detail::SYCLConfig< SYCL_PI_TRACE >::get
static int get()
Definition: config.hpp:134
sycl::_V1::detail::ods_target_list
Definition: device_filter.hpp:55
sycl::_V1::detail::SYCLConfig< SYCL_ENABLE_DEFAULT_CONTEXTS >::reset
static void reset()
Definition: config.hpp:329
sycl::_V1::info::device_type::accelerator
@ accelerator
sycl::_V1::detail::SYCLConfig< SYCL_ENABLE_DEFAULT_CONTEXTS >::resetWithValue
static void resetWithValue(const char *Val)
Definition: config.hpp:331
sycl::_V1::detail::SYCLConfig< SYCL_CACHE_DIR >::reset
static void reset()
Definition: config.hpp:431
info_desc.hpp
sycl::_V1::detail::SYCLConfig< SYCL_ENABLE_DEFAULT_CONTEXTS >::get
static bool get()
Definition: config.hpp:314
sycl::_V1::detail::SYCLConfig< SYCL_ENABLE_DEFAULT_CONTEXTS >::getName
static const char * getName()
Definition: config.hpp:335
sycl::_V1::detail::ConfigFromFileEnabled
constexpr bool ConfigFromFileEnabled
Definition: config.hpp:39
INVALID_CONFIG_EXCEPTION
#define INVALID_CONFIG_EXCEPTION(BASE, MSG)
Definition: config.hpp:106
sycl::_V1::detail::SYCLConfig< SYCL_CACHE_PERSISTENT >::get
static bool get()
Definition: config.hpp:387
sycl::_V1::detail::SYCLConfig< SYCL_RT_WARNING_LEVEL >::get
static unsigned int get()
Definition: config.hpp:156
sycl::_V1::detail::SYCLConfigBase
Definition: config.hpp:68
sycl::_V1::detail::SYCLConfig< SYCL_CACHE_PERSISTENT >::reset
static void reset()
Definition: config.hpp:389
sycl::_V1::detail::SYCLConfig::get
static const char * get()
Definition: config.hpp:115
sycl::_V1::detail::SYCLConfig::reset
static void reset()
Definition: config.hpp:117
sycl::_V1::detail::SYCLConfig::getName
static const char * getName()
Definition: config.hpp:119
sycl::_V1::detail::SYCLConfig< SYCL_CACHE_PERSISTENT >::getName
static const char * getName()
Definition: config.hpp:391
sycl::_V1::detail::START
@ START
Definition: config.hpp:53
sycl::_V1::detail::SYCLConfig< SYCL_ENABLE_FUSION_CACHING >::get
static bool get()
Definition: config.hpp:593