diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-08-24 14:44:04 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-08-24 14:44:04 +0400 |
commit | 48b4de31521501203c39fc7efa9aca7d018b6a1c (patch) | |
tree | 31a05c15bc56321652912fb1eef9070cd17f8ec4 /intern/cycles/device/device_cpu.cpp | |
parent | 29bdf37f9d1a5a45b98aeed15d415df27050615b (diff) |
Cycles:
* auto/fixed threads option is used now, patch by Thomas.
* remove unused CUDA_LIBRARIES, library is dynamically loaded
* fix mesh XML export operator for API update
Diffstat (limited to 'intern/cycles/device/device_cpu.cpp')
-rw-r--r-- | intern/cycles/device/device_cpu.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index bb47a127f20..7066efee547 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -44,10 +44,14 @@ public: ThreadQueue<DeviceTask> tasks; KernelGlobals *kg; - CPUDevice() + CPUDevice(int threads_num) { kg = kernel_globals_create(); - threads.resize(system_cpu_thread_count()); + + if(threads_num == 0) + threads_num = system_cpu_thread_count(); + + threads.resize(threads_num); for(size_t i = 0; i < threads.size(); i++) threads[i] = new thread(function_bind(&CPUDevice::thread_run, this, i)); @@ -207,9 +211,9 @@ public: } }; -Device *device_cpu_create() +Device *device_cpu_create(int threads) { - return new CPUDevice(); + return new CPUDevice(threads); } CCL_NAMESPACE_END |