From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 292D93858C2C; Tue, 23 Nov 2021 14:27:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 292D93858C2C From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/103384] New: [OpenMP] declare variant with device={kind(nohost)} does not use GPU, kind(gpu) works Date: Tue, 23 Nov 2021 14:27:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: openmp, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc target_milestone attachments.created Message-ID: 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: Tue, 23 Nov 2021 14:27:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103384 Bug ID: 103384 Summary: [OpenMP] declare variant with device=3D{kind(nohost)} does not use GPU, kind(gpu) works Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: openmp, wrong-code Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- Created attachment 51861 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51861&action=3Dedit Testcase, fails as is (if omp_get_num_devices() > 0) and '{kind(nohost)}' - works when later is changed to "match(device=3D{kind(gpu)})" Observed with https://github.com/SOLLVE/sollve_vv/blob/master/tests/5.0/declare_target/te= st_declare_target_device_type_nohost.c For that testcase with nvptx offloading, with #pragma omp declare variant(target_function) match(device=3D{kind(gpu)}) target_function() is called and the code is executed on the GPU (value a[0] =3D 5 (host function 'update') + 1 (device function 'target_function') =3D=3D 6). However, using kind(nohost), i.e. #pragma omp declare variant(target_function) match(device=3D{kind(nohost)= }) will *not* execute 'target_function' (thus: a[0] =3D=3D 10 =3D 2*5 (host fu= nction 'update'). Expected: both {kind(nohost)} and {kind(gpu)} are executed on the GPU.=