Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
45f46a8
factoring out devtest from many F90 tests and putting it in a common …
alisterj1138 Feb 26, 2025
07b5cdf
major refactor of F90 atomic tests to all follow a common pattern and…
alisterj1138 Feb 26, 2025
b829b73
updating the precision on some C/C++ tests to be less strict, also fi…
alisterj1138 Feb 26, 2025
4abfc73
fixing acc_malloc.* to be less strict; acc_property_free_memory is no…
alisterj1138 Feb 26, 2025
182ddb6
fixing acc_copyin_with_len.F90 to use new devtest, plus a bit of math
alisterj1138 Feb 26, 2025
f9119a0
fixing some set_device_type tests to use the interface correctly; als…
alisterj1138 Feb 26, 2025
d22fd42
serial_private.c/.cpp were missing a present clause
alisterj1138 Feb 26, 2025
146afc7
fixing typo in serial_private.F90
alisterj1138 Feb 26, 2025
2cd87b3
adding missing variable initialization
alisterj1138 Feb 28, 2025
0e3757b
error count update line missing equals; err + 1 --> err += 1
alisterj1138 Feb 28, 2025
2a6caa1
fixing some math for serial/parallel_implicit_data_attributes
alisterj1138 Feb 28, 2025
b0cf8ea
changing routine gang to routine seq; cannot call gang routine withou…
alisterj1138 Feb 28, 2025
e5fdda1
adding missing reduction variable initialization
alisterj1138 Feb 28, 2025
2b90cc1
fixing some typos
alisterj1138 Feb 28, 2025
21f9c80
acc routine (fmin) is unnecessary
alisterj1138 Feb 28, 2025
4ad176a
fixing a bug in the test checks for kernels_if.*; also updating F90 t…
alisterj1138 Feb 28, 2025
95fe15d
adding missing allocations to C/C++ declare_function_scope_* tests
alisterj1138 Feb 28, 2025
d9491cf
removing some duplicate declarations and macros in acc_testsuite_decl…
alisterj1138 Feb 28, 2025
68b6cd2
major edits to declare_copyin/create.F90 so that a separate module fi…
alisterj1138 Feb 28, 2025
2cf67f4
adding array slice syntax and swapping indices around because Fortran…
alisterj1138 Feb 28, 2025
15911e1
fixing loop indicies
alisterj1138 Feb 28, 2025
1445751
fixing a loop index
alisterj1138 Feb 28, 2025
a0c54f8
fixing one more set of loop indicies
alisterj1138 Feb 28, 2025
bb3cd0a
fixing a typo and adding a declare create for a global
alisterj1138 Feb 28, 2025
d125b88
adding vector_length clause to force single thread gangs
alisterj1138 Feb 28, 2025
bd37ed4
missing pragma in acc_copyin_async.c
alisterj1138 Feb 28, 2025
c0bf6cf
shifting some pragmas around so acc_copyout_async* tests align
alisterj1138 Feb 28, 2025
ed23f08
removing duplicate acc creates and adding a missing copyout
alisterj1138 Feb 28, 2025
cde47ff
fixing array bounds in firstprivate for serial_firstprivate.c/.cpp
alisterj1138 Mar 3, 2025
d922263
Revert "removing duplicate acc creates and adding a missing copyout"
alisterj1138 Mar 3, 2025
09c7058
adding missing copyouts and fixing a copyout missing the finalize
alisterj1138 Mar 3, 2025
7fd9b83
fixing typo, = -> ==
alisterj1138 Mar 3, 2025
34ca287
correct fix for acc_wait_any this time
alisterj1138 Mar 6, 2025
24bffa6
fixing typo in parallel_create_zero
alisterj1138 Mar 6, 2025
40d9cb1
modifying acc_wait_any slightly to make more use of async
alisterj1138 Mar 14, 2025
7cb389b
fixing misc typos, including a loop index and a couple #ifndefs
alisterj1138 Mar 14, 2025
3a513fe
Merge branch 'master' into testpatches; grabbing updates from main repo
alisterj1138 May 22, 2025
ab83024
Fixing logical atomic tests to use .EQV./.NEQV. instead of .EQ./.NE.
alisterj1138 Jul 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions Tests/acc_copyin.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "common.Fh"

#ifndef T1
!T1:runtime,data,executable-data,construct-independent,V:2.0-2.7
LOGICAL FUNCTION test1()
Expand Down Expand Up @@ -102,15 +104,8 @@ LOGICAL FUNCTION test3()
INTEGER :: x !Iterators
REAL(8),DIMENSION(LOOPCOUNT):: a, b, c, a_copy, b_copy !Data
INTEGER :: errors = 0
LOGICAL,DIMENSION(1):: devtest

devtest(1) = .TRUE.
!$acc enter data copyin(devtest(1:1))
!$acc parallel present(devtest(1:1))
devtest(1) = .FALSE.
!$acc end parallel

IF (devtest(1) .eqv. .TRUE.) THEN
IF (devtest() .eqv. .TRUE.) THEN
SEEDDIM(1) = 1
# ifdef SEED
SEEDDIM(1) = SEED
Expand Down Expand Up @@ -316,15 +311,8 @@ LOGICAL FUNCTION test7()
INTEGER :: x !Iterators
REAL(8),DIMENSION(LOOPCOUNT):: a, b, c, a_copy, b_copy !Data
INTEGER :: errors = 0
LOGICAL,DIMENSION(1):: devtest

devtest(1) = .TRUE.
!$acc enter data copyin(devtest(1:1))
!$acc parallel present(devtest(1:1))
devtest(1) = .FALSE.
!$acc end parallel

IF (devtest(1) .eqv. .TRUE.) THEN
IF (devtest() .eqv. .TRUE.) THEN
!Initialization
SEEDDIM(1) = 1
# ifdef SEED
Expand Down
1 change: 1 addition & 0 deletions Tests/acc_copyin_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ int test4(){
}
}
acc_copyin_async(c, n * sizeof(real_t), 1);
#pragma acc exit data delete(c[0:n]) async(1)
#pragma acc parallel present(c[0:n]) async(1)
{
#pragma acc loop
Expand Down
24 changes: 6 additions & 18 deletions Tests/acc_copyin_with_len.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "common.Fh"

#ifndef T1
!T1:runtime,data,executable-data,construct-independent,V:2.0-2.7
LOGICAL FUNCTION test1()
Expand Down Expand Up @@ -103,15 +105,8 @@ LOGICAL FUNCTION test3()
REAL(8),DIMENSION(LOOPCOUNT):: a, b, c, a_copy, b_copy !Data
REAL(8) :: RAND
INTEGER :: errors = 0
INTEGER,DIMENSION(1) :: devtest

devtest(1) = 1
!$acc enter data copyin(devtest(1:1))
!$acc parallel present(devtest(1:1))
devtest(1) = 0
!$acc end parallel

IF (devtest(1) .eq. 1) THEN
IF (devtest() .eq. .TRUE.) THEN
SEEDDIM(1) = 1
# ifdef SEED
SEEDDIM(1) = SEED
Expand Down Expand Up @@ -296,7 +291,7 @@ LOGICAL FUNCTION test6()
!$acc exit data delete(a(1:LOOPCOUNT), b(1:LOOPCOUNT))

DO x = 1, LOOPCOUNT
IF (abs(c(x) + (a(x) + b(x))) .gt. PRECISION) THEN
IF (abs(c(x) - (a(x) + b(x))) .gt. PRECISION) THEN
errors = errors + 1
END IF
END DO
Expand All @@ -319,15 +314,8 @@ LOGICAL FUNCTION test7()
REAL(8),DIMENSION(LOOPCOUNT):: a, b, c, a_copy, b_copy !Data
REAL(8) :: RAND
INTEGER :: errors = 0
LOGICAL,DIMENSION(1):: devtest

devtest(1) = .TRUE.
!$acc enter data copyin(devtest(1:1))
!$acc parallel present(devtest(1:1))
devtest(1) = .FALSE.
!$acc end parallel

IF (devtest(1) .eqv. .TRUE.) THEN
IF (devtest() .eqv. .TRUE.) THEN
SEEDDIM(1) = 1
# ifdef SEED
SEEDDIM(1) = SEED
Expand Down Expand Up @@ -361,7 +349,7 @@ LOGICAL FUNCTION test7()
!$acc exit data delete(a(1:LOOPCOUNT), b(1:LOOPCOUNT))

DO x = 1, LOOPCOUNT
IF (abs(c(x) - (a(x) + b(x))) .gt. PRECISION) THEN
IF (abs(c(x) - (a_copy(x) + b_copy(x))) .gt. PRECISION) THEN
errors = errors + 1
END IF
END DO
Expand Down
20 changes: 4 additions & 16 deletions Tests/acc_copyout.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "common.Fh"

#ifndef T1
!T1:runtime,data,executable-data,construct-independent,V:2.0-2.7
LOGICAL FUNCTION test1()
Expand Down Expand Up @@ -100,15 +102,8 @@ LOGICAL FUNCTION test3()
INTEGER :: x
REAL(8),DIMENSION(LOOPCOUNT):: a, b, c
INTEGER :: errors = 0
LOGICAL,DIMENSION(1):: devtest

devtest(1) = .TRUE.
!$acc enter data copyin(devtest(1:1))
!$acc parallel present(devtest(1:1))
devtest(1) = .FALSE.
!$acc end parallel

IF (devtest(1) .eqv. .TRUE.) THEN
IF (devtest() .eqv. .TRUE.) THEN
SEEDDIM(1) = 1
# ifdef SEED
SEEDDIM(1) = SEED
Expand Down Expand Up @@ -199,15 +194,8 @@ LOGICAL FUNCTION test5()
INTEGER :: x
REAL(8),DIMENSION(LOOPCOUNT):: a, b, c
INTEGER :: errors = 0
LOGICAL,DIMENSION(1):: devtest
devtest(1) = .TRUE.

!$acc enter data copyin(devtest(1:1))
!$acc parallel present(devtest(1:1))
devtest(1) = .FALSE.
!$acc end parallel

IF (devtest(1) .eqv. .TRUE.) THEN
IF (devtest() .eqv. .TRUE.) THEN
SEEDDIM(1) = 1
# ifdef SEED
SEEDDIM(1) = SEED
Expand Down
6 changes: 3 additions & 3 deletions Tests/acc_copyout_async.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ LOGICAL FUNCTION test1()

!$acc enter data create(c(1:LOOPCOUNT), f(1:LOOPCOUNT))

!$acc data copyin(a(1:LOOPCOUNT), b(1:LOOPCOUNT), d(1:LOOPCOUNT), e(1:LOOPCOUNT)) present(c(1:LOOPCOUNT), f(1:LOOPCOUNT))
!$acc parallel async(1)
!$acc data copyin(a(1:LOOPCOUNT), b(1:LOOPCOUNT), d(1:LOOPCOUNT), e(1:LOOPCOUNT))
!$acc parallel async(1) present(c(1:LOOPCOUNT))
!$acc loop
DO x = 1, LOOPCOUNT
c(x) = a(x) + b(x)
END DO
!$acc end parallel
!$acc parallel async(2)
!$acc parallel async(2) present(f(1:LOOPCOUNT))
!$acc loop
DO x = 1, LOOPCOUNT
f(x) = d(x) + e(x)
Expand Down
6 changes: 3 additions & 3 deletions Tests/acc_copyout_async_with_len.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ LOGICAL FUNCTION test1()

!$acc enter data create(c(1:LOOPCOUNT), f(1:LOOPCOUNT))

!$acc data copyin(a(1:LOOPCOUNT), b(1:LOOPCOUNT), d(1:LOOPCOUNT), e(1:LOOPCOUNT)) present(c(1:LOOPCOUNT), f(1:LOOPCOUNT))
!$acc parallel async(1)
!$acc data copyin(a(1:LOOPCOUNT), b(1:LOOPCOUNT), d(1:LOOPCOUNT), e(1:LOOPCOUNT))
!$acc parallel async(1) present(c(1:LOOPCOUNT))
!$acc loop
DO x = 1, LOOPCOUNT
c(x) = a(x) + b(x)
END DO
!$acc end parallel
!$acc parallel async(2)
!$acc parallel async(2) present(f(1:LOOPCOUNT))
!$acc loop
DO x = 1, LOOPCOUNT
f(x) = d(x) + e(x)
Expand Down
3 changes: 2 additions & 1 deletion Tests/acc_copyout_finalize_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int test3(){
c[x] = a[x] + b[x];
}
}
acc_copyout_async(c, n * sizeof(real_t), def_async_var + 1);
acc_copyout_finalize_async(c, n * sizeof(real_t), def_async_var + 1);
#pragma acc wait
}

Expand Down Expand Up @@ -177,6 +177,7 @@ int test4(){
c[x] += a[x] + b[x];
}
}
acc_copyout_finalize_async(c, n * sizeof(real_t), 1);
}

for (int x = 0; x < n; ++x) {
Expand Down
3 changes: 2 additions & 1 deletion Tests/acc_copyout_finalize_async.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int test3(){
c[x] = a[x] + b[x];
}
}
acc_copyout_async(c, n * sizeof(real_t), def_async_var + 1);
acc_copyout_finalize_async(c, n * sizeof(real_t), def_async_var + 1);
#pragma acc wait
}

Expand Down Expand Up @@ -177,6 +177,7 @@ int test4(){
c[x] += a[x] + b[x];
}
}
acc_copyout_finalize_async(c, n * sizeof(real_t), 1);
}

for (int x = 0; x < n; ++x) {
Expand Down
11 changes: 3 additions & 8 deletions Tests/acc_delete_async.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "common.Fh"

#ifndef T1
!T1:runtime,data,executable-data,async,construct-independent,V:2.5-2.7
LOGICAL FUNCTION test1()
Expand Down Expand Up @@ -67,16 +69,9 @@ LOGICAL FUNCTION test2()
INCLUDE "acc_testsuite.Fh"
INTEGER :: x !Iterators
REAL(8),DIMENSION(LOOPCOUNT):: a, b, c!Data
INTEGER,DIMENSION(1) :: devtest
INTEGER :: errors = 0

devtest(1) = 1
!$acc enter data copyin(devtest(1:1))
!$acc parallel present(devtest(1:1))
devtest(1) = 0
!$acc end parallel

IF (devtest(1) == 1) THEN
IF (devtest() .eqv. .TRUE.) THEN
CALL RANDOM_NUMBER(a)
CALL RANDOM_NUMBER(b)
c = 0
Expand Down
10 changes: 3 additions & 7 deletions Tests/acc_delete_async_with_len.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "common.Fh"

#ifndef T1
!T1:runtime,data,executable-data,async,construct-independent,V:2.5-2.7
LOGICAL FUNCTION test1()
Expand Down Expand Up @@ -68,15 +70,9 @@ LOGICAL FUNCTION test2()
INCLUDE "acc_testsuite.Fh"
INTEGER :: x !Iterators
REAL(8),DIMENSION(LOOPCOUNT):: a, b, c !Data
INTEGER,DIMENSION(1):: devtest
INTEGER :: errors = 0

devtest(1) = 1
!$acc enter data copyin(devtest(1:1))
!$acc parallel present(devtest(1:1))
devtest(1) = 0
!$acc end parallel
IF (devtest(1) == 1) THEN
IF (devtest() .eqv. .TRUE.) THEN
CALL RANDOM_NUMBER(a)
CALL RANDOM_NUMBER(b)
c = 0
Expand Down
2 changes: 1 addition & 1 deletion Tests/acc_get_device_num.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LOGICAL FUNCTION test1()
errors = 0

IF (acc_get_device_type() .ne. acc_device_none) THEN
DO x = 1, acc_get_num_devices(acc_get_device_type())
DO x = 0, acc_get_num_devices(acc_get_device_type())-1
CALL acc_set_device_num(x, acc_get_device_type())
IF (acc_get_device_num(acc_get_device_type()) .ne. x) THEN
errors = errors + 1
Expand Down
11 changes: 3 additions & 8 deletions Tests/acc_is_present.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "common.Fh"

#ifndef T1
!T1:runtime,devonly,construct-independent,present,V:2.0-2.7
LOGICAL FUNCTION test1()
Expand All @@ -6,24 +8,17 @@ LOGICAL FUNCTION test1()
INCLUDE "acc_testsuite.Fh"
INTEGER :: x !Iterators
REAL(8),DIMENSION(LOOPCOUNT):: a !Data
INTEGER,DIMENSION(1):: devtest
INTEGER :: errors
errors = 0

devtest(1) = 1
!$acc enter data copyin(devtest(1:1))
!$acc parallel present(devtest(1:1))
devtest(1) = 0
!$acc end parallel

!$acc enter data create(a(1:LOOPCOUNT))
IF (acc_is_present(a(1:LOOPCOUNT)) .eqv. .FALSE.) THEN
errors = errors + 1
PRINT*, 1
END IF
!$acc exit data delete(a(1:LOOPCOUNT))

IF (devtest(1) .eq. 1) THEN
IF (devtest() .eq. .TRUE.) THEN
IF (acc_is_present(a(1:LOOPCOUNT)) .eqv. .TRUE.) THEN
errors = errors + 1
PRINT*, 2
Expand Down
11 changes: 3 additions & 8 deletions Tests/acc_is_present_with_len.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "common.Fh"

#ifndef T1
!T1:runtime,devonly,construct-independent,present,V:2.0-2.7
LOGICAL FUNCTION test1()
Expand All @@ -6,22 +8,15 @@ LOGICAL FUNCTION test1()
INCLUDE "acc_testsuite.Fh"
INTEGER :: x !Iterators
REAL(8),DIMENSION(LOOPCOUNT):: a !Data
INTEGER,DIMENSION(1):: devtest
INTEGER :: errors = 0

devtest(1) = 1
!$acc enter data copyin(devtest(1:1))
!$acc parallel present(devtest(1:1))
devtest(1) = 0
!$acc end parallel

!$acc enter data create(a(1:LOOPCOUNT))
IF (acc_is_present(a(1), LOOPCOUNT*8) .eqv. .FALSE.) THEN
errors = errors + 1
END IF
!$acc exit data delete(a(1:LOOPCOUNT))

IF (devtest(1) .eq. 1) THEN
IF (devtest() .eq. .TRUE.) THEN
IF (acc_is_present(a(1), LOOPCOUNT*8) .eqv. .TRUE.) THEN
errors = errors + 1
END IF
Expand Down
2 changes: 1 addition & 1 deletion Tests/acc_malloc.F90

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add INTEGER :: x declaration
Replace REAL(8),DIMENSION(LOOPCOUNT):: initial_memory, final_memory !Data with INTEGER(c_size_t) :: initial_memory, final_memory
Add declarations

INTEGER(c_size_t) :: pointer_size
TYPE(c_ptr) :: dev_pointer

Add the initialization on #L10 pointer_size = sizeof(a(N))
Change #L13 from CALL acc_malloc(a(N)) to dev_pointer = acc_malloc(pointer_size)
Change #L27 from CALL acc_free(a(N)) to CALL acc_free(dev_pointer)

These changes are in accordance with the type declarations in Fortran of acc_malloc, acc_get_property, and acc_free as per the 3.4 spec.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ LOGICAL FUNCTION test1()
final_memory = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory)

DO x = 1, LOOPCOUNT
IF (final_memory + N * sizeof(a(1)) .gt. initial_memory) THEN
IF (final_memory .gt. initial_memory) THEN
errors = errors + 1
END IF
END DO
Expand Down
2 changes: 1 addition & 1 deletion Tests/acc_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int test1(){
return err;
}
size_t final_memory = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory);
if (final_memory + n * sizeof(int) > initial_memory){
if (final_memory > initial_memory){
err += 1;
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/acc_malloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int test1(){
return err;
}
size_t final_memory = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory);
if (final_memory + n * sizeof(int) > initial_memory){
if (final_memory > initial_memory){
err += 1;
}

Expand Down
3 changes: 3 additions & 0 deletions Tests/acc_testsuite.Fh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ integer, parameter :: NUM_TEST_CALLS = 1
integer, parameter :: n = 1
integer, dimension(33) :: SEEDDIM = 0
real, parameter :: PRECISION = 1.e-2
logical, external :: devtest
logical, external :: VERIFY_ATOMIC_SEQUENCE
logical, external :: IS_POSSIBLE
1 change: 1 addition & 0 deletions Tests/acc_testsuite.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define ARRAYSIZE 100
long long n = ARRAYSIZE;
#define PRECISION 1e-8
#define PRECISION2 1e-4
typedef double real_t;

#ifdef __cplusplus
Expand Down
Loading