Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/openaccel-lab/blob/main/workloads/saxpy/kernel.cu # openaccel-lab aien-dev/openaccel-lab Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `openaccel-lab / workloads / saxpy / kernel.cu` 16 lines ยท 564 bytes Raw Blame History 1 // SPDX-License-Identifier: Apache-2.0 2 #include 3 4 __global__ void saxpy(const float *alpha, const float *x, const float *y_in, float *y, long long n) 5 { 6 long long i = (long long)blockIdx.x * blockDim.x + threadIdx.x; 7 if (i < n) 8 y[i] = alpha[0] * x[i] + y_in[i]; 9 } 10 11 void oal_launch(const long long *p, void *const *buf) 12 { 13 long long n = p[0]; 14 saxpy<<<(unsigned)((n + 255) / 256), 256>>>((const float *)buf[0], (const float *)buf[1], 15 (const float *)buf[2], (float *)buf[3], n); 16 }