OpenCL CPU applications

OpenCL, which is used for GPU applications, can also be used for multicore CPU applications.

Depending on what drivers are installed on a client computer, one or more OpenCL implementations may be available. When you build OpenCL/CPU applications, they may be compatible with only one implementation, or there may be a preferred implementation.

You can use the plan class mechanism to control what app versions are sent. Your app plan function can call

bool HOST::get_cpu_opencl_prop(const char* vendor, OPENCL_CPU_PROP&);

to see if the host has an OpenCL/CPU implementation for the given vendor ("nvidia", "amd", or "intel"). If so, the OpenCL properties are returned.

Use this function as follows:

bool app_plan_opencl_cpu_intel(SCHEDULER_REQUEST& sreq, HOST_USAGE& hu) {
    if ("intel", ocp)) {
        ... host has Intel OpenCL/CPU implementation
        if (!strstr(,"sse4.1")) {
            // interesting factoid: Intel's OpenCL/CPU implementation requires SSE4.1
            return false;
Last modified 8 years ago Last modified on Feb 3, 2014, 11:06:09 PM