| | 34 | |
| | 35 | err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &input); |
| | 36 | err |= clSetKernelArg(kernel, 1, sizeof(cl_mem), &output); |
| | 37 | err |= clSetKernelArg(kernel, 2, sizeof(unsigned int), &count); |
| | 38 | |
| | 39 | clSetKernelArg sets arguments for an array of each device in the kernel. |
| | 40 | {{{ |
| | 41 | $assert(global%local == 0); |
| | 42 | kernel param[global/local]; |
| | 43 | for(int i = 0; i < global/local; i++) |
| | 44 | { |
| | 45 | //Also picks the device to be used |
| | 46 | param[i].device_id = device_id[0]; |
| | 47 | //other parts of the struct |
| | 48 | param[i].input = input; |
| | 49 | param[i].output = output; |
| | 50 | param[i].count = count; |
| | 51 | } |
| | 52 | }}} |