Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

extension request - masked do loop

mike_gaitens
Novice
500 Views
In the spirit of Run it up the flagpole and see if
anyone salutes, this proposes the following modest
language extension.

[name:] &
LOOP (triplet-spec [,triplet-spec]...[, mask-expr])
.
END LOOP [name]

Note the proposed syntax matches that of the FORALL
construct which was a DIGITAL F90 extension.
LOOP differs from FORALL in that any statement allowed
in the body of an ordinary DO loop is allowed within the
LOOP construct.

The first triplet-spec specifies the outermost loop.
Thus with two triplet-specs, the proposed construct
would execute exactly as the F77 construct:

DO i = i1, i2, i3 ! first triplet
DO j = j1, j2, j3 ! second triplet
IF (mask-expr) THEN
.
END IF
END DO
END DO

The keyword LOOP is tentative; other candidate keywords
include: DoFor, DoMask, DoOver, NEST, or VFDO. Compiler
writer to choose the keyword.

Arguments for this extension are: it is more F95-like;
it is a relatively common need; and it saves at least
one level of indentation. Anyone else think it worth
having?
0 Kudos
1 Reply
Steven_L_Intel1
Employee
500 Views
FYI - FORALL was a feature from High-Performance Fortran (HPF) that was subsequently adopted into Fortran 95. It wasn't our invention.

Steve
0 Kudos
Reply