I added 'num_images()' to the list of functions that are evaluated as intrinsic. I also added a test file in flang/test/Semantics to test calls to 'num_images()'. There was a call to 'num_images()' in flang/test/Semantics/call10.f90 that expected an error, now it no longer produces an error. So I edited that file accordingly. I also edited the intrinsics unit test to add further testing of 'num_images()'.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please remove num_images from the list of unimplemented intrinsics in flang/documentation/Intrinsics.md.
Looks good. Thanks!
flang/test/Semantics/call10.f90 | ||
---|---|---|
188 | I don't think you need a comment because you noted the reason in the commit message. |
flang/lib/Evaluate/intrinsics.cpp | ||
---|---|---|
584 | num_images is not an intrinsic procedure in subclause 16 of the standard; INTRINSIC NUM_IMAGES would not be a valid statement. It shouldn't be here with the actual intrinsics unless you're proposing to make it one as an extension. |
LGTM, and thanks for the contribution.
flang/lib/Evaluate/intrinsics.cpp | ||
---|---|---|
584 | Whoops, my mistake; I had it confused with another procedure. |
Based on feedback, I have removed 'num_images()' from the to do list in the documentation intrinsics.md. I have also updated the test call10.f90 to remove an unnecessary comment.
flang/test/Semantics/num_images.f90 | ||
---|---|---|
15 | I believe it is because 'num_images()' is overloaded with 3 variants and one of these has no arguments. If an argument is found that doesn't fully match the versions of 'num_images()' that do have arguments, then it seems to be interpreting those incorrect calls as an call to the version with no arguments. Thus the error being "too many actual arguments" if the argument is of an unexpected type or "unknown keyword argument" if a correct keyword argument is used, but with an incorrect type. I haven't looked into if there is a way to change the logic of the errors being produced in these cases. | |
23 | Replied in comment above. |
@ktras, do you have the necessary permissions to commit this or do you need someone to do it for you?
No, I do not, so I would need someone to commit it for me if everything looks ready to go. Thank you all for your help!
Excellent! I'm working on some NAG tests that use coarrays, and they use this_image().
Thanks for doing this!
num_images is not an intrinsic procedure in subclause 16 of the standard; INTRINSIC NUM_IMAGES would not be a valid statement. It shouldn't be here with the actual intrinsics unless you're proposing to make it one as an extension.