[flang-commits] [flang] [flang][cuda] Force default allocator in device code (PR #102238)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Tue Aug 6 15:11:44 PDT 2024


================
@@ -162,11 +162,17 @@ RT_API_ATTRS int Descriptor::Allocate() {
     elementBytes = raw_.elem_len = 0;
   }
   std::size_t byteSize{Elements() * elementBytes};
+
+  // Force default allocator in device code.
+#ifdef RT_DEVICE_COMPILATION
----------------
klausler wrote:

This logic could be encapsulated in a single member function in Descriptor and used both here and below.

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


More information about the flang-commits mailing list