| 1 | After a sudden realization, I find that I need almost none of the openCL stuff
|
|---|
| 2 | The programs can be broken into these very simple parts:
|
|---|
| 3 | 1. Get the number of devices, give them ids
|
|---|
| 4 | Related to clGetDevices
|
|---|
| 5 | 2. Prepare to make threads threads using device ids as "ranks"
|
|---|
| 6 | based either on array index or their device id
|
|---|
| 7 | Give them variables from __global or __local, remember that local is default
|
|---|
| 8 | global means that each one gets from a pointer to the same variable
|
|---|
| 9 | Use the kernel text for the above
|
|---|
| 10 | *
|
|---|
| 11 |
|
|---|
| 12 | 3. Get the paramater inputs from what would be from clSetKernelArg, possibly clEnqueueWriteBuffer
|
|---|
| 13 |
|
|---|
| 14 | 4. Spawn processes in the same order as clEnqueueNDRangeKernel
|
|---|
| 15 | Stick data in the arrays
|
|---|
| 16 |
|
|---|
| 17 | 5. Store output somewhere else
|
|---|
| 18 | May come from arrays
|
|---|
| 19 |
|
|---|
| 20 | 6. Possibly free
|
|---|
| 21 |
|
|---|
| 22 | Considerations:
|
|---|
| 23 | Make a struct for the array that holds:
|
|---|
| 24 | Rank
|
|---|
| 25 | Any variables that go in
|
|---|
| 26 | Types that aren't handled by CIVL
|
|---|
| 27 | cl_mem variables being ignored?
|
|---|
| 28 |
|
|---|
| 29 | Figure out something to do with local variables
|
|---|
| 30 |
|
|---|
| 31 | How to make sure that none of the numbers are
|
|---|
| 32 |
|
|---|
| 33 | Should the user be expected to change variables that end up too big for civl?
|
|---|
| 34 |
|
|---|
| 35 | Remove mentions of "unsigned" as they are not supported yet
|
|---|
| 36 | Same for vector types
|
|---|
| 37 |
|
|---|
| 38 | Basic idea of conversion program:
|
|---|
| 39 | Kernel - After getting input on where the kernel is (or not):
|
|---|
| 40 | Get all of the parameters, they will become variables and part of a struct
|
|---|
| 41 | put all of the rest in, add device_id as a parameter, convert get_global_id(0) to something else
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 | To simulate workgroups:
|
|---|
| 45 | Possibly have a function in between kernel and $spawn
|
|---|
| 46 |
|
|---|
| 47 | Problems:
|
|---|
| 48 | Sick
|
|---|
| 49 | Spent lots of time to figure out odd behavior to realize that floats and random do not work as expected
|
|---|