File: async_copy_loop.cl

package info (click to toggle)
oclgrind 21.10-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,216 kB
  • sloc: cpp: 21,369; ansic: 6,395; lisp: 1,122; python: 124; makefile: 19
file content (14 lines) | stat: -rw-r--r-- 344 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
kernel void async_copy_loop(global int *data, local int *scratch)
{
  int i = get_local_id(0);

  event_t event = 0;
  for (int j = 0; j < get_local_size(0); j++)
  {
    int offset = j;
    event = async_work_group_copy(scratch+offset, data+offset, 1, event);
  }
  wait_group_events(1, &event);

  data[get_local_size(0)-i-1] = scratch[i];
}