Better late than never! OpenCL Example (mostly)
Better late than never! OpenCL Example (mostly)
- Subject: Better late than never! OpenCL Example (mostly)
- From: Darrin Cardani <email@hidden>
- Date: Fri, 4 Sep 2009 10:19:20 -0700
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.:
Attachment:
FxOpenCL.zip
Description: Zip archive
Darrin
--
Darrin Cardani
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden