CLRadeonExtender (GCN assembler, Radeon assembler) mirror
Clone or download
Failed to load latest commit information.
CLRX CLRadeonExtender: DTree: Fixed GCC warning. AsmAmdCL2: Fixed possible… Aug 21, 2018
amdasm CLRadeonExtender: DTree: Fixed GCC warning. AsmAmdCL2: Fixed possible… Aug 21, 2018
amdbin CLRadeonExtender: BinGen: Add ElfBinSectId type and use it in source … Jul 8, 2018
clhelper CLRadeonExtender: Add support for multiple OpenCL platforms to CLHelp… Feb 18, 2018
clwrapper CLRadeonExtender: Remove obsolete argument from AsmPseudoOps::doEnum.… May 10, 2018
cmake CLRadeonExtender: Change Copyright dates. Dec 31, 2017
doc CLRadeonExtender: CLRXDocs: Add info about constant literals in symre… Jul 9, 2018
editors CLRadeonExtender: Add a missing pseudo-ops (hsaconfig and hsalayout) … Jun 29, 2018
pkgconfig CLRadeonExtender: Change Copyright dates. Dec 31, 2017
programs CLRadeonExtender: clrxdisasm: precise descriptions for '-H' and '-L' … Jun 26, 2018
samples CLRadeonExtender: Correct comment for reading width, height. Jun 25, 2018
tests CLRadeonExtender: AsmWait: Add rwFlags to AsmDelayedOp. Update GCNWai… Jul 21, 2018
utils CLRadeonExtender: GCNRVU: Register access to VCC, FLAT_SCRATCH and XN… Jul 11, 2018
.gitattributes CLRadeonExtender: Rename AsmWaitHandler to GCNWaitHandler. Jul 4, 2018
.gitignore CLRadeonExtender: Update svn:ignore. Aug 31, 2017
AUTHORS CLRadeonExtender: Update AUTHORS. Apr 5, 2018
CMakeLists.txt CLRadeonExtender: Change version number. Sep 19, 2018
CONTRIBUTORS CLRadeonExtender: Add '.gdssize' to AmdCL2 format handling (original … Jan 22, 2017
COPYING CLRadeonExtender: Add COPYING (GPL 2.0) license for programs. Jan 29, 2016
COPYING.DOC CLRadeonExtender: Added License to documentation. Dec 30, 2015
COPYING.LIB CLRadeonExtender: Move COPYING into COPYING.LIB. Jan 29, 2016
ChangeLog CLRadeonExtender: Update change log. Sep 20, 2018
Check64Bit.cpp CLRadeonExtender: Make checking bitness more portable in CMakeLists.t… Sep 14, 2017 CLRadeonExtender: Doxygen: Add info about callOnce and OnceFlag. Sep 15, 2017
INSTALL CLRadeonExtender: Precise description of GCC5CXX11NEWABI option. May 17, 2018
Int128Detect.cpp CLRadeonExtender: Use only C++ compiler: rename Int128Detect.c to Int… Sep 14, 2017
README CLRadeonExtender: Add alternative links without SSL to README's. Jul 7, 2018 CLRadeonExtender: Add alternative links without SSL to README's. Jul 7, 2018
ThreadOnce.cpp CLRadeonExtender: Add checking C++11 Thread call_once. Add detection … Sep 13, 2017


This is mirror of the CLRadeonExtender project.

Original site is here or if SSL certificate doesn't work.

CLRadeonExtender provides tools to develop software in low-level for the Radeon GPU's compatible with GCN 1.0/1.1/1.2/1.4 (AMD VEGA) architecture. Currently, this project have two tools to develop that software:

  • clrxasm - the GCN assembler
  • clrxdisasm - the GCN disassembler

Both tools can operate on four binary formats:

  • the AMD Catalyst OpenCL program binaries
  • the GalliumCompute (Mesa) program binaries
  • the AMD Catalyst OpenCL 2.0 (new AMD format) program binaries
  • the ROCm (RadeonOpenCompute) program binaries

CLRadeonExtender not only provides basic tools to low-level development, but also allow to embed own assembler with AMD Catalyst driver through CLwrapper. An embedded assembler can be called from clBuildProgram OpenCL call with specified option -xasm. Refer to README and INSTALL to learn about CLRXWrapper.

System requirements

CLRadeonExtender requires:

  • C++11 compliant compiler (Clang++ or GCC 4.7 or later, MSVC 2015 or later)
  • any build system supported by CMake (GNU make, NMake, Visual Studio, ...)
  • CMake system (2.8 or later)
  • Threads support (for Linux, recommended NPTL)
  • Unix-like (Linux or BSD) system or Windows system

Optionally, CLRXWrapper requires:

  • or OpenCL.dll
  • OpenCL headers
  • OpenGL headers (to 0.1.5 version)
  • OpenCL ICD (for example from AMD Catalyst driver)
  • AMD Catalyst driver or AMDGPU-PRO driver.

and documentation requires:

  • pod2man utility for Unix manuals
  • markdown_py utility for CLRX Documentation
  • Doxygen for CLRX API Documentation


To build system you should create a build directory in source code package:

mkdir build

and run:

cmake .. [cmake options]

Optional CMake configuration options for build:

  • CMAKE_BUILD_TYPE - type of build (Release, Debug, GCCSan, GCCSSP).
  • CMAKE_INSTALL_PREFIX - prefix for installation (for example '/usr/local')
  • BUILD_32BIT - build 32-bit binaries (works only in the Unix/Linux 64-bit environment)
  • BUILD_TESTS - build all tests
  • BUILD_SAMPLES - build OpenCL samples
  • BUILD_DOCUMENTATION - build project documentation (doxygen, unix manuals, user doc)
  • BUILD_DOXYGEN - build doxygen documentation
  • BUILD_MANUAL - build Unix manual pages
  • BUILD_CLRXDOC - build CLRX user documentation
  • BUILD_STATIC_EXE - build with statically linked executables
  • GCC5CXX11NEWABI - build with new GCC5 C++11 ABI (required if GCC uses old ABI by default)
  • NO_STATIC - no static libraries
  • NO_CLWRAPPER - do not build CLRXWrapper
  • CPU_ARCH - target CPU architecture (in GCC parameter to -march, for MSVC parameter to /arch:)
  • OPENCL_DIST_DIR - an OpenCL directory distribution installation (optional)

You can just add one or many of these options to cmake command:


or for Microsoft Visual C++ (for NMake):

cmake .. -G "NMake Makefiles" [cmake configuration options]

or for Microsoft Visual C++ (for same Visual Studio)

cmake .. -G "Visual Studio XXXXXX [arch]" [cmake configuration options]

where XXXX - version of Visual Studio (7, 14 2015, ...). arch - architecture (Win64, ARM) (optional).

After creating Makefiles scripts you can compile project:

make or make -jX - where X is number of processors.

or (for NMake)


or just execute build option in Visual Studio.

After building you can check whether project is working (if you will build tests):


Creating documentation will be done by this command (if you will enable a building documentation, required for version 0.1):

make Docs

or (for NMake)

nmake Docs


Due to unknown reasons, the compilation under clang++ will be failed. We recommend to use gcc compiler to build the CLRadeonExtender. You should prepend cmake command by CXX=g++: CXX=g++ cmake .. .....


Installation is easy. Just run command:

make install

or (for NMake):

nmake install

Usage of libraries in binaries

The default (without '-gcc5' in name) binary libraries for Linux are compiled for C++11 old ABI, hence you must add option -D_GLIBCXX_USE_CXX11_ABI=0 to compiler commands if you are using GCC 5.0 or higher or compiler that by default uses new C++11 ABI.


Usage of the clrxasm is easy:

clrxasm [-o outputFile] [options] [file ...]

If no file specified clrxasm read source from standard input.

Useful options:

  • -g DEVICETYPE - device type ('pitcairn', 'bonaire'...)
  • -A ARCH - architecture ('gcn1.0', 'gcn1.1', 'gcn1.2' or 'gcn1.4')
  • -b BINFMT - binary format ('amd', 'amdcl2', 'gallium', 'rocm', 'rawcode')
  • -t VERSION - driver version for which a binary will be generated
  • -w - suppress warnings

Usage of the clrxdisasm:

clrxdisasm [options] [file ...]

and clrxdisasm will print a disassembled code to standard output.

Useful options for clrxdisasm:

  • -a - print everything (not only code, but also kernels and their metadatas)
  • -f - print floating points
  • -h - print hexadecimal instruction codes
  • -C - print configuration dump instead metadatas, CALnotes and setup data
  • -g DEVICETYPE - device type ('pitcairn', 'bonaire'...)
  • -A ARCH - architecture ('gcn1.0', 'gcn1.1', 'gcn1.2' or 'gcn1.4')
  • -t VERSION - driver version for which a binary will be generated

A CLRX assembler accepts source from disassembler.