Dateien
rocm-systems/projects/hip-tests/catch/unit/library/library_code_load.cc
T

Revisionen in .git-blame-ignore-revs werden ignoriert. Klicke hier, um das zu umgehen und die normale Blame-Ansicht zu sehen.

17 Zeilen
384 B
C++

#include <hip/hip_runtime.h>
extern "C" {
__global__ void add_kernel(float* out, float* a, float* b) {
size_t i = threadIdx.x;
out[i] = a[i] + b[i];
}
__global__ void sub_kernel(float* out, float* a, float* b) {
size_t i = threadIdx.x;
out[i] = a[i] - b[i];
}
__global__ void mul_kernel(float* out, float* a, float* b) {
size_t i = threadIdx.x;
out[i] = a[i] * b[i];
}
}