From patchwork Fri Apr 1 11:24:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 52569 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CC0113858D28 for ; Fri, 1 Apr 2022 11:25:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC0113858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1648812312; bh=EXbnL6TawZkt82K/QMebfgmZFfPv3tAQj0n9zzHKvfc=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=bkjpaqeMRrogwqsBE3wlAzA/CsrQDsC5i8AF646+/jmqzwaX1jwYwPquwFBz5cGdr UKLGqpMmoS1NptX3yOFQC0yl3Jbt1LAudjyRCo7fQLMBLS0TbC4W/x/gJCQ/ULZ5ci +LuP+5hEMBOlhvEWeyNkp9u+WDDNSjHJNDeqynYg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 8D25D3858D28 for ; Fri, 1 Apr 2022 11:24:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8D25D3858D28 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8BC7C21A91; Fri, 1 Apr 2022 11:24:42 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6F64F132C1; Fri, 1 Apr 2022 11:24:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Xo7uGfrgRmLLFwAAMHmgww (envelope-from ); Fri, 01 Apr 2022 11:24:42 +0000 Date: Fri, 1 Apr 2022 13:24:40 +0200 To: gcc-patches@gcc.gnu.org Subject: [PATCH][libgomp, testsuite, nvptx] Limit recursion in declare_target-{1,2}.f90 Message-ID: <20220401112438.GA19247@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_NONE, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gcc-patches From: Tom de Vries Reply-To: Tom de Vries Cc: Jakub Jelinek , Thomas Schwinge Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi, When running testcases libgomp.fortran/examples-4/declare_target-{1,2}.f90 on an RTX A2000 (sm_86) with driver 510.60.02 and with GOMP_NVPTX_JIT=-O0 I run into: ... FAIL: libgomp.fortran/examples-4/declare_target-1.f90 -O0 \ -DGOMP_NVPTX_JIT=-O0 execution test FAIL: libgomp.fortran/examples-4/declare_target-2.f90 -O0 \ -DGOMP_NVPTX_JIT=-O0 execution test ... Fix this by further limiting recursion depth in the test-cases for nvptx. Furthermore, make the recursion depth limiting nvptx-specific. Tested on x86_64 with nvptx accelerator. Any comments? Thanks, - Tom [libgomp, testsuite, nvptx] Limit recursion in declare_target-{1,2}.f90 libgomp/ChangeLog: 2022-04-01 Tom de Vries * testsuite/libgomp.fortran/examples-4/declare_target-1.f90: Define and use REC_DEPTH. * testsuite/libgomp.fortran/examples-4/declare_target-2.f90: Same. --- .../libgomp.fortran/examples-4/declare_target-1.f90 | 18 +++++++++++++----- .../libgomp.fortran/examples-4/declare_target-2.f90 | 20 ++++++++++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-1.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-1.f90 index b761979ecde..03c5c53ed67 100644 --- a/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-1.f90 +++ b/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-1.f90 @@ -1,4 +1,16 @@ ! { dg-do run } +! { dg-additional-options "-cpp" } +! Reduced from 25 to 23, otherwise execution runs out of thread stack on +! Nvidia Titan V. +! Reduced from 23 to 22, otherwise execution runs out of thread stack on +! Nvidia T400 (2GB variant), when run with GOMP_NVPTX_JIT=-O0. +! Reduced from 22 to 20, otherwise execution runs out of thread stack on +! Nvidia RTX A2000 (6GB variant), when run with GOMP_NVPTX_JIT=-O0. +! { dg-additional-options "-DREC_DEPTH=20" { target { offload_target_nvptx } } } */ + +#ifndef REC_DEPTH +#define REC_DEPTH 25 +#endif module e_53_1_mod integer :: THRESHOLD = 20 @@ -27,9 +39,5 @@ end module program e_53_1 use e_53_1_mod, only : fib, fib_wrapper if (fib (15) /= fib_wrapper (15)) stop 1 - ! Reduced from 25 to 23, otherwise execution runs out of thread stack on - ! Nvidia Titan V. - ! Reduced from 23 to 22, otherwise execution runs out of thread stack on - ! Nvidia T400 (2GB variant), when run with GOMP_NVPTX_JIT=-O0. - if (fib (22) /= fib_wrapper (22)) stop 2 + if (fib (REC_DEPTH) /= fib_wrapper (REC_DEPTH)) stop 2 end program diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-2.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-2.f90 index f576c25ba39..0e8bea578a8 100644 --- a/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-2.f90 +++ b/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-2.f90 @@ -1,16 +1,24 @@ ! { dg-do run } +! { dg-additional-options "-cpp" } +! Reduced from 25 to 23, otherwise execution runs out of thread stack on +! Nvidia Titan V. +! Reduced from 23 to 22, otherwise execution runs out of thread stack on +! Nvidia T400 (2GB variant), when run with GOMP_NVPTX_JIT=-O0. +! Reduced from 22 to 18, otherwise execution runs out of thread stack on +! Nvidia RTX A2000 (6GB variant), when run with GOMP_NVPTX_JIT=-O0. +! { dg-additional-options "-DREC_DEPTH=18" { target { offload_target_nvptx } } } */ + +#ifndef REC_DEPTH +#define REC_DEPTH 25 +#endif program e_53_2 !$omp declare target (fib) integer :: x, fib !$omp target map(from: x) - ! Reduced from 25 to 23, otherwise execution runs out of thread stack on - ! Nvidia Titan V. - ! Reduced from 23 to 22, otherwise execution runs out of thread stack on - ! Nvidia T400 (2GB variant), when run with GOMP_NVPTX_JIT=-O0. - x = fib (22) + x = fib (REC_DEPTH) !$omp end target - if (x /= fib (22)) stop 1 + if (x /= fib (REC_DEPTH)) stop 1 end program integer recursive function fib (n) result (f)