kylelutz/compute — pull request #4 by ddemidov (2013-03-22 07:00:10+00:00)
Title: Fixing CL_INVALID_OPERATION on AMD OpenCL

`boost::compute::program::build()` throws `CL_INVALID_OPERATION` when run on AMD OpenCL implementation.

I believe this is the same issue as reported here: http://devgurus.amd.com/thread/159987.

The Khronos C++ bindings only retain programs on copy, not on creation (so normally program lifecycle is build, release, not retain, build, release). The proposed patch fixes the issue by combining `program::create_with_source/binary` and `program::build`.

With the patch applied, the only failing tests on AMD OpenCL (with CPU as compute device) are these:

```
The following tests FAILED:
2 - core.command_queue (Failed)
32 - algorithm.insertion_sort (Failed)
39 - algorithm.radix_sort (Failed)
47 - algorithm.sort (Failed)
```