Program Correctness by Transformation
Deductive program verification can be used effectively to verify high-level programs, but can be challenging for low-level, high-performance code. In this paper, we argue that compilation and program transformations should be made annotation-aware, i.e. during compilation and program transformation, not only the code should be changed, but also the corresponding annotations. As a result, if the original high-level program could be verified, also the resulting low-level program can be verified. We illustrate this approach on a concrete case, where loop annotations that capture possible loop parallelisations are translated into specifications of an OpenCL kernel that corresponds to the parallel loop. We also sketch how several commonly used OpenCL kernel transformations can be adapted to also transform the corresponding program annotations. Finally, we conclude the paper with a list of research challenges that need to be addressed to further develop this approach.
We are indebted to Jeroen Vonk, who started studying some of the annotation-aware program transformations as part of his Bachelor project. This work is supported by the ERC 258405 VerCors project (Huisman, Blom), the EU FP7 STREP 287767 CARP project (Huisman, Blom, Darabi), and the NWO VICI 639.023.710 Mercedes project (Huisman, Safari).
- 1.Amighi, A., Haack, C., Huisman, M., Hurlin, C.: Permission-based separation logic for multithreaded Java programs. LMCS 11(1) (2015)Google Scholar
- 2.Amini, M.: Source-to-source automatic program transformations for GPU-like hardware accelerators. Master’s thesis, Ecole Nationale Supérieure des Mines de Paris (2012)Google Scholar
- 3.Baghdadi, R., et al.: PENCIL: towards a platform-neutral compute intermediate language for DSLs. CoRR, abs/1302.5586 (2013)Google Scholar
- 7.Bornat, R., Calcagno, C., O’Hearn, P.W., Parkinson, M.J.: Permission accounting in separation logic. In: POPL, pp. 259–270 (2005)Google Scholar
- 10.Darabi, S.: Verification of program parallelization. Ph.D. thesis, University of Twente (2018)Google Scholar
- 12.de Gouw, S., Rot, J., de Boer, F.S., Bubel, R., Hähnle, R.: OpenJDK’s Java.utils.Collection.sort() is broken: the good, the bad and the worst case. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 273–289. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21690-4_16CrossRefGoogle Scholar
- 13.Huang, D., et al.: Automated transformation of GPU-specific OpenCL kernels targeting performance portability on multi-core/many-core CPUs. In: Silva, F., Dutra, I., Santos Costa, V. (eds.) Euro-Par 2014. LNCS, vol. 8632, pp. 210–221. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-09873-9_18CrossRefGoogle Scholar
- 14.Jung, R., et al.: Iris: monoids and invariants as an orthogonal basis for concurrent reasoning. In: POPL, pp. 637–650. ACM (2015)Google Scholar
- 16.Leavens, G.T., et al.: JML Reference Manual. Department of Computer Science, Iowa State University, February 2007. http://www.jmlspecs.org
- 17.Nandakumar, D.: Automatic translation of CUDA to OpenCL and comparison of performance optimizations on GPUs. Master’s thesis, University of Illinois at Urbana-Champaign (2011)Google Scholar
- 19.Shen, J.: Efficient high performance computing on heterogeneous platforms. Ph.D. thesis, Technical University of Delft (2015)Google Scholar
- 20.Wu, B., Chen, G., Li, D., Shen, X., Vetter, J.: Enabling and exploiting flexible task assignment on GPU through SM-centric program transformations. In: ICS 2015 Proceedings of the 29th ACM on International Conference on Supercomputing, pp. 119–130. ACM (2015)Google Scholar