diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-06-05 15:18:02 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-06-22 14:06:47 +0300 |
commit | b10b7cdb43b07e67905ffdeba3639dd5f9806169 (patch) | |
tree | 23a9f1e23dfd5d2fadde7b89930334384a73970a /intern/cycles/device/cuda/device_cuda_impl.cpp | |
parent | d8c2092b15de61a69bddbc082998a1dc786d73af (diff) |
Cleanup: use lambdas instead of functors for task pools, remove threadid
Diffstat (limited to 'intern/cycles/device/cuda/device_cuda_impl.cpp')
-rw-r--r-- | intern/cycles/device/cuda/device_cuda_impl.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/intern/cycles/device/cuda/device_cuda_impl.cpp b/intern/cycles/device/cuda/device_cuda_impl.cpp index 83f7bc10911..13f2ec530b0 100644 --- a/intern/cycles/device/cuda/device_cuda_impl.cpp +++ b/intern/cycles/device/cuda/device_cuda_impl.cpp @@ -2401,16 +2401,6 @@ void CUDADevice::thread_run(DeviceTask &task) } } -class CUDADeviceTask : public Task { - public: - CUDADeviceTask(CUDADevice *device, DeviceTask &task) : task(task) - { - run = function_bind(&CUDADevice::thread_run, device, task); - } - - DeviceTask task; -}; - void CUDADevice::task_add(DeviceTask &task) { CUDAContextScope scope(this); @@ -2426,7 +2416,10 @@ void CUDADevice::task_add(DeviceTask &task) film_convert(task, task.buffer, task.rgba_byte, task.rgba_half); } else { - task_pool.push(new CUDADeviceTask(this, task)); + task_pool.push([=] { + DeviceTask task_copy = task; + thread_run(task_copy); + }); } } |