From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83899 invoked by alias); 24 Jul 2018 20:47:25 -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 83766 invoked by uid 89); 24 Jul 2018 20:47:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=areas X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Jul 2018 20:47:23 +0000 Received: from svr-orw-mbx-01.mgc.mentorg.com ([147.34.90.201]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1fi4DK-0006di-Ad from Cesar_Philippidis@mentor.com ; Tue, 24 Jul 2018 13:47:22 -0700 Received: from m3800.philippidis.net (147.34.91.1) by svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Tue, 24 Jul 2018 13:47:20 -0700 From: To: , Subject: [PATCH 01/11] [nvptx] Update openacc dim macros Date: Tue, 24 Jul 2018 20:47:00 -0000 Message-ID: <58cceded37d28f7c41002d4b69b6bc0489f25368.1532464999.git.cesar@codesourcery.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-07/txt/msg01430.txt.bz2 From: Cesar Philippidis Besides for updating the macros for the NVPTX OpenACC dims, this patch also renames PTX_GANG_DEFAULT to PTX_DEFAULT_RUNTIME_DIM. I had originally included the PTX_GANG_DEFAULT hunk in an earlier libgomp patch, but going forward it makes sense to isolate the nvptx and libgomp changes when possible, which this patch series does. 2018-XX-YY Cesar Philippidis gcc/ config/nvptx/nvptx.c (PTX_GANG_DEFAULT): Rename to PTX_DEFAULT_RUNTIME_DIM. * (PTX_VECTOR_LENGTH, PTX_WORKER_LENGTH, PTX_DEFAULT_RUNTIME_DIM): Move to the top of the file. (PTX_WARP_SIZE): Define. (PTX_CTA_SIZE): Define. (nvptx_simt_vf): Return PTX_WARP_SIZE instead of PTX_VECTOR_LENGTH. (nvptx_goacc_validate_dims): Use PTX_DEFAULT_RUNTIME_DIM. diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 5608bee..521f83e 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -81,6 +81,13 @@ #define WORKAROUND_PTXJIT_BUG_2 1 #define WORKAROUND_PTXJIT_BUG_3 1 +/* Define dimension sizes for known hardware. */ +#define PTX_VECTOR_LENGTH 32 +#define PTX_WORKER_LENGTH 32 +#define PTX_DEFAULT_RUNTIME_DIM 0 /* Defer to runtime. */ +#define PTX_WARP_SIZE 32 +#define PTX_CTA_SIZE 1024 + /* The various PTX memory areas an object might reside in. */ enum nvptx_data_area { @@ -5161,18 +5168,13 @@ nvptx_expand_builtin (tree exp, rtx target, rtx ARG_UNUSED (subtarget), default: gcc_unreachable (); } } - -/* Define dimension sizes for known hardware. */ -#define PTX_VECTOR_LENGTH 32 -#define PTX_WORKER_LENGTH 32 -#define PTX_GANG_DEFAULT 0 /* Defer to runtime. */ /* Implement TARGET_SIMT_VF target hook: number of threads in a warp. */ static int nvptx_simt_vf () { - return PTX_VECTOR_LENGTH; + return PTX_WARP_SIZE; } /* Validate compute dimensions of an OpenACC offload or routine, fill @@ -5216,7 +5218,7 @@ nvptx_goacc_validate_dims (tree decl, int dims[], int fn_level) if (dims[GOMP_DIM_WORKER] < 0) dims[GOMP_DIM_WORKER] = PTX_WORKER_LENGTH; if (dims[GOMP_DIM_GANG] < 0) - dims[GOMP_DIM_GANG] = PTX_GANG_DEFAULT; + dims[GOMP_DIM_GANG] = PTX_DEFAULT_RUNTIME_DIM; changed = true; } -- 2.7.4