[Openmp-commits] [openmp] [OpenMP][NFC] Extract device image handling into a class/header (PR #74129)

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Fri Dec 1 11:07:25 PST 2023


================
@@ -0,0 +1,39 @@
+//===-- DeviceImage.h - Representation of the device code/image -*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef OMPTARGET_DEVICE_IMAGE_H
+#define OMPTARGET_DEVICE_IMAGE_H
+
+#include "Shared/APITypes.h"
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Object/OffloadBinary.h"
+
+class DeviceImageTy {
+
+  std::unique_ptr<llvm::object::OffloadBinary> Binary;
+
+  __tgt_device_image Image;
+  __tgt_image_info ImageInfo;
----------------
jhuber6 wrote:

I want to redesign all of this at some point. All the information we need should be in the ELF header so  there's no need for the runtime to need to parse some special binary format. We will however still store it at the section such that tools like `llvm-objdump` can read what it is.

https://github.com/llvm/llvm-project/pull/74129


More information about the Openmp-commits mailing list