Skip to main content

Module runtime

Module runtime 

Source
Expand description

Runtime objects and queries. A MemoryScope names the memory a pointer or tensor lives in; the functions allocate tensors and query devices and the runtime.

Structs§

MemoryScope
A registered memory space, such as global or shared, that a pointer or tensor lives in.
MemoryScopeObj
The object behind MemoryScope.

Functions§

create_view
Create a view of the storage of source, relative_byte_offset bytes past its data, with another shape and data type (runtime.TensorCreateView).
empty
Allocate an uninitialized tensor on device, in the memory scope mem_scope or the global one (runtime.TensorAllocWithScope).
enabled
Return whether the runtime of the device or target kind target ("cpu", "cuda", "llvm"…) is enabled (runtime.RuntimeEnabled).
get_cuda_device_count
Return the number of CUDA devices (runtime.GetCudaDeviceCount).
get_cuda_free_memory
Return the free and total memory of the current CUDA device, as a message (runtime.GetCudaFreeMemory).
get_device_attr
Return the attribute name of device, such as exist or max_threads_per_block, or None when the device does not report it (runtime.GetDeviceAttr).
num_threads
Return the number of threads the runtime thread pool uses (runtime.NumThreads).