mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
[OpenCL] Moves all OpenCL kernels to *.cl files.
Kernel files are located in opm/simulators/linalg/bda/opencl/kernels.
CMake will combine them for usage in
${PROJECT_BINARY_DIR}/clSources.cpp that becomes part of the library.
This commit is contained in:
committed by
Markus Blatt
parent
e970449667
commit
c7ac97e215
15
opm/simulators/linalg/bda/opencl/kernels/axpy.cl
Normal file
15
opm/simulators/linalg/bda/opencl/kernels/axpy.cl
Normal file
@@ -0,0 +1,15 @@
|
||||
/// axpy kernel: a = a + alpha * b
|
||||
__kernel void axpy(
|
||||
__global double *in,
|
||||
const double a,
|
||||
__global double *out,
|
||||
const int N)
|
||||
{
|
||||
unsigned int NUM_THREADS = get_global_size(0);
|
||||
int idx = get_global_id(0);
|
||||
|
||||
while(idx < N){
|
||||
out[idx] += a * in[idx];
|
||||
idx += NUM_THREADS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user