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.

Highlights

  • CUDA (Compute Unified Device Architecture) is a widely-used platform that eases the programming of GPUs for general-purpose parallel computing

  • Based on the LLVM framework, we develop a static checker to perform in depth analysis on the transformed code to recognize the vulnerable code that can potentially result in undefined behaviors

  • It can correctly transform CUDA C programs, and accurately identify vulnerable code, and determine whether the identified vulnerable code would result in undefined behaviors or not

Read more

Summary

Introduction

CUDA (Compute Unified Device Architecture) is a widely-used platform that eases the programming of GPUs for general-purpose parallel computing. In computer programming, undefined behaviors refer to unpredictable behaviors that a specific piece of code may produce. This is a feature of some programming languages, especially the C language [2]. Because the C standard presumes the program never invokes undefined behaviors, so the way that C-family compilers exploit undefined behaviors is to optimize a program under this assumption. This always results in consequences that are often counterintuitive, for example, a program works well with common optimizations (e.g., −O0), but breaks at higher optimization levels (e.g., −O2).

Objectives
Results
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call