From patchwork Wed Dec 11 12:47:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1207640 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515694-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="w1GtoaRy"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47XxYQ4pFfz9sPh for ; Wed, 11 Dec 2019 23:48:08 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=w1R8rwazH6wEeGVb/6/4kO30MVwmQ5Dhv9+jTqbXKmZ4GECFoo /HS5zXuMwzjB0LevkpJwFB6H2b5KrrLHgDFfIEWdHceD1i96glGcUjcnDLG5thOB 6KLH3roLqt92W35T3ptsHVlQGgs3ecojPMUThUyA798fHFCdAxeaO4cqc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=NBZ7mCiguxuctcGzs/Wxs9GgXOU=; b=w1GtoaRyx/cVGp/zBL9u hy7nrouK1742768VXxNX/qghyHf9Iif4ZDLK650Yt1XKubv+Z6vjUXKP0zD0rETt UZK8i/5wE4mJyfDwu3smKIqoHlVi08xmJ9mD7fJNmjXVftA3hKVPsumIQWhVW8in 1kPCheMeZO0JpNqCE9Cx41s= Received: (qmail 50106 invoked by alias); 11 Dec 2019 12:48:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 50086 invoked by uid 89); 11 Dec 2019 12:48:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.8 required=5.0 tests=AWL, BAYES_00, GARBLED_SUBJECT, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=PUBLIC, cleans, exclude X-HELO: esa4.mentor.iphmx.com Received: from esa4.mentor.iphmx.com (HELO esa4.mentor.iphmx.com) (68.232.137.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Dec 2019 12:47:59 +0000 IronPort-SDR: r7aQZsJJxQME9VCGHU40aBhBVj6CIODWZTc5nE/CLUu8j0/RXpHY70ecz2fUjq2KTnZ1OKwCnY gL736b1Uo6yZ8NBeiQN2s0oqQpruNTibaNU3G7WJS8GlUrqjz7FG6kDqUWUlhwAbHZTnbdSGhQ u/VBY11sm9FkCk+WtRLW22enG3LSthzm7/xCk2PNK33TGk7KyM3ec3V3pg78UbNuk7GcmngwEZ GiKZO5/esjjPFnwWj8YgTOy4TuGVhcDYWXzjde0oNXetu+tLBk6+NdDK6hnzp85t5s2P7kbMoZ 44E= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 11 Dec 2019 04:47:57 -0800 IronPort-SDR: lj27I+/b+29tMv+bhfiGuE1iXNxRkwl5cJWrK45jRIOIVjKfw2qy4rdoWLeMInA6JmnLp7E1ZY lEgIl3zQ/VCcH0utjOnc84yWoF5wW7JcaCAo+Q6mtINXyz9/HKOpzxkbjnbgG0PUWS+1I25Emt OwsxoNsSJlhZOvBcz3AJAo24puCJJWhYwr3QiQFzc/TKNc0My1nmdH9qz0dZTpkZqtm4NnnMCi V3oQZBFJKefvY+mjl/YqDclT0kyKw8ncxrtS0QVkWqsmjAL9wnut/zsm3lwh4F3xwUByaxlouH d8E= To: gcc-patches , fortran , Thomas Schwinge From: Tobias Burnus Subject: =?utf-8?q?=5Bpatch=5D_libgomp/openacc=2Ef90_=E2=80=93_clean-up_p?= =?utf-8?q?ublic/private_attributes?= Message-ID: <2ac801b8-4dc4-62bc-10d8-e222af3bc304@codesourcery.com> Date: Wed, 11 Dec 2019 13:47:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 X-IsSubscribed: yes This patch cleans up the public/private handling in libgomp/openacc.f90: * module openacc_kinds marked symbols explicitly as public and private (but default is public). Make this explicit by a 'PUBLIC' and remove the (redundant) explicit 'public :: ' lines. * 'module openacc' had a bunch of 'public :: ' lines but the default was already 'public'. Changed this to 'private' and marked the use-associated 'openacc_kinds' symbols as 'public' and added 'public' statements for the two missing items. (Net effect: this will hide all openacc_internal symbols.) I think this patch is rather obvious. Nonetheless: are the comments? (If not, I will commit it in the next days.) Tobias PS: I found the two missing symbols by looking at the 'interface ' lines; 'module openacc' has only those + the version symbol. PPS: I have filled PR 92913 as gfortran feature request to compare the 'interface' block's procedure declarations with the actual procedure declarations outside of the modules; as, unfortunately, no argument-mismatch check exists, currently. 2019-12-11 Tobias Burnus libgomp/ * openacc.f90 (module openacc_kinds): Use 'PUBLIC' to mark all symbols as public except for the 'use …, only' imported symbol, which is private. (module openacc): Default to 'PRIVATE' to exclude openacc_internal; mark all symbols from module openacc_kinds as PUBLIC; add missing PUBLIC attributes for acc_copyout_finalize and acc_delete_finalize. diff --git a/libgomp/openacc.f90 b/libgomp/openacc.f90 index 831a157e703..b37f1872d50 100644 --- a/libgomp/openacc.f90 +++ b/libgomp/openacc.f90 @@ -31,13 +31,12 @@ module openacc_kinds use iso_fortran_env, only: int32 implicit none + public private :: int32 - public :: acc_device_kind - integer, parameter :: acc_device_kind = int32 + ! When adding items, also update 'public' setting in 'module openmp' below. - public :: acc_device_none, acc_device_default, acc_device_host - public :: acc_device_not_host, acc_device_nvidia + integer, parameter :: acc_device_kind = int32 ! Keep in sync with include/gomp-constants.h. integer (acc_device_kind), parameter :: acc_device_none = 0 @@ -48,16 +47,11 @@ module openacc_kinds integer (acc_device_kind), parameter :: acc_device_nvidia = 5 integer (acc_device_kind), parameter :: acc_device_gcn = 8 - public :: acc_handle_kind - integer, parameter :: acc_handle_kind = int32 - public :: acc_async_noval, acc_async_sync - ! Keep in sync with include/gomp-constants.h. integer (acc_handle_kind), parameter :: acc_async_noval = -1 integer (acc_handle_kind), parameter :: acc_async_sync = -2 - end module module openacc_internal @@ -717,6 +711,13 @@ module openacc use openacc_internal implicit none + private + ! From openacc_kinds + public :: acc_device_kind, acc_handle_kind + public :: acc_device_none, acc_device_default, acc_device_host + public :: acc_device_not_host, acc_device_nvidia, acc_device_gcn + public :: acc_async_noval, acc_async_sync + public :: openacc_version public :: acc_get_num_devices, acc_set_device_type, acc_get_device_type @@ -730,6 +731,7 @@ module openacc public :: acc_update_device, acc_update_self, acc_is_present public :: acc_copyin_async, acc_create_async, acc_copyout_async public :: acc_delete_async, acc_update_device_async, acc_update_self_async + public :: acc_copyout_finalize, acc_delete_finalize integer, parameter :: openacc_version = 201306