Fix: cycles CPU device not being used when it should be on some multi-GPU
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 11 Jan 2012 13:18:06 +0000 (13:18 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 11 Jan 2012 13:18:06 +0000 (13:18 +0000)
configurations.

intern/cycles/device/device.cpp
intern/cycles/device/device_cpu.cpp

index 1f0be1599bfbec2ab33a474ad8ee3a684550fa61..e4beb4d7d8cfd9a9bf732b122e58fa1e0b7717fd 100644 (file)
@@ -255,8 +255,6 @@ vector<DeviceInfo>& Device::available_devices()
        static bool devices_init = false;
 
        if(!devices_init) {
-               device_cpu_info(devices);
-
 #ifdef WITH_CUDA
                if(cuLibraryInit())
                        device_cuda_info(devices);
@@ -271,6 +269,8 @@ vector<DeviceInfo>& Device::available_devices()
                device_multi_info(devices);
 #endif
 
+               device_cpu_info(devices);
+
 #ifdef WITH_NETWORK
                device_network_info(devices);
 #endif
index e29266b0a7dae2cec4af8cf4b80813f53bf8a1d8..f4b2b7a8269373b059e5fec64fb141d673b8d1f7 100644 (file)
@@ -272,7 +272,7 @@ void device_cpu_info(vector<DeviceInfo>& devices)
        info.id = "CPU";
        info.num = 0;
 
-       devices.push_back(info);
+       devices.insert(devices.begin(), info);
 }
 
 CCL_NAMESPACE_END