From patchwork Thu May 2 10:06:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1930576 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Vo7ucxUa; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VVV373lPcz20fb for ; Thu, 2 May 2024 20:06:59 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B08B93858416 for ; Thu, 2 May 2024 10:06:57 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A93253858D34 for ; Thu, 2 May 2024 10:06:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A93253858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A93253858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714644400; cv=none; b=T89TD5Jk0Vs+b1ng2Zt0Y/mlitsv08/bcPdXIi5RMaY8TPQJ3NA5BGz5mpkTF5xYMIOc+ARy7JSX+ZXLC58yem+IluS0TKkNjwPzRw+Gzx6qYD/f7a0gMGn7qC/1BGvq1IVN0g0KjAMzOzSmhYpDKTLD+CPTHW7hOZDcfbiTN6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714644400; c=relaxed/simple; bh=IIuILuYTMDcq1yQsKuFC7w8tiNZwD0pXqox+HFwC20c=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=GoIdBgyoJU2GwhcEeP3oeaV4Oeo7kjEhBc8YYwJ7wPzahKEPNXUcXghsNpArGBK5Pt7mCyZw9GQoPKK/X1pVMt6S9E6McmiG7NIQGReczdyrUz+44qolfaYZStwMYQVxSsOmeQl9MkJBYdb7PPk6Ozhf+HtFhxpNnZlER07b7TE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714644398; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=XxDmvcjiZXSGlk23fIjnsPjSPBMjlJltQt9nACu7xes=; b=Vo7ucxUaDNHEOMaIIaoWRY7CuViQmmbyZI0lEm/zjmzkkyMnWj8UkSH9itJMUsEDe86A62 JrPmgFPOsIdGy8uXHCd4q8h39nHOOdBgpFWPIw8W7mfvqiXsGfiOE7G0CzRghGjDGmkZtY pNLKWLxtkFCdfDr5a+fiTKLSxUPHfts= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-650-C27z0xi4PW63_0kRQiuthw-1; Thu, 02 May 2024 06:06:36 -0400 X-MC-Unique: C27z0xi4PW63_0kRQiuthw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 709C53C108C1; Thu, 2 May 2024 10:06:36 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.224.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D7DC492BC7; Thu, 2 May 2024 10:06:36 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 442A6YqC1753272 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 2 May 2024 12:06:35 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 442A6Y7t1753271; Thu, 2 May 2024 12:06:34 +0200 Date: Thu, 2 May 2024 12:06:34 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Cc: Tobias Burnus Subject: [committed] libgomp: Add gfx90c, 1036 and 1103 declare variant tests Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! Recently -march=gfx{90c,1036,1103} support has been added, but corresponding changes weren't done in the testsuite. The following patch adds that. Tested on x86_64-linux (with fiji and gfx1103 devices; had to use OMP_DEFAULT_DEVICE=1 there, fiji doesn't really work due to LLVM dropping support, but we still list those as offloading devices). Committed to trunk. 2024-05-02 Jakub Jelinek * testsuite/libgomp.c/declare-variant-4.h (gfx90c, gfx1036, gfx1103): New functions. (f): Add #pragma omp declare variant directives for those. * testsuite/libgomp.c/declare-variant-4-gfx90c.c: New test. * testsuite/libgomp.c/declare-variant-4-gfx1036.c: New test. * testsuite/libgomp.c/declare-variant-4-gfx1103.c: New test. Jakub --- libgomp/testsuite/libgomp.c/declare-variant-4.h.jj 2024-01-29 12:11:57.917149306 +0100 +++ libgomp/testsuite/libgomp.c/declare-variant-4.h 2024-05-02 11:41:42.579379273 +0200 @@ -37,6 +37,13 @@ gfx90a (void) __attribute__ ((noipa)) int +gfx90c (void) +{ + return 0x90c; +} + +__attribute__ ((noipa)) +int gfx1030 (void) { return 0x1030; @@ -44,11 +51,25 @@ gfx1030 (void) __attribute__ ((noipa)) int +gfx1036 (void) +{ + return 0x1036; +} + +__attribute__ ((noipa)) +int gfx1100 (void) { return 0x1100; } +__attribute__ ((noipa)) +int +gfx1103 (void) +{ + return 0x1103; +} + #ifdef USE_FIJI_FOR_GFX803 #pragma omp declare variant(gfx803) match(device = {isa("fiji")}) #else @@ -58,8 +79,11 @@ gfx1100 (void) #pragma omp declare variant(gfx906) match(device = {isa("gfx906")}) #pragma omp declare variant(gfx908) match(device = {isa("gfx908")}) #pragma omp declare variant(gfx90a) match(device = {isa("gfx90a")}) +#pragma omp declare variant(gfx90c) match(device = {isa("gfx90c")}) #pragma omp declare variant(gfx1030) match(device = {isa("gfx1030")}) +#pragma omp declare variant(gfx1036) match(device = {isa("gfx1036")}) #pragma omp declare variant(gfx1100) match(device = {isa("gfx1100")}) +#pragma omp declare variant(gfx1103) match(device = {isa("gfx1103")}) __attribute__ ((noipa)) int f (void) --- libgomp/testsuite/libgomp.c/declare-variant-4-gfx90c.c.jj 2024-05-02 11:38:57.272597106 +0200 +++ libgomp/testsuite/libgomp.c/declare-variant-4-gfx90c.c 2024-05-02 11:39:11.169410657 +0200 @@ -0,0 +1,8 @@ +/* { dg-do link { target { offload_target_amdgcn } } } */ +/* { dg-additional-options -foffload=amdgcn-amdhsa } */ +/* { dg-additional-options -foffload=-march=gfx90c } */ +/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */ + +#include "declare-variant-4.h" + +/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx90c \\(\\);" "optimized" } } */ --- libgomp/testsuite/libgomp.c/declare-variant-4-gfx1036.c.jj 2024-05-02 11:39:29.393166162 +0200 +++ libgomp/testsuite/libgomp.c/declare-variant-4-gfx1036.c 2024-05-02 11:39:51.834865074 +0200 @@ -0,0 +1,8 @@ +/* { dg-do link { target { offload_target_amdgcn } } } */ +/* { dg-additional-options -foffload=amdgcn-amdhsa } */ +/* { dg-additional-options -foffload=-march=gfx1036 } */ +/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */ + +#include "declare-variant-4.h" + +/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx1036 \\(\\);" "optimized" } } */ --- libgomp/testsuite/libgomp.c/declare-variant-4-gfx1103.c.jj 2024-05-02 11:39:43.155981513 +0200 +++ libgomp/testsuite/libgomp.c/declare-variant-4-gfx1103.c 2024-05-02 11:40:02.801717936 +0200 @@ -0,0 +1,8 @@ +/* { dg-do link { target { offload_target_amdgcn } } } */ +/* { dg-additional-options -foffload=amdgcn-amdhsa } */ +/* { dg-additional-options -foffload=-march=gfx1103 } */ +/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */ + +#include "declare-variant-4.h" + +/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx1103 \\(\\);" "optimized" } } */