[PATCH] D126734: [flang] Add team_type to num_images intrinsic call
Katherine Rasmussen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 31 17:03:43 PDT 2022
ktras created this revision.
ktras added reviewers: klausler, sscalpone, craig.rasmussen, rouson, PeteSteinfeld, jeanPerier.
ktras added projects: Flang, LLVM.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
ktras requested review of this revision.
`num_images` had previously been added to the list of intrinsics
before the type `team_type` had been implemented. Now that `team_type`
is implemented, add the `num_images` call that has the team argument.
Update the semantics tests for `num_images`.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D126734
Files:
flang/lib/Evaluate/intrinsics.cpp
flang/test/Semantics/num_images01.f90
flang/test/Semantics/num_images02.f90
Index: flang/test/Semantics/num_images02.f90
===================================================================
--- flang/test/Semantics/num_images02.f90
+++ flang/test/Semantics/num_images02.f90
@@ -23,10 +23,7 @@
!___ standard-conforming statements with team_type argument present (not yet supported) ___
- !ERROR: too many actual arguments for intrinsic 'num_images'
n = num_images(home)
-
- !ERROR: unknown keyword argument to intrinsic 'num_images'
n = num_images(team=home)
!___ non-conforming statements ___
Index: flang/test/Semantics/num_images01.f90
===================================================================
--- flang/test/Semantics/num_images01.f90
+++ flang/test/Semantics/num_images01.f90
@@ -2,11 +2,17 @@
! Check for semantic errors in num_images() function calls
subroutine test
+ use iso_fortran_env, only: team_type
+ implicit none
+
+ type(team_type) my_team
! correct calls, should produce no errors
print *, num_images()
print *, num_images(team_number=1)
print *, num_images(1)
+ print *, num_images(my_team)
+ print *, num_images(team=my_team)
! incorrectly typed argument
! the error is seen as too many arguments to the num_images() call with no arguments
@@ -25,6 +31,7 @@
!ERROR: unknown keyword argument to intrinsic 'num_images'
print *, num_images(team_numbers=1)
- !TODO: test num_images() calls related to team_type argument
+ !ERROR: unknown keyword argument to intrinsic 'num_images'
+ print *, num_images(teams=my_team)
end subroutine
Index: flang/lib/Evaluate/intrinsics.cpp
===================================================================
--- flang/lib/Evaluate/intrinsics.cpp
+++ flang/lib/Evaluate/intrinsics.cpp
@@ -629,6 +629,8 @@
// NULL() is a special case handled in Probe() below
{"num_images", {}, DefaultInt, Rank::scalar,
IntrinsicClass::transformationalFunction},
+ {"num_images", {{"team", TeamType, Rank::scalar}}, DefaultInt,
+ Rank::scalar, IntrinsicClass::transformationalFunction},
{"num_images", {{"team_number", AnyInt, Rank::scalar}}, DefaultInt,
Rank::scalar, IntrinsicClass::transformationalFunction},
{"out_of_range",
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126734.433233.patch
Type: text/x-patch
Size: 2206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220601/0d0842e1/attachment.bin>
More information about the llvm-commits
mailing list