From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 306A13858D37 for ; Wed, 2 Mar 2022 15:12:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 306A13858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mentor.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.90,149,1643702400"; d="scan'208,217";a="72472781" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 02 Mar 2022 07:12:34 -0800 IronPort-SDR: npcuI9sJDjvGU5csfeE3qmuagZx0e+g88mbpcEyFj5uDS9ZnS+vtEezoIJrHqaR89cW0xGrEEP 1XnS7EPSaPzO4ZtI289+sHupp6B5TGyzHajt0PunjlKWMAR0kcFH1mMEwpwhsQIc1k1rj3s0fb M+nWhoa4TEYzPBAvfluiiktcnZS6NUVaX/s6uSqJ2MdONmak1E7x6miahpTB9x1/VztyWjGcMR 3z/Wp2twZ0HaR2i7nm2riEm2EdddJqNfKRg5MN9qpHYkkdH01tIftnspAVYY5LCPdFLz/3kd6d 6ao= From: "Stubbs, Andrew" To: Jakub Jelinek , "gcc@gcc.gnu.org" Subject: OpenMP auto-simd Thread-Topic: OpenMP auto-simd Thread-Index: AdguP7ccSXQ1uzq1SFe+HdKUP8TCfw== Date: Wed, 2 Mar 2022 15:12:30 +0000 Message-ID: <2213264c2c5c467fb491f71051173873@svr-ies-mbx-01.mgc.mentorg.com> Accept-Language: en-GB, en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [137.202.0.90] MIME-Version: 1.0 X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, HTML_MESSAGE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2022 15:12:36 -0000 Hi Jakub, all, Has anyone ever considered having GCC add the "simd" clause to offload (or = regular) loop nests automatically? For example, something like "-fomp-auto-simd" would transform "distribute p= arallel" to "distribute parallel simd" automatically. Loop nests that alrea= dy contain "simd" clauses or directives would remain unchanged, most likely= . The reason I ask is that other toolchains have chosen to use a "SIMT" model= for GPUs, which means that OpenMP threads map to individual vector lanes a= nd are therefore are strictly scalar. The result is that the "simd" directi= ve is irrelevant and lots of code out there isn't using it at all (so I'm t= old). Meanwhile, in GCC we map OpenMP threads to Nvidia warps and AMD GCN w= avefronts, so it is impossible to get full performance without explicitly s= pecifying the "simd" directive. We therefore suffer in direct comparisons. I'm of the opinion that GCC is the one implementing OpenMP as intended, but= all the same I need to explore our options here, figure out what the conse= quences would be, and plan a project to do what we can. I've thought of simply enabling "-ftree-vectorize" on AMD GCN (this doesn't= help NVPTX) but I think that is sub-optimal because things like the OpenMP= scheduler really need to be aware of the vector size, and there's probably= other ways in which parallel regions can be better formed with regard to t= he vectorizer. If these features don't exist right now then I have an oppor= tunity to include them in our upcoming project. Any info/suggestions/advice would be appreciated. Thanks Andrew