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:
authorHa Hyung-jin <robobeg>2019-11-05 18:27:52 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-11-05 18:40:55 +0300
commit9a9e93e8043b515360eacd71c20b193c9e15204d (patch)
tree4250f094dbc3cddf1fa0e96466be593ede852431 /intern/cycles/device/device_memory.cpp
parent1b46b7c42f6a7ce2e0506a1cedf6e2bd084c4894 (diff)
Fix T71071: errors when using multiple CUDA/Optix GPUs and host mapped memory
The multi device code did not correctly handle cases where some GPUs store a resource in device memory and others store it in host mapped memory. Differential Revision: https://developer.blender.org/D6126
Diffstat (limited to 'intern/cycles/device/device_memory.cpp')
-rw-r--r--intern/cycles/device/device_memory.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/intern/cycles/device/device_memory.cpp b/intern/cycles/device/device_memory.cpp
index c8a71bf4b3b..c106b4505db 100644
--- a/intern/cycles/device/device_memory.cpp
+++ b/intern/cycles/device/device_memory.cpp
@@ -36,12 +36,15 @@ device_memory::device_memory(Device *device, const char *name, MemoryType type)
device(device),
device_pointer(0),
host_pointer(0),
- shared_pointer(0)
+ shared_pointer(0),
+ shared_counter(0)
{
}
device_memory::~device_memory()
{
+ assert(shared_pointer == 0);
+ assert(shared_counter == 0);
}
device_memory::device_memory(device_memory &&other)
@@ -59,12 +62,14 @@ device_memory::device_memory(device_memory &&other)
device(other.device),
device_pointer(other.device_pointer),
host_pointer(other.host_pointer),
- shared_pointer(other.shared_pointer)
+ shared_pointer(other.shared_pointer),
+ shared_counter(other.shared_counter)
{
other.device_size = 0;
other.device_pointer = 0;
other.host_pointer = 0;
other.shared_pointer = 0;
+ other.shared_counter = 0;
}
void *device_memory::host_alloc(size_t size)