An extension of Csmith, CLsmith aims to find OpenCL compiler bugs via EMI and RDT.


CLsmith makes use of two existing testing techniques, Random Differential Testing and Equivalence Modulo Inputs (EMI), applying them in a many-core environment, OpenCL. Its primary feature is the generation of random OpenCL kernels, exercising many features of the language. It also brings a novel idea of applying EMI, via dead-code injection.

The CLsmith tool managed to find over 50 bugs in numerous OpenCL implementation from vendors such as Intel, AMD and Nvidia. It is available for download here.

Research Support

This research has been supported by the EU FP7 CARP project, Correct and Efficient Accelerator Programming, an EPSRC Pathways to Impact Award, and the Imperial College London UROP scheme.