File: loop_count.cl

package info (click to toggle)
intel-gpu-tools 2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 63,360 kB
  • sloc: xml: 781,458; ansic: 360,567; python: 8,336; yacc: 2,781; perl: 1,196; sh: 1,177; lex: 487; asm: 227; lisp: 35; makefile: 30
file content (15 lines) | stat: -rw-r--r-- 342 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Must be same as MAGIC_LOOP_STOP in lib/intel_compute.c */
#define MAGIC_LOOP_STOP 0x12341234

__kernel void loop(volatile __global int *input,
		   __global int *output,
		   unsigned int count)
{
	int i = get_global_id(0);

	for (int c = 0; c < count; c++) {
		if (input[0] == MAGIC_LOOP_STOP)
			break;
		output[0] = output[0] + i;
	}
}