summaryrefslogtreecommitdiff
path: root/kernels/compiler_workgroup_scan_inclusive.cl
blob: 915251ed3aa253d8db302ff30790176194a460ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
 * Workgroup scan inclusive add functions
 */
kernel void compiler_workgroup_scan_inclusive_add_int(global int *src, global int *dst) {
  int val = src[get_global_id(0)];
  int sum = work_group_scan_inclusive_add(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_add_uint(global uint *src, global uint *dst) {
  uint val = src[get_global_id(0)];
  uint sum = work_group_scan_inclusive_add(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_add_long(global long *src, global long *dst) {
  long val = src[get_global_id(0)];
  long sum = work_group_scan_inclusive_add(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_add_ulong(global ulong *src, global ulong *dst) {
  ulong val = src[get_global_id(0)];
  ulong sum = work_group_scan_inclusive_add(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_add_float(global float *src, global float *dst) {
  float val = src[get_global_id(0)];
  float sum = work_group_scan_inclusive_add(val);
  dst[get_global_id(0)] = sum;
}

/*
 * Workgroup scan inclusive max functions
 */
kernel void compiler_workgroup_scan_inclusive_max_int(global int *src, global int *dst) {
  int val = src[get_global_id(0)];
  int sum = work_group_scan_inclusive_max(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_max_uint(global uint *src, global uint *dst) {
  uint val = src[get_global_id(0)];
  uint sum = work_group_scan_inclusive_max(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_max_long(global long *src, global long *dst) {
  long val = src[get_global_id(0)];
  long sum = work_group_scan_inclusive_max(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_max_ulong(global ulong *src, global ulong *dst) {
  ulong val = src[get_global_id(0)];
  ulong sum = work_group_scan_inclusive_max(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_max_float(global float *src, global float *dst) {
  float val = src[get_global_id(0)];
  float sum = work_group_scan_inclusive_max(val);
  dst[get_global_id(0)] = sum;
}

/*
 * Workgroup scan inclusive min functions
 */
kernel void compiler_workgroup_scan_inclusive_min_int(global int *src, global int *dst) {
  int val = src[get_global_id(0)];
  int sum = work_group_scan_inclusive_min(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_min_uint(global uint *src, global uint *dst) {
  uint val = src[get_global_id(0)];
  uint sum = work_group_scan_inclusive_min(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_min_long(global long *src, global long *dst) {
  long val = src[get_global_id(0)];
  long sum = work_group_scan_inclusive_min(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_min_ulong(global ulong *src, global ulong *dst) {
  ulong val = src[get_global_id(0)];
  ulong sum = work_group_scan_inclusive_min(val);
  dst[get_global_id(0)] = sum;
}

kernel void compiler_workgroup_scan_inclusive_min_float(global float *src, global float *dst) {
  float val = src[get_global_id(0)];
  float sum = work_group_scan_inclusive_min(val);
  dst[get_global_id(0)] = sum;
}