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§
- Memory
Scope - A registered memory space, such as
globalorshared, that a pointer or tensor lives in. - Memory
Scope Obj - The object behind
MemoryScope.
Functions§
- create_
view - Create a view of the storage of
source,relative_byte_offsetbytes past its data, with another shape and data type (runtime.TensorCreateView). - empty
- Allocate an uninitialized tensor on
device, in the memory scopemem_scopeor 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
nameofdevice, such asexistormax_threads_per_block, orNonewhen the device does not report it (runtime.GetDeviceAttr). - num_
threads - Return the number of threads the runtime thread pool uses (
runtime.NumThreads).