std1.0.0-beta-7 SafeC docs

std :: ml::gpu_mps

Function std::mps_mul_f32_chained

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

int mps_mul_f32_chained(struct MpsBuf bufA, const &float b, &float out, unsigned long n)

out[i] = bufA[i] * b[i] -- generic chained elementwise multiply (one pending GPU input, one plain CPU array), used by Tensor::square_gpu's backward: 2*diff (still GPU-pending from the forward pass) times the incoming gradient (an ordinary CPU array -- see __sum_backward, which writes it eagerly with no GPU involvement at all).