source: CIVL/examples/translation/opencl/notes/test.cvl@ 50f834b

1.23 2.0 main test-branch
Last change on this file since 50f834b was 6777880, checked in by Jacob Trieu <fuufusuu@…>, 12 years ago

Moved some code and non-code for clarity

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1075 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 575 bytes
Line 
1$input int NCPU;
2$input int NCPU_BOUND;
3
4$input int NGPU;
5$input int NGPU_BOUND;
6
7$assume 0 < NCPU && NCPU <= NCPU_BOUND;
8$assume 0 < NGPU && NCPU <= NGPU_BOUND;
9
10
11int clgetDeviceIds( cl_device_id *devices,
12 cl_uint *num_devices){
13
14 if(type == CPU)
15 {
16 while(i < num_devices){
17 *(devices+i) = i;
18 i++;
19 if(i == NCPU)
20 break;
21 }
22 }else{
23 while(i < num_devices){
24 *(devices+i) = i;
25 i++;
26 if(i == NGPU)
27 break;
28 }
29 }
30 }
31
32 struct cl_device_id{
33 device_t type;
34 int id;
35 }
36
37 civl verify -inputNCPU_BOUND=4 -inputNGPU_BOUND=3....
Note: See TracBrowser for help on using the repository browser.