Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/cuda/device_impl.cpp
| Show First 20 Lines • Show All 1,196 Lines • ▼ Show 20 Lines | bool CUDADevice::should_use_graphics_interop() | ||||
| int num_all_devices = 0; | int num_all_devices = 0; | ||||
| cuda_assert(cuDeviceGetCount(&num_all_devices)); | cuda_assert(cuDeviceGetCount(&num_all_devices)); | ||||
| if (num_all_devices == 0) { | if (num_all_devices == 0) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| vector<CUdevice> gl_devices(num_all_devices); | vector<CUdevice> gl_devices(num_all_devices); | ||||
| uint num_gl_devices; | uint num_gl_devices = 0; | ||||
| cuGLGetDevices(&num_gl_devices, gl_devices.data(), num_all_devices, CU_GL_DEVICE_LIST_ALL); | cuGLGetDevices(&num_gl_devices, gl_devices.data(), num_all_devices, CU_GL_DEVICE_LIST_ALL); | ||||
| for (CUdevice gl_device : gl_devices) { | for (uint i = 0; i < num_gl_devices; ++i) { | ||||
| if (gl_device == cuDevice) { | if (gl_devices[i] == cuDevice) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| int CUDADevice::get_num_multiprocessors() | int CUDADevice::get_num_multiprocessors() | ||||
| Show All 28 Lines | |||||