Skip to content

Commit 6574a2e

Browse files
authored
[flang][cuda] Add TODO for allocate with device source (#163630)
1 parent a1f233a commit 6574a2e

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

flang/lib/Lower/Allocatable.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,10 @@ class AllocateStmtHelper {
629629
unsigned allocatorIdx = Fortran::lower::getAllocatorIdx(alloc.getSymbol());
630630
fir::ExtendedValue exv = isSource ? sourceExv : moldExv;
631631

632+
if (const Fortran::semantics::Symbol *sym{GetLastSymbol(sourceExpr)})
633+
if (Fortran::semantics::IsCUDADevice(*sym))
634+
TODO(loc, "CUDA Fortran: allocate with device source");
635+
632636
// Generate a sequence of runtime calls.
633637
errorManager.genStatCheck(builder, loc);
634638
genAllocateObjectInit(box, allocatorIdx);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
! RUN: %not_todo_cmd bbc -emit-fir -fcuda -o - %s 2>&1 | FileCheck %s
2+
3+
program main
4+
implicit none
5+
integer, device, allocatable :: a_d(:)
6+
integer, allocatable :: a(:)
7+
! CHECK: not yet implemented: CUDA Fortran: allocate with device source
8+
allocate(a, source=a_d)
9+
end program

0 commit comments

Comments
 (0)