Integrate the kernels bits.

This commit is contained in:
laurent
2023-06-22 09:59:00 +01:00
parent 1309932933
commit 083ced4428
7 changed files with 294 additions and 53 deletions

27
kernels/src/affine.cu Normal file
View File

@ -0,0 +1,27 @@
extern "C" __global__ void affine_f32(
const size_t numel,
const float *x,
float *y,
const float mul,
const float add
) {
unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;
if (i >= numel) {
return;
}
y[i] = x[i] * mul + add;
}
extern "C" __global__ void affine_f64(
const size_t numel,
const double *x,
double *y,
const double mul,
const double add
) {
unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;
if (i >= numel) {
return;
}
y[i] = x[i] * mul + add;
}