From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 941D9386F81B; Fri, 9 Oct 2020 08:36:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 941D9386F81B From: "amonakov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/97203] [nvptx] 'illegal memory access was encountered' with 'omp simd'/SIMT and cexpf call Date: Fri, 09 Oct 2020 08:36:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: openmp, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: amonakov at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2020 08:36:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97203 Alexander Monakov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amonakov at gcc dot gnu.org --- Comment #6 from Alexander Monakov --- (In reply to Tom de Vries from comment #4) > So, I think calling functions from simd code is atm not supported for nvp= tx. >=20 > Stack variables in simd code are mapped on a per-thread stack rather than= on > the > usual per-warp stack. >=20 > The functions are compiled with the usual per-warp stack, so calling those > functions from simd might mean the different lanes are gonna disagree abo= ut > what the value in a stack variable should be. This is inaccurate. In -msoft-stack mode there's no baked-in assumption that stacks are always per-warp. The "soft stack" pointer can point either to gl= obal memory (outside of SIMD regions), or to local memory (inside SIMD regions).= The pointer is switched between per-warp global memory and per-lane local memor= y by nvptx.c:nvptx_output_softstack_switch. The main requirement is that functions callable from OpenMP offloaded code = are compiled for -mgomp multilib variant. The design allows calling functions e= ven from inside SIMD regions, and it should be supported. It is very disappointing that the first reaction was "I think ... is not supported" without reaching out and asking questions. Lack of efficient communication was a huge issue when OpenMP offloading support was contribut= ed, and it's disappointing to see it again years later.=