diff options
Diffstat (limited to 'intern/cycles/blender/python.cpp')
-rw-r--r-- | intern/cycles/blender/python.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/intern/cycles/blender/python.cpp b/intern/cycles/blender/python.cpp index 7bd1ad2cafe..8b2b331f73e 100644 --- a/intern/cycles/blender/python.cpp +++ b/intern/cycles/blender/python.cpp @@ -871,18 +871,20 @@ static PyObject *enable_print_stats_func(PyObject * /*self*/, PyObject * /*args* static PyObject *get_device_types_func(PyObject * /*self*/, PyObject * /*args*/) { vector<DeviceType> device_types = Device::available_types(); - bool has_cuda = false, has_optix = false, has_hip = false, has_metal = false; + bool has_cuda = false, has_optix = false, has_hip = false, has_metal = false, has_oneapi = false; foreach (DeviceType device_type, device_types) { has_cuda |= (device_type == DEVICE_CUDA); has_optix |= (device_type == DEVICE_OPTIX); has_hip |= (device_type == DEVICE_HIP); has_metal |= (device_type == DEVICE_METAL); + has_oneapi |= (device_type == DEVICE_ONEAPI); } - PyObject *list = PyTuple_New(4); + PyObject *list = PyTuple_New(5); PyTuple_SET_ITEM(list, 0, PyBool_FromLong(has_cuda)); PyTuple_SET_ITEM(list, 1, PyBool_FromLong(has_optix)); PyTuple_SET_ITEM(list, 2, PyBool_FromLong(has_hip)); PyTuple_SET_ITEM(list, 3, PyBool_FromLong(has_metal)); + PyTuple_SET_ITEM(list, 4, PyBool_FromLong(has_oneapi)); return list; } @@ -914,6 +916,9 @@ static PyObject *set_device_override_func(PyObject * /*self*/, PyObject *arg) else if (override == "METAL") { BlenderSession::device_override = DEVICE_MASK_METAL; } + else if (override == "ONEAPI") { + BlenderSession::device_override = DEVICE_MASK_ONEAPI; + } else { printf("\nError: %s is not a valid Cycles device.\n", override.c_str()); Py_RETURN_FALSE; |