From patchwork Wed May 18 10:08:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1632723 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=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L37xG5btkz9sBB for ; Wed, 18 May 2022 20:08:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B0AA63858C52 for ; Wed, 18 May 2022 10:08:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 5C6753858C51 for ; Wed, 18 May 2022 10:08:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5C6753858C51 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.91,234,1647331200"; d="scan'208,223";a="78686783" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 18 May 2022 02:08:32 -0800 IronPort-SDR: zsC82xjtJl7a3dCQZlJdOqhWSwzsOBrDu3aSG7MJM5leIKpteYDUboduPWAo2NYoW3Q/aIS/7k c0+kccjzv8PIBTv+NqVuIe7i4HD8vyig7yMEJwx9Z+21XCv1xZkdo7U9ObeKQfgIIFJNGSm+gt 7OGDb7kpO7+caQ/TzfSjhxR4vgAkMoShGWNLA0eBmOAqZOW1a0Z4sKCfQZK9YbhTRZybio3NM2 /EuzA5t/26Mk+CDrrn3D16qJkKfaMvY2ghO0W89vMDGY+380lBDGJhgZYd0liTz6hX7GLPEfbx M7E= From: Thomas Schwinge To: Subject: 'include/cuda/cuda.h': For C++, wrap in 'extern "C"' (was: [PATCH] Allow building GCC with PTX offloading even without CUDA being installed (gcc and nvptx-tools patches)) References: <20170113181123.GA1867@tucnak> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Wed, 18 May 2022 12:08:24 +0200 Message-ID: <87r14rqhk7.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi! On 2017-01-13T19:11:23+0100, Jakub Jelinek wrote: > cuda.h header included > in this patch To make this '#include'able in C++ code, I've pushed to master branch commit bdd1dc1bfbe1492edf3ce5e4288cfbc55be329ab "'include/cuda/cuda.h': For C++, wrap in 'extern "C"'", see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From bdd1dc1bfbe1492edf3ce5e4288cfbc55be329ab Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 29 Apr 2022 10:33:15 +0200 Subject: [PATCH] 'include/cuda/cuda.h': For C++, wrap in 'extern "C"' include/ * cuda/cuda.h: For C++, wrap in 'extern "C"'. --- include/cuda/cuda.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/cuda/cuda.h b/include/cuda/cuda.h index 5c813ad2cf8..d7105fb331e 100644 --- a/include/cuda/cuda.h +++ b/include/cuda/cuda.h @@ -32,6 +32,10 @@ the proprietary CUDA toolkit. */ #define CUDA_VERSION 8000 +#ifdef __cplusplus +extern "C" { +#endif + typedef void *CUcontext; typedef int CUdevice; #if defined(__LP64__) || defined(_WIN64) @@ -191,4 +195,8 @@ CUresult cuStreamQuery (CUstream); CUresult cuStreamSynchronize (CUstream); CUresult cuStreamWaitEvent (CUstream, CUevent, unsigned); +#ifdef __cplusplus +} +#endif + #endif /* GCC_CUDA_H */ -- 2.35.1