Function tvm::function::ffi::TVMDeviceAllocDataSpaceWithScope [−][src]
pub unsafe extern "C" fn TVMDeviceAllocDataSpaceWithScope(
dev: DLDevice,
ndim: i32,
shape: *const i64,
dtype: DLDataType,
mem_scope: *const i8,
out_data: *mut *mut c_void
) -> i32
Expand description
\brief Allocate a data space on device with special memory scope. \note The memory could use a special multi-dimensional memory layout. That is why we pass shape and dtype instead of raw number of bytes. \param dev The device to perform operation. \param ndim The number of dimension of the tensor. \param shape The shape of the tensor. \param dtype The type of elements. \param mem_scope The memory scope of the tensor, can be nullptr, which indicate the default global DRAM \param out_data The allocated device pointer. \return 0 when success, nonzero when failure happens