45 lines · c
1//===-- DeviceImage.h - Representation of the device code/image -*- 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-exception6//7//===----------------------------------------------------------------------===//8//9//10//===----------------------------------------------------------------------===//11 12#ifndef OMPTARGET_DEVICE_IMAGE_H13#define OMPTARGET_DEVICE_IMAGE_H14 15#include "OffloadEntry.h"16#include "Shared/APITypes.h"17 18#include "llvm/ADT/SmallVector.h"19#include "llvm/ADT/StringRef.h"20#include "llvm/ADT/iterator.h"21#include "llvm/ADT/iterator_range.h"22#include "llvm/Object/OffloadBinary.h"23 24#include <memory>25 26class DeviceImageTy {27 28 std::unique_ptr<llvm::object::OffloadBinary> Binary;29 30 __tgt_bin_desc *BinaryDesc;31 __tgt_device_image Image;32 33public:34 DeviceImageTy(__tgt_bin_desc &BinaryDesc, __tgt_device_image &Image);35 36 __tgt_device_image &getExecutableImage() { return Image; }37 __tgt_bin_desc &getBinaryDesc() { return *BinaryDesc; }38 39 auto entries() {40 return llvm::make_range(Image.EntriesBegin, Image.EntriesEnd);41 }42};43 44#endif // OMPTARGET_DEVICE_IMAGE_H45