__global const float *y, __global float *z) { uint i = get_global_id(0); z[i] = alpha * x[i] + y[i]; } #[spir_kernel] fn saxpy<T: Float>(alpha: T, xp: &[T], y: &[T], z: &[T]) { let i = get_global_id(0); pz[i] = alpha * x[i] + y[i]; } Old-School OpenCL C Modern OpenCL Rust