Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/cuda/device_impl.cpp
| Show First 20 Lines • Show All 771 Lines • ▼ Show 20 Lines | void CUDADevice::generic_copy_to(device_memory &mem) | ||||
| } | } | ||||
| } | } | ||||
| void CUDADevice::generic_free(device_memory &mem) | void CUDADevice::generic_free(device_memory &mem) | ||||
| { | { | ||||
| if (mem.device_pointer) { | if (mem.device_pointer) { | ||||
| CUDAContextScope scope(this); | CUDAContextScope scope(this); | ||||
| thread_scoped_lock lock(cuda_mem_map_mutex); | thread_scoped_lock lock(cuda_mem_map_mutex); | ||||
| DCHECK(cuda_mem_map.find(&mem) != cuda_mem_map.end()); | |||||
| const CUDAMem &cmem = cuda_mem_map[&mem]; | const CUDAMem &cmem = cuda_mem_map[&mem]; | ||||
| /* If cmem.use_mapped_host is true, reference counting is used | /* If cmem.use_mapped_host is true, reference counting is used | ||||
| * to safely free a mapped host memory. */ | * to safely free a mapped host memory. */ | ||||
| if (cmem.use_mapped_host) { | if (cmem.use_mapped_host) { | ||||
| assert(mem.shared_pointer); | assert(mem.shared_pointer); | ||||
| if (mem.shared_pointer) { | if (mem.shared_pointer) { | ||||
| ▲ Show 20 Lines • Show All 352 Lines • ▼ Show 20 Lines | void CUDADevice::tex_alloc(device_texture &mem) | ||||
| } | } | ||||
| } | } | ||||
| void CUDADevice::tex_free(device_texture &mem) | void CUDADevice::tex_free(device_texture &mem) | ||||
| { | { | ||||
| if (mem.device_pointer) { | if (mem.device_pointer) { | ||||
| CUDAContextScope scope(this); | CUDAContextScope scope(this); | ||||
| thread_scoped_lock lock(cuda_mem_map_mutex); | thread_scoped_lock lock(cuda_mem_map_mutex); | ||||
| DCHECK(cuda_mem_map.find(&mem) != cuda_mem_map.end()); | |||||
| const CUDAMem &cmem = cuda_mem_map[&mem]; | const CUDAMem &cmem = cuda_mem_map[&mem]; | ||||
| if (cmem.texobject) { | if (cmem.texobject) { | ||||
| /* Free bindless texture. */ | /* Free bindless texture. */ | ||||
| cuTexObjectDestroy(cmem.texobject); | cuTexObjectDestroy(cmem.texobject); | ||||
| } | } | ||||
| if (!mem.is_resident(this)) { | if (!mem.is_resident(this)) { | ||||
| ▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines | |||||