From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 152B538515FF for ; Mon, 12 Sep 2022 08:19:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 152B538515FF 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-wr1-x433.google.com with SMTP id k9so14123855wri.0 for ; Mon, 12 Sep 2022 01:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date; bh=ExNfc8crnPWDcab3UrcNXBjtTXp/lkueN7ze1I47ssA=; b=ezAmcCoBmSr5S6UQH4c2T6PkBiPxJVv0R6Rf+ci03HreL5cJQbgP0XVSK2nIfqrFAl +gsSTVRyNay2nEqopmbuVZS8MinCbBWvHprdo1RNHr2t354kHPUoPqCwyt7Q6fCk7f33 rgnTftCXEEIIcMLxMPN2uivPof0k0JMz2LvC2R4T4kUd3Ca9UKJd6O9v6RFofWROn21k YIc5uAu8q470SbetCGMMqOXSbpTyg28K1DzF8u2+N2pnLHQeh783TLx5EXSOxP5W8/LJ ASs5AWhBNEDFMaEs7q3/6MnD52+Dnu3a8eTOM/Qi8FaMxbKITXxR1WJopMmEOoY0kmRg dwRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=ExNfc8crnPWDcab3UrcNXBjtTXp/lkueN7ze1I47ssA=; b=19kdOHdPVYpahAkKOdkjayUlKzbnDh6PJH+zszo9TYuoLplrYOfAlbUPvLW4i/Anne hEPJMtj+pQTJeOaFTzOd7aKJDJXYAYhBgq3bUac/udX330SEwh5BtLika3Ci6+u/hciG YiG0oICRHKsO2u9iQkyQeZmfA5w3LI7rIniiBGi7NJYqBOJAAS6MrQgQLtgKuYICNiCh m2TDIFtqUmyQ0iPB5S89JtnFCkJpYI0SzXDrtX/4KZwRit1SE5glmq1f5pIurn6DMeDl kpN3aMKIKhFnBy4suWVY2utUTpjYIhPA49gxlb2duzGiEpD3YvL7zaHAuISI9ZHZn+CF XOdg== X-Gm-Message-State: ACgBeo1oMGlTSF2keeJpl9PQ6IKWjnJzSR/m1B/dzRf5woAhHXhNa0pV MITuDaqs2nxcfCilYkiHl+LRoBF1J3ic5w== X-Google-Smtp-Source: AA6agR4pDdadiRDZu7kU7h1jndYgePY+zbbG78O9ISZKZKA7urqiy8dB8t6SD5Tgy1uILTHXDoPcbQ== X-Received: by 2002:adf:d22f:0:b0:228:75b0:90c9 with SMTP id k15-20020adfd22f000000b0022875b090c9mr14140662wrh.490.1662970785001; Mon, 12 Sep 2022 01:19:45 -0700 (PDT) Received: from poulhies-Precision-5550 (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id o22-20020a05600c511600b003a5b6086381sm9138924wms.48.2022.09.12.01.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 01:19:44 -0700 (PDT) Date: Mon, 12 Sep 2022 10:19:43 +0200 From: Marc =?iso-8859-1?Q?Poulhi=E8s?= To: gcc-patches@gcc.gnu.org Cc: Steve Baird Subject: [Ada] Improve CUDA host-side and device-side binder support Message-ID: <20220912081943.GA1513147@poulhies-Precision-5550> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline X-Spam-Status: No, score=-12.9 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,T_SCC_BODY_TEXT_LINE 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: --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On the host-side, the binder now generates CUDA_Execute pragmas to invoke initialization and finalization on the device-side. The front end's expansion of these pragmas includes references to entities declared in package CUDA.Internal. Generate a with-clause so that unit will be available. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * bindgen.adb: When the binder is invoked for the host, generate a "with CUDA.Internal;" with clause. --HcAYCG3uE/tztfnV Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -2552,6 +2552,9 @@ package body Bindgen is if Enable_CUDA_Expansion then WBI ("with Interfaces.C;"); WBI ("with Interfaces.C.Strings;"); + + -- with of CUDA.Internal needed for CUDA_Execute pragma expansion + WBI ("with CUDA.Internal;"); end if; Resolve_Binder_Options (Elab_Order); --HcAYCG3uE/tztfnV--