Skip to content

Commit

Permalink
[flang][cuda] Remove check for obsolete constraint (#70707)
Browse files Browse the repository at this point in the history
The online CUDA Fortran documentation states that a device subprogram
must be a top-level module subprogram, but this has turned out to be an
obsolete constraint. Stop enforcing it.
  • Loading branch information
klausler committed Oct 31, 2023
1 parent ba177c7 commit f19af90
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
6 changes: 0 additions & 6 deletions flang/lib/Semantics/check-declarations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1394,12 +1394,6 @@ void CheckHelper::CheckSubprogram(
if (ClassifyProcedure(symbol) == ProcedureDefinitionClass::Internal) {
messages_.Say(symbol.name(),
"A device subprogram may not be an internal subprogram"_err_en_US);
} else if ((*cudaAttrs == common::CUDASubprogramAttrs::Device ||
*cudaAttrs == common::CUDASubprogramAttrs::HostDevice) &&
(symbol.owner().kind() != Scope::Kind::Module ||
details.isInterface())) {
messages_.Say(symbol.name(),
"An ATTRIBUTES(DEVICE) subprogram must be a top-level module procedure"_err_en_US);
}
}
if ((!details.cudaLaunchBounds().empty() ||
Expand Down
2 changes: 0 additions & 2 deletions flang/test/Semantics/cuf02.cuf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
! RUN: %python %S/test_errors.py %s %flang_fc1
module m
interface
!ERROR: An ATTRIBUTES(DEVICE) subprogram must be a top-level module procedure
attributes(device) subroutine exts1
end
end interface
Expand Down Expand Up @@ -44,6 +43,5 @@ module m
end
end

!ERROR: An ATTRIBUTES(DEVICE) subprogram must be a top-level module procedure
attributes(device) subroutine exts1
end

0 comments on commit f19af90

Please sign in to comment.