• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Better late than never! OpenCL Example (mostly)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Better late than never! OpenCL Example (mostly)


  • Subject: Re: Better late than never! OpenCL Example (mostly)
  • From: Paul Schneider <email@hidden>
  • Date: Fri, 4 Sep 2009 16:12:52 -0500


Brian,

This is probably a good place to start with OpenCL:

http://developer.apple.com/mac/library/documentation/Performance/Conceptual/OpenCL_MacProgGuide/Introduction/Introduction.html

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.

- 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.

1. Do we need to use OpenCL to get the benefit of Grand Central Dispatch?

2. Is there a document that lists the functions,
     statements, and structure available in OpenCL?

(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?


  -- Brian

On Sep 4, 2009, at 10:19 AM, Darrin Cardani wrote:

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.:

<FxOpenCL.zip>


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

_______________________________________________ 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

_______________________________________________ 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
  • Follow-Ups:
    • Re: Better late than never! OpenCL Example (mostly)
      • From: Brian Gardner <email@hidden>
References: 
 >Better late than never! OpenCL Example (mostly) (From: Darrin Cardani <email@hidden>)
 >Re: Better late than never! OpenCL Example (mostly) (From: Brian Gardner <email@hidden>)

  • Prev by Date: Re: Better late than never! OpenCL Example (mostly)
  • Next by Date: Re: Better late than never! OpenCL Example (mostly)
  • Previous by thread: Re: Better late than never! OpenCL Example (mostly)
  • Next by thread: Re: Better late than never! OpenCL Example (mostly)
  • Index(es):
    • Date
    • Thread