OffloadWrapper.h 1.2 KB

12345678910111213141516171819202122232425262728
  1. //===- OffloadWrapper.h --r-------------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLVM_CLANG_TOOLS_CLANG_LINKER_WRAPPER_OFFLOAD_WRAPPER_H
  9. #define LLVM_CLANG_TOOLS_CLANG_LINKER_WRAPPER_OFFLOAD_WRAPPER_H
  10. #include "llvm/ADT/ArrayRef.h"
  11. #include "llvm/IR/Module.h"
  12. /// Wraps the input device images into the module \p M as global symbols and
  13. /// registers the images with the OpenMP Offloading runtime libomptarget.
  14. llvm::Error wrapOpenMPBinaries(llvm::Module &M,
  15. llvm::ArrayRef<llvm::ArrayRef<char>> Images);
  16. /// Wraps the input fatbinary image into the module \p M as global symbols and
  17. /// registers the images with the CUDA runtime.
  18. llvm::Error wrapCudaBinary(llvm::Module &M, llvm::ArrayRef<char> Images);
  19. /// Wraps the input bundled image into the module \p M as global symbols and
  20. /// registers the images with the HIP runtime.
  21. llvm::Error wrapHIPBinary(llvm::Module &M, llvm::ArrayRef<char> Images);
  22. #endif