brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · dee6802 Raw
41 lines · plain
1// REQUIRES: host-supports-nvptx2// RUN: mlir-opt %s --gpu-module-to-binary="format=llvm" | FileCheck %s3// RUN: mlir-opt %s --gpu-module-to-binary="format=isa" | FileCheck %s -check-prefix=CHECK-ISA4// RUN: mlir-opt %s --gpu-module-to-binary="format=llvm section=__fatbin" | FileCheck %s -check-prefix=CHECK-SECTION5 6module attributes {gpu.container_module} {7  // CHECK-LABEL:gpu.binary @kernel_module18  // CHECK:[#gpu.object<#nvvm.target<chip = "sm_70">, offload = "{{.*}}">]9  // CHECK-SECTION: #gpu.object<#nvvm.target<chip = "sm_70">, properties = {section = "__fatbin"}10  gpu.module @kernel_module1 [#nvvm.target<chip = "sm_70">] {11    llvm.func @kernel(%arg0: i32, %arg1: !llvm.ptr,12        %arg2: !llvm.ptr, %arg3: i64, %arg4: i64,13        %arg5: i64) attributes {gpu.kernel} {14      llvm.return15    }16  }17 18  // CHECK-LABEL:gpu.binary @kernel_module219  // CHECK-ISA:[#gpu.object<#nvvm.target<flags = {fast}>, properties = {LLVMIRToISATimeInMs = {{[0-9]+}} : i64, O = 2 : i32}, assembly = "{{.*}}">, #gpu.object<#nvvm.target, properties = {LLVMIRToISATimeInMs = {{[0-9]+}} : i64, O = 2 : i32}, assembly = "{{.*}}">]20  gpu.module @kernel_module2 [#nvvm.target<flags = {fast}>, #nvvm.target] {21    llvm.func @kernel(%arg0: i32, %arg1: !llvm.ptr,22        %arg2: !llvm.ptr, %arg3: i64, %arg4: i64,23        %arg5: i64) attributes {gpu.kernel} {24      llvm.return25    }26  }27 28  // CHECK-LABEL:gpu.binary @kernel_module3 <#gpu.select_object<1 : i64>>29  // CHECK:[#gpu.object<#nvvm.target<chip = "sm_70">, offload = "{{.*}}">, #gpu.object<#nvvm.target<chip = "sm_80">, offload = "{{.*}}">]30  // CHECK-SECTION: [#gpu.object<#nvvm.target<chip = "sm_70">, properties = {section = "__fatbin"},{{.*}} #gpu.object<#nvvm.target<chip = "sm_80">, properties = {section = "__fatbin"}31  gpu.module @kernel_module3 <#gpu.select_object<1>> [32      #nvvm.target<chip = "sm_70">,33      #nvvm.target<chip = "sm_80">] {34    llvm.func @kernel(%arg0: i32, %arg1: !llvm.ptr,35        %arg2: !llvm.ptr, %arg3: i64, %arg4: i64,36        %arg5: i64) attributes {gpu.kernel} {37      llvm.return38    }39  }40}41