Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/memory.h
| Show First 20 Lines • Show All 275 Lines • ▼ Show 20 Lines | |||||
| protected: | protected: | ||||
| friend class CUDADevice; | friend class CUDADevice; | ||||
| friend class OptiXDevice; | friend class OptiXDevice; | ||||
| friend class HIPDevice; | friend class HIPDevice; | ||||
| /* Only create through subclasses. */ | /* Only create through subclasses. */ | ||||
| device_memory(Device *device, const char *name, MemoryType type); | device_memory(Device *device, const char *name, MemoryType type); | ||||
| device_memory(device_memory &&other) noexcept; | |||||
| /* No copying allowed. */ | /* No copying and allowed. | ||||
| * | |||||
| * This is because device implementation might need to register device memory in an allocation | |||||
| * map of some sort and use pointer as a key to identify blocks. Moving data from one place to | |||||
| * another bypassing device allocation routines will make those maps hard to maintain. */ | |||||
| device_memory(const device_memory &) = delete; | device_memory(const device_memory &) = delete; | ||||
| device_memory(device_memory &&other) noexcept = delete; | |||||
| device_memory &operator=(const device_memory &) = delete; | device_memory &operator=(const device_memory &) = delete; | ||||
| device_memory &operator=(device_memory &&) = delete; | |||||
| /* Host allocation on the device. All host_pointer memory should be | /* Host allocation on the device. All host_pointer memory should be | ||||
| * allocated with these functions, for devices that support using | * allocated with these functions, for devices that support using | ||||
| * the same pointer for host and device. */ | * the same pointer for host and device. */ | ||||
| void *host_alloc(size_t size); | void *host_alloc(size_t size); | ||||
| void host_free(); | void host_free(); | ||||
| /* Device memory allocation and copying. */ | /* Device memory allocation and copying. */ | ||||
| ▲ Show 20 Lines • Show All 354 Lines • Show Last 20 Lines | |||||