IEEE Access (Jan 2019)
Detecting Undefined Behaviors in CUDA C
Abstract
With the increasing deployment of GPUs in many domains, it is important to enhance the dependability of GPU-based systems especially in mission critical environments. We believe that undefined behaviors present a major challenge for the CUDA platform, because its programming language and compiler are derived from traditional C/C++ languages. In this paper, we first present a suite of benchmarks for CUDA, which contains 77 categories of undefined behaviors corresponding to the core language in C11 standard. It is developed to evaluate how current CUDA compilers deal with undefined behaviors. Then, we present the design and implementation of a system that can detect and locate vulnerable code that may result in undefined behaviors in CUDA programs. Our system is composed of a program converter and a static analyzer; the former transforms CUDA programs into a portable and semantic-reserved C/C++ programs, and the latter performs analysis on the transformed programs to statically identify undefined behaviors. Using CUDA SDK and a set of real CUDA applications, we conduct extensive experiments to investigate the effectiveness of our system on finding undefined behaviors in CUDA C programs.
Keywords