Skip to main content

//clika-runtime/io.clika.runtime/Device/Companion

Companion

[common]
object Companion

Properties​

NameSummary
CPU[common]
val CPU: Device
The whole-machine host CPU.
WHOLE_MACHINE[common]
const val WHOLE_MACHINE: Int
The CPU index naming the whole machine: every core, over memory the OS places on first touch.

Functions​

NameSummary
cpu[common]
fun cpu(socket: Int = WHOLE_MACHINE): Device
cpu() is every core; cpu(i) is socket i.
cuda[common]
fun cuda(index: Int = 0): Device
The index-th CUDA device.
gpu[common]
fun gpu(index: Int = 0): Device
The generic accelerator: the first GPU backend that loads and exposes a device on this host, else the CPU (said once at warning level on the runtime's log channel).
htp[common]
fun htp(index: Int = 0): Device
The index-th HTP device.
metal[common]
fun metal(index: Int = 0): Device
The index-th Metal device.
parse[common]
fun parse(text: String): Device
Parse "cpu", "gpu", "cuda", "cuda:1", "vulkan:0", "metal", "htp" or "tpu" (case-insensitive; an absent index means the backend's default device).
tpu[common]
fun tpu(index: Int = 0): Device
The index-th TPU device.
vulkan[common]
fun vulkan(index: Int = 0): Device
The index-th Vulkan device.