Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/optix/device.cpp
| /* SPDX-License-Identifier: Apache-2.0 | /* SPDX-License-Identifier: Apache-2.0 | ||||
| * Copyright 2019, NVIDIA Corporation. | * Copyright 2019, NVIDIA Corporation. | ||||
| * Copyright 2019-2022 Blender Foundation. */ | * Copyright 2019-2022 Blender Foundation. */ | ||||
| #include "device/optix/device.h" | #include "device/optix/device.h" | ||||
| #include "device/cuda/device.h" | #include "device/cuda/device.h" | ||||
| #include "device/optix/device_impl.h" | #include "device/optix/device_impl.h" | ||||
| #include "util/log.h" | #include "util/log.h" | ||||
| #ifdef WITH_OSL | |||||
| # include <OSL/oslversion.h> | |||||
| #endif | |||||
| #ifdef WITH_OPTIX | #ifdef WITH_OPTIX | ||||
| # include <optix_function_table_definition.h> | # include <optix_function_table_definition.h> | ||||
| #endif | #endif | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| bool device_optix_init() | bool device_optix_init() | ||||
| { | { | ||||
| Show All 40 Lines | for (DeviceInfo info : cuda_devices) { | ||||
| cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, info.num); | cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, info.num); | ||||
| if (major < 5) { | if (major < 5) { | ||||
| /* Only Maxwell and up are supported by OptiX. */ | /* Only Maxwell and up are supported by OptiX. */ | ||||
| continue; | continue; | ||||
| } | } | ||||
| info.type = DEVICE_OPTIX; | info.type = DEVICE_OPTIX; | ||||
| info.id += "_OptiX"; | info.id += "_OptiX"; | ||||
| # if defined(WITH_OSL) && (OSL_VERSION_MINOR >= 13 || OSL_VERSION_MAJOR > 1) | |||||
| info.has_osl = true; | |||||
| # endif | |||||
| info.denoisers |= DENOISER_OPTIX; | info.denoisers |= DENOISER_OPTIX; | ||||
| devices.push_back(info); | devices.push_back(info); | ||||
| } | } | ||||
| #else | #else | ||||
| (void)cuda_devices; | (void)cuda_devices; | ||||
| (void)devices; | (void)devices; | ||||
| #endif | #endif | ||||
| Show All 18 Lines | |||||