Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

adildacoolset

macrumors 65816
Original poster
Hello,

I was wondering if it's possible to do GPGPU computations on modern iOS devices. I read somewhere that the OpenCL framework is a private framework, but I want to see if it's true.

I saw nothing on this when I searched apple developer manuals for iOS, and when I looked on other forums, there were outdated articles present before the arrival of the iPad 2.

Now, the PowerVR 5XT and series 6 are OpenCL capable, so I would like to know if it can be used. If not, then what else can be used to perform GPGPU computations?
 
Hello,

I was wondering if it's possible to do GPGPU computations on modern iOS devices. I read somewhere that the OpenCL framework is a private framework, but I want to see if it's true.

I saw nothing on this when I searched apple developer manuals for iOS, and when I looked on other forums, there were outdated articles present before the arrival of the iPad 2.

Now, the PowerVR 5XT and series 6 are OpenCL capable, so I would like to know if it can be used. If not, then what else can be used to perform GPGPU computations?

OpenCL is an open computing platform. It is most definitely not private.

There are rumors that it is included in recent versions of iOS for internal use, but not exposed to third party developers. It could be there, but not available for our use, so in that sense it would be private.

I have also heard rumors of third party developers who have successfully built OpenCL and included it in their apps, but have not been able to find out how to do it.

So far the best I've been able to come up with is writing shader programs that do GPGPU work, but that is a crude tool at best.

I too have been chomping at the bit for OpenCL on iOS devices. It would enable lots of cool possibilities.
 
OpenCL is an open computing platform. It is most definitely not private.

There are rumors that it is included in recent versions of iOS for internal use, but not exposed to third party developers. It could be there, but not available for our use, so in that sense it would be private.

I have also heard rumors of third party developers who have successfully built OpenCL and included it in their apps, but have not been able to find out how to do it.

So far the best I've been able to come up with is writing shader programs that do GPGPU work, but that is a crude tool at best.

I too have been chomping at the bit for OpenCL on iOS devices. It would enable lots of cool possibilities.

Yeah, but why do I still see an OpenCL.framework in Xcode still?
 
When you do the normail "link binary with libraries", I see OpenCL.framework

Can you be very specific?

What version and build of Xcode? (e.g. Xcode Version 5.0.1 (5A2034a) )

Where, exactly, are you seeing this? Can you provide a detailed description of how to get there, (e.g. "Select project in project navigator; select target, select build phases, look in 'link binary with libraries' and open that disclosure triangle...)

Can you provide a screen-shot? When I try to add a new framework and type "Open" as the prefix, I see OpenAL.framework and OpenGLES.framework, but not OpenCL. Are you sure you're not misreading the name of the OpenAL framework?
 
Can you be very specific?

What version and build of Xcode? (e.g. Xcode Version 5.0.1 (5A2034a) )

Where, exactly, are you seeing this? Can you provide a detailed description of how to get there, (e.g. "Select project in project navigator; select target, select build phases, look in 'link binary with libraries' and open that disclosure triangle...)

Can you provide a screen-shot? When I try to add a new framework and type "Open" as the prefix, I see OpenAL.framework and OpenGLES.framework, but not OpenCL. Are you sure you're not misreading the name of the OpenAL framework?

Hmm, I could've sworn I saw it before. But now it doesn't. Maybe I was looking at OS X projects. Silly me.
 
You can compile and run OpenCL code on iOS devices using the private framework, but you won't be able to get them into the App Store.

Here is some example project how to do it:
https://github.com/linusyang/opencl-test-ios

Are you the developer of bullet physics? [sorry for being a little off topic. I just remember an Erwin as being the admin for bullet physics forums].

Anyways thank you very much.
 
Drat. I was hoping you were right and apple added it as a framework. Like you, I really want OpenCL support on iOS.

If you have a developer program account, maybe you can ask Apple. I don't have an account, so I can't. I'd love to have posted my findings.

There was a lot of talk from Apple about the enhanced OpenCL for mavericks. And with Apple's push for the iPad as a content-creating PC replacement, it better get OpenCL soon.

I'd really love to try out some really cool stuff. To me, using vertex/fragment shaders for GPGPU just seems like a messy alternative.
 
If you have a developer program account, maybe you can ask Apple. I don't have an account, so I can't. I'd love to have posted my findings.

There was a lot of talk from Apple about the enhanced OpenCL for mavericks. And with Apple's push for the iPad as a content-creating PC replacement, it better get OpenCL soon.

I'd really love to try out some really cool stuff. To me, using vertex/fragment shaders for GPGPU just seems like a messy alternative.

Agreed. A reaching-around-your-elbow-to-scratch-your-butt solution.
 
Ok, so I've seen in the OpenGL ES programming guide for iOS that OpenGL ES 3.0 enables general purpose computing on the GPU.

How is that effective? It sounds absolutely useless outside of games given the way the framework is structured.
 
It isn't if it can't be practically implemented. It is the kind of thing I would simply ignore.

You can ignore it. But other developers don't, and they do do (non-game) computation on iOS device GPUs, even given the limitations (no Open CL, latencies, etc.)
 
You can ignore it. But other developers don't, and they do do (non-game) computation on iOS device GPUs, even given the limitations (no Open CL, latencies, etc.)

Perhaps you have an example? That sounds like a mess of code given the way you would have to write it.
 
That sounds like a mess of code given the way you would have to write it.

Is is. There are examples on the net of how to do it using vertex arrays, shader code, and fake image bitmaps for the results. Years ago, those methods are what initially generated the interest in developing cleaner APIs like CUDA and Open CL. But you can still do it like the old-time pioneers did, if it buys you anything.
 
Is is. There are examples on the net of how to do it using vertex arrays, shader code, and fake image bitmaps for the results. Years ago, those methods are what initially generated the interest in developing cleaner APIs like CUDA and Open CL. But you can still do it like the old-time pioneers did, if it buys you anything.


I don't think I would do that in iOS due to difficulty to maintain it. What I forgot to mention before is that my other concern would be Apple's approval guidelines. They tend to be somewhat strict and unusual.
 
I don't think I would do that in iOS due to difficulty to maintain it. What I forgot to mention before is that my other concern would be Apple's approval guidelines. They tend to be somewhat strict and unusual.

I've heard of at least one approved app in App store that was using the GPU for computation. There are probably more. Although Apple could always change their mind... about almost anything.

Some say that iOS code should not be written to be easy to maintain. Apple changes too much too often. Many of Apple's own iPhoneOS 2.x sample apps don't build any more. So iOS apps should instead be architected and coded to be easy to mostly throw away and re-write.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.