OpenACCV-V
OpenACCV-V copied to clipboard
gcc/8.2.0 compilation failures
Hi,
Trying to compile the .c test files with gcc/8.2.0, i am getting a few failures. I'd like to get your expert feedback about those failures, i.e can we explain those failure because gcc just does not support the directives used in the test code (then i'll be fine with it). If not, we may want to report to the compiler team or adapt the src code.
Undefined references:
-
acc_copyin_async
-
acc_copyout_async
-
acc_create_async
-
acc_delete_async
-
acc_get_default_async
-
acc_memcpy_from_device_async
-
acc_set_default_async
-
acc_update_device_async
-
acc_update_self_async
-
acc_free (undef acc_property_free_memory)
-
acc_get_property (undef acc_property_free_memory)
-
acc_malloc (undef acc_property_free_memory)
For instance:
cc -fopenacc -lm acc_copyin_async.c -o acc_copyin_async
acc_copyin_async.c: In function 'test':
acc_copyin_async.c:19:5: warning: implicit declaration of function 'acc_copyin_async';
did you mean 'acc_wait_async'? [-Wimplicit-function-declaration]
acc_copyin_async(a, n * sizeof(real_t), 1);
^~~~~~~~~~~~~~~~
acc_wait_async
/tmp/ccuvXq81.o:acc_copyin_async.c:function test:
error: undefined reference to 'acc_copyin_async'
'c' appears more than once
cc -fopenacc -lm acc_wait.c -o acc_wait
acc_wait.c: In function 'test':
acc_wait.c:27:13: error: 'c' appears more than once in data clauses
#pragma acc parallel present(c[0:n], d[0:n], c[0:n]) async(1) wait(2)
- acc_async_test
- acc_wait
expected ')'
cc -fopenacc -lm parallel_private.c -o parallel_private
parallel_private.c:21:49: error: expected ')' before '[' token
#pragma acc parallel num_gangs(10) private(c[0:n])
- parallel_firstprivate
- parallel_private
INTERNAL-COMPILER-ERROR
cc -fopenacc -lm acc_memcpy_to_device_async.c -o acc_memcpy_to_device_async
acc_memcpy_to_device_async.c:36:5: warning:
implicit declaration of function 'acc_memcpy_to_device_async';
did you mean 'acc_memcpy_to_device'? [-Wimplicit-function-declaration]
acc_memcpy_to_device_async(devdata, a, n * sizeof(real_t), 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~
acc_memcpy_to_device
during GIMPLE pass: omplower
acc_memcpy_to_device_async.c:89:13: internal compiler error: Segmentation fault
#pragma acc update host(hostdata[2*n:n]) async(3)
'tile' argument
cc -fopenacc -lm parallel_loop_tile.c -o parallel_loop_tile
parallel_loop_tile.c:45:40: error: 'tile' argument needs positive integral constant
#pragma acc parallel loop tile(tile_arg/10, tile_arg, tile_arg*2)
expected clause before finalize
cc -fopenacc -lm exit_data_finalize.c -o exit_data_finalize
exit_data_finalize.c:63:66: error: expected '#pragma acc' clause before 'finalize'
#pragma acc exit data delete(a[0:n], b[0:n]) copyout(c[0:n]) finalize
array section
cc -fopenacc -lm declare.c -o declare
declare.c:50:29: error: array section in '#pragma acc declare'
#pragma acc declare copyin(b[0:n])
array section is not contiguous
cc -fopenacc -lm acc_async_test_all.c -o acc_async_test_all
acc_async_test_all.c:25:34: error: array section is not contiguous in 'map' clause
#pragma acc enter data create(a[0:10][0:n], b[0:10][0:n],
c[0:10][0:n], d[0:10][0:n], e[0:10][0:n])
'c' undeclared
cc -fopenacc -lm atomic_capture_bitor_equals.c -o atomic_capture_bitor_equals
atomic_capture_bitor_equals.c:54:70: error: 'c' undeclared (first use in this function)
#pragma acc data copyin(a[0:n]) copy(totals[0:n/10 + 1]) copyout(c[0:n])
Ok, so I have addressed some of these by making changes to the tests. Thanks again for pointing these things out! The issues in described in the following sections have been fixed in the tests:
- 'c' appears more than once
- 'tile' argument
- array section
- 'c' undeclared
The rest, I believe I have explanations for their failures in some regard:
-
Undefined References: GCC has not kept up with the runtime library. It makes sense that these might go longer without being supported since they lose the benefit of using a directive based language. These are not hard to bypass by implementing them yourself by defining each one to be a function that contains the directive form of the runtime routine.
-
expected ')': GCC doesn't allow pointer array subsections as a variable in a "var-list". So when it sees the array bounds, it doesn't accept it as a proper argument to the firstprivate/private clauses. The definition for a var is found on line 3418 on page 126 in the 2.7 specifications. The variable is allowed to be a subarray specification. Section 2.7.1 describes data specification in data clauses and suggests in many ways that pointers and arrays are interchangeable in C.
-
INTERNAL-COMPILER-ERROR: This shouldn't happen. This is a compiler error, as it itself recognizes. Can't help you much here.
-
'tile' argument: I bring this one up again, because once I made the fix, It still failed to complete in my next run. There might still be an issue in it, but I didn't see anything that was readily apparent.
-
expected clause before finalize: This one I don't know. Last time I ran on GCC, it didn't recognize the finalize clause as syntactically valid. It seems to now accept it, but with some bugs. I don't think that my usage of it is incorrect.
-
array section is not contiguous: I don't think that this is an issue with me. The data seems to fit the requirements of a multidimensional array as described in lines 1086-1091, page 37 of the 2.7 specifications.