Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loopy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Sepanski
loopy
Commits
ce289b05
Commit
ce289b05
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Test parsing of two Fortran subroutines in one source
parent
a195f013
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_fortran.py
+37
-0
37 additions, 0 deletions
test/test_fortran.py
with
37 additions
and
0 deletions
test/test_fortran.py
+
37
−
0
View file @
ce289b05
...
...
@@ -412,6 +412,43 @@ def test_fuse_kernels(ctx_factory):
lp
.
auto_test_vs_ref
(
xyderiv
,
ctx
,
knl
,
parameters
=
dict
(
nelements
=
20
,
ndofs
=
4
))
def
test_parse_and_fuse_two_kernels
():
fortran_src
=
"""
subroutine fill(out, a, n)
implicit none
real*8 a, out(n)
integer n, i
do i = 1, n
out(i) = a
end do
end
subroutine twice(out, n)
implicit none
real*8 out(n)
integer n, i
do i = 1, n
out(i) = 2*out(i)
end do
end
!$loopy begin
!
! fill, twice = lp.parse_fortran(SOURCE)
! knl = lp.fuse_kernels((fill, twice))
! print(knl)
! RESULT = [knl]
!
!$loopy end
"""
knl
,
=
lp
.
parse_transformed_fortran
(
fortran_src
)
if
__name__
==
"
__main__
"
:
if
len
(
sys
.
argv
)
>
1
:
exec
(
sys
.
argv
[
1
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment