diff mbox

[gomp4] Fix libgomp-oacc.c/lib-66.c testcase

Message ID 545CD051.9020407@mentor.com
State New
Headers show

Commit Message

Tom de Vries Nov. 7, 2014, 1:59 p.m. UTC
On 04-11-14 23:46, Tom de Vries wrote:
> Thomas,
>
> This patch fixes the libgomp-oacc.c/lib-66.c testcase.
>
> It allows the test to run for non-shared mem accelerators, and skips the test
> otherwise.
>

Fixed path in log message (testsuite/libgomp.oacc-c/lib-66.c -> 
testsuite/libgomp.oacc-c-c++-common/lib-66.c).

ok for gomp-4_0-branch?

Thanks,
- Tom

Comments

Thomas Schwinge Nov. 7, 2014, 4:09 p.m. UTC | #1
Hi Tom!

On Fri, 7 Nov 2014 14:59:45 +0100, Tom de Vries <Tom_deVries@mentor.com> wrote:
> On 04-11-14 23:46, Tom de Vries wrote:
> > This patch fixes the libgomp-oacc.c/lib-66.c testcase.
> >
> > It allows the test to run for non-shared mem accelerators, and skips the test
> > otherwise.

> 2014-11-03  Tom de Vries  <tom@codesourcery.com>
> 
> 	* testsuite/libgomp.oacc-c-c++-common/lib-66.c: Skip for shared memory
> 	accelerators.
> 	(main):  Use acc_device_default instead of acc_device_nvidia.

OK, thanks!

One note:

> --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-66.c
> +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-66.c
> @@ -1,4 +1,5 @@
>  /* { dg-do run } */
> +/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
>  
>  #include <string.h>
>  #include <stdlib.h>
> @@ -12,7 +13,7 @@ main (int argc, char **argv)
>    unsigned char *h;
>    void *d;
>  
> -  acc_init (acc_device_nvidia);
> +  acc_init (acc_device_default);

It doesn't hurt, but initializing with acc_device_default is the default
anyway.  But, you can keep this, to make sure that we actually do support
this.

>  
>    h = (unsigned char *) malloc (N);
>  
> @@ -41,7 +42,7 @@ main (int argc, char **argv)
>  
>    free (h);
>  
> -  acc_shutdown (acc_device_nvidia);
> +  acc_shutdown (acc_device_default);
>  
>    return 0;
>  }


Grüße,
 Thomas
diff mbox

Patch

2014-11-03  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/lib-66.c: Skip for shared memory
	accelerators.
	(main):  Use acc_device_default instead of acc_device_nvidia.
---
 libgomp/testsuite/libgomp.oacc-c-c++-common/lib-66.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-66.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-66.c
index 360c05b..398dc2a 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-66.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/lib-66.c
@@ -1,4 +1,5 @@ 
 /* { dg-do run } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
 
 #include <string.h>
 #include <stdlib.h>
@@ -12,7 +13,7 @@  main (int argc, char **argv)
   unsigned char *h;
   void *d;
 
-  acc_init (acc_device_nvidia);
+  acc_init (acc_device_default);
 
   h = (unsigned char *) malloc (N);
 
@@ -41,7 +42,7 @@  main (int argc, char **argv)
 
   free (h);
 
-  acc_shutdown (acc_device_nvidia);
+  acc_shutdown (acc_device_default);
 
   return 0;
 }
-- 
1.9.1