std1.0.0-beta-7 SafeC docs

std :: ml::gpu_rocm

Struct std::RocmBuf

#include <std/ml/gpu_rocm.h> source

struct RocmBuf {
    unsigned long dev;
    unsigned long len;
}

A float32 buffer in GPU memory. 'dev' is the device address — never dereferenced on the host — and 0 for an invalid (failed or freed) buffer; 'len' is the element count every op checks against.

Fields

§unsigned long devsource
§unsigned long lensource

Methods

§void free()source · definition

dev := 0

§static struct RocmBuf alloc(unsigned long n)source · definition

uninitialized; dev == 0 on failure

§static struct RocmBuf upload([]const float host)source · definition