std1.0.0-beta-7 SafeC docs

std :: ml::gpu_cuda

Function std::cuda_half_unscale_many

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

int cuda_half_unscale_many(
    const &Vec<struct CudaHalfBuf> src,
    const &Vec<struct CudaBuf> dst,
    float scale,
    struct CudaBuf 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 (cuda_zero) before the step.