Can we use openCL on consoles like Xbox One and PS4 for General purpose GPU?
Can we use openCL on consoles?
You can do GPGPU certainly, but I wouldn't count on OpenCL specifically. I can't say because I alternately don't know or can't talk about either console's development tools.
But at any rate, I would guess that openCL wouldn't be your best bet even if its available, because it might just be at too high a level of abstraction anyways. Anything that's so important and intensive that you want to shuffle it over to the GPU is likely also important enough to be tuned specifically for the GPGPU capabilities of fixed platforms (e.g. consoles) where they present themselves, and OpenCL is likely insufficient for that task. Perhaps if you're not really pushing the envelope, but that's not most console games. If you're prototyping on a PC, implement your algorithm in OpenCL, or C++AMP, and tune it to run well on AMD GCN architecture to prepare for the consoles -- that'll be your biggest leg up. But you're going to need to tune it for the consoles anyways, IMO, so its probably premature to think about your approach in terms of source-code portability.
There is nothing stopping the console developer from making an OpenCL implementation available for their respective platform as its just a standard waiting for implementation. No different that DX or its variant being used on Microsoft console. As far as being slower, I would disagree with that assumption since just like OpenGL, OpenCL can be extended to allow implementers to take a advantage of their hardware platform, up to an including memory access. Consoles usually have unified memory architectures so if anything the console implementation of OpenCL could potentially be faster than a comparable desktop implementation. OpenCL may be a high level abstraction, but in the end all the devices sees is a command stream so being at a higher level is not really a factor as long as the software ( compiler etc. ) is able to optimized aggressively.
Though this may not answer the question since I have no insight into console development tools, but I hope it offer some insight.
There's no OpenCL on consoles. I doubt that any console maker would consider it to be worth the engineering effort required to write and support a CL implementation, considering that very few (if any) games use it.
There is nothing stopping the console developer from making an OpenCL implementation available for their respective platform as its just a standard waiting for implementation. No different that DX or its variant being used on Microsoft console.
My point, though, is that you really only need OpenCL for the abstraction, and you don't need abstraction on consoles, even when your game is cross-platform (becasue each console will likely sell 100million units in its lifetime, and when you have those kinds of numbers, they demolish even the most popular, long-lived PC GPUs) -- yes, there could a a very specific version of OpenCL that's highly tuned for one or both consoles, but even still its unlikely it would produce as good results as a hand-tuned command stream. If you're on a console, and you have something that's so critical to be worth offloading at all, its equally worth hand-tuning it to the platform in all likelihood, and if you're pushing that kind of envelope its likely you have that expertise on your staff.
I argue that you won't get that top performance out of OpenCL even with extensions, a custom run-time, and a custom compiler -- but even if you did, that would be a huge software effort, and even still would not be vanilla OpenCL, but a custom-extended OpenCL -- so what would you gain? The extensions make it non-portable again, so we can't take our OpenCL source code and simply recompile it for another platform.
That doesn't mean one vendor's solution doesn't look like OpenCL maybe, or DirectCompute, or C++ AMP -- in fact, one could imagine easily that some subset of these are true -- it just doesn't matter. In the end, on the console, you're sufficiently specialized such that your source code in any form is effectively non-portable.
I mean, even look at the GPGPU ecosystem today -- if you need to run on CPUs and GPUs, or GPUs from anyone but nVidia, then you use OpenCL; and if you know your code will always run on nVidia hardware, then you use CUDA and you'd be a fool not to.
@MJP is there any way that we can use GPGPU on consoles?
Yes, of course. But if you don't know whether and what they are, you're really worrying about all this prematurely, and losing sleep over irrelevant details regardless.
Sony calls their shading language PSSL. Different consoles do use different languages... however, they're all so extremely similar to each other that you can very easily write code that compiles correctly on every platform (using a few #defines to rename keywords, etc)... so they're all pretty much HLSL.