std1.0.0-beta-7 SafeC docs

std :: ml::gpu_rocm

Function std::rocm_half_unscale_many

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

int rocm_half_unscale_many(
    const &Vec<struct RocmHalfBuf> src,
    const &Vec<struct RocmBuf> dst,
    float scale,
    struct RocmBuf flag,
)

Gradient unscaling: dst[i] = src[i] * scale in fp32 (16-bit or fp32 sources; the fp32 form may work in place, dst == src), and flag[0] = 1 when any result is inf or NaN. The flag is only ever set: zero it (rocm_zero) before the step.