Skip to content

Instantly share code, notes, and snippets.

@sschaetz
Created February 21, 2020 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sschaetz/5b8e7cfff96cb515334f6d2575db1f1d to your computer and use it in GitHub Desktop.
Save sschaetz/5b8e7cfff96cb515334f6d2575db1f1d to your computer and use it in GitHub Desktop.
AURA_KERNEL void add(
AURA_DEVMEM float *a,
AURA_DEVMEM float *b,
AURA_DEVMEM float *c
#if defined AURA_BASE_OPENCL
)
{
const uint tid = get_global_id(0);
#else
,
uint3 gid [[ thread_position_in_grid ]]
{
const uint tid = gid.x;
#endif
c[tid] = a[tid] + b[tid];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment