[llvm] [Offload][NFC] Reorganize `utils::` and make Device/Host/Shared clearer (PR #100280)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 5 13:06:34 PDT 2024
================
@@ -0,0 +1,22 @@
+//===-- Shared/Types.h - Type defs shared between host and device - 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
+//
+//===----------------------------------------------------------------------===//
+//
+// Environments shared between host and device.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef OMPTARGET_SHARED_TYPES_H
+#define OMPTARGET_SHARED_TYPES_H
+
+#ifndef OMPTARGET_DEVICE_RUNTIME
+#include <cstdint>
+#else
+#include "DeviceTypes.h"
+#endif
----------------
jhuber6 wrote:
The fact that we're redefining the standard integers here is simply us building this incorrectly, you can include `stdint.h` just fine from the GPU if you pass `-nostdlibinc` or `-ffreestanding`, or manually undefine `__STDC_HOSTED__`, in order of desirability.
https://github.com/llvm/llvm-project/pull/100280
More information about the llvm-commits
mailing list