diff --git a/mlir/test/Target/SPIRV/entry-point.mlir b/mlir/test/Target/SPIRV/entry-point.mlir index 88ad637fb7606..a7ec5290151ef 100644 --- a/mlir/test/Target/SPIRV/entry-point.mlir +++ b/mlir/test/Target/SPIRV/entry-point.mlir @@ -1,12 +1,17 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical OpenCL requires #spirv.vce { spirv.func @noop() -> () "None" { spirv.Return } - // CHECK: spirv.EntryPoint "GLCompute" @noop + // CHECK: spirv.EntryPoint "Kernel" @noop // CHECK-NEXT: spirv.ExecutionMode @noop "ContractionOff" - spirv.EntryPoint "GLCompute" @noop + spirv.EntryPoint "Kernel" @noop spirv.ExecutionMode @noop "ContractionOff" } @@ -15,13 +20,13 @@ spirv.module Logical GLSL450 requires #spirv.vce { spirv.module Logical GLSL450 requires #spirv.vce { // CHECK: spirv.GlobalVariable @var2 : !spirv.ptr // CHECK-NEXT: spirv.GlobalVariable @var3 : !spirv.ptr - // CHECK-NEXT: spirv.func @noop({{%.*}}: !spirv.ptr, {{%.*}}: !spirv.ptr) "None" + // CHECK-NEXT: spirv.func @noop() "None" // CHECK: spirv.EntryPoint "GLCompute" @noop, @var2, @var3 spirv.GlobalVariable @var2 : !spirv.ptr spirv.GlobalVariable @var3 : !spirv.ptr - spirv.func @noop(%arg0 : !spirv.ptr, %arg1 : !spirv.ptr) -> () "None" { + spirv.func @noop() -> () "None" { spirv.Return } spirv.EntryPoint "GLCompute" @noop, @var2, @var3 - spirv.ExecutionMode @noop "ContractionOff" + spirv.ExecutionMode @noop "LocalSize", 1, 1, 1 } diff --git a/mlir/test/Target/SPIRV/logical-ops.mlir b/mlir/test/Target/SPIRV/logical-ops.mlir index 05cbddc048151..d570815448b7c 100644 --- a/mlir/test/Target/SPIRV/logical-ops.mlir +++ b/mlir/test/Target/SPIRV/logical-ops.mlir @@ -1,6 +1,11 @@ // RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} + +spirv.module Logical OpenCL requires #spirv.vce { spirv.func @iequal_scalar(%arg0: i32, %arg1: i32) "None" { // CHECK: {{.*}} = spirv.IEqual {{.*}}, {{.*}} : i32 %0 = spirv.IEqual %arg0, %arg1 : i32 @@ -92,7 +97,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // ----- -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.SpecConstant @condition_scalar = true spirv.func @select() -> () "None" { %0 = spirv.Constant 4.0 : f32 @@ -115,7 +120,7 @@ spirv.module Logical GLSL450 requires #spirv.vce { // Test select works with bf16 scalar and vectors. -spirv.module Logical GLSL450 requires #spirv.vce { +spirv.module Logical GLSL450 requires #spirv.vce { spirv.SpecConstant @condition_scalar = true spirv.func @select_bf16() -> () "None" { %0 = spirv.Constant 4.0 : bf16 diff --git a/mlir/test/Target/SPIRV/sampled-image.mlir b/mlir/test/Target/SPIRV/sampled-image.mlir index 694862d943534..ff068208540f4 100644 --- a/mlir/test/Target/SPIRV/sampled-image.mlir +++ b/mlir/test/Target/SPIRV/sampled-image.mlir @@ -1,11 +1,16 @@ // RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip %s | FileCheck %s -spirv.module Logical GLSL450 requires #spirv.vce { - // CHECK: !spirv.ptr>, UniformConstant> - spirv.GlobalVariable @var0 bind(0, 1) : !spirv.ptr>, UniformConstant> +// RUN: %if spirv-tools %{ rm -rf %t %} +// RUN: %if spirv-tools %{ mkdir %t %} +// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %} +// RUN: %if spirv-tools %{ spirv-val %t %} - // CHECK: !spirv.ptr>, UniformConstant> - spirv.GlobalVariable @var1 bind(0, 0) : !spirv.ptr>, UniformConstant> +spirv.module Logical GLSL450 requires #spirv.vce { + // CHECK: !spirv.ptr>, UniformConstant> + spirv.GlobalVariable @var0 bind(0, 1) : !spirv.ptr>, UniformConstant> + + // CHECK: !spirv.ptr>, UniformConstant> + spirv.GlobalVariable @var1 bind(0, 0) : !spirv.ptr>, UniformConstant> // CHECK: !spirv.ptr>, UniformConstant> spirv.GlobalVariable @var2 bind(0, 0) : !spirv.ptr>, UniformConstant>