Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/device/device_cuda.cpp')
-rw-r--r--intern/cycles/device/device_cuda.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 73d87ae4a2e..55b467fc856 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -341,9 +341,11 @@ public:
cuda_pop_context();
}
- void mem_copy_from(device_memory& mem, size_t offset, size_t size)
+ void mem_copy_from(device_memory& mem, int y, int w, int h, int elem)
{
- /* todo: offset is ignored */
+ size_t offset = elem*y*w;
+ size_t size = elem*w*h;
+
cuda_push_context();
cuda_assert(cuMemcpyDtoH((uchar*)mem.data_pointer + offset,
(CUdeviceptr)((uchar*)mem.device_pointer + offset), size))
@@ -863,6 +865,8 @@ void device_cuda_info(vector<DeviceInfo>& devices)
if(cuDeviceGetCount(&count) != CUDA_SUCCESS)
return;
+ vector<DeviceInfo> display_devices;
+
for(int num = 0; num < count; num++) {
char name[256];
int attr;
@@ -878,11 +882,16 @@ void device_cuda_info(vector<DeviceInfo>& devices)
info.num = num;
/* if device has a kernel timeout, assume it is used for display */
- if(cuDeviceGetAttribute(&attr, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, num) == CUDA_SUCCESS && attr == 1)
+ if(cuDeviceGetAttribute(&attr, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, num) == CUDA_SUCCESS && attr == 1) {
info.display_device = true;
-
- devices.push_back(info);
+ display_devices.push_back(info);
+ }
+ else
+ devices.push_back(info);
}
+
+ if(!display_devices.empty())
+ devices.insert(devices.end(), display_devices.begin(), display_devices.end());
}
CCL_NAMESPACE_END