5#ifndef __DEVICE_MEMORY_H__
6#define __DEVICE_MEMORY_H__
328 size_t new_size = num;
387 T *
alloc(
size_t width,
size_t height = 0,
size_t depth = 0)
389 size_t new_size =
size(width, height, depth);
409 T *
resize(
size_t width,
size_t height = 0,
size_t depth = 0)
411 size_t new_size =
size(width, height, depth);
414 void *new_ptr =
host_alloc(
sizeof(T) * new_size);
418 memcpy((T *)new_ptr, (T *)
host_pointer,
sizeof(T) * min_size);
573 size_t size(
size_t width,
size_t height,
size_t depth)
575 return width * ((height == 0) ? 1 : height) * ((depth == 0) ? 1 : depth);
620 void *
alloc(
const size_t width,
const size_t height,
const size_t depth = 0);
627 size_t size(
const size_t width,
const size_t height,
const size_t depth)
629 return width * ((height == 0) ? 1 : height) * ((depth == 0) ? 1 : depth);
blender::float3 packed_float3
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
bool is_resident(Device *sub_device) const
size_t memory_elements_size(int elements)
device_memory(const device_memory &)=delete
size_t original_device_size
device_memory(Device *device, const char *name, MemoryType type)
device_ptr original_device_ptr
device_memory(device_memory &&other) noexcept=delete
device_ptr device_pointer
void * host_alloc(size_t size)
device_memory & operator=(const device_memory &)=delete
device_memory & operator=(device_memory &&)=delete
friend class OneapiDevice
void device_copy_from(size_t y, size_t w, size_t h, size_t elem)
void swap_device(Device *new_device, size_t new_device_size, device_ptr new_device_ptr)
device_only_memory(device_only_memory &&other) noexcept
virtual ~device_only_memory()
void alloc_to_device(size_t num, bool shrink_to_fit=true)
device_only_memory(Device *device, const char *name, bool allow_host_memory_fallback=false)
device_sub_ptr(device_memory &mem, size_t offset, size_t size)
device_sub_ptr & operator=(const device_sub_ptr &)
device_ptr operator*() const
size_t size(const size_t width, const size_t height, const size_t depth)
void * alloc(const size_t width, const size_t height, const size_t depth=0)
device_texture(Device *device, const char *name, const uint slot, ImageDataType image_data_type, InterpolationType interpolation, ExtensionType extension)
device_vector(Device *device, const char *name, MemoryType type)
void copy_to_device_if_modified()
size_t size(size_t width, size_t height, size_t depth)
void move_device(Device *new_device)
void give_data(array< T > &to)
T * resize(size_t width, size_t height=0, size_t depth=0)
void steal_data(array< T > &from)
T * alloc(size_t width, size_t height=0, size_t depth=0)
void free_if_need_realloc(bool force_free)
void copy_from_device(size_t y, size_t w, size_t h)
static constexpr size_t datatype_size(DataType datatype)
#define CCL_NAMESPACE_END
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
unsigned __int64 uint64_t
static const size_t num_elements
static const DataType data_type