From patchwork Wed Aug 8 14:27:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 955077 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-483399-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="FJlDUa7D"; 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 41ltyj73V2z9s3Z for ; Thu, 9 Aug 2018 00:27:57 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=VIw8Mc+hmhsvJ5IUOWApge2ZCR7+TQhOsJx/1SaMJZigOAubVD9Gv NDYeOCTBOZV20qeO3kBocmdcbFyvdhtVoJ7FxwrABQhl9NjecbGQMPgAKH1/cNG5 CoBtQuu5mOERJ3s3igpzJwT+JU5HcF7cZlVjYjRsQXYrf5QoadcOOY= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=EFFLCoZKKeG6CdNM7dmmClxc0eo=; b=FJlDUa7D/dWCIoXZGrSc 3iWIbteYX3422BCGb2IuwP72GVXcly9meF1m8YDQKxY45LGHXrc7JfTBlMU6phb5 5k+hfY6PBpWbVc5jJINy9YrsOf502zZqZ98XNuGw0fn3aWeNKncC+Rsc1aVlTlY/ pIRuu7TfBMpNf9+Erq3dQBY= Received: (qmail 128403 invoked by alias); 8 Aug 2018 14:27:50 -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 127328 invoked by uid 89); 8 Aug 2018 14:27:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.2 spammy=7000 X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Aug 2018 14:27:43 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 80F62AE9E for ; Wed, 8 Aug 2018 14:27:41 +0000 (UTC) Date: Wed, 8 Aug 2018 16:27:42 +0200 From: Tom de Vries To: gcc-patches@gcc.gnu.org Subject: [committed][libgomp, nvptx] Note that cuGetErrorString is in CUDA_VERSION >= 6000 Message-ID: <20180808142740.GA22444@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, Cuda driver api function cuGetErrorString is available in version 6.0 and higher. This patch: - removes a comment saying the declaration is not available in cuda.h 6.0 - fixes the presence test to use CUDA_VERSION < 6000 - moves the declaration to toplevel Build on x86_64 with nvptx accelerator and reg-tested libgomp. Committed to trunk. Thanks, - Tom [libgomp, nvptx] Note that cuGetErrorString is in CUDA_VERSION >= 6000 2018-08-08 Tom de Vries * plugin/plugin-nvptx.c (cuda_error): Move declaration of cuGetErrorString ... (cuGetErrorString): ... here. Guard with CUDA_VERSION < 6000. --- libgomp/plugin/plugin-nvptx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index 825470adce3e..e2ea542049b0 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -49,6 +49,10 @@ #include #include +#if CUDA_VERSION < 6000 +extern CUresult cuGetErrorString (CUresult, const char **); +#endif + #define DO_PRAGMA(x) _Pragma (#x) #if PLUGIN_NVPTX_DYNAMIC @@ -156,11 +160,6 @@ init_cuda_lib (void) static const char * cuda_error (CUresult r) { -#if CUDA_VERSION < 7000 - /* Specified in documentation and present in library from at least - 5.5. Not declared in header file prior to 7.0. */ - extern CUresult cuGetErrorString (CUresult, const char **); -#endif const char *desc; r = CUDA_CALL_NOCHECK (cuGetErrorString, r, &desc);