Re: Better late than never! OpenCL Example (mostly)
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=I0KKKQGt2RuVNFJ2YW3os8htHVf1WNGLph8ad99hrlAQyxxh3NBrXn/qZxkM8pZZ; h=Received:Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer:X-ELNK-Trace:X-Originating-IP; 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/site_archiver%40lists.ap... 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 site_archiver@lists.apple.com
participants (1)
-
Brian Gardner