From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1823 invoked by alias); 21 Jun 2018 13:58:15 -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 1808 invoked by uid 89); 21 Jun 2018 13:58:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1040, H*r:0700 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; Thu, 21 Jun 2018 13:58:13 +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 1fW06F-0000ib-0R from Cesar_Philippidis@mentor.com ; Thu, 21 Jun 2018 06:58:11 -0700 Received: from [127.0.0.1] (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; Thu, 21 Jun 2018 06:58:08 -0700 Subject: Re: [patch] adjust default nvptx launch geometry for OpenACC offloaded regions To: Tom de Vries CC: "gcc-patches@gcc.gnu.org" , Jakub Jelinek References: <7864b0d0-b39f-713b-9d5c-13e91c11bd55@suse.de> From: Cesar Philippidis Message-ID: <0034e0fb-402e-8681-0f62-3fd274d00a99@codesourcery.com> Date: Thu, 21 Jun 2018 13:58:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <7864b0d0-b39f-713b-9d5c-13e91c11bd55@suse.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-SW-Source: 2018-06/txt/msg01317.txt.bz2 On 06/20/2018 03:15 PM, Tom de Vries wrote: > On 06/20/2018 11:59 PM, Cesar Philippidis wrote: >> Now it follows the formula contained in >> the "CUDA Occupancy Calculator" spreadsheet that's distributed with CUDA. > > Any reason we're not using the cuda runtime functions to get the > occupancy (see PR85590 - [nvptx, libgomp, openacc] Use cuda runtime fns > to determine launch configuration in nvptx ) ? There are two reasons: 1) cuda_occupancy.h depends on the CUDA runtime to extract the device properties instead of the CUDA driver API. However, we can always teach libgomp how to populate the cudaDeviceProp struct using the driver API. 2) CUDA is not always present on the build host, and that's why libgomp maintains its own cuda.h. So at the very least, this functionality would be good to have in libgomp as a fallback implementation; its not good to have program fail due to insufficient hardware resources errors when it is avoidable. Cesar