Speaker: Alexander Monakov
This talk describes the implementation of OpenMP offloading for NVIDIA accelerators (corresponding to the 'nvptx' GCC target). It required changes in the nvptx backend, middle-end (mostly in OpenMP lowering) and libgomp. Although the implementation tries to fit within the existing infrastructure, the new code execution style in offloaded OpenMP regions (where logical threads are mapped onto PTX synchronous thread groups (warps), and individual PTX threads are exposed only as SIMD lanes) requires that OpenMP SIMD lowering is specialized for this execution style. Furthermore, since offloaded code is generated from the same LTO bytecode as the host code, we need to arrange that before LTO stream-out, GIMPLE representation incorporates both traditional and GPU-specific flows, and either can be easily cleaned out just after LTO stream-in.