1 //===-- DeviceImage.h - Representation of the device code/image -*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
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"
28 std::unique_ptr
<llvm::object::OffloadBinary
> Binary
;
30 __tgt_bin_desc
*BinaryDesc
;
31 __tgt_device_image Image
;
34 DeviceImageTy(__tgt_bin_desc
&BinaryDesc
, __tgt_device_image
&Image
);
36 __tgt_device_image
&getExecutableImage() { return Image
; }
37 __tgt_bin_desc
&getBinaryDesc() { return *BinaryDesc
; }
40 return llvm::make_range(Image
.EntriesBegin
, Image
.EntriesEnd
);
44 #endif // OMPTARGET_DEVICE_IMAGE_H