From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113490 invoked by alias); 8 Jan 2019 17:42:27 -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 113456 invoked by uid 89); 8 Jan 2019 17:42:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_STOCKGEN,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Request, preserved, HTo:U*macro, sk:changel X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Jan 2019 17:42:22 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1ggvOO-0000Bf-2S from Thomas_Schwinge@mentor.com ; Tue, 08 Jan 2019 09:42:20 -0800 Received: from hertz.schwinge.homeip.net (137.202.0.90) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Tue, 8 Jan 2019 17:42:16 +0000 From: Thomas Schwinge To: "Maciej W. Rozycki" , CC: Chung-Lin Tang , Jakub Jelinek , Catherine Moore Subject: Re: [PATCH, og8] Add OpenACC 2.6 `acc_get_property' support In-Reply-To: References: User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Tue, 08 Jan 2019 17:42:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2019-01/txt/msg00423.txt.bz2 --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-length: 723 Hi Maciej! On Mon, 3 Dec 2018 16:51:14 +0000, "Maciej W. Rozycki" wrote: > Add generic support for the OpenACC 2.6 `acc_get_property' and=20 > `acc_get_property_string' routines, as well as full handlers for the=20 > host and the NVPTX offload targets and a minimal handler for the HSA=20 > offload target. ..., but a similar minimal handler for the Intel MIC offload plugin missing. ;-) (... which "for reasons" doesn't live in "libgomp/plugin/", next to the other plugins.) To fix that, I pushed the attached to openacc-gcc-8-branch, with the code copied and adjusted from your minimal handler for the HSA offload target, but also with an additional TODO added. Gr=C3=BC=C3=9Fe Thomas --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-Add-OpenACC-2.6-acc_get_property-support-restore-Int.patch" Content-length: 2549 >From c632bd83096f1a4e4ed59161797087ff800e4c23 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 8 Jan 2019 15:21:35 +0100 Subject: [PATCH] Add OpenACC 2.6 `acc_get_property' support: restore Intel MIC offloading The "OpenACC 2.6 `acc_get_property' support" changes regressed the relevant libgomp OpenMP execution test cases to no longer consider Intel MIC offloading because of: libgomp: while loading libgomp-plugin-intelmic.so.1: [...]/libgomp-plugin-intelmic.so.1: undefined symbol: GOMP_OFFLOAD_get_property liboffloadmic/ * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_get_property): New function. --- liboffloadmic/ChangeLog.openacc | 10 +++++++++ .../plugin/libgomp-plugin-intelmic.cpp | 21 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 liboffloadmic/ChangeLog.openacc diff --git a/liboffloadmic/ChangeLog.openacc b/liboffloadmic/ChangeLog.openacc new file mode 100644 index 000000000000..2e666da2ce0c --- /dev/null +++ b/liboffloadmic/ChangeLog.openacc @@ -0,0 +1,10 @@ +2019-01-08 Thomas Schwinge + + * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_get_property): + New function. + +Copyright (C) 2019 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. diff --git a/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp b/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp index d1678d0514e9..f74941c2b549 100644 --- a/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp +++ b/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp @@ -174,6 +174,27 @@ GOMP_OFFLOAD_get_num_devices (void) return num_devices; } +extern "C" union gomp_device_property_value +GOMP_OFFLOAD_get_property (int n, int prop) +{ + union gomp_device_property_value nullval = { .val = 0 }; + + if (n >= num_devices) + { + GOMP_PLUGIN_error + ("Request for a property of a non-existing Intel MIC device %i", n); + return nullval; + } + + switch (prop) + { + case GOMP_DEVICE_PROPERTY_VENDOR: + return (union gomp_device_property_value) { .ptr = /* TODO: "error: invalid conversion from 'const void*' to 'void*' [-fpermissive]" */ (char *) "Intel" }; + default: + return nullval; + } +} + static bool offload (const char *file, uint64_t line, int device, const char *name, int num_vars, VarDesc *vars, const void **async_data) -- 2.17.1 --=-=-=--