Skip to content
Snippets Groups Projects
Commit 386e923f authored by Johannes Mey's avatar Johannes Mey
Browse files

improved test data and tests for OpenACC

parent 5de97173
No related branches found
No related tags found
No related merge requests found
Showing
with 372 additions and 598 deletions
! acc atomic directive (2.12)
!$acc atomic
x = 1
!$acc end atomic
......@@ -19,4 +21,4 @@ x = 1
x = 1
!$acc end atomic
end
end program
! cache directive (2.10)
!$acc cache(a,b,c)
......
! OpenACC clause test
x = 0
! if ===========================================================================
!$acc parallel if(1)
......@@ -244,7 +248,7 @@ end do
!$acc routine(myRoutine) bind(aName)
!$acc routine(myRoutine) bind("some string...! x = 1")
!$acc routine(myRoutine) bind('some string...! x = 1')
! nohost =======================================================================
......
!$acc declare
!$acc declare if(x)
......
do i = 1, n(5)
x = 1
end do
......
......@@ -4,262 +4,16 @@
! if ===========================================================================
!$acc parallel if(1)
x = 1
!$acc end parallel
!$acc parallel if(a)
x = 1
!$acc end parallel
!$acc parallel if(a + 1)
x = 1
!$acc end parallel
!$acc parallel if(a%b)
x = 1
!$acc end parallel
!$acc parallel if(a(1,2))
x = 1
!$acc end parallel
! default(none) ================================================================
!$acc parallel default(none)
x = 1
!$acc end parallel
! device type ==================================================================
!$acc parallel device_type(t1)
x = 1
!$acc end parallel
!$acc parallel device_type(t1,t2)
x = 1
!$acc end parallel
!$acc parallel device_type(*)
x = 1
!$acc end parallel
! short versions are expanded
! !$acc parallel dtype(t1)
! x = 1
! !$acc end parallel
! !$acc parallel dtype(t1,t2)
! x = 1
! !$acc end parallel
! !$acc parallel dtype(*)
! x = 1
! !$acc end parallel
! tile =========================================================================
!$acc loop tile(myTile)
!$acc loop collapse(1) vector
do i = 1,n(5)
x = 1
end do
!$acc end loop
! wait =========================================================================
!$acc parallel wait(x + 1,2,y)
x = 1
!$acc end parallel
! collapse =====================================================================
!$acc loop collapse(4)
do i = 1,n(5)
x = 1
end do
!$acc end loop
!$acc loop collapse(0)
do i = 1,n(5)
x = 1
end do
!$acc end loop
!$acc loop collapse(#TEST#)
do i = 1,n(5)
x = 1
end do
!$acc end loop
! expression clauses ===========================================================
!$acc parallel async(1 + x)
x = 1
!$acc end parallel
!$acc parallel num_gangs(1 + x)
x = 1
!$acc end parallel
!$acc parallel num_workers(1 + x)
x = 1
!$acc end parallel
!$acc parallel vector_length(1 + x)
x = 1
!$acc end parallel
! reduction ====================================================================
! operators
!$acc parallel reduction(+:x)
x = 1
!$acc end parallel
!$acc parallel reduction(*:x)
x = 1
!$acc end parallel
!$acc parallel reduction(max:x)
x = 1
!$acc end parallel
!$acc parallel reduction(min:x)
x = 1
!$acc end parallel
!$acc parallel reduction(iand:x)
x = 1
!$acc end parallel
!$acc parallel reduction(ior:x)
x = 1
!$acc end parallel
!$acc parallel reduction(ieor:x)
x = 1
!$acc end parallel
!$acc parallel reduction(.and.:x)
x = 1
!$acc end parallel
!$acc parallel reduction(.or.:x)
x = 1
!$acc end parallel
!$acc parallel reduction(.eqv.:x)
x = 1
!$acc end parallel
!$acc parallel reduction(.neqv.:x)
x = 1
!$acc end parallel
! variabes
!$acc parallel reduction(+:x,y,z)
!$acc parallel copyin()
x = 1
!$acc end parallel
! variable list clauses ========================================================
!$acc enter data copy(x,y,z)
!$acc enter data copyin(x,y)
!$acc enter data copyout(x)
!$acc enter data create(x)
!$acc enter data delete(x)
!$acc enter data device(x)
!$acc enter data firstprivate(x)
!$acc enter data host(x)
!$acc enter data present(x)
!$acc enter data present_or_copy(x)
!$acc enter data present_or_copyin(x)
!$acc enter data present_or_copyout(x)
!$acc enter data present_or_create(x)
!$acc enter data private(x)
!$acc enter data self(x)
!$acc enter data use_device(x)
! short versions are expanded
! !$acc enter data pcopy(x)
! !$acc enter data pcopyin(x)
! !$acc enter data pcopyout(x)
! !$acc enter data pcreate(x)
! loop clauses =================================================================
!$acc loop gang
do i = 1,n(5)
x = 1
end do
!$acc end loop
!$acc loop worker
do i = 1,n(5)
x = 1
end do
!$acc end loop
!$acc loop vector
do i = 1,n(5)
x = 1
end do
!$acc end loop
!$acc loop independent
do i = 1,n(5)
x = 1
end do
!$acc end loop
!$acc loop gang(3)
do i = 1,n(5)
x = 1
end do
!$acc end loop
!$acc loop worker(3)
do i = 1,n(5)
x = 1
end do
!$acc end loop
!$acc loop vector(3)
do i = 1,n(5)
x = 1
end do
!$acc end loop
!$acc loop shortloop
do i = 1,n(5)
x = 1
end do
!$acc end loop
! seq ==========================================================================
!$acc routine(myRoutine) seq
! bind =========================================================================
!$acc routine(myRoutine) bind(aName)
!$acc routine(myRoutine) bind('some string...! x = 1')
! nohost =======================================================================
!$acc routine nohost
! device_resident ==============================================================
!$acc declare device_resident(x,y,z)
! link =========================================================================
!$acc declare link(x,y,z)
end
......@@ -6,6 +6,8 @@
10 ALLOCATE(a,b)
allocate(integer::a,b)
allocate(a,stat=i, errmsg=blah, source=k)
allocate(m(n)%foo,stat=i, errmsg=blah, source=k)
allocate(m(n)%foo, source= t0(n*99))
end
......@@ -21,6 +21,16 @@ public class OpenAccTest extends TestBase {
@Test(dataProvider = "OpenACC", groups = {"prettyprinter"})
public void testOpenAccPrettyPrinter(File f) throws Exception {
testParse(f, true, false, false, true, Root.class);
testParse(f, true, false, false, false, Root.class);
}
@Test(dataProvider = "OpenACC", groups = {"prettyprinter"})
public void testOpenAccPrettyPrinterCompare(File f) throws Exception {
testParse(f, true, false, true, true, Root.class);
}
@Test(dataProvider = "OpenACC", groups = {"prettyprinter"})
public void testOpenAccPrettyPrinterCompareWithWhitespace(File f) throws Exception {
testParse(f, true, false, true, false, Root.class);
}
}
......@@ -143,9 +143,10 @@ public class TestBase {
}
if (!r.hasValue()) {
if (r.parseError().index > 0) {
Assert.assertTrue(r.hasValue(), "ParseError in " + file.getName() + ":" + parser.location(r.parseError().index) + ":(" + r.parseError().index + ") " + r.parseError().msg + ".");
System.err.println(parser.format(r.parseError()));
Assert.assertTrue(r.hasValue(), "ParseError in " + file.getName());
} else {
Assert.assertTrue(r.hasValue(), "ParseError in " + file.getName() + ":" + ":(" + r.parseError().index + ") " + r.parseError().msg + ".");
Assert.assertTrue(r.hasValue(), "ParseError in " + file.getName() + ".");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment