25#if !defined(WITH_ONEAPI)
39 if (getenv(
"SYCL_CACHE_PERSISTENT") ==
nullptr) {
40 _putenv_s(
"SYCL_CACHE_PERSISTENT",
"1");
42 if (getenv(
"SYCL_CACHE_THRESHOLD") ==
nullptr) {
43 _putenv_s(
"SYCL_CACHE_THRESHOLD",
"0");
45 if (getenv(
"ONEAPI_DEVICE_SELECTOR") ==
nullptr) {
46 if (getenv(
"CYCLES_ONEAPI_ALL_DEVICES") ==
nullptr) {
47 _putenv_s(
"ONEAPI_DEVICE_SELECTOR",
"level_zero:*");
50 _putenv_s(
"ONEAPI_DEVICE_SELECTOR",
"!opencl:*");
54 if (getenv(
"ZES_ENABLE_SYSMAN") ==
nullptr) {
55 _putenv_s(
"ZES_ENABLE_SYSMAN",
"1");
57 if (getenv(
"UR_L0_USE_COPY_ENGINE") ==
nullptr) {
58 _putenv_s(
"UR_L0_USE_COPY_ENGINE",
"1");
60 if (getenv(
"UR_L0_USE_COPY_ENGINE_FOR_FILL") ==
nullptr) {
61 _putenv_s(
"UR_L0_USE_COPY_ENGINE_FOR_FILL",
"1");
64 if (getenv(
"SYCL_UR_USE_LEVEL_ZERO_V2") ==
nullptr) {
65 _putenv_s(
"SYCL_UR_USE_LEVEL_ZERO_V2",
"1");
68 setenv(
"SYCL_CACHE_PERSISTENT",
"1",
false);
69 setenv(
"SYCL_CACHE_THRESHOLD",
"0",
false);
70 if (getenv(
"CYCLES_ONEAPI_ALL_DEVICES") ==
nullptr) {
71 setenv(
"ONEAPI_DEVICE_SELECTOR",
"level_zero:*",
false);
74 setenv(
"ONEAPI_DEVICE_SELECTOR",
"!opencl:*",
false);
77 setenv(
"ZES_ENABLE_SYSMAN",
"1",
false);
78 setenv(
"UR_L0_USE_COPY_ENGINE",
"1",
false);
79 setenv(
"UR_L0_USE_COPY_ENGINE_FOR_FILL",
"1",
false);
81 setenv(
"SYCL_UR_USE_LEVEL_ZERO_V2",
"1",
false);
94 return make_unique<OneapiDevice>(info, stats, profiler, headless);
101 LOG_FATAL <<
"Requested to create oneAPI device while not enabled for this build.";
108static void device_iterator_cb(
const char *
id,
113 bool has_execution_optimization,
114 bool meets_driver_requirement,
129# if defined(WITH_OPENIMAGEDENOISE)
130# if OIDN_VERSION >= 20300
133 if (OIDNDenoiserGPU::is_device_supported(info)) {
149# ifdef WITH_EMBREE_GPU
159 devices->push_back(info);
163 LOG_INFO <<
"Device with id \"" << info.
id <<
"\" supports "
172 OneapiDevice::iterate_devices(device_iterator_cb, &devices);
182 char *c_capabilities = OneapiDevice::device_capabilities();
183 if (c_capabilities) {
184 capabilities = c_capabilities;
185 free(c_capabilities);
bool has_execution_optimization
bool meets_driver_requirement
DenoiserTypeMask denoisers
bool use_hardware_raytracing
CCL_NAMESPACE_BEGIN const char * denoiserTypeToHumanReadable(DenoiserType type)
@ DENOISER_OPENIMAGEDENOISE
#define CCL_NAMESPACE_END
unique_ptr< Device > device_oneapi_create(const DeviceInfo &info, Stats &stats, Profiler &profiler, bool headless)
void device_oneapi_info(vector< DeviceInfo > &devices)
CCL_NAMESPACE_BEGIN bool device_oneapi_init()
string device_oneapi_capabilities()
ATTR_WARN_UNUSED_RESULT const size_t num