About this book

This book describes software development and optimization for OpenCL on Mali™ Bifrost and Valhall GPUs.

Product revision status

The rmpn identifier indicates the revision status of the product described in this book, for example, r1p2, where:

rmIdentifies the major revision of the product, for example, r1.
pnIdentifies the minor revision or modification status of the product, for example, p2.

Intended audience

This guide is written for software developers with experience in C or C-like languages who want to develop OpenCL on Mali™ Bifrost and Valhall GPUs.

Using this book

This book is organized into the following chapters:

Chapter 1 Introduction

This chapter introduces Mali™ GPUs, OpenCL, and the Mali GPU OpenCL driver.

Chapter 2 Parallel processing concepts

This chapter describes the main concepts of parallel processing.

Chapter 3 OpenCL concepts

This chapter describes the OpenCL concepts.

Chapter 4 Developing an OpenCL application

This chapter describes the development stages of an OpenCL application.

Chapter 5 Execution stages of an OpenCL application

This chapter describes the execution stages of an OpenCL application.

Chapter 6 Converting existing code to OpenCL

This chapter describes converting existing code to OpenCL.

Chapter 7 Retuning existing OpenCL code

This chapter describes how to retune existing OpenCL code so you can run it on Mali™ GPUs.

Chapter 8 Optimizing OpenCL for Mali™ GPUs

This chapter describes the procedure to optimize OpenCL applications for Mali™ GPUs.

Chapter 9 OpenCL optimizations list

This chapter lists several optimizations to use when writing OpenCL code for Mali™ GPUs.

Chapter 10 Kernel auto-vectorizer and unroller

This chapter describes the kernel auto-vectorizer and unroller.

Appendix A OpenCL data types

This appendix describes OpenCL data types.

Appendix B OpenCL built-in functions

This appendix lists the OpenCL built-in functions.

Appendix C OpenCL extensions

This appendix describes the OpenCL extensions that the Mali™ GPU OpenCL driver supports.

Appendix D Using OpenCL extensions

This appendix provides usage notes on specific OpenCL extensions.

Appendix E OpenCL 1.2

This appendix describes some of the important changes to the Mali™ OpenCL driver in OpenCL 1.2.

Appendix F OpenCL 2.0

This appendix describes the important changes to the Mali™ OpenCL driver in OpenCL 2.0.

Appendix G OpenCL 2.1

This appendix describes the important changes to the Mali™ OpenCL driver in OpenCL 2.1.

Appendix H Revisions

This appendix contains a list of technical changes made between releases and where they are documented in this guide.


The Arm® Glossary is a list of terms used in Arm documentation, together with definitions for those terms. The Arm Glossary does not contain terms that are industry standard unless the Arm meaning differs from the generally accepted meaning.

See the Arm® Glossary for more information.

Typographic conventions
Introduces special terminology, denotes cross-references, and citations.
Highlights interface elements, such as menu names. Denotes signal names. Also used for terms in descriptive lists, where appropriate.
Denotes text that you can enter at the keyboard, such as commands, file and program names, and source code.
Denotes a permitted abbreviation for a command or option. You can enter the underlined text instead of the full command or option name.
monospace italic
Denotes arguments to monospace text where the argument is to be replaced by a specific value.
monospace bold
Denotes language keywords when used outside example code.
Encloses replaceable terms for assembler syntax where they appear in code or code fragments. For example:
MRC p15, 0, <Rd>, <CRn>, <CRm>, <Opcode_2>
Used in body text for a few terms that have specific technical meanings, that are defined in the Arm® Glossary. For example, IMPLEMENTATION DEFINED, IMPLEMENTATION SPECIFIC, UNKNOWN, and UNPREDICTABLE.

Additional reading

This book contains information that is specific to this product. See the following documents for other relevant information.

Arm publications
  • Customers developing OpenCL on an Android platform, see Arm® Mali™ RenderScript Best Pratices Developer Guide (ARM 101144).
  • Arm® Mali™ Midgard OpenCL Developer Guide (ARM 100614)

See http://Developer.arm.com, for access to Arm documentation

Other publications

OpenCL 2.0 Specification, www.khronos.org

Non-ConfidentialPDF file icon PDF version101574_0302_00_en
Copyright © 2019 Arm Limited or its affiliates. All rights reserved.