From patchwork Sat Jan 12 22:21:24 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: 1024004 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-493945-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="qbC/qVlP"; 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 43cZ2W4qtCz9s7T for ; Sun, 13 Jan 2019 09:21:20 +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=q5ImsYtynbQ27+DQITKrHQrc4QdglvbcjYxf3x0cAfnMMGMkJV2lr lzfXt9d2VKqftiV2UPj18JM8xl0HXvd0Ya6jumgshwP6pdxDRIyRO718y9sbWjSU h9t7BslV0AKwD5p5oiuq6pHeGil3nAnX93NPx59cFJ+1XGqDtn+siY= 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=xfxliSUocoNWahKj88SdKuWnmPU=; b=qbC/qVlPdjO6auD+fkll hBOlkPESHaZ2AjRhALtIC9VZszJ1lrlZBAKSm7YwL8/3ehlrBYj7oAcUNiSJk3XF zmaCR3QLlv+tAp7FDQQoL9NUNUvL/YG6+pEWxMf/nBjP9KBiPLL6z8oC1IkQGCQi 8r0TpcsaS7xme28lw5FHNw0= Received: (qmail 103824 invoked by alias); 12 Jan 2019 22:21:12 -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 103814 invoked by uid 89); 12 Jan 2019 22:21:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy= 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; Sat, 12 Jan 2019 22:21:11 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5CAF8AC66; Sat, 12 Jan 2019 22:21:09 +0000 (UTC) From: Tom de Vries To: gcc-patches@gcc.gnu.org Cc: Thomas Schwinge Subject: [PATCH 2/9] [nvptx] Update insufficient launch message for variable vector_length Date: Sat, 12 Jan 2019 23:21:24 +0100 Message-Id: <20190112222131.29519-3-tdevries@suse.de> In-Reply-To: <20190112222131.29519-1-tdevries@suse.de> References: <20190112222131.29519-1-tdevries@suse.de> X-IsSubscribed: yes Update message in nvptx libgomp plugin about insufficient resources to launch kernel, to accommodate for the fact the vector_length can now be variable. 19-01-08 Tom de Vries * plugin/plugin-nvptx.c (nvptx_exec): Update insufficient hardware resources diagnostic. --- libgomp/plugin/plugin-nvptx.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index c80da64c422..8912660966a 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -1297,14 +1297,16 @@ nvptx_exec (void (*fn), size_t mapnum, void **hostaddrs, void **devaddrs, if (dims[GOMP_DIM_WORKER] * dims[GOMP_DIM_VECTOR] > targ_fn->max_threads_per_block) { - int suggest_workers - = targ_fn->max_threads_per_block / dims[GOMP_DIM_VECTOR]; - GOMP_PLUGIN_fatal ("The Nvidia accelerator has insufficient resources to" - " launch '%s' with num_workers = %d; recompile the" - " program with 'num_workers = %d' on that offloaded" - " region or '-fopenacc-dim=:%d'", - targ_fn->launch->fn, dims[GOMP_DIM_WORKER], - suggest_workers, suggest_workers); + const char *msg + = ("The Nvidia accelerator has insufficient resources to launch '%s'" + " with num_workers = %d and vector_length = %d" + "; " + "recompile the program with 'num_workers = x and vector_length = y'" + " on that offloaded region or '-fopenacc-dim=:x:y' where" + " x * y <= %d" + ".\n"); + GOMP_PLUGIN_fatal (msg, targ_fn->launch->fn, dims[GOMP_DIM_WORKER], + dims[GOMP_DIM_VECTOR], targ_fn->max_threads_per_block); } /* Check if the accelerator has sufficient barrier resources to