memo / ofxMSAOpenCL

C++ openFrameworks addon for very simple to use wrapper for OpenCL. All underlying openCL objects are accessible to allow advanced features too if need be
http://www.memo.tv/ofxmsaopencl/
Other
88 stars 35 forks source link

No unload/delete kernel function #9

Closed SoylentGraham closed 7 years ago

SoylentGraham commented 11 years ago

I've noticed you can just delete a kernel, but then the kernels map will contain a dangling pointer. I'd make the change myself, BUT, I've had to remove the use of that kernel map anyway as it asserts for me so I've commented it out...

SoylentGraham commented 11 years ago

Ditto for programs

memo commented 7 years ago

Hey, not sure what you mean. The maps use smart pointers, so deleting from the map should safely delete the kernel or program too. You can get the maps via map<string, OpenCLXXXPtr> getXXXs(), and then do as you please, e.g. to erase an item from a map https://stackoverflow.com/questions/10038985/remove-a-key-from-a-c-map

(I didn't want to wrap all of the functionality of std::maps, since C++ has done all that anyway, instead you have direct access to the maps).

P.S. If you delete a kernel which is used in a program it might not play nicely!

memo commented 7 years ago

P.S. sorry for very late reply, I had notifications turned off and just noticed!