Add vecadd-loop

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.
This commit is contained in:
Hansung Kim
2023-10-31 23:32:52 -07:00
parent 6563ed696e
commit 2f4fd11c93
8 changed files with 358 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
__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];
}
}