Automatic Test Case Reduction for OpenCL

We report on an extension to the C-Reduce tool, for automatic reduction of C test cases, to handle OpenCL kernels. This enables an automated method for detecting bugs in OpenCL compilers, by generating large random kernels using the CLsmith generator, identifying kernels that yield result differences across OpenCL platforms and optimisation levels, and using our novel extension to C-Reduce to automatically reduce such kernels to minimal forms that can be filed as bug reports. A major part of our effort involved the design of ShadowKeeper, a new plugin for the Oclgrind simulator that provides accurate detection of accesses to uninitialised data. We present experimental results showing the effectiveness of our method for finding bugs in a number of OpenCL compilers.

[1]  Andreas Zeller Chapter 6 – Scientific Debugging , 2006 .

[2]  Alastair F. Donaldson,et al.  Many-core compiler fuzzing , 2015, PLDI.

[3]  Andreas Zeller,et al.  Why Programs Fail: A Guide to Systematic Debugging , 2005 .

[4]  John Wickerson,et al.  The Design and Implementation of a Verification Technique for GPU Kernels , 2015, TOPL.

[5]  Xuejun Yang,et al.  Test-case reduction for C compiler bugs , 2012, PLDI.

[6]  Zhendong Su,et al.  Compiler validation via equivalence modulo inputs , 2014, PLDI.

[7]  Anne Marsden,et al.  International Organization for Standardization , 2014 .

[8]  Nicholas Nethercote,et al.  Using Valgrind to Detect Undefined Value Errors with Bit-Precision , 2005, USENIX Annual Technical Conference, General Track.

[9]  Nicholas Nethercote,et al.  How to shadow every byte of memory used by a program , 2007, VEE '07.

[10]  Alastair F. Donaldson,et al.  Metamorphic Testing for (Graphics) Compilers , 2016, 2016 IEEE/ACM 1st International Workshop on Metamorphic Testing (MET).

[11]  Moritz Pflanzer Automatic test case reduction of randomly generated OpenCL kernels , 2016 .

[12]  Xuejun Yang,et al.  Finding and understanding bugs in C compilers , 2011, PLDI '11.

[13]  Simon McIntosh-Smith,et al.  Oclgrind: an extensible OpenCL device simulator , 2015, IWOCL.

[14]  Alex Groce,et al.  Taming compiler fuzzers , 2013, ACM-SIGPLAN Symposium on Programming Language Design and Implementation.

[15]  Konstantin Serebryany,et al.  MemorySanitizer: Fast detector of uninitialized memory use in C++ , 2015, 2015 IEEE/ACM International Symposium on Code Generation and Optimization (CGO).