From patchwork Sat Jan 12 22:21:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 1024010 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-493951-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="UaIvCtrj"; 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 43cZ3t0w4Bz9sCh for ; Sun, 13 Jan 2019 09:22:33 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=oeq7DIKdzJEI1AYuRXrsTisitGkOK5oPNaoQjZo2b/eszhllP6Rm8 NhwHwlRHEUeanXP+wS237gyIBkqDivCPPsC7jKBlWdvNke/n9VoMe/2daox6029R TXP/fyrakph1FBJxzZQvCKtH1l6Atk2FxO/XlTAcwbI7nQOUDYSHco= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=qB/Bb4LimY+qB4KklegHMHWkU3U=; b=UaIvCtrjtZVyNOBwQRpk ZDc2K0v9bZWVzVpVUYuiuOBgJRlmbFmju6w2DwZIcVwr3xIJkpdd8gYLQUPO/8w+ aBuisA0TF9+sb7j+0k02DdIzC8rzqYDARrmtOT6n1c7/p99fUNqCHumAjxatBslj Luiu1Xo5CxUlCPGHm4tFHLU= Received: (qmail 104767 invoked by alias); 12 Jan 2019 22:21:18 -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 104717 invoked by uid 89); 12 Jan 2019 22:21:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=HX-detected-operating-system:timestamps X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 12 Jan 2019 22:21:16 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giReU-0007FC-6w for gcc-patches@gcc.gnu.org; Sat, 12 Jan 2019 17:21:14 -0500 Received: from mx2.suse.de ([195.135.220.15]:52524 helo=mx1.suse.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giReU-0007EH-0o for gcc-patches@gcc.gnu.org; Sat, 12 Jan 2019 17:21:14 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D880DAE63; Sat, 12 Jan 2019 22:21:10 +0000 (UTC) From: Tom de Vries To: gcc-patches@gcc.gnu.org Cc: Thomas Schwinge Subject: [PATCH 8/9] [nvptx] Enable setting vector length using -fopenacc-dim Date: Sat, 12 Jan 2019 23:21:30 +0100 Message-Id: <20190112222131.29519-9-tdevries@suse.de> In-Reply-To: <20190112222131.29519-1-tdevries@suse.de> References: <20190112222131.29519-1-tdevries@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 X-IsSubscribed: yes Enable setting vector length using -fopenacc-dim, f.i. -fopenacc-dim=::128. 2019-01-12 Tom de Vries * config/nvptx/nvptx.c (nvptx_goacc_validate_dims_1): Alow setting vector length using -fopenacc-dim. * plugin/plugin-nvptx.c (nvptx_exec): Update error message. --- gcc/config/nvptx/nvptx.c | 3 ++- libgomp/plugin/plugin-nvptx.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 8d2740cd50f..03c0f82f4a2 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -5705,7 +5705,8 @@ nvptx_goacc_validate_dims_1 (tree decl, int dims[], int fn_level, unsigned used) if (oacc_default_dims_p) { - dims[GOMP_DIM_VECTOR] = default_vector_length; + if (dims[GOMP_DIM_VECTOR] < 0) + dims[GOMP_DIM_VECTOR] = default_vector_length; if (dims[GOMP_DIM_WORKER] < 0) dims[GOMP_DIM_WORKER] = PTX_DEFAULT_RUNTIME_DIM; if (dims[GOMP_DIM_GANG] < 0) diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index 8912660966a..dd2bcf3083f 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -1321,7 +1321,7 @@ nvptx_exec (void (*fn), size_t mapnum, void **hostaddrs, void **devaddrs, " region or '-fopenacc-dim=:x:' where x <= 15" "; " "or, recompile the program with 'vector_length = 32' on that" - " offloaded region" + " offloaded region or '-fopenacc-dim=::32'" ".\n"); GOMP_PLUGIN_fatal (msg, targ_fn->launch->fn, dims[GOMP_DIM_WORKER], dims[GOMP_DIM_VECTOR]);