From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 610EB3856963 for ; Mon, 26 Sep 2022 09:15:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 610EB3856963 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x32b.google.com with SMTP id n40-20020a05600c3ba800b003b49aefc35fso3342983wms.5 for ; Mon, 26 Sep 2022 02:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=5kW6krEErmzuesLqEFyjkbSPsfd9FWs4gttLJa359r0=; b=H4FZkJiYh82EVAmBYftIU+LEqnHLKv2BCewuBDhgfoZR7gNnWRLyhmO6eS6dPlL9b0 Rsu/SNMPkdfYjj2p9nJzU2D5BPReDxgw1IuMNIRbIAfnn77PE8FEku+8z8eqwhQZ/hKg KSBvHLwwjmi31tNzh+Wo6H2LF2kG+dPTsDLYDOwkO88nQr8Xze6etiN8Auq+hFr0wSaP Sog5hFBDLji1dI87H0le9Aeed8Pk7yJchRUyuuEi9btZJMrBsU+qrq9lL108lN+m8HyH ARrBoY6aos/hrW6joyfXE1BBh2JnTRb3h5gsbOksA5KrVzmqN+K0bjUkBJC2L4Uu37uh a/1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=5kW6krEErmzuesLqEFyjkbSPsfd9FWs4gttLJa359r0=; b=v6YKsRuIvD/mVymyvw8pNr5A8r25DJxTDAgozcvx4X0a91i1W/l+Gq45mrERV2VY4T O3OUB7n0T+fnJZkgpor55LKOa5RSGBh76uj+rV2i50BXtP0brrgLv5FKZfDpA1qvc5lP ZjP0nS2JyU6vR2pQp9IYqIGeNMER3gnCW3LmpM64ISLHNoBxZ+XJIm2bBFzuN02VBGcf EUy2+QaeAHEt9D0jg8278Qb8rRoLWNG/tSkKRSmJHf0yvZS2tpynYX186Rf3KIPl0CgZ LFuTk2hGM2Dq1Y5l7ThN9CtIWLmeRt/6fsEtm1iBFsGOgujykOIurUA6akHXndploI3j 9ldQ== X-Gm-Message-State: ACrzQf0NbhgsOLFvoJdSiS+y783OP7WrXKz3CMDug3m5dxp9zyAPA0wv qogwgttMH5Wfl9a/Yk47CPhcHhQ6d3ZeHg== X-Google-Smtp-Source: AMsMyM7QU/DdoVd6shpcF465x1C8tNnW9wzJ5oeD6LmJhHHv3FO6R6fiRp/3LuMmAiOXB38SA+7NXA== X-Received: by 2002:a05:600c:3d13:b0:3b4:be25:9236 with SMTP id bh19-20020a05600c3d1300b003b4be259236mr14371996wmb.65.1664183724998; Mon, 26 Sep 2022 02:15:24 -0700 (PDT) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id cc16-20020a5d5c10000000b0021e4829d359sm14179334wrb.39.2022.09.26.02.15.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 02:15:24 -0700 (PDT) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Steve Baird Subject: [COMMITED] ada: Improve CUDA host-side and device-side binder support Date: Mon, 26 Sep 2022 11:15:22 +0200 Message-Id: <20220926091522.273508-1-poulhies@adacore.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Steve Baird Binder-generated code is not allowed to use Ada2012 syntax. In order to specify an aspect, a pragma must be used. gcc/ada/ * bindgen.adb: When the binder is invoked for the device, specify the CUDA_Global aspect for the adainit and adafinal procedures via a pragma instead of via an aspect_specification. --- gcc/ada/bindgen.adb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index b2fa44d2dff..f2aaa2dea92 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -134,9 +134,6 @@ package body Bindgen is -- Text for aspect specifications (if any) given as part of the -- Adainit and Adafinal spec declarations. - function Aspect_Text return String is - (if Enable_CUDA_Device_Expansion then " with CUDA_Global" else ""); - ---------------------------------- -- Interface_State Pragma Table -- ---------------------------------- @@ -2644,10 +2641,11 @@ package body Bindgen is end if; WBI (""); - WBI (" procedure " & Ada_Init_Name.all & Aspect_Text & ";"); + WBI (" procedure " & Ada_Init_Name.all & ";"); if Enable_CUDA_Device_Expansion then WBI (" pragma Export (C, " & Ada_Init_Name.all & ", Link_Name => """ & Device_Ada_Init_Link_Name & """);"); + WBI (" pragma CUDA_Global (" & Ada_Init_Name.all & ");"); else WBI (" pragma Export (C, " & Ada_Init_Name.all & ", """ & Ada_Init_Name.all & """);"); @@ -2662,11 +2660,12 @@ package body Bindgen is if not Cumulative_Restrictions.Set (No_Finalization) then WBI (""); - WBI (" procedure " & Ada_Final_Name.all & Aspect_Text & ";"); + WBI (" procedure " & Ada_Final_Name.all & ";"); if Enable_CUDA_Device_Expansion then WBI (" pragma Export (C, " & Ada_Final_Name.all & ", Link_Name => """ & Device_Ada_Final_Link_Name & """);"); + WBI (" pragma CUDA_Global (" & Ada_Final_Name.all & ");"); else WBI (" pragma Export (C, " & Ada_Final_Name.all & ", """ & Ada_Final_Name.all & """);"); -- 2.25.1