From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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 22:21:00 -0000 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 X-SW-Source: 2019-01/txt/msg00714.txt.bz2 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 -- 2.16.4