Re: Better late than never! OpenCL Example (mostly)
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Brian, This is probably a good place to start with OpenCL: http://developer.apple.com/mac/library/documentation/Performance/Conceptual/... - Paul On Sep 4, 2009, at 3:56 PM, Brian Gardner wrote: Thank you, Darrin. This is an invaluable example! I guess I have some really basic newbie questions. 2. Is there a document that lists the functions, statements, and structure available in OpenCL? -- Brian On Sep 4, 2009, at 10:19 AM, Darrin Cardani wrote: <FxOpenCL.zip> Darrin -- Darrin Cardani dcardani@apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/brianrg%40earthlink.net _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/pschneider%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.ap... I found it with a simple google search: "site:developer.apple.com opencl". OpenCL and Grand Central Dispatch are separate technologies. You can use one or the other separately, or both together. The FxPlug framework is currently 32-bit, as are the shipping versions of Final Cut and Motion. Since the OS doesn't support loading 64-bit plugins into a 32-bit process, you will have to develop 32-bit FxPlugs for the time being. However, all of the OS API is available in 32-bit as well as 64-bit. In addition to developer.apple.com, you might also be interested in Ars Technica's review of Snow Leopard. It describes the major new features in Snow Leopard in a very approachable way. In particular, I think pages 5, 10, 12, and 14 might clear up some of your questions. 1. Do we need to use OpenCL to get the benefit of Grand Central Dispatch? (Like, how did you know that there existed a "write_imagef" procedure and "sampler_t" data type?) 3. To what extent is 64 bit programming available inside an FxPlug? And is it available through OpenCL, independent of OpenCL, or both? OK, I've got a simple OpenCL example working. One caveat: I don't yet have the GPU path working, but the CPU path is working fine. I've left in what I wrote for the GPU, but it's commented out. Feel free to uncomment it, tweak it, and let me know if you can get it working. :) I'm talking to the OpenCL and OpenGL teams to see if they have any advice on getting it working. This is a very simple example which just adjusts the brightness of the image. The cool thing is that with the exception of setting up the OpenCL context and images, there's basically one code path that should (eventually) work on both the CPU and GPU. The actual code of the image processing is written only once! One other caveat - this might not be the fastest implementation. With the goal of simplicity in mind, I didn't bother to cache the context or the built kernel. I believe that you can probably increase the speed by caching both of those. Hopefully by the time I work this into a real world piece of sample code that we can ship, both of those things will be done. But in the meantime, enjoy, and let me know if you have any questions, comments, bug reports, etc.: This email sent to brianrg@earthlink.net This email sent to pschneider@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Paul Schneider