A Hoare Logic for SIMT Programs
We study a Hoare Logic to reason about GPU kernels, which are parallel programs executed on GPUs. We consider the SIMT (Single Instruction Multiple Threads) execution model, in which multiple threads execute in lockstep (that is, execute the same instruction at a time). When control branches both branches are executed sequentially but during the execution of each branch only those threads that take it are enabled; after the control converges, all threads are enabled and execute in lockstep again. In this paper we adapt Hoare Logic to the SIMT setting, by adding an extra component representing the set of enabled threads to the usual Hoare triples. It turns out that soundness and relative completeness do not hold for all programs; a difficulty arises from the fact that one thread can invalidate the loop termination condition of another thread through shared memory. We overcome this difficulty by identifying an appropriate class of programs for which soundness and relative completeness hold.
Unable to display preview. Download preview PDF.
- 2.NVIDIA: NVIDIA CUDA C Programming Guide (2012)Google Scholar
- 5.Collingbourne, P., Cadar, C., Kelly, P.H.: Symbolic crosschecking of floating-point and SIMD code. In: Proc. of the sixth conference on Computer systems, EuroSys 2011, pp. 315–328. ACM, New York (2011)Google Scholar
- 7.Li, G., Gopalakrishnan, G.: Scalable SMT-based verification of GPU kernel functions. In: Proc. of the 18th ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE 2010), pp. 187–196. ACM (2010)Google Scholar
- 8.Li, G., Gopalakrishnan, G.: Parameterized verification of GPU kernel programs. In: 2012 IEEE 26th International Parallel and Distributed Processing Symposium Workshops & PhD Forum (IPDPSW), pp. 2450–2459 (May 2012)Google Scholar
- 10.Li, P., Li, G., Gopalakrishnan, G.: Parametric flows: automated behavior equivalencing for symbolic analysis of races in CUDA programs. In: Proc. of the International Conference on High Performance Computing, Networking, Storage and Analysis (SC 2012), pp. 29:1–29:10. IEEE Computer Society Press (2012)Google Scholar
- 12.Huisman, M., Mihelčić, M.: Specification and verification of GPGPU programs using permission-based separation logic. In: Bytecode 2013, 8th Workshop on Bytecode Semantics, Verification, Analysis and Transformation (2013), http://hgpu.org/?p=9099
- 13.Apt, K.R., de Boer, F., Olderog, E.R.: Verification of Sequential and Concurrent Programs, 3rd edn. Springer Publishing Company, Incorporated (2009)Google Scholar
- 15.NVIDIA: Parallel Thread Execution ISA Version 3.1 (2012)Google Scholar
- 16.Tripakis, S., Stergiou, C., Lublinerman, R.: Checking equivalence of spmd programs using non-interference. Technical Report UCB/EECS-2010-11, EECS Department, University of California, Berkeley (January 2010)Google Scholar