From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117567 invoked by alias); 10 Oct 2015 10:49:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 117557 invoked by uid 89); 10 Oct 2015 10:49:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 10 Oct 2015 10:49:52 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50764) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1Zkrin-0001JV-RN for gcc-patches@gnu.org; Sat, 10 Oct 2015 06:49:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zkrik-0005uf-6T for gcc-patches@gnu.org; Sat, 10 Oct 2015 06:49:49 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:61363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zkrik-0005uC-0K for gcc-patches@gnu.org; Sat, 10 Oct 2015 06:49:46 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Zkrii-0000Ez-IA from Tom_deVries@mentor.com for gcc-patches@gnu.org; Sat, 10 Oct 2015 03:49:44 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Sat, 10 Oct 2015 11:49:43 +0100 To: "gcc-patches@gnu.org" From: Tom de Vries Subject: [gomp4, committed] Add goacc/kernels-acc-on-device.c Message-ID: <5618ED1D.60906@mentor.com> Date: Sat, 10 Oct 2015 10:49:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040709080009070605040300" X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 X-SW-Source: 2015-10/txt/msg01042.txt.bz2 --------------040709080009070605040300 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 110 Hi, this patch adds a new kernels region test-case. Committed to gomp-4_0-branch as trivial. Thanks, - Tom --------------040709080009070605040300 Content-Type: text/x-patch; name="0001-Add-goacc-kernels-acc-on-device.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0001-Add-goacc-kernels-acc-on-device.c.patch" Content-length: 1203 Add goacc/kernels-acc-on-device.c 2015-10-10 Tom de Vries * c-c++-common/goacc/kernels-acc-on-device.c: New test. --- .../c-c++-common/goacc/kernels-acc-on-device.c | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/goacc/kernels-acc-on-device.c diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-acc-on-device.c b/gcc/testsuite/c-c++-common/goacc/kernels-acc-on-device.c new file mode 100644 index 0000000..e9e93c7 --- /dev/null +++ b/gcc/testsuite/c-c++-common/goacc/kernels-acc-on-device.c @@ -0,0 +1,39 @@ +/* { dg-additional-options "-O2" } */ + +#include + +#define N 32 + +void +foo (float *a, float *b) +{ + float exp; + int i; + int n; + +#pragma acc kernels copyin(a[0:N]) copyout(b[0:N]) + { + int ii; + + for (ii = 0; ii < N; ii++) + { + if (acc_on_device (acc_device_host)) + b[ii] = a[ii] + 1; + else + b[ii] = a[ii]; + } + } + +#pragma acc kernels copyin(a[0:N]) copyout(b[0:N]) + { + int ii; + + for (ii = 0; ii < N; ii++) + { + if (acc_on_device (acc_device_host)) + b[ii] = a[ii] + 2; + else + b[ii] = a[ii]; + } + } +} -- 1.9.1 --------------040709080009070605040300--