[memprof] Use a new constructor of IndexedAllocationInfo (NFC) (#116920)
[llvm-project.git] / offload / include / DeviceImage.h
blobba46a837f402cf7ca673df2a6af84c97ec6c4d6c
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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 //
10 //===----------------------------------------------------------------------===//
12 #ifndef OMPTARGET_DEVICE_IMAGE_H
13 #define OMPTARGET_DEVICE_IMAGE_H
15 #include "OffloadEntry.h"
16 #include "Shared/APITypes.h"
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"
24 #include <memory>
26 class DeviceImageTy {
28 std::unique_ptr<llvm::object::OffloadBinary> Binary;
30 __tgt_bin_desc *BinaryDesc;
31 __tgt_device_image Image;
33 public:
34 DeviceImageTy(__tgt_bin_desc &BinaryDesc, __tgt_device_image &Image);
36 __tgt_device_image &getExecutableImage() { return Image; }
37 __tgt_bin_desc &getBinaryDesc() { return *BinaryDesc; }
39 auto entries() {
40 return llvm::make_range(Image.EntriesBegin, Image.EntriesEnd);
44 #endif // OMPTARGET_DEVICE_IMAGE_H