| | 1 | = OpenCL CPU applications = |
| | 2 | |
| | 3 | OpenCL, which is used for GPU applications, can also be used for multicore CPU applications. |
| | 4 | |
| | 5 | Depending on what drivers are installed on a client computer, |
| | 6 | one or more OpenCL implementations may be available. |
| | 7 | When you build OpenCL/CPU applications, |
| | 8 | they may be compatible with only one implementation, |
| | 9 | or there may be a preferred implementation. |
| | 10 | |
| | 11 | You can use the plan class mechanism to control what |
| | 12 | app versions are sent. |
| | 13 | Your app plan function can call |
| | 14 | {{{ |
| | 15 | bool HOST::get_cpu_opencl_prop(const char* vendor, OPENCL_CPU_PROP&); |
| | 16 | }}} |
| | 17 | to see if the host has an OpenCL/CPU implementation |
| | 18 | for the given vendor ("nvidia", "amd", or "intel"). |
| | 19 | If so, the OpenCL properties are returned. |
| | 20 | |
| | 21 | Use this function as follows: |
| | 22 | {{{ |
| | 23 | bool app_plan_opencl_cpu_intel(SCHEDULER_REQUEST& sreq, HOST_USAGE& hu) { |
| | 24 | OPENCL_CPU_PROP ocp; |
| | 25 | if (sreq.host.get_cpu_opencl_prop("intel", ocp)) { |
| | 26 | ... host has Intel OpenCL/CPU implementation |
| | 27 | } |
| | 28 | ... |
| | 29 | } |
| | 30 | }}} |