This is the same kernel as vecadd but repeated in a for-loop many times so that the runtime overhead at the startup is amortized.
10 lines
265 B
Plaintext
10 lines
265 B
Plaintext
__kernel void vecadd_loop (__global volatile const float *A,
|
|
__global volatile const float *B,
|
|
__global volatile float *C)
|
|
{
|
|
int gid = get_global_id(0);
|
|
for (int i = 0; i < 100; i++) {
|
|
C[gid] = A[gid] + B[gid];
|
|
}
|
|
}
|