1 # This whole file adapted from libgomp.c
/c.exp.
3 if [info exists lang_library_path
] then {
4 unset lang_library_path
7 if [info exists lang_test_file
] then {
10 if [info exists lang_include_flags
] then {
11 unset lang_include_flags
14 load_lib libgomp
-dg.exp
15 load_gcc_lib gcc
-dg.exp
17 #
If a testcase doesn
't have special options, use these.
18 if ![info exists DEFAULT_CFLAGS] then {
19 set DEFAULT_CFLAGS "-O2"
26 # XXX (TEMPORARY): Remove the -flto once that's properly integrated.
27 lappend ALWAYS_CFLAGS
"additional_flags=-fopenacc -flto"
29 # Gather a list of all tests.
30 set tests
[lsort
[find $srcdir
/$subdir
*.c
]]
32 set ld_library_path $always_ld_library_path
33 append ld_library_path
[gcc
-set-multilib
-library
-path $GCC_UNDER_TEST
]
34 set_ld_library_path_env_vars
36 # Todo
: get list of accelerators from configure options
--enable
-accelerator.
37 set accels
{ "nvidia" "host_nonshm" }
39 # Run
on host
(or fallback
) accelerator.
42 # Test OpenACC with available accelerators.
43 set SAVE_ALWAYS_CFLAGS
"$ALWAYS_CFLAGS"
44 foreach accel $accels
{
45 set ALWAYS_CFLAGS
"$SAVE_ALWAYS_CFLAGS"
46 set tagopt
"-DACC_DEVICE_TYPE_$accel=1"
48 # Todo
: Determine shared memory or not using run
-time test.
57 # Copy ptx file
(TEMPORARY
)
58 remote_download host $srcdir
/libgomp.oacc
-c
/subr.ptx
61 lappend ALWAYS_CFLAGS
"additional_flags=-I${srcdir}"
68 set tagopt
"$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
70 # Todo
: Verify that this works
for both local and remote testing.
71 setenv ACC_DEVICE_TYPE $accel
73 dg
-runtest $tests
"$tagopt" $DEFAULT_CFLAGS