diff mbox series

[og9] Fix libgomp serial-dims.c test for AMD GCN

Message ID 20191016190751.70236-1-julian@codesourcery.com
State New
Headers show
Series [og9] Fix libgomp serial-dims.c test for AMD GCN | expand

Commit Message

Julian Brown Oct. 16, 2019, 7:07 p.m. UTC
This patch adds support for AMD GCN offloading to the
libgomp.oacc-c-c++-common/serial-dims.c test case.

I will apply to the og9 branch shortly.

Thanks,

Julian

ChangeLog

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/serial-dims.c: Support AMD GCN.
---
 libgomp/testsuite/libgomp.oacc-c-c++-common/serial-dims.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/serial-dims.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/serial-dims.c
index 3895405b2cf..e373ebd37b7 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/serial-dims.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/serial-dims.c
@@ -69,6 +69,13 @@  int main ()
 	  /* The GCC nvptx back end enforces vector_length (32).  */
 	  vectors_actual = 32;
 	}
+      else if (acc_on_device (acc_device_gcn))
+	{
+	  /* AMD GCN relies on the autovectorizer for the vector dimension:
+	     the loop below isn't likely to be vectorized, so vectors_actual
+	     is effectively 1.  */
+	  vectors_actual = 1;
+	}
       else if (!acc_on_device (acc_device_host))
 	__builtin_abort ();
 #pragma acc loop gang \