Using C++ API to re-write the ocl samples.