source: CIVL/examples/translation/opencl/notes/ToDo@ 764d472

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

square.cvl

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

  • Property mode set to 100644
File size: 2.9 KB
Line 
1use demoCL in Xcode to get hardware info (driver version openCL 1.1)
2
3square.c
4
5
6Types:
7size_t
8cl_device_id
9cl_context
10cl_command_queue
11cl_program
12cl_kernel
13
14cl_mem
15Types for now are just structs, see cl.h
16------Above this line are implemented-------
17Hardware methods:
18
19methods are externs
20 Declared but not defined unless given one
21
22clGetDeviceIDs
23 uses int err, takes 5 parameters
24 http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetDeviceIDs.html
25 [x]
26
27 cl_int clGetPlatformIDs( cl_uint num_entries,
28 cl_platform_id *platforms,
29 cl_uint *num_platforms)
30
31clCreateContext
32 uses a cl_context context, takes 6 parameters
33 http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clCreateContext.html
34 openCL uses them for commands, memory, program, kernel objects, executing kernels
35 [x]
36
37Kernels and other:
38clCreateCommandQueue
39 uses a cl_command_queue commands, takes 4 parameters
40 uses &device_id and &err
41 http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clCreateCommandQueue.html
42 [x]
43
44clCreateProgramWithSource
45 uses cl_program program, takes 5 parameters
46 uses context
47 -IN PROGRESS-
48
49clCreateProgramWithBinary
50 [x], see clCreateProgramWithSource
51
52clBuildProgram
53 [x]
54
55//clGetProgramBuildInfo
56
57clCreateKernel
58[x]
59
60clCreateBuffer
61[]
62
63[6/17/14, 2:29:20 PM] Manchun Zheng: you'll need to malloc it every time you increase the size
64[6/17/14, 2:30:12 PM] Manchun Zheng: for example T* buffer = (T*) malloc(sizeof(T));
65[6/17/14, 2:30:33 PM] Manchun Zheng: then when you want to add a new T to buffer
66[6/17/14, 2:30:49 PM] Manchun Zheng: btw, you also need to keep track of the size of buffer.
67[6/17/14, 2:30:55 PM] Manchun Zheng: so initially, size = 1;
68[6/17/14, 2:31:00 PM] Manchun Zheng: when you add a new T
69[6/17/14, 2:31:17 PM] Jean Jacques Rousseau: ah, got it
70[6/17/14, 2:31:44 PM] Manchun Zheng: you malloc by (size+ 1)*sizeof(T)
71[6/17/14, 2:31:52 PM] Manchun Zheng: and then you copy the previous data
72[6/17/14, 2:31:55 PM] Manchun Zheng: and add the new data
73
74clEnqueueWriteBuffer
75[]
76
77clSetKernelArg
78[]
79
80clGetKernelWorkGroupInfo
81[]
82
83clEnqueueReadBuffer
84[]
85
86clReleaseMemObject
87[]
88
89clReleaseProgram
90[]
91
92clReleaseKernel
93[]
94
95clReleaseCommandQueue
96[]
97
98clReleaseContext
99[]
100
101Kernel code changes
102[6/17/14, 12:34:48 PM] Jean Jacques Rousseau: oh, right
103[6/17/14, 12:35:48 PM] Jean Jacques Rousseau: although, I think I found it
104[6/17/14, 12:36:04 PM] Jean Jacques Rousseau: this Comm is a struct, and one of the fields is storing the rank
105[6/17/14, 12:36:12 PM] Jean Jacques Rousseau: when you make it, put in the rank yourself
106
107flam naught shy stub
108
109
110
111Possible simplified implementation?
112Instead of buffers just turn them into straight variables
113May lose some power, can't use sizeof(type) * number
114
115CIVL code to consider:
116$proc is like a processid, but not an int
117$proc_null($proc *p);
118
119$self, refers to self
120
121$spawn f(expr,...,exprn);
122or
123$proc p = $spawn f(i);
124
125$gbarrier or $barrier (one is global)
Note: See TracBrowser for help on using the repository browser.