Different approaches to compute APIs: OpenCL from the Khronos Group

Share on linkedin
Share on twitter
Share on facebook
Share on reddit
Share on digg
Share on email

Compute APIs are a new evolution in the mobile and embedded market space, and are subject to quite a range of different conceptual approaches compared to the evolution of 3D graphics API. The mobile-optimised OpenGL ES API for 3D graphics evolved from a market-tested and well-proven OpenGL API for desktop PCs; this allowed a rapid API evolution with fairly little risk. In the mobile space, two offerings are currently competing for developer attention: the Khronos developed OpenCL API (OS agnostic) and the Google Android-specific Renderscript API. While the goal of both APIs is the same in exposing parallel compute functionality, the approach and vision behind both APIs is very different, as I’ll discuss below.

Compute is far newer as an API concept, and the desktop market is still in the early days of API evolution, where a hardware-specific proprietary API called CUDA is playing a significant role. Custom APIs though are an approach long-abandoned in the 3D space. As a result, compute APIs are all still very young and are going through the usual growing pains, as the software and hardware vendors find the most optimal approaches and balanced feature sets.

OpenCL – a bottom-up development approach

OpenCL, developed by the Khronos Group, builds on the proven concepts of the other open APIs, and follows a logical hardware-driven evolutionary approach. Specifically, this means that an initial version of the API has been created with a feature set in-line with the feature set available in products. As with the Khronos 3D APIs, a desktop hardware optimised variant exists, and a mobile/embedded hardware optimised variant exists.

Unlike the Khronos 3D API, which has two different and separate API developments (OpenGL and OpenGL ES), the compute API OpenCL takes a different approach. This approach is a bit more like that of Microsoft DirectX, in that it exposes different feature levels: a desktop Full Profile and an embedded/mobile optimised variant called the Embedded Profile.

Additionally, in line with the OpenGL concept, the OpenCL API also allows for extensions.  These are extra features which can be exposed optionally, and are typically used to check market feedback on new features that were just not convincing enough to make it into the core specification. Over time, these extensions can be deprecated and fall to the side, or may be adopted into the core if enough Khronos Group members decide they are useful.

The development approach of OpenCL is a bottom-up approach, in that the API starts from the feature set supported by hardware. The API does not typically expose new features until they are usable, allowing for a simple and straightforward approach where over time newer functionality is added to the API as the hardware evolves. The two profiles in OpenCL allow for the embedded market to evolve in line with its far more power-limited requirements, while the desktop profile can concentrate on high-performance compute usage cases which are not (or are far less), limited by power budgets.

The diagram below shows the bottom-up, hardware and market segment focussed approach of the OpenCL API. Over time, incremental OpenCL versions have been released in line with hardware capabilities and market requirements – with 2 specific profiles – a Full Profile (FP) focussed on the desktop High Performance Compute (HPC) market segment, and an Embedded Profile (EP) focussed on the mobile low power consumption focussed market segment.

PowerVR - mobile GPU computing - OpenCL evolution

This development approach is fairly hardware-centric, and it allows for a trivial link between hardware generations and API versions. From a software point of view, this approach is also interesting, in that any new feature exposed is also a feature which is likely to be available and run at full performance. The disadvantage is that software must be rewritten over time to take advantage of the new features added in later versions of the API.

For more articles, news and announcements on GPU compute, keep coming back to our blog and follow us on Twitter (@ImaginationTech, @GPUCompute and @PowerVRInsider).
Kristof Beets

Kristof Beets

Kristof Beets is the senior director of product management for PowerVR Graphics at Imagination Technologies where he drives the product roadmaps to ensure alignment with market requirements. Prior to this, he was part of the business development group and before this, he led the in-house demo development team and the competitive analysis team. His engineering background includes work on SDKs and tools for both PC and mobile products as a member of the PowerVR Developer Relations Team. His work has been published in many guides game and graphics programmers, such as Shader X2, X5 and X6, ARM IQ Magazine, and online by the Khronos Group, Beyond3D.com and 3Dfx Interactive. Kristof has a background in electrical engineering and received a Master's degree in artificial intelligence. He has spoken at GDC, SIGGRAPH, Embedded Technology, MWC and many other conferences.

3 thoughts on “Different approaches to compute APIs: OpenCL from the Khronos Group”

  1. This expose and comparison of compute APIs is fantastic. I am really looking forward to hearing your perspective of Android’s Renderscript. Thanks!

    Reply

Please leave a comment below

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted. We respect your privacy and will not publish your personal details.

Blog Contact

If you have any enquiries regarding any of our blog posts, please contact:

United Kingdom

[email protected]
Tel: +44 (0)1923 260 511

Search by Tag

Search by Author

Related blog articles

Beaglebone Black

Fun with PowerVR and the BeagleBone Black: Low-Cost Development Made Easy

Development boards are cool and the BeagleBone® Black (BBB) is one of the more interesting ones around. This widely available tiny board costs around £35 and will boot Linux is only 10 seconds so anyone interested in development can get stuck in quickly. The Introduction to Mobile Graphics course has been recently revamped for 2020 for the Imagination’s University Programme and the widely available, low-cost BBB is an ideal platform for student teaching and exercises based on OpenGL® ES2.0, instead of an expensive standard PC.

Read More »
Apple M1 image

Why you should be running your iOS apps on your new Apple M1 laptop

Towards the end of last year, Apple released the latest version of its Apple MacBook Pro and Macbook Air laptops. This release was notable as with these brand-new laptops Apple made a significant change – the processor inside was based on its own M1 chip rather than the Intel architecture that it had been using since 2006. Since its release, the Apple M1 has been widely hailed for its performance, outstripping Intel in all the major benchmarks and all in a cool, quiet package with low power consumption.

Read More »
android background

The Android Invasion: Imagination GPU IP buddies up with Google-powered devices

Google Android continues to have the lion share of the mobile market, powering around 75% of all smartphones and tablets, making it the most used operating system in the world. Imagination’s PowerVR architecture-based IP and the Android OS are bedfellows, with a host of devices based on Android coming to market all the time. Here we list a few that have appeared in Q4 2020.

Read More »

Connect

Sign up to receive the latest news and product updates from Imagination straight to your inbox.