Customers traditionally approach the programming of complex ARM® + C66x digital signal processor (DSP) systems on chip (SoCs) such as TI’s Sitara™ AM57x SoC by focusing on manually partitioning the application across the ARM cores and DSPs and hand-optimizing the appropriate sections of the application for the given core. This approach tends to yield the maximum entitlement but has drawbacks; –the resulting application cannot be easily ported from one TI SoC to another and time to market increases because programmers need to manage dispatch, communication and synchronization mechanisms.
To provide customers an alternative, TI has enabled industry-standard heterogeneous multicore programming models such as OpenCL and OpenMP® offload on ARM + DSP SoCs. This post will focus on OpenCL and TI’s implementation of it. In a later post, I will write about OpenMP Offload.
What is OpenCL?
OpenCL is a framework for expressing programs where parallel computation is dispatched across heterogeneous devices. It is an open, royalty-free standard managed by Khronos consortium. On a heterogeneous SoC, OpenCL views one of the programmable cores as a host and the other cores as devices. For example, on a Sitara AM572x SoC, the host is the ARM® Cortex®-A15 cluster running SMP/Linux or TI-RTOS and the device is the C6xx DSP cluster. The application running on the host (i.e. the host program) manages execution of code (kernels) on the device and is also responsible for making data available to the device. A device consists of one or more compute units. On Sitara AM572x SoCs, each C66x DSP is a compute unit.
The OpenCL runtime consists of two components: (1) An API for the host program to create and submit kernels for execution and (2) A cross-platform language for expressing kernels – OpenCL C – which is based on C99 C with some additions and restrictions
OpenCL supports both data parallel and task parallel programming paradigms. Data parallel execution parallelizes the execution across compute units on a device. Task parallel execution enables asynchronous dispatch of tasks to each compute unit
TI’s implementation of OpenCL
Here are a few key features of TI’s OpenCL implementation for Sitara AM572x SoCs:
TI’s extensions to OpenCL
TI has enabled various extensions to OpenCL to take advantage of features on its SoCs, leverage the existing C66x DSP code base and make them easier to use. The following is a list of some examples of such extensions:
Why use OpenCL?
Using a standard approach to programming heterogeneous SoCs simplifies programming; it allows the programmer to use standard, well-documented APIs to handle the mechanics of dispatching code and data to the DSPs and focus on optimizing the dispatched code. Other benefits include:
When does OpenCL apply?
OpenCL was designed for a scenario in which one of the cores on the SoC is designated the host. This core runs the OpenCL API and manages execution of kernels on the devices. As described earlier, the host on an AM57x SoC is an ARM Cortex-A15 core running Linux or TI-RTOS. All orchestration of control and data is done by the host. If the customer’s use case fits within the host-centric model, OpenCL is an option to offload computation to the DSPs.
Other considerations include:
How can I get started?
OpenCL on Sitara AM572x SoCs is available via TI’s Processor SDK Linux. Download and install the SDK following the instructions listed at this link. Refer to the OpenCL User Guide for instructions on building and running OpenCL examples.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.