Just some code examples from OpenCLHowto.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

12 lines
237 B

#pragma OPENCL EXTENSION cl_khr_fp64: enable
__kernel void sum(
__global const float *a,
__global const float *b,
__global float *c,
long n)
{
int gid = get_global_id(0);
if (gid < n)
c[gid] = a[gid] + b[gid];
}