From patchwork Thu Nov 14 16:36:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 1194959 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-513435-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="SebuXrze"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47DRvs1qFdz9sP4 for ; Fri, 15 Nov 2019 03:36:55 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=K7Ripaa3a50DtGEq8bdPwWmuV3jQULr9yom3dPgXqCj3sQfPx4 as0wbdYQ71bfd43YEFET6URQ3fGzV1PwKZoy7twiYRs2bSMcYMttTJSeC/b/yx3S ZyLbVTY5Rc7jLUo6ysRivgZKC21f/5j5Vx6QhVbsq/ivMfbqmAsLZwGRQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=hsvBpg4ER997LMCdninRp9A8r6k=; b=SebuXrze01kKhtn3gHR2 Mr2uxvb7WnUXISh/5qRkqYewjDg3TJZ/nRICvTm18g1jN1Mo56KwJeHWGHWjhHw8 bghePetFbw+hawlnRQgrRGs40Kd0Y2llx1NObLAPJnr08rtdC2VyxJPxQNSMqCYS yHjk+ebAe18K2l4cZ3w1j+4= Received: (qmail 74276 invoked by alias); 14 Nov 2019 16:36:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 74268 invoked by uid 89); 14 Nov 2019 16:36:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=cexp, 3169, device X-HELO: esa2.mentor.iphmx.com Received: from esa2.mentor.iphmx.com (HELO esa2.mentor.iphmx.com) (68.232.141.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Nov 2019 16:36:45 +0000 IronPort-SDR: syuwpse8l8SDYyXvryB3tVCF5HYeUhCMqBQheSFtz6KWj37+OibcFsrOCZfXfLs3AYvGpo6mKG d8GLcgJe6HuQKIIAuOuM54fj15+ghXi2PBZsT+fCvkhoayu7XRSjCw0UeSPSyv1ydkY5kCrOye xsmMqTqbMpGN0eENEMNx0vZjrCjeSMR4Za/FVWMa8Si9vBh9nEKexPmmbYujkn59El1yaoybtV E5d93QD2cGVHdqvVErRte370uoQGPJpXkmqVzVobh+BwzP6D2FsBA2ATk5vf2zSVphfcfFsH5K ek4= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 14 Nov 2019 08:36:44 -0800 IronPort-SDR: K2IPLFYyyPVDD1GWmsq8qcOB48Km6RSBHtm7FhqPHrzuQR3Sr1kFaLucNtFpjcTS9F1qxbJJKF izWHIRT8cidakVg2uKKGdbhOHhnpMEYAjM0WI+1mXYRwDYxNJrqpN89yO3UzDcj+yKGa5sFOTr +q57BAxNmpT6koz61joTTfqKtCBmYRdO0z2Riu+gjl0ZvjToJ9soNzao19j/8dpd6VJx/NHC+w ROk4BadJngNVyXAUugM91GgDhvyDXi7aJp9MzKwlX7sjiRoCLeQKaAAlGtqrhxnSzFF2X96PY6 Dyg= To: "gcc-patches@gcc.gnu.org" From: Andrew Stubbs Subject: [patch, libgomp] Enable OpenACC GCN testing Message-ID: <737bd55b-e1fb-97cf-2a50-837a39cb6075@codesourcery.com> Date: Thu, 14 Nov 2019 16:36:38 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 Hi, This patch adds some necessary bits to enable OpenACC testings for amdgcn offloading. The two "check_effective" procedures are not actually needed yet, but later patches to test cases will use them. OK to commit? Thanks Andrew Enable OpenACC GCN testing. 2019-11-14 Andrew Stubbs libgomp/ * testsuite/lib/libgomp.exp (offload_target_to_openacc_device_type): Recognize amdgcn. (check_effective_target_openacc_amdgcn_accel_present): New proc. (check_effective_target_openacc_amdgcn_accel_selected): New proc. * testsuite/libgomp.oacc-c++/c++.exp: Set acc_mem_shared for amdgcn. * testsuite/libgomp.oacc-c/c.exp: Likewise. * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise. diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 14d9b5f1305..802c6ea275f 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -316,6 +316,9 @@ proc offload_target_to_openacc_device_type { offload_target } { nvptx* { return "nvidia" } + amdgcn* { + return "gcn" + } default { error "Unknown offload target: $offload_target" } @@ -444,3 +447,28 @@ proc check_effective_target_hsa_offloading_selected {} { check_effective_target_hsa_offloading_selected_nocache }] } +# Return 1 if at least one AMD GCN board is present. + +proc check_effective_target_openacc_amdgcn_accel_present { } { + return [check_runtime openacc_amdgcn_accel_present { + #include + int main () { + return !(acc_get_num_devices (acc_device_gcn) > 0); + } + } "" ] +} + +# Return 1 if at least one AMD GCN board is present, and the AMD GCN device +# type is selected by default. + +proc check_effective_target_openacc_amdgcn_accel_selected { } { + if { ![check_effective_target_openacc_amdgcn_accel_present] } { + return 0; + } + global offload_target + if { [string match "amdgcn*" $offload_target] } { + return 1; + } + return 0; +} + diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp index dcefa792ca4..b2502a5f94c 100644 --- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp +++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp @@ -106,6 +106,9 @@ if { $lang_test_file_found } { set acc_mem_shared 0 } + gcn { + set acc_mem_shared 0 + } default { error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)" } diff --git a/libgomp/testsuite/libgomp.oacc-c/c.exp b/libgomp/testsuite/libgomp.oacc-c/c.exp index 55cd40f1e99..420237eafe9 100644 --- a/libgomp/testsuite/libgomp.oacc-c/c.exp +++ b/libgomp/testsuite/libgomp.oacc-c/c.exp @@ -69,6 +69,9 @@ foreach offload_target [concat [split $offload_targets ","] "disable"] { set acc_mem_shared 0 } + gcn { + set acc_mem_shared 0 + } default { error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)" } diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp index 852f372b319..1a731dd4c24 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp +++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp @@ -94,6 +94,9 @@ if { $lang_test_file_found } { set acc_mem_shared 0 } + gcn { + set acc_mem_shared 0 + } default { error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)" }