[llvm-branch-commits] [flang] [flang] Lower REDUCE intrinsic with DIM argument (PR #94771)

2024-06-07 Thread Slava Zakharin via llvm-branch-commits


@@ -527,10 +571,32 @@ struct ForcedReduceComplex10 {
   }
 };
 
+/// Placeholder for Dim complex(10) version of Reduce Intrinsic
+struct ForcedReduceComplex10Dim {
+  static constexpr const char *name =
+  ExpandAndQuoteKey(RTNAME(CppReduceComplex10Dim));
+  static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
+return [](mlir::MLIRContext *ctx) {
+  auto ty = mlir::ComplexType::get(mlir::FloatType::getF80(ctx));
+  auto boxTy =
+  fir::runtime::getModel()(ctx);
+  auto opTy = mlir::FunctionType::get(ctx, {ty, ty}, ty);
+  auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
+  auto intTy = mlir::IntegerType::get(ctx, 8 * sizeof(int));
+  auto refTy = fir::ReferenceType::get(ty);
+  auto refBoxTy = fir::ReferenceType::get(boxTy);
+  auto i1Ty = mlir::IntegerType::get(ctx, 1);
+  return mlir::FunctionType::get(
+  ctx, {refBoxTy, boxTy, opTy, strTy, intTy, intTy, boxTy, refTy, 
i1Ty},
+  {});
+};
+  }
+};
+
 /// Placeholder for complex(16) version of Reduce Intrinsic
 struct ForcedReduceComplex16 {
   static constexpr const char *name =
-  ExpandAndQuoteKey(RTNAME(CppReduceComplex16));
+  ExpandAndQuoteKey(RTNAME(CppReduceComplex16Dim));

vzakhari wrote:

Is this change intended?

https://github.com/llvm/llvm-project/pull/94771
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang] Lower REDUCE intrinsic with DIM argument (PR #94771)

2024-06-07 Thread Slava Zakharin via llvm-branch-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=
Message-ID:
In-Reply-To: 



@@ -540,9 +606,31 @@ struct ForcedReduceComplex16 {
   auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
   auto intTy = mlir::IntegerType::get(ctx, 8 * sizeof(int));
   auto refTy = fir::ReferenceType::get(ty);
+  auto refBoxTy = fir::ReferenceType::get(boxTy);

vzakhari wrote:

Then, I guess, this should not be needed as well :)

https://github.com/llvm/llvm-project/pull/94771
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang] Lower REDUCE intrinsic with DIM argument (PR #94771)

2024-06-07 Thread Slava Zakharin via llvm-branch-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?Message-ID:
In-Reply-To: 



@@ -540,9 +606,31 @@ struct ForcedReduceComplex16 {
   auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
   auto intTy = mlir::IntegerType::get(ctx, 8 * sizeof(int));
   auto refTy = fir::ReferenceType::get(ty);
+  auto refBoxTy = fir::ReferenceType::get(boxTy);

vzakhari wrote:

Hmm, I must be missing something.

The runtime API is defined as:
```
void RTDEF(CppReduceComplex16)(std::complex &result,
const Descriptor &array,
ReductionOperation> operation,
const char *source, int line, int dim, const Descriptor *mask,
const std::complex *identity, bool ordered) {
```
So the first argument should be a reference to a complex value, isn't it right?

https://github.com/llvm/llvm-project/pull/94771
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang] Lower REDUCE intrinsic with DIM argument (PR #94771)

2024-06-07 Thread Slava Zakharin via llvm-branch-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?Message-ID:
In-Reply-To: 



@@ -540,9 +606,31 @@ struct ForcedReduceComplex16 {
   auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
   auto intTy = mlir::IntegerType::get(ctx, 8 * sizeof(int));
   auto refTy = fir::ReferenceType::get(ty);
+  auto refBoxTy = fir::ReferenceType::get(boxTy);
   auto i1Ty = mlir::IntegerType::get(ctx, 1);
   return mlir::FunctionType::get(
-  ctx, {refTy, boxTy, opTy, strTy, intTy, intTy, boxTy, refTy, i1Ty},
+  ctx, {refBoxTy, boxTy, opTy, strTy, intTy, intTy, boxTy, refTy, 
i1Ty},
+  {});
+};
+  }
+};
+
+/// Placeholder for Dim complex(16) version of Reduce Intrinsic
+struct ForcedReduceComplex16Dim {
+  static constexpr const char *name =
+  ExpandAndQuoteKey(RTNAME(CppReduceComplex16Dim));
+  static constexpr fir::runtime::FuncTypeBuilderFunc getTypeModel() {
+return [](mlir::MLIRContext *ctx) {
+  auto ty = mlir::ComplexType::get(mlir::FloatType::getF128(ctx));
+  auto boxTy =
+  fir::runtime::getModel()(ctx);
+  auto opTy = mlir::FunctionType::get(ctx, {ty, ty}, ty);
+  auto strTy = fir::ReferenceType::get(mlir::IntegerType::get(ctx, 8));
+  auto intTy = mlir::IntegerType::get(ctx, 8 * sizeof(int));
+  auto refTy = fir::ReferenceType::get(ty);
+  auto i1Ty = mlir::IntegerType::get(ctx, 1);
+  return mlir::FunctionType::get(
+  ctx, {boxTy, boxTy, opTy, strTy, intTy, intTy, boxTy, refTy, i1Ty},

vzakhari wrote:

The first argument is a box reference here but not in the non-dim case.

https://github.com/llvm/llvm-project/pull/94771
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang] Lower REDUCE intrinsic with DIM argument (PR #94771)

2024-06-07 Thread Slava Zakharin via llvm-branch-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=,Valentin Clement
 
Message-ID:
In-Reply-To: 


https://github.com/vzakhari approved this pull request.

Thank you, Valentin!

https://github.com/llvm/llvm-project/pull/94771
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang] Add allocator_idx attribute on fir.embox and fircg.ext_embox (PR #101212)

2024-07-30 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari edited 
https://github.com/llvm/llvm-project/pull/101212
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang] Add allocator_idx attribute on fir.embox and fircg.ext_embox (PR #101212)

2024-07-30 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari commented:

Thank you, Valentin.  It looks good to me with one minor comment.

https://github.com/llvm/llvm-project/pull/101212
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang] Add allocator_idx attribute on fir.embox and fircg.ext_embox (PR #101212)

2024-07-30 Thread Slava Zakharin via llvm-branch-commits


@@ -103,3 +103,27 @@ func.func @fir_dev_issue_1416(%arg0: 
!fir.ref>, %low: index
 fir.call @do_something(%3) : (!fir.box>) -> ()
 return
 }
+
+// CHECK-LABEL: define void @_QPtest_allocator1()
+func.func @_QPtest_allocator1() {
+  %c20 = arith.constant 20 : index
+  %0 = fir.alloca !fir.array<20xi32> {bindc_name = "x", uniq_name = 
"_QFtest_sliceEx"}
+  %1 = fir.shape %c20 : (index) -> !fir.shape<1>
+  %3 = fir.embox %0(%1) {allocator_idx = 1 : i32} : 
(!fir.ref>, !fir.shape<1>) -> !fir.box>
+  fir.call @_QPtest_callee(%3) : (!fir.box>) -> ()
+  return
+}
+
+// %{{.*}} = insertvalue { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } { 
ptr undef, i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64), i32 
20240719, i8 1, i8 9, i8 0, i8 2, [1 x [3 x i64]] [[3 x i64] [i64 1, i64 20, 
i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64)]] }

vzakhari wrote:

Missing `CHECK:`?

https://github.com/llvm/llvm-project/pull/101212
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][cuda] Add CUF allocator (PR #101216)

2024-07-30 Thread Slava Zakharin via llvm-branch-commits


@@ -0,0 +1,43 @@
+//===-- include/flang/Runtime/CUDA/allocator.h --*- 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 FORTRAN_RUNTIME_CUDA_ALLOCATOR_H_
+#define FORTRAN_RUNTIME_CUDA_ALLOCATOR_H_
+
+#include "flang/Runtime/descriptor.h"
+
+static constexpr unsigned kPinnedAllocatorPos = 1;
+static constexpr unsigned kDeviceAllocatorPos = 2;
+static constexpr unsigned kManagedAllocatorPos = 3;
+
+#define CUDA_REPORT_IF_ERROR(expr) \
+  [](CUresult result) { \
+if (!result) \
+  return; \
+const char *name = nullptr; \
+cuGetErrorName(result, &name); \
+if (!name) \
+  name = ""; \
+fprintf(stderr, "'%s' failed with '%s'\n", #expr, name); \

vzakhari wrote:

It might be best to use `FortranRuntime` `terminator` class to report and 
terminate in case of an error. Ideally, we would also provide the source code 
location from the compiler to the runtime.

https://github.com/llvm/llvm-project/pull/101216
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][cuda] Add CUF allocator (PR #101216)

2024-07-30 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari edited 
https://github.com/llvm/llvm-project/pull/101216
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][cuda] Add CUF allocator (PR #101216)

2024-07-30 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/101216
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][cuda] Add CUF allocator (PR #101216)

2024-07-30 Thread Slava Zakharin via llvm-branch-commits


@@ -0,0 +1,18 @@
+#===-- runtime/CUDA/CMakeLists.txt 
-===#
+#
+# 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
+#
+#======#
+
+include_directories(${CUDAToolkit_INCLUDE_DIRS})
+find_library(CUDA_RUNTIME_LIBRARY cuda HINTS 
${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
+
+add_flang_library(CufRuntime
+  allocator.cpp
+)
+target_link_libraries(CufRuntime
+PRIVATE
+${CUDA_RUNTIME_LIBRARY}

vzakhari wrote:

Thank you for switching to using `terminator`.  I think you have to add a 
linking dependency on `FortranRuntime` now.

https://github.com/llvm/llvm-project/pull/101216
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][TBAABuilder] not all loads and stores are inside of functions (PR #84305)

2024-03-07 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/84305
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added Fortran::common::reference_wrapper for use on device. (PR #85178)

2024-03-13 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari created 
https://github.com/llvm/llvm-project/pull/85178

This is a simplified implementation of std::reference_wrapper that can be used
in the offload builds for the device code. The methods are properly
marked with RT_API_ATTRS so that the device compilation succedes.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-13 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari created 
https://github.com/llvm/llvm-project/pull/85179

The visitor only allows Internal.*IoStatementState variants to be visited.
In case another variant is met a runtime error is produced.
During the device compilation the other variants' classes are not referenced,
which, for example, helps to avoid warnings about __host__ only
methods referenced in __device__ code.

I had problems parameterizing the Fortran::common visitor to limit
the allowed variants, but I can give it another try if creating
a copy looks inappropriate.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [NFC][flang] Reorder const and RT_API_ATTRS. (PR #85180)

2024-03-13 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari created 
https://github.com/llvm/llvm-project/pull/85180

Clean-up to keep the type qualifier next to the type.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added self-printing for InternalUnit. (PR #85181)

2024-03-13 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari created 
https://github.com/llvm/llvm-project/pull/85181

An InternalUnit might be constructed to allocate its own "output"
buffer of a predefined size. The buffer is then used for collecting
all the output, and it printed by std::printf at the end of the statement.

This is a suggested way for supporting 'PRINT *, ...' in the device code.
It might be not ideal, because the output is not formatted the same way
as the UNIT=5 output is formatted by default.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Enable PRINT of integer32 for device. (PR #85182)

2024-03-13 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari created 
https://github.com/llvm/llvm-project/pull/85182

Use InternalUnit with own buffer to accumulate output and print it
at the end of the statement. Some code was disabled with RT_DEVICE_COMPILATION
checks. It can be enabled later.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-14 Thread Slava Zakharin via llvm-branch-commits

vzakhari wrote:

> It would be better to have the types that are available on the device declare 
> themselves so in their declarations via a member or (better) inherited trait.

Like this. I will add the type trait for those types that are available on the 
device.

> The big variant union in `IoStatementState` could omit the host-only options 
> when compiled for the device.

I am not sure what you are suggesting.  I cannot comment out (e.g. with 
`RT_DEVICE_OUTPUT` check) the members of `std::variant<...> u_` union, because 
this will require commenting out all class declarations that try to explicitly 
access/emplace an instance of the commented out class into the union member. 
For example,
```
class NoUnitIoStatementState : public IoStatementBase {
...
  template 
  NoUnitIoStatementState(A &stmt, const char *sourceFile = nullptr,
  int sourceLine = 0, int badUnitNumber = -1)
  : IoStatementBase{sourceFile, sourceLine}, ioStatementState_{stmt},
badUnitNumber_{badUnitNumber} {}
...
};

class NoopStatementState : public NoUnitIoStatementState {
public:
  NoopStatementState(
  const char *sourceFile = nullptr, int sourceLine = 0, int unitNumber = -1)
  : NoUnitIoStatementState{*this, sourceFile, sourceLine, unitNumber} {}
...
};
```

`ioStatementState_{stmt}` is invalid if the union does not have 
`NoUnitIoStatementState` variant. There are more examples like this, and there 
is a lot of code that will need to be commented out for the device compilation 
if I modify the union declaration.  Maybe I misunderstood your comment, though.

https://github.com/llvm/llvm-project/pull/85179
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85179


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85179


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Enable PRINT of integer32 for device. (PR #85182)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85182


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Enable PRINT of integer32 for device. (PR #85182)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85182


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added Fortran::common::reference_wrapper for use on device. (PR #85178)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85178


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added Fortran::common::reference_wrapper for use on device. (PR #85178)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85178


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Enable PRINT of integer32 for device. (PR #85182)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85182


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Enable PRINT of integer32 for device. (PR #85182)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85182


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85179


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85179


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [NFC][flang] Reorder const and RT_API_ATTRS. (PR #85180)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85180


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [NFC][flang] Reorder const and RT_API_ATTRS. (PR #85180)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85180


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added self-printing for InternalUnit. (PR #85181)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85181


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added self-printing for InternalUnit. (PR #85181)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85181


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added Fortran::common::reference_wrapper for use on device. (PR #85178)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85178


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added Fortran::common::reference_wrapper for use on device. (PR #85178)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85178


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85179


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85179


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [NFC][flang] Reorder const and RT_API_ATTRS. (PR #85180)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85180


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [NFC][flang] Reorder const and RT_API_ATTRS. (PR #85180)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85180


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added self-printing for InternalUnit. (PR #85181)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85181


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added self-printing for InternalUnit. (PR #85181)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85181


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Enable PRINT of integer32 for device. (PR #85182)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85182


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Enable PRINT of integer32 for device. (PR #85182)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85182


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [NFC][flang] Reorder const and RT_API_ATTRS. (PR #85180)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85180


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85179


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85179


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [NFC][flang] Reorder const and RT_API_ATTRS. (PR #85180)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85180


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added self-printing for InternalUnit. (PR #85181)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85181


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added self-printing for InternalUnit. (PR #85181)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85181


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Enable PRINT of integer32 for device. (PR #85182)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85182


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Enable PRINT of integer32 for device. (PR #85182)

2024-03-15 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari updated 
https://github.com/llvm/llvm-project/pull/85182


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-21 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari closed 
https://github.com/llvm/llvm-project/pull/85179
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added custom visitor for IoStatementState variants. (PR #85179)

2024-03-21 Thread Slava Zakharin via llvm-branch-commits

vzakhari wrote:

Will use alternative solution.

https://github.com/llvm/llvm-project/pull/85179
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added self-printing for InternalUnit. (PR #85181)

2024-03-21 Thread Slava Zakharin via llvm-branch-commits

vzakhari wrote:

Will use alternative solution.

https://github.com/llvm/llvm-project/pull/85181
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Added self-printing for InternalUnit. (PR #85181)

2024-03-21 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari closed 
https://github.com/llvm/llvm-project/pull/85181
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Enable PRINT of integer32 for device. (PR #85182)

2024-03-21 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari closed 
https://github.com/llvm/llvm-project/pull/85182
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang][runtime] Enable PRINT of integer32 for device. (PR #85182)

2024-03-21 Thread Slava Zakharin via llvm-branch-commits

vzakhari wrote:

Will use alternative solution.

https://github.com/llvm/llvm-project/pull/85182
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][cuda] Lower device/managed/unified allocation to cuda ops (PR #90526)

2024-04-29 Thread Slava Zakharin via llvm-branch-commits

vzakhari wrote:

Thank you, Valentin!

Is it expected that we can have a mix of `fir.alloca` and `fir.cuda_alloc` 
operations in the device routines (e.g. I suppose 
`fir::FirOpBuilder::createTemporaryAlloc` can generate `fir.alloca` for a 
temporary location in device code)?  It is not necessarily an issue, I just 
want to understand whether we will have to handle both operations in the device 
code.

https://github.com/llvm/llvm-project/pull/90526
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][cuda] Lower device/managed/unified allocation to cuda ops (PR #90526)

2024-04-29 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari approved this pull request.


https://github.com/llvm/llvm-project/pull/90526
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [flang] [lld] [llvm] [Flang] LLVM_ENABLE_RUNTIMES=FortranRuntime (PR #110217)

2024-10-08 Thread Slava Zakharin via llvm-branch-commits


@@ -171,145 +76,88 @@ set(sources
   unit-map.cpp
   unit.cpp
   utf.cpp
-  ${FORTRAN_MODULE_OBJECTS}
 )
 
-include(AddFlangOffloadRuntime)
-
-# List of files that are buildable for all devices.
-set(supported_files
-  ISO_Fortran_binding.cpp
-  allocatable.cpp
-  allocator-registry.cpp
-  array-constructor.cpp
-  assign.cpp
-  buffer.cpp
-  character.cpp
-  connection.cpp
-  copy.cpp
-  derived-api.cpp
-  derived.cpp
-  descriptor.cpp
-  descriptor-io.cpp
-  dot-product.cpp
-  edit-input.cpp
-  edit-output.cpp
-  environment.cpp
-  extrema.cpp
-  external-unit.cpp
-  file.cpp
-  findloc.cpp
-  format.cpp
-  inquiry.cpp
-  internal-unit.cpp
-  io-api.cpp
-  io-api-minimal.cpp
-  io-error.cpp
-  io-stmt.cpp
-  iostat.cpp
-  matmul-transpose.cpp
-  matmul.cpp
-  memory.cpp
-  misc-intrinsic.cpp
-  namelist.cpp
-  non-tbp-dio.cpp
-  numeric.cpp
-  pointer.cpp
-  product.cpp
-  pseudo-unit.cpp
-  ragged.cpp
-  stat.cpp
-  sum.cpp
-  support.cpp
-  terminator.cpp
-  tools.cpp
-  transformational.cpp
-  type-code.cpp
-  type-info.cpp
-  unit.cpp
-  utf.cpp
+set(public_headers "")
+file(GLOB_RECURSE public_headers
+  "${FLANGRUNTIME_SOURCE_DIR}/include/flang/Runtime/*.h"
+  "${FLANGRUNTIME_SOURCE_DIR}/include/flang/Common/*.h"
   )
 
-enable_cuda_compilation(FortranRuntime "${supported_files}")
-enable_omp_offload_compilation("${supported_files}")

vzakhari wrote:

Is this just removed or moved somewhere?

https://github.com/llvm/llvm-project/pull/110217
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][cuda] Convert module allocation/deallocation to runtime calls (PR #109214)

2024-09-18 Thread Slava Zakharin via llvm-branch-commits

https://github.com/vzakhari approved this pull request.

Great!

https://github.com/llvm/llvm-project/pull/109214
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits