[Issue] a record android opencl c ++: Do Context, class assignment function CommandQueue

Such a start code written:
Cl = Cl :: :: CTX the Context the Context (CL_DEVICE_TYPE_GPU, NULL);
Cl Cl :: :: = CommandQueue CommandQueue Queue (CTX, Devices [device_index],
CL_QUEUE_PROFILING_ENABLE, & ERR);

It found running normal operation, but still can not get the right result.

Find the one good example of substitute objects one by one, eventually found the two objects above assignment function is causing the problem.
Therefore, unless you can read the source code confirmation so used, or should still avoid copying or using the value assignment function object.
Although the new object is likely to get all the content, but the old object destruction and then lead to a new object pointing to the contents of the error.

Normal modified following code:
Cl * the Context :: :: CTX = Cl new new the Context (CL_DEVICE_TYPE_GPU, NULL);
Cl CommandQueue * Queue :: :: = Cl new new CommandQueue (CTX, Devices [device_index],
CL_QUEUE_PROFILING_ENABLE, & ERR);

Guess you like

Origin www.cnblogs.com/ahfuzhang/p/11605057.html
Recommended