gcc/libgomp/testsuite/libgomp.oacc-c-c++-common
Tom de Vries e0451f93d9 [nvptx] Add some support for .local atomics
The ptx insn atom doesn't support local memory.  In case of doing an atomic
operation on local memory, we run into:
...
operation not supported on global/shared address space
...
This is the cuGetErrorString message for CUDA_ERROR_INVALID_ADDRESS_SPACE.

The message is somewhat confusing given that actually the operation is not
supported on local address space.

Fix this by falling back on a non-atomic version when detecting
a frame-related memory operand.

This only solves some cases that are detected at compile-time.  It does
however fix the openacc private-atomic-* test-cases.

Tested on x86_64 with nvptx accelerator.

gcc/ChangeLog:

2022-01-27  Tom de Vries  <tdevries@suse.de>

	* config/nvptx/nvptx.md (define_insn "atomic_compare_and_swap<mode>_1")
	(define_insn "atomic_exchange<mode>")
	(define_insn "atomic_fetch_add<mode>")
	(define_insn "atomic_fetch_addsf")
	(define_insn "atomic_fetch_<logic><mode>"): Output non-atomic version
	if memory operands is frame-relative.

gcc/testsuite/ChangeLog:

2022-01-31  Tom de Vries  <tdevries@suse.de>

	* gcc.target/nvptx/stack-atomics-run.c: New test.

libgomp/ChangeLog:

2022-01-27  Tom de Vries  <tdevries@suse.de>

	* testsuite/libgomp.oacc-c-c++-common/private-atomic-1.c: Remove
	PR83812 workaround.
	* testsuite/libgomp.oacc-fortran/private-atomic-1-vector.f90: Same.
	* testsuite/libgomp.oacc-fortran/private-atomic-1-worker.f90: Same.
2022-02-01 19:28:24 +01:00
..
2018-06-22 12:04:14 +02:00
2018-06-22 12:04:14 +02:00
2018-06-22 12:04:14 +02:00
2018-06-22 12:04:14 +02:00
2021-04-26 12:32:00 +02:00
2019-10-02 21:05:35 +02:00
2022-01-21 18:45:30 +01:00
2022-01-21 18:45:30 +01:00
2019-12-19 00:10:08 +01:00
2019-12-19 00:10:08 +01:00
2019-12-19 00:10:08 +01:00
2019-12-19 00:10:08 +01:00
2019-12-19 00:10:08 +01:00
2021-04-26 12:32:00 +02:00
2021-04-26 12:32:00 +02:00
2018-06-22 12:04:14 +02:00
2018-06-22 12:04:14 +02:00
2018-06-22 12:04:14 +02:00
2021-04-26 12:32:00 +02:00
2022-01-19 08:27:00 +01:00
2021-04-26 12:32:00 +02:00
2018-08-02 15:59:01 +00:00
2021-04-26 12:32:00 +02:00
2021-07-21 23:58:11 +02:00