From patchwork Wed May 18 10:11:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 54152 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 62E023857425 for ; Wed, 18 May 2022 10:11:33 +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 9F4743858C52 for ; Wed, 18 May 2022 10:11:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F4743858C52 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="78686855" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 18 May 2022 02:11:16 -0800 IronPort-SDR: bvezT5eMR15ptadxbgdy1WNHqUlQIV3XJeLbN/4v8CatGJL2mpTmFeZ0xFhdephnyOdaViXcCW ECLOX06Uc2D/roVAhIPVHjzbB2P5oUdyDQUOci1s3jOvFydSIEfkRP6YUq/yaCTcRixC/yBOj1 hdW99hDqqF8Dk9STmIJOws8wcMDtKMDacNO3PfDQwS1DldAPCuCmnumomEvE9jjD50L5zztEMm u8ce7Cp/CaXYUj4yRVxTox2MeKKTrJP4g+qWPi0cc8ixXlWdOCw6HcSMmy6ua3BZs56IaP/jAB Aig= From: Thomas Schwinge To: Subject: 'include/cuda/cuda.h': Add parts necessary for nvptx-tools 'nvptx-run' (was: [PATCH] Allow building GCC with PTX offloading even without CUDA being installed (gcc and nvptx-tools patches)) In-Reply-To: <20170113181123.GA1867@tucnak> 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:11:08 +0200 Message-ID: <87pmkbqhfn.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-05.mgc.mentorg.com (139.181.222.5) 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+patchwork=sourceware.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 In order to be able to use that file without changes for nvptx-tools 'nvptx-run', I've pushed to GCC master branch commit 86f64400a5692499856d41462461327b93f82b8d "'include/cuda/cuda.h': Add parts necessary for nvptx-tools 'nvptx-run'", 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 86f64400a5692499856d41462461327b93f82b8d Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 29 Apr 2022 10:44:12 +0200 Subject: [PATCH] 'include/cuda/cuda.h': Add parts necessary for nvptx-tools 'nvptx-run' include/ * cuda/cuda.h (enum CUjit_option): Add 'CU_JIT_GENERATE_DEBUG_INFO', 'CU_JIT_GENERATE_LINE_INFO'. (enum CUlimit): Add 'CU_LIMIT_STACK_SIZE', 'CU_LIMIT_MALLOC_HEAP_SIZE'. (cuCtxSetLimit, cuGetErrorName): Add. --- include/cuda/cuda.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/cuda/cuda.h b/include/cuda/cuda.h index d7105fb331e..3938d05d150 100644 --- a/include/cuda/cuda.h +++ b/include/cuda/cuda.h @@ -97,7 +97,9 @@ typedef enum { CU_JIT_ERROR_LOG_BUFFER = 5, CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES = 6, CU_JIT_OPTIMIZATION_LEVEL = 7, - CU_JIT_LOG_VERBOSE = 12 + CU_JIT_GENERATE_DEBUG_INFO = 11, + CU_JIT_LOG_VERBOSE = 12, + CU_JIT_GENERATE_LINE_INFO = 13, } CUjit_option; typedef enum { @@ -117,6 +119,11 @@ enum { CU_STREAM_NON_BLOCKING = 1 }; +typedef enum { + CU_LIMIT_STACK_SIZE = 0x00, + CU_LIMIT_MALLOC_HEAP_SIZE = 0x02, +} CUlimit; + #define cuCtxCreate cuCtxCreate_v2 CUresult cuCtxCreate (CUcontext *, unsigned, CUdevice); #define cuCtxDestroy cuCtxDestroy_v2 @@ -128,6 +135,7 @@ CUresult cuCtxPopCurrent (CUcontext *); #define cuCtxPushCurrent cuCtxPushCurrent_v2 CUresult cuCtxPushCurrent (CUcontext); CUresult cuCtxSynchronize (void); +CUresult cuCtxSetLimit (CUlimit, size_t); CUresult cuDeviceGet (CUdevice *, int); #define cuDeviceTotalMem cuDeviceTotalMem_v2 CUresult cuDeviceTotalMem (size_t *, CUdevice); @@ -143,6 +151,7 @@ CUresult cuEventRecord (CUevent, CUstream); CUresult cuEventSynchronize (CUevent); CUresult cuFuncGetAttribute (int *, CUfunction_attribute, CUfunction); CUresult cuGetErrorString (CUresult, const char **); +CUresult cuGetErrorName (CUresult, const char **); CUresult cuInit (unsigned); CUresult cuDriverGetVersion (int *); CUresult cuLaunchKernel (CUfunction, unsigned, unsigned, unsigned, unsigned, -- 2.35.1