This patches proposes an initial implementation of the libomptarget based on what we have working today in https://github.com/clang-omp.
I tried to follow what has been done in openmp/runtime in terms of the cmake build system.
The library sources are placed under libomptarget and it consists of three components:
- device agnostic library (the interface that clang uses)
- device plugins - right now we create a plug-in for CUDA-enabled devices, and a generic 64-bit plugin that works on powerpcBE/LE and x86_64 (mostly for testing purposes)
- device runtime library for CUDA enabled devices.
The interface of the plugins and target agnostic library are documented in http://goo.gl/L1rnKJ.
I included the logic for testing based on llvm-lit and FileCheck. Currently there are only two regression tests that basically check that offloading failed. This is because the target side codegen (http://reviews.llvm.org/D12614) and driver support (http://reviews.llvm.org/D9888) are still under review in clang. Once that functionality is in clang I plan to include more tests to exercise the library.
In this patch, I tried to organize things based on what makes sense to me and also based on previous discussions with other OpenMP project contributors. I am happy to organize things in a different way if suggested to do so - the goal here is also open the discussion on how this library should be contributed to the the project.
Let me now any suggestions/comments you may have,
Thanks!
Samuel