Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/device.h
| Show First 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | public: | ||||
| /* regular memory */ | /* regular memory */ | ||||
| virtual void mem_alloc(const char *name, device_memory& mem, MemoryType type) = 0; | virtual void mem_alloc(const char *name, device_memory& mem, MemoryType type) = 0; | ||||
| virtual void mem_copy_to(device_memory& mem) = 0; | virtual void mem_copy_to(device_memory& mem) = 0; | ||||
| virtual void mem_copy_from(device_memory& mem, | virtual void mem_copy_from(device_memory& mem, | ||||
| int y, int w, int h, int elem) = 0; | int y, int w, int h, int elem) = 0; | ||||
| virtual void mem_zero(device_memory& mem) = 0; | virtual void mem_zero(device_memory& mem) = 0; | ||||
| virtual void mem_free(device_memory& mem) = 0; | virtual void mem_free(device_memory& mem) = 0; | ||||
| virtual int mem_get_offset_alignment() { return 1; } | |||||
| virtual device_ptr mem_get_offset_ptr(device_memory& mem, int offset, int size, MemoryType type) | |||||
| { | |||||
| /* Only required for devices that implement denoising. */ | |||||
| assert(false); | |||||
| (void) mem; (void) offset; (void) size; (void) type; | |||||
| return (device_ptr) 0; | |||||
| } | |||||
| /* constant memory */ | /* constant memory */ | ||||
brecht: `mem_address_alignment()` seems like a more clear name, not sure what offsets have to do with… | |||||
| virtual void const_copy_to(const char *name, void *host, size_t size) = 0; | virtual void const_copy_to(const char *name, void *host, size_t size) = 0; | ||||
| /* texture memory */ | /* texture memory */ | ||||
| virtual void tex_alloc(const char * /*name*/, | virtual void tex_alloc(const char * /*name*/, | ||||
| device_memory& /*mem*/, | device_memory& /*mem*/, | ||||
| InterpolationType interpolation = INTERPOLATION_NONE, | InterpolationType interpolation = INTERPOLATION_NONE, | ||||
| ExtensionType extension = EXTENSION_REPEAT) | ExtensionType extension = EXTENSION_REPEAT) | ||||
Done Inline ActionsMaybe rename to mem_alloc_sub_ptr and mem_free_sub_ptr. brecht: Maybe rename to `mem_alloc_sub_ptr` and `mem_free_sub_ptr`. | |||||
| { | { | ||||
| (void)interpolation; /* Ignored. */ | (void)interpolation; /* Ignored. */ | ||||
| (void)extension; /* Ignored. */ | (void)extension; /* Ignored. */ | ||||
| }; | }; | ||||
| virtual void tex_free(device_memory& /*mem*/) {}; | virtual void tex_free(device_memory& /*mem*/) {}; | ||||
| /* pixel memory */ | /* pixel memory */ | ||||
| Show All 23 Lines | |||||
| #ifdef WITH_NETWORK | #ifdef WITH_NETWORK | ||||
| /* networking */ | /* networking */ | ||||
| void server_run(); | void server_run(); | ||||
| #endif | #endif | ||||
| /* multi device */ | /* multi device */ | ||||
| virtual void map_tile(Device * /*sub_device*/, RenderTile& /*tile*/) {} | virtual void map_tile(Device * /*sub_device*/, RenderTile& /*tile*/) {} | ||||
| virtual int device_number(Device * /*sub_device*/) { return 0; } | virtual int device_number(Device * /*sub_device*/) { return 0; } | ||||
| virtual void map_neighbor_tiles(Device * /*sub_device*/, RenderTile * /*tiles*/) {} | |||||
| virtual void unmap_neighbor_tiles(Device * /*sub_device*/, RenderTile * /*tiles*/) {} | |||||
| /* static */ | /* static */ | ||||
| static Device *create(DeviceInfo& info, Stats &stats, bool background = true); | static Device *create(DeviceInfo& info, Stats &stats, bool background = true); | ||||
| static DeviceType type_from_string(const char *name); | static DeviceType type_from_string(const char *name); | ||||
| static string string_from_type(DeviceType type); | static string string_from_type(DeviceType type); | ||||
| static vector<DeviceType>& available_types(); | static vector<DeviceType>& available_types(); | ||||
| static vector<DeviceInfo>& available_devices(); | static vector<DeviceInfo>& available_devices(); | ||||
| Show All 18 Lines | |||||
mem_address_alignment() seems like a more clear name, not sure what offsets have to do with it.
I'm not sure what the require alignment is on CUDA, and on older CPUs SSE needs alignment as well. I suggest to use 16 as the default value here instead of 1.