brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · d1112f7 Raw
39 lines · plain
1// RUN: mlir-opt %s --nvvm-attach-target='module=nvvm.* O=3 chip=sm_90' --rocdl-attach-target='module=rocdl.* O=3 chip=gfx90a' --xevm-attach-target='module=xevm.* O=3 chip=pvc' | FileCheck %s2// RUN: mlir-opt %s --nvvm-attach-target='module=options.* O=1 chip=sm_70 fast=true ftz=true' --rocdl-attach-target='module=options.* l=file1.bc,file2.bc wave64=false finite-only=true' --xevm-attach-target='module=options.* O=1 chip=pvc' | FileCheck %s --check-prefix=CHECK_OPTS3 4module attributes {gpu.container_module} {5// Verify the target is appended.6// CHECK: @nvvm_module_1 [#nvvm.target<O = 3, chip = "sm_90">] {7gpu.module @nvvm_module_1 {8}9// Verify the target is appended.10// CHECK: @nvvm_module_2 [#nvvm.target<chip = "sm_60">, #nvvm.target<O = 3, chip = "sm_90">] {11gpu.module @nvvm_module_2 [#nvvm.target<chip = "sm_60">] {12}13// Verify the target is not added multiple times.14// CHECK: @nvvm_module_3 [#nvvm.target<O = 3, chip = "sm_90">] {15gpu.module @nvvm_module_3 [#nvvm.target<O = 3, chip = "sm_90">] {16}17// Verify the NVVM target is not added as it fails to match the regex, but the ROCDL does get appended.18// CHECK: @rocdl_module [#rocdl.target<O = 3, chip = "gfx90a">] {19gpu.module @rocdl_module {20}21// Verify that other targets are not added as they fail to match the regex, but XeVM does get appended.22// CHECK: @xevm_module [#xevm.target<O = 3, chip = "pvc">] {23gpu.module @xevm_module {24}25// Check the options were added.26// CHECK_OPTS: @options_module_1 [#nvvm.target<O = 1, chip = "sm_70", flags = {fast, ftz}>,27// CHECK_OPTS-SAME: #rocdl.target<flags = {finite_only, no_wave64}, link = ["file1.bc", "file2.bc"]>,28// CHECK_OPTS-SAME: #xevm.target<O = 1, chip = "pvc">]  {29gpu.module @options_module_1 {30}31// Check the options were added and that the first target was preserved.32// CHECK_OPTS: @options_module_2 [#nvvm.target<O = 3, chip = "sm_90">,33// CHECK_OPTS-SAME: #nvvm.target<O = 1, chip = "sm_70", flags = {fast, ftz}>,34// CHECK_OPTS-SAME: #rocdl.target<flags = {finite_only, no_wave64}, link = ["file1.bc", "file2.bc"]>,35// CHECK_OPTS-SAME: #xevm.target<O = 1, chip = "pvc">]  {36gpu.module @options_module_2 [#nvvm.target<O = 3, chip = "sm_90">] {37}38}39