File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -767,6 +767,15 @@ class AllocateStmtHelper {
767767 const fir::MutableBoxValue &box,
768768 ErrorManager &errorManager,
769769 const Fortran::semantics::Symbol &sym) {
770+
771+ if (const Fortran::semantics::DeclTypeSpec *declTypeSpec = sym.GetType ())
772+ if (const Fortran::semantics::DerivedTypeSpec *derivedTypeSpec =
773+ declTypeSpec->AsDerived ())
774+ if (derivedTypeSpec->HasDefaultInitialization (
775+ /* ignoreAllocatable=*/ true , /* ignorePointer=*/ true ))
776+ TODO (loc,
777+ " CUDA Fortran: allocate on device with default initialization" );
778+
770779 Fortran::lower::StatementContext stmtCtx;
771780 cuf::DataAttributeAttr cudaAttr =
772781 Fortran::lower::translateSymbolCUFDataAttribute (builder.getContext (),
Original file line number Diff line number Diff line change 1+ ! RUN: %not_todo_cmd bbc -emit-fir -fcuda -o - %s 2>&1 | FileCheck %s
2+
3+ program test
4+ implicit none
5+
6+ type :: t1
7+ real(4) :: x_fin(1:10) = acos(-1.0_4)
8+ end type t1
9+
10+ type(t1), allocatable, device :: t(:)
11+
12+ ! CHECK: not yet implemented: CUDA Fortran: allocate on device with default initialization
13+ allocate(t(1:2))
14+
15+ end program
You can’t perform that action at this time.
0 commit comments