Skip to content

Instantly share code, notes, and snippets.

@jackalcooper
Last active September 25, 2022 19:56
Show Gist options
  • Save jackalcooper/26941ff8990119ff8b1b0e9512882ee0 to your computer and use it in GitHub Desktop.
Save jackalcooper/26941ff8990119ff8b1b0e9512882ee0 to your computer and use it in GitHub Desktop.
defmodule Manx.Lowering do
alias Beaver.MLIR
import MLIR.Sigils
import MLIR.{Transforms, Conversion}
alias Beaver.MLIR.Dialect.GPU
def tosa_vulkan(op) do
op
|> MLIR.Operation.verify!(dump_if_fail: true)
|> canonicalize
|> MLIR.Pass.Composer.nested("func.func", fn pm ->
MLIR.Pass.pipeline!(pm, "tosa-make-broadcastable")
MLIR.Pass.pipeline!(pm, "llvm-request-c-wrappers")
MLIR.Pass.pipeline!(pm, "tosa-layerwise-constant-fold")
end)
|> cse
|> tosa_to_arith
|> tosa_to_tensor()
|> convert_tensor_to_linalg()
|> MLIR.Pass.Composer.nested("func.func", [
tosa_to_linalg(),
linalg_fuse_elementwise_ops(),
linalg_bufferize(),
convert_linalg_to_parallel_loops(),
gpu_map_parallel_loops()
])
|> MLIR.Pass.Composer.pipeline("arith-bufferize,func-bufferize")
|> convert_parallel_loops_to_gpu()
|> gpu_launch_sink_index_computations()
|> gpu_kernel_outlining()
|> MLIR.Pass.Composer.nested("gpu.module", fn pm ->
MLIR.CAPI.mlirOpPassManagerAddOwnedPass(pm, lower_affine())
npm = MLIR.CAPI.mlirOpPassManagerGetNestedUnder(pm, MLIR.StringRef.create("gpu.func"))
MLIR.CAPI.mlirOpPassManagerAddOwnedPass(npm, __MODULE__.PutSPVAttrPass.create())
end)
|> MLIR.Pass.Composer.nested("func.func", fn pm ->
MLIR.Pass.pipeline!(pm, "tensor-bufferize")
end)
|> convert_vector_to_spirv()
|> convert_arith_to_spirv()
|> convert_cf_to_spirv()
|> convert_math_to_spirv()
|> convert_gpu_to_spirv()
|> MLIR.Pass.Composer.nested("spv.module", fn pm ->
MLIR.Pass.pipeline!(pm, "spirv-lower-abi-attrs")
MLIR.Pass.pipeline!(pm, "spirv-update-vce")
end)
|> convert_gpu_launch_to_vulkan_launch
|> convert_memref_to_spirv()
|> convert_scf_to_spirv()
|> convert_tensor_to_spirv()
|> convert_func_to_spirv()
|> convert_func_to_llvm
|> convert_complex_to_standard()
|> convert_vector_to_llvm
|> convert_memref_to_llvm
|> convert_complex_to_llvm()
|> convert_func_to_llvm
|> reconcile_unrealized_casts
|> launch_func_to_vulkan
|> MLIR.Pass.Composer.run!(dump_if_fail: false, print: true)
end
@doc """
Run passes to compile IR generated from Nx expressions, mostly in TOSA and some LinAlg. The results should be in LLVM.
"""
def tosa_cpu(op) do
op
|> MLIR.Operation.verify!(dump_if_fail: true)
|> canonicalize
|> MLIR.Pass.Composer.nested("func.func", fn pm ->
MLIR.Pass.pipeline!(pm, "tosa-make-broadcastable")
end)
|> MLIR.Pass.Composer.nested("func.func", fn pm ->
MLIR.Pass.pipeline!(pm, "tosa-layerwise-constant-fold")
end)
|> cse
|> tosa_to_scf
|> tosa_to_arith
|> tosa_to_tensor()
|> convert_tensor_to_linalg()
|> MLIR.Pass.Composer.nested("func.func", [
tosa_to_linalg(),
linalg_fuse_elementwise_ops()
])
|> MLIR.Pass.Composer.nested("func.func", [
linalg_bufferize(),
convert_linalg_to_loops(),
lower_affine(),
convert_math_to_llvm(),
convert_arith_to_llvm(),
convert_scf_to_cf(),
"arith-expand",
"memref-expand"
])
|> MLIR.Pass.Composer.nested("func.func", fn pm ->
MLIR.Pass.pipeline!(pm, "tensor-bufferize")
end)
|> MLIR.Pass.Composer.pipeline("arith-bufferize,func-bufferize")
|> MLIR.Pass.Composer.nested("func.func", fn pm ->
MLIR.Pass.pipeline!(pm, "llvm-request-c-wrappers")
end)
|> convert_math_to_libm
|> convert_complex_to_standard()
|> convert_vector_to_llvm
|> convert_memref_to_llvm
|> convert_complex_to_llvm()
|> convert_func_to_llvm
|> reconcile_unrealized_casts
|> MLIR.Pass.Composer.run!(dump_if_fail: true, print: false)
end
end
tsai@183eefe61145 beaver % mix test --max-failures 1 apps/manx/test/beaver/defn/expr_test.exs:788
21:49:46.135 [debug] [CMake] configuring...
21:49:47.129 [debug] [CMake] building...
21:49:47.348 [debug] [CMake] installed to /Users/tsai/oss/beaver/_build/test/native-install
==> manx
21:49:47.692 [debug] [Beaver] loading NIF
21:49:53.078 [debug] [Beaver] NIF loaded
21:49:53.090 [debug] [Beaver] global MLIR context created
21:49:53.690 [debug] [Beaver] dialect modules loaded
Excluding tags: [:test]
Including tags: [line: "788"]
21:49:54.662 [info] [Beaver] IR printing enabled
// -----// IR Dump Before Canonicalizer (canonicalize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> {
%0 = "tosa.cast"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%1 = "tosa.exp"(%0) : (tensor<3xf32>) -> tensor<3xf32>
return %1 : tensor<3xf32>
}
}
// -----// IR Dump After Canonicalizer (canonicalize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> {
%0 = "tosa.exp"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before TosaMakeBroadcastable (tosa-make-broadcastable) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> {
%0 = "tosa.exp"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before LLVMRequestCWrappers (llvm-request-c-wrappers) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> {
%0 = "tosa.exp"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump After LLVMRequestCWrappers (llvm-request-c-wrappers) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.exp"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before TosaLayerwiseConstantFoldPass (tosa-layerwise-constant-fold) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.exp"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before CSE (cse) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.exp"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before TosaToArith (tosa-to-arith) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.exp"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before TosaToTensor (tosa-to-tensor) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.exp"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before ConvertTensorToLinalg (convert-tensor-to-linalg) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.exp"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before TosaToLinalg (tosa-to-linalg) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.exp"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump After TosaToLinalg (tosa-to-linalg) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = linalg.init_tensor [3] : tensor<3xf32>
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%arg0 : tensor<3xf32>) outs(%0 : tensor<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%2 = math.exp %arg1 : f32
linalg.yield %2 : f32
} -> tensor<3xf32>
return %1 : tensor<3xf32>
}
}
// -----// IR Dump Before LinalgElementwiseOpFusion (linalg-fuse-elementwise-ops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = linalg.init_tensor [3] : tensor<3xf32>
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%arg0 : tensor<3xf32>) outs(%0 : tensor<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%2 = math.exp %arg1 : f32
linalg.yield %2 : f32
} -> tensor<3xf32>
return %1 : tensor<3xf32>
}
}
// -----// IR Dump Before LinalgBufferize (linalg-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = linalg.init_tensor [3] : tensor<3xf32>
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%arg0 : tensor<3xf32>) outs(%0 : tensor<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%2 = math.exp %arg1 : f32
linalg.yield %2 : f32
} -> tensor<3xf32>
return %1 : tensor<3xf32>
}
}
// -----// IR Dump After LinalgBufferize (linalg-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = linalg.init_tensor [3] : tensor<3xf32>
%c3 = arith.constant 3 : index
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%3 = bufferization.to_tensor %2 : memref<3xf32>
linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%0 : memref<3xf32>) outs(%2 : memref<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%5 = math.exp %arg1 : f32
linalg.yield %5 : f32
}
%4 = bufferization.to_tensor %2 : memref<3xf32>
return %4 : tensor<3xf32>
}
}
// -----// IR Dump Before LinalgLowerToParallelLoops (convert-linalg-to-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = linalg.init_tensor [3] : tensor<3xf32>
%c3 = arith.constant 3 : index
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%3 = bufferization.to_tensor %2 : memref<3xf32>
linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%0 : memref<3xf32>) outs(%2 : memref<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%5 = math.exp %arg1 : f32
linalg.yield %5 : f32
}
%4 = bufferization.to_tensor %2 : memref<3xf32>
return %4 : tensor<3xf32>
}
}
// -----// IR Dump After LinalgLowerToParallelLoops (convert-linalg-to-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.exp %3 : f32
memref.store %4, %1[%arg1] : memref<3xf32>
scf.yield
}
%2 = bufferization.to_tensor %1 : memref<3xf32>
return %2 : tensor<3xf32>
}
}
// -----// IR Dump Before GpuMapParallelLoopsPass (gpu-map-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.exp %3 : f32
memref.store %4, %1[%arg1] : memref<3xf32>
scf.yield
}
%2 = bufferization.to_tensor %1 : memref<3xf32>
return %2 : tensor<3xf32>
}
}
// -----// IR Dump After GpuMapParallelLoopsPass (gpu-map-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.exp %3 : f32
memref.store %4, %1[%arg1] : memref<3xf32>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%2 = bufferization.to_tensor %1 : memref<3xf32>
return %2 : tensor<3xf32>
}
}
// -----// IR Dump Before ArithmeticBufferize (arith-bufferize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.exp %3 : f32
memref.store %4, %1[%arg1] : memref<3xf32>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%2 = bufferization.to_tensor %1 : memref<3xf32>
return %2 : tensor<3xf32>
}
}
// -----// IR Dump Before FuncBufferize (func-bufferize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.exp %3 : f32
memref.store %4, %1[%arg1] : memref<3xf32>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%2 = bufferization.to_tensor %1 : memref<3xf32>
return %2 : tensor<3xf32>
}
}
// -----// IR Dump After FuncBufferize (func-bufferize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%5 = memref.load %1[%arg1] : memref<3xf32>
%6 = math.exp %5 : f32
memref.store %6, %2[%arg1] : memref<3xf32>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%3 = bufferization.to_tensor %2 : memref<3xf32>
%4 = bufferization.to_memref %3 : memref<3xf32>
return %4 : memref<3xf32>
}
}
// -----// IR Dump Before ConvertParallelLoopToGpu (convert-parallel-loops-to-gpu) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%5 = memref.load %1[%arg1] : memref<3xf32>
%6 = math.exp %5 : f32
memref.store %6, %2[%arg1] : memref<3xf32>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%3 = bufferization.to_tensor %2 : memref<3xf32>
%4 = bufferization.to_memref %3 : memref<3xf32>
return %4 : memref<3xf32>
}
}
// -----// IR Dump After ConvertParallelLoopToGpu (convert-parallel-loops-to-gpu) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%6 = affine.apply #map1(%arg1)[%c1, %c0]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.exp %7 : f32
memref.store %8, %2[%6] : memref<3xf32>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
}
// -----// IR Dump Before GpuLaunchSinkIndexComputations (gpu-launch-sink-index-computations) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%6 = affine.apply #map1(%arg1)[%c1, %c0]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.exp %7 : f32
memref.store %8, %2[%6] : memref<3xf32>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
}
// -----// IR Dump After GpuLaunchSinkIndexComputations (gpu-launch-sink-index-computations) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%c1_1 = arith.constant 1 : index
%c0_2 = arith.constant 0 : index
%6 = affine.apply #map1(%arg1)[%c1_1, %c0_2]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.exp %7 : f32
memref.store %8, %2[%6] : memref<3xf32>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
}
// -----// IR Dump Before GpuKernelOutlining (gpu-kernel-outlining) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%c1_1 = arith.constant 1 : index
%c0_2 = arith.constant 0 : index
%6 = affine.apply #map1(%arg1)[%c1_1, %c0_2]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.exp %7 : f32
memref.store %8, %2[%6] : memref<3xf32>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
}
// -----// IR Dump After GpuKernelOutlining (gpu-kernel-outlining) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%1 : memref<3xf32>, %2 : memref<3xf32>)
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.exp %13 : f32
memref.store %14, %arg1[%12] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before TensorBufferize (tensor-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%1 : memref<3xf32>, %2 : memref<3xf32>)
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.exp %13 : f32
memref.store %14, %arg1[%12] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After TensorBufferize (tensor-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.exp %13 : f32
memref.store %14, %arg1[%12] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertAffineToStandard (lower-affine) ('gpu.module' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.exp %13 : f32
memref.store %14, %arg1[%12] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertAffineToStandard (lower-affine) ('gpu.module' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.exp %14 : f32
memref.store %15, %arg1[%13] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before Elixir.Manx.Lowering.PutSPVAttrPass (put_spv_attr_pass) ('gpu.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.exp %14 : f32
memref.store %15, %arg1[%13] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After Elixir.Manx.Lowering.PutSPVAttrPass (put_spv_attr_pass) ('gpu.func' operation: @Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.exp %14 : f32
memref.store %15, %arg1[%13] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertVectorToSPIRV (convert-vector-to-spirv) ('builtin.module' operation) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.exp %14 : f32
memref.store %15, %arg1[%13] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertVectorToSPIRV (convert-vector-to-spirv) ('builtin.module' operation) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertArithmeticToSPIRV (convert-arith-to-spirv) ('builtin.module' operation) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertArithmeticToSPIRV (convert-arith-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertControlFlowToSPIRV (convert-cf-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertControlFlowToSPIRV (convert-cf-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertMathToSPIRV (convert-math-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertMathToSPIRV (convert-math-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertGPUToSPIRV (convert-gpu-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertGPUToSPIRV (convert-gpu-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" Logical GLSL450 {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer> {spv.interface_var_abi = #spv.interface_var_abi<(0, 0)>}, %arg1: !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer> {spv.interface_var_abi = #spv.interface_var_abi<(0, 1)>}) "None" attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>, workgroup_attributions = 0 : i64} {
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %arg0[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Exp %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %arg1[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before SPIRVLowerABIAttributes (spirv-lower-abi-attrs) ('spv.module' operation: @__spv__Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" Logical GLSL450 {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer> {spv.interface_var_abi = #spv.interface_var_abi<(0, 0)>}, %arg1: !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer> {spv.interface_var_abi = #spv.interface_var_abi<(0, 1)>}) "None" attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>, workgroup_attributions = 0 : i64} {
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %arg0[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Exp %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %arg1[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After SPIRVLowerABIAttributes (spirv-lower-abi-attrs) ('spv.module' operation: @__spv__Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" Logical GLSL450 {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0" bind(0, 0) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1" bind(0, 1) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"() "None" attributes {workgroup_attributions = 0 : i64} {
%Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_1_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_0_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_0_addr[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Exp %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_1_addr[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
spv.EntryPoint "GLCompute" @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel", @__builtin_var_WorkgroupId__, @__builtin_var_LocalInvocationId__, @__builtin_var_NumWorkgroups__
spv.ExecutionMode @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" "LocalSize", 16, 1, 1
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before SPIRVUpdateVCE (spirv-update-vce) ('spv.module' operation: @__spv__Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" Logical GLSL450 {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0" bind(0, 0) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1" bind(0, 1) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"() "None" attributes {workgroup_attributions = 0 : i64} {
%Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_1_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_0_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_0_addr[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Exp %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_1_addr[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
spv.EntryPoint "GLCompute" @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel", @__builtin_var_WorkgroupId__, @__builtin_var_LocalInvocationId__, @__builtin_var_NumWorkgroups__
spv.ExecutionMode @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" "LocalSize", 16, 1, 1
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After SPIRVUpdateVCE (spirv-update-vce) ('spv.module' operation: @__spv__Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" Logical GLSL450 requires #spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]> {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0" bind(0, 0) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1" bind(0, 1) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"() "None" attributes {workgroup_attributions = 0 : i64} {
%Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_1_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_0_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_0_addr[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Exp %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_1_addr[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
spv.EntryPoint "GLCompute" @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel", @__builtin_var_WorkgroupId__, @__builtin_var_LocalInvocationId__, @__builtin_var_NumWorkgroups__
spv.ExecutionMode @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" "LocalSize", 16, 1, 1
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertGpuLaunchFuncToVulkanLaunchFunc (convert-gpu-launch-to-vulkan-launch) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" Logical GLSL450 requires #spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]> {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0" bind(0, 0) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1" bind(0, 1) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"() "None" attributes {workgroup_attributions = 0 : i64} {
%Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_1_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_0_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_0_addr[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Exp %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_exp2F1-fun-0-.32300880_kernel_arg_1_addr[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
spv.EntryPoint "GLCompute" @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel", @__builtin_var_WorkgroupId__, @__builtin_var_LocalInvocationId__, @__builtin_var_NumWorkgroups__
spv.ExecutionMode @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" "LocalSize", 16, 1, 1
}
gpu.module @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Exp %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertGpuLaunchFuncToVulkanLaunchFunc (convert-gpu-launch-to-vulkan-launch) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
call @vulkanLaunch(%3, %2, %2, %arg0, %1) {spirv_blob = "\03\02#\07\00\00\01\00\16\00\00\002\00\00\00\00\00\00\00\11\00\02\00\01\00\00\00\0A\00\0B\00SPV_KHR_storage_buffer_storage_class\00\00\00\00\0B\00\06\00.\00\00\00GLSL.std.450\00\00\00\00\0E\00\03\00\00\00\00\00\01\00\00\00\0F\00\15\00\05\00\00\00\10\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel\00\00\00\00\06\00\00\00\05\00\00\00\04\00\00\00\10\00\06\00\10\00\00\00\11\00\00\00\10\00\00\00\01\00\00\00\01\00\00\00\05\00\0A\00\04\00\00\00__builtin_var_NumWorkgroups__\00\00\00\05\00\0B\00\05\00\00\00__builtin_var_LocalInvocationId__\00\00\00\05\00\09\00\06\00\00\00__builtin_var_WorkgroupId__\00\05\00\12\00\0C\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0\00\00\05\00\12\00\0D\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1\00\00\05\00\11\00\10\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel\00\00\00\00G\00\04\00\04\00\00\00\0B\00\00\00\18\00\00\00G\00\04\00\05\00\00\00\0B\00\00\00\1B\00\00\00G\00\04\00\06\00\00\00\0B\00\00\00\1A\00\00\00G\00\04\00\09\00\00\00\06\00\00\00\04\00\00\00H\00\05\00\08\00\00\00\00\00\00\00#\00\00\00\00\00\00\00G\00\03\00\08\00\00\00\02\00\00\00G\00\04\00\0C\00\00\00!\00\00\00\00\00\00\00G\00\04\00\0C\00\00\00\22\00\00\00\00\00\00\00G\00\04\00\0D\00\00\00!\00\00\00\01\00\00\00G\00\04\00\0D\00\00\00\22\00\00\00\00\00\00\00\15\00\04\00\03\00\00\00 \00\00\00\00\00\00\00\17\00\04\00\02\00\00\00\03\00\00\00\03\00\00\00 \00\04\00\01\00\00\00\01\00\00\00\02\00\00\00;\00\04\00\01\00\00\00\04\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\05\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\06\00\00\00\01\00\00\00\16\00\03\00\0A\00\00\00 \00\00\00+\00\04\00\03\00\00\00\0B\00\00\00\03\00\00\00\1C\00\04\00\09\00\00\00\0A\00\00\00\0B\00\00\00\1E\00\03\00\08\00\00\00\09\00\00\00 \00\04\00\07\00\00\00\0C\00\00\00\08\00\00\00;\00\04\00\07\00\00\00\0C\00\00\00\0C\00\00\00;\00\04\00\07\00\00\00\0D\00\00\00\0C\00\00\00\13\00\02\00\0F\00\00\00!\00\03\00\0E\00\00\00\0F\00\00\00+\00\04\00\03\00\00\00$\00\00\00\10\00\00\00+\00\04\00\03\00\00\00%\00\00\00\01\00\00\00+\00\04\00\03\00\00\00'\00\00\00\00\00\00\00 \00\04\00*\00\00\00\0C\00\00\00\0A\00\00\006\00\05\00\0F\00\00\00\10\00\00\00\00\00\00\00\0E\00\00\00\F8\00\02\00\11\00\00\00=\00\04\00\02\00\00\00\12\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\13\00\00\00\12\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\14\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\15\00\00\00\14\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\16\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\17\00\00\00\16\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\18\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\19\00\00\00\18\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\1A\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1B\00\00\00\1A\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\1C\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1D\00\00\00\1C\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\1E\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00\1F\00\00\00\1E\00\00\00\00\00\00\00=\00\04\00\02\00\00\00 \00\00\00\04\00\00\00Q\00\05\00\03\00\00\00!\00\00\00 \00\00\00\01\00\00\00=\00\04\00\02\00\00\00\22\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00#\00\00\00\22\00\00\00\02\00\00\00\F9\00\02\00&\00\00\00\F8\00\02\00&\00\00\00\84\00\05\00\03\00\00\00(\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\00)\00\00\00'\00\00\00(\00\00\00A\00\06\00*\00\00\00+\00\00\00\0C\00\00\00'\00\00\00)\00\00\00=\00\04\00\0A\00\00\00,\00\00\00+\00\00\00\0C\00\06\00\0A\00\00\00-\00\00\00.\00\00\00\1B\00\00\00,\00\00\00\84\00\05\00\03\00\00\00/\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\000\00\00\00'\00\00\00/\00\00\00A\00\06\00*\00\00\001\00\00\00\0D\00\00\00'\00\00\000\00\00\00>\00\03\001\00\00\00-\00\00\00\FD\00\01\008\00\01\00", spirv_entry_point = "Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"} : (index, index, index, memref<3xf32>, memref<3xf32>) -> ()
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
func.func private @vulkanLaunch(index, index, index, memref<3xf32>, memref<3xf32>)
}
// -----// IR Dump Before ConvertMemRefToSPIRV (convert-memref-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
call @vulkanLaunch(%3, %2, %2, %arg0, %1) {spirv_blob = "\03\02#\07\00\00\01\00\16\00\00\002\00\00\00\00\00\00\00\11\00\02\00\01\00\00\00\0A\00\0B\00SPV_KHR_storage_buffer_storage_class\00\00\00\00\0B\00\06\00.\00\00\00GLSL.std.450\00\00\00\00\0E\00\03\00\00\00\00\00\01\00\00\00\0F\00\15\00\05\00\00\00\10\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel\00\00\00\00\06\00\00\00\05\00\00\00\04\00\00\00\10\00\06\00\10\00\00\00\11\00\00\00\10\00\00\00\01\00\00\00\01\00\00\00\05\00\0A\00\04\00\00\00__builtin_var_NumWorkgroups__\00\00\00\05\00\0B\00\05\00\00\00__builtin_var_LocalInvocationId__\00\00\00\05\00\09\00\06\00\00\00__builtin_var_WorkgroupId__\00\05\00\12\00\0C\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0\00\00\05\00\12\00\0D\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1\00\00\05\00\11\00\10\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel\00\00\00\00G\00\04\00\04\00\00\00\0B\00\00\00\18\00\00\00G\00\04\00\05\00\00\00\0B\00\00\00\1B\00\00\00G\00\04\00\06\00\00\00\0B\00\00\00\1A\00\00\00G\00\04\00\09\00\00\00\06\00\00\00\04\00\00\00H\00\05\00\08\00\00\00\00\00\00\00#\00\00\00\00\00\00\00G\00\03\00\08\00\00\00\02\00\00\00G\00\04\00\0C\00\00\00!\00\00\00\00\00\00\00G\00\04\00\0C\00\00\00\22\00\00\00\00\00\00\00G\00\04\00\0D\00\00\00!\00\00\00\01\00\00\00G\00\04\00\0D\00\00\00\22\00\00\00\00\00\00\00\15\00\04\00\03\00\00\00 \00\00\00\00\00\00\00\17\00\04\00\02\00\00\00\03\00\00\00\03\00\00\00 \00\04\00\01\00\00\00\01\00\00\00\02\00\00\00;\00\04\00\01\00\00\00\04\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\05\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\06\00\00\00\01\00\00\00\16\00\03\00\0A\00\00\00 \00\00\00+\00\04\00\03\00\00\00\0B\00\00\00\03\00\00\00\1C\00\04\00\09\00\00\00\0A\00\00\00\0B\00\00\00\1E\00\03\00\08\00\00\00\09\00\00\00 \00\04\00\07\00\00\00\0C\00\00\00\08\00\00\00;\00\04\00\07\00\00\00\0C\00\00\00\0C\00\00\00;\00\04\00\07\00\00\00\0D\00\00\00\0C\00\00\00\13\00\02\00\0F\00\00\00!\00\03\00\0E\00\00\00\0F\00\00\00+\00\04\00\03\00\00\00$\00\00\00\10\00\00\00+\00\04\00\03\00\00\00%\00\00\00\01\00\00\00+\00\04\00\03\00\00\00'\00\00\00\00\00\00\00 \00\04\00*\00\00\00\0C\00\00\00\0A\00\00\006\00\05\00\0F\00\00\00\10\00\00\00\00\00\00\00\0E\00\00\00\F8\00\02\00\11\00\00\00=\00\04\00\02\00\00\00\12\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\13\00\00\00\12\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\14\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\15\00\00\00\14\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\16\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\17\00\00\00\16\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\18\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\19\00\00\00\18\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\1A\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1B\00\00\00\1A\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\1C\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1D\00\00\00\1C\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\1E\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00\1F\00\00\00\1E\00\00\00\00\00\00\00=\00\04\00\02\00\00\00 \00\00\00\04\00\00\00Q\00\05\00\03\00\00\00!\00\00\00 \00\00\00\01\00\00\00=\00\04\00\02\00\00\00\22\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00#\00\00\00\22\00\00\00\02\00\00\00\F9\00\02\00&\00\00\00\F8\00\02\00&\00\00\00\84\00\05\00\03\00\00\00(\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\00)\00\00\00'\00\00\00(\00\00\00A\00\06\00*\00\00\00+\00\00\00\0C\00\00\00'\00\00\00)\00\00\00=\00\04\00\0A\00\00\00,\00\00\00+\00\00\00\0C\00\06\00\0A\00\00\00-\00\00\00.\00\00\00\1B\00\00\00,\00\00\00\84\00\05\00\03\00\00\00/\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\000\00\00\00'\00\00\00/\00\00\00A\00\06\00*\00\00\001\00\00\00\0D\00\00\00'\00\00\000\00\00\00>\00\03\001\00\00\00-\00\00\00\FD\00\01\008\00\01\00", spirv_entry_point = "Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"} : (index, index, index, memref<3xf32>, memref<3xf32>) -> ()
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
func.func private @vulkanLaunch(index, index, index, memref<3xf32>, memref<3xf32>)
}
// -----// IR Dump Before SCFToSPIRV (convert-scf-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
call @vulkanLaunch(%3, %2, %2, %arg0, %1) {spirv_blob = "\03\02#\07\00\00\01\00\16\00\00\002\00\00\00\00\00\00\00\11\00\02\00\01\00\00\00\0A\00\0B\00SPV_KHR_storage_buffer_storage_class\00\00\00\00\0B\00\06\00.\00\00\00GLSL.std.450\00\00\00\00\0E\00\03\00\00\00\00\00\01\00\00\00\0F\00\15\00\05\00\00\00\10\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel\00\00\00\00\06\00\00\00\05\00\00\00\04\00\00\00\10\00\06\00\10\00\00\00\11\00\00\00\10\00\00\00\01\00\00\00\01\00\00\00\05\00\0A\00\04\00\00\00__builtin_var_NumWorkgroups__\00\00\00\05\00\0B\00\05\00\00\00__builtin_var_LocalInvocationId__\00\00\00\05\00\09\00\06\00\00\00__builtin_var_WorkgroupId__\00\05\00\12\00\0C\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0\00\00\05\00\12\00\0D\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1\00\00\05\00\11\00\10\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel\00\00\00\00G\00\04\00\04\00\00\00\0B\00\00\00\18\00\00\00G\00\04\00\05\00\00\00\0B\00\00\00\1B\00\00\00G\00\04\00\06\00\00\00\0B\00\00\00\1A\00\00\00G\00\04\00\09\00\00\00\06\00\00\00\04\00\00\00H\00\05\00\08\00\00\00\00\00\00\00#\00\00\00\00\00\00\00G\00\03\00\08\00\00\00\02\00\00\00G\00\04\00\0C\00\00\00!\00\00\00\00\00\00\00G\00\04\00\0C\00\00\00\22\00\00\00\00\00\00\00G\00\04\00\0D\00\00\00!\00\00\00\01\00\00\00G\00\04\00\0D\00\00\00\22\00\00\00\00\00\00\00\15\00\04\00\03\00\00\00 \00\00\00\00\00\00\00\17\00\04\00\02\00\00\00\03\00\00\00\03\00\00\00 \00\04\00\01\00\00\00\01\00\00\00\02\00\00\00;\00\04\00\01\00\00\00\04\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\05\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\06\00\00\00\01\00\00\00\16\00\03\00\0A\00\00\00 \00\00\00+\00\04\00\03\00\00\00\0B\00\00\00\03\00\00\00\1C\00\04\00\09\00\00\00\0A\00\00\00\0B\00\00\00\1E\00\03\00\08\00\00\00\09\00\00\00 \00\04\00\07\00\00\00\0C\00\00\00\08\00\00\00;\00\04\00\07\00\00\00\0C\00\00\00\0C\00\00\00;\00\04\00\07\00\00\00\0D\00\00\00\0C\00\00\00\13\00\02\00\0F\00\00\00!\00\03\00\0E\00\00\00\0F\00\00\00+\00\04\00\03\00\00\00$\00\00\00\10\00\00\00+\00\04\00\03\00\00\00%\00\00\00\01\00\00\00+\00\04\00\03\00\00\00'\00\00\00\00\00\00\00 \00\04\00*\00\00\00\0C\00\00\00\0A\00\00\006\00\05\00\0F\00\00\00\10\00\00\00\00\00\00\00\0E\00\00\00\F8\00\02\00\11\00\00\00=\00\04\00\02\00\00\00\12\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\13\00\00\00\12\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\14\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\15\00\00\00\14\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\16\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\17\00\00\00\16\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\18\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\19\00\00\00\18\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\1A\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1B\00\00\00\1A\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\1C\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1D\00\00\00\1C\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\1E\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00\1F\00\00\00\1E\00\00\00\00\00\00\00=\00\04\00\02\00\00\00 \00\00\00\04\00\00\00Q\00\05\00\03\00\00\00!\00\00\00 \00\00\00\01\00\00\00=\00\04\00\02\00\00\00\22\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00#\00\00\00\22\00\00\00\02\00\00\00\F9\00\02\00&\00\00\00\F8\00\02\00&\00\00\00\84\00\05\00\03\00\00\00(\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\00)\00\00\00'\00\00\00(\00\00\00A\00\06\00*\00\00\00+\00\00\00\0C\00\00\00'\00\00\00)\00\00\00=\00\04\00\0A\00\00\00,\00\00\00+\00\00\00\0C\00\06\00\0A\00\00\00-\00\00\00.\00\00\00\1B\00\00\00,\00\00\00\84\00\05\00\03\00\00\00/\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\000\00\00\00'\00\00\00/\00\00\00A\00\06\00*\00\00\001\00\00\00\0D\00\00\00'\00\00\000\00\00\00>\00\03\001\00\00\00-\00\00\00\FD\00\01\008\00\01\00", spirv_entry_point = "Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"} : (index, index, index, memref<3xf32>, memref<3xf32>) -> ()
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
func.func private @vulkanLaunch(index, index, index, memref<3xf32>, memref<3xf32>)
}
[Beaver] [loc(unknown)] failed to legalize unresolved materialization from 'memref<3xf32>' to '!spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>' that remained live after conversion
// -----// IR Dump After SCFToSPIRV Failed (convert-scf-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
call @vulkanLaunch(%3, %2, %2, %arg0, %1) {spirv_blob = "\03\02#\07\00\00\01\00\16\00\00\002\00\00\00\00\00\00\00\11\00\02\00\01\00\00\00\0A\00\0B\00SPV_KHR_storage_buffer_storage_class\00\00\00\00\0B\00\06\00.\00\00\00GLSL.std.450\00\00\00\00\0E\00\03\00\00\00\00\00\01\00\00\00\0F\00\15\00\05\00\00\00\10\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel\00\00\00\00\06\00\00\00\05\00\00\00\04\00\00\00\10\00\06\00\10\00\00\00\11\00\00\00\10\00\00\00\01\00\00\00\01\00\00\00\05\00\0A\00\04\00\00\00__builtin_var_NumWorkgroups__\00\00\00\05\00\0B\00\05\00\00\00__builtin_var_LocalInvocationId__\00\00\00\05\00\09\00\06\00\00\00__builtin_var_WorkgroupId__\00\05\00\12\00\0C\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_0\00\00\05\00\12\00\0D\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel_arg_1\00\00\05\00\11\00\10\00\00\00Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel\00\00\00\00G\00\04\00\04\00\00\00\0B\00\00\00\18\00\00\00G\00\04\00\05\00\00\00\0B\00\00\00\1B\00\00\00G\00\04\00\06\00\00\00\0B\00\00\00\1A\00\00\00G\00\04\00\09\00\00\00\06\00\00\00\04\00\00\00H\00\05\00\08\00\00\00\00\00\00\00#\00\00\00\00\00\00\00G\00\03\00\08\00\00\00\02\00\00\00G\00\04\00\0C\00\00\00!\00\00\00\00\00\00\00G\00\04\00\0C\00\00\00\22\00\00\00\00\00\00\00G\00\04\00\0D\00\00\00!\00\00\00\01\00\00\00G\00\04\00\0D\00\00\00\22\00\00\00\00\00\00\00\15\00\04\00\03\00\00\00 \00\00\00\00\00\00\00\17\00\04\00\02\00\00\00\03\00\00\00\03\00\00\00 \00\04\00\01\00\00\00\01\00\00\00\02\00\00\00;\00\04\00\01\00\00\00\04\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\05\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\06\00\00\00\01\00\00\00\16\00\03\00\0A\00\00\00 \00\00\00+\00\04\00\03\00\00\00\0B\00\00\00\03\00\00\00\1C\00\04\00\09\00\00\00\0A\00\00\00\0B\00\00\00\1E\00\03\00\08\00\00\00\09\00\00\00 \00\04\00\07\00\00\00\0C\00\00\00\08\00\00\00;\00\04\00\07\00\00\00\0C\00\00\00\0C\00\00\00;\00\04\00\07\00\00\00\0D\00\00\00\0C\00\00\00\13\00\02\00\0F\00\00\00!\00\03\00\0E\00\00\00\0F\00\00\00+\00\04\00\03\00\00\00$\00\00\00\10\00\00\00+\00\04\00\03\00\00\00%\00\00\00\01\00\00\00+\00\04\00\03\00\00\00'\00\00\00\00\00\00\00 \00\04\00*\00\00\00\0C\00\00\00\0A\00\00\006\00\05\00\0F\00\00\00\10\00\00\00\00\00\00\00\0E\00\00\00\F8\00\02\00\11\00\00\00=\00\04\00\02\00\00\00\12\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\13\00\00\00\12\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\14\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\15\00\00\00\14\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\16\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\17\00\00\00\16\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\18\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\19\00\00\00\18\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\1A\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1B\00\00\00\1A\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\1C\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1D\00\00\00\1C\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\1E\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00\1F\00\00\00\1E\00\00\00\00\00\00\00=\00\04\00\02\00\00\00 \00\00\00\04\00\00\00Q\00\05\00\03\00\00\00!\00\00\00 \00\00\00\01\00\00\00=\00\04\00\02\00\00\00\22\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00#\00\00\00\22\00\00\00\02\00\00\00\F9\00\02\00&\00\00\00\F8\00\02\00&\00\00\00\84\00\05\00\03\00\00\00(\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\00)\00\00\00'\00\00\00(\00\00\00A\00\06\00*\00\00\00+\00\00\00\0C\00\00\00'\00\00\00)\00\00\00=\00\04\00\0A\00\00\00,\00\00\00+\00\00\00\0C\00\06\00\0A\00\00\00-\00\00\00.\00\00\00\1B\00\00\00,\00\00\00\84\00\05\00\03\00\00\00/\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\000\00\00\00'\00\00\00/\00\00\00A\00\06\00*\00\00\001\00\00\00\0D\00\00\00'\00\00\000\00\00\00>\00\03\001\00\00\00-\00\00\00\FD\00\01\008\00\01\00", spirv_entry_point = "Elixir.Manx.ExprTest.-unary_exp/1-fun-0-.32300880_kernel"} : (index, index, index, memref<3xf32>, memref<3xf32>) -> ()
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
func.func private @vulkanLaunch(index, index, index, memref<3xf32>, memref<3xf32>)
}
1) test unary float ops exp (Manx.ExprTest)
apps/manx/test/beaver/defn/expr_test.exs:813
** (RuntimeError) Unexpected failure running pass pipeline
code: unquote(defn_fun)(@float_tensor),
stacktrace:
(beaver 0.1.0) lib/beaver/mlir/pass/composer.ex:85: Beaver.MLIR.Pass.Composer.run!/2
(manx 0.1.0) lib/manx/nx/compiler.ex:71: Manx.Compiler.__jit__/5
(nx 0.3.0-dev) lib/nx/defn/compiler.ex:323: Nx.Defn.Compiler.__runtime__/2
test/beaver/defn/expr_test.exs:815: (test)
--max-failures reached, aborting test suite
Finished in 1.3 seconds (1.3s async, 0.00s sync)
69 tests, 1 failure, 68 excluded
Randomized with seed 705342
tsai@183eefe61145 beaver %
tsai@183eefe61145 beaver % mix test --max-failures 1 apps/manx/test/beaver/defn/expr_test.exs:788
21:59:11.981 [debug] [CMake] configuring...
21:59:12.661 [debug] [CMake] building...
21:59:12.761 [debug] [CMake] installed to /Users/tsai/oss/beaver/_build/test/native-install
==> manx
21:59:12.896 [debug] [Beaver] loading NIF
21:59:17.163 [debug] [Beaver] NIF loaded
21:59:17.184 [debug] [Beaver] global MLIR context created
21:59:17.610 [debug] [Beaver] dialect modules loaded
Excluding tags: [:test]
Including tags: [line: "788"]
21:59:18.371 [info] [Beaver] IR printing enabled
// -----// IR Dump Before Canonicalizer (canonicalize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> {
%0 = "tosa.cast"(%arg0) : (tensor<3xf32>) -> tensor<3xi8>
%1 = "tosa.const"() {value = dense<0x7F800000> : tensor<3xf32>} : () -> tensor<3xf32>
%2 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%3 = "tosa.equal"(%1, %2) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%4 = "tosa.cast"(%3) : (tensor<3xi1>) -> tensor<3xi8>
return %4 : tensor<3xi8>
}
}
// -----// IR Dump After Canonicalizer (canonicalize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> {
%0 = "tosa.const"() {value = dense<0x7F800000> : tensor<3xf32>} : () -> tensor<3xf32>
%1 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%2 = "tosa.equal"(%1, %0) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%3 = "tosa.cast"(%2) : (tensor<3xi1>) -> tensor<3xi8>
return %3 : tensor<3xi8>
}
}
// -----// IR Dump Before TosaMakeBroadcastable (tosa-make-broadcastable) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> {
%0 = "tosa.const"() {value = dense<0x7F800000> : tensor<3xf32>} : () -> tensor<3xf32>
%1 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%2 = "tosa.equal"(%1, %0) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%3 = "tosa.cast"(%2) : (tensor<3xi1>) -> tensor<3xi8>
return %3 : tensor<3xi8>
}
}
// -----// IR Dump Before LLVMRequestCWrappers (llvm-request-c-wrappers) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> {
%0 = "tosa.const"() {value = dense<0x7F800000> : tensor<3xf32>} : () -> tensor<3xf32>
%1 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%2 = "tosa.equal"(%1, %0) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%3 = "tosa.cast"(%2) : (tensor<3xi1>) -> tensor<3xi8>
return %3 : tensor<3xi8>
}
}
// -----// IR Dump After LLVMRequestCWrappers (llvm-request-c-wrappers) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%0 = "tosa.const"() {value = dense<0x7F800000> : tensor<3xf32>} : () -> tensor<3xf32>
%1 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%2 = "tosa.equal"(%1, %0) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%3 = "tosa.cast"(%2) : (tensor<3xi1>) -> tensor<3xi8>
return %3 : tensor<3xi8>
}
}
// -----// IR Dump Before TosaLayerwiseConstantFoldPass (tosa-layerwise-constant-fold) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%0 = "tosa.const"() {value = dense<0x7F800000> : tensor<3xf32>} : () -> tensor<3xf32>
%1 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%2 = "tosa.equal"(%1, %0) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%3 = "tosa.cast"(%2) : (tensor<3xi1>) -> tensor<3xi8>
return %3 : tensor<3xi8>
}
}
// -----// IR Dump Before CSE (cse) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%0 = "tosa.const"() {value = dense<0x7F800000> : tensor<3xf32>} : () -> tensor<3xf32>
%1 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%2 = "tosa.equal"(%1, %0) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%3 = "tosa.cast"(%2) : (tensor<3xi1>) -> tensor<3xi8>
return %3 : tensor<3xi8>
}
}
// -----// IR Dump Before TosaToArith (tosa-to-arith) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%0 = "tosa.const"() {value = dense<0x7F800000> : tensor<3xf32>} : () -> tensor<3xf32>
%1 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%2 = "tosa.equal"(%1, %0) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%3 = "tosa.cast"(%2) : (tensor<3xi1>) -> tensor<3xi8>
return %3 : tensor<3xi8>
}
}
// -----// IR Dump After TosaToArith (tosa-to-arith) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%cst = arith.constant dense<0x7F800000> : tensor<3xf32>
%0 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%1 = "tosa.equal"(%0, %cst) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%2 = "tosa.cast"(%1) : (tensor<3xi1>) -> tensor<3xi8>
return %2 : tensor<3xi8>
}
}
// -----// IR Dump Before TosaToTensor (tosa-to-tensor) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%cst = arith.constant dense<0x7F800000> : tensor<3xf32>
%0 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%1 = "tosa.equal"(%0, %cst) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%2 = "tosa.cast"(%1) : (tensor<3xi1>) -> tensor<3xi8>
return %2 : tensor<3xi8>
}
}
// -----// IR Dump Before ConvertTensorToLinalg (convert-tensor-to-linalg) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%cst = arith.constant dense<0x7F800000> : tensor<3xf32>
%0 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%1 = "tosa.equal"(%0, %cst) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%2 = "tosa.cast"(%1) : (tensor<3xi1>) -> tensor<3xi8>
return %2 : tensor<3xi8>
}
}
// -----// IR Dump Before TosaToLinalg (tosa-to-linalg) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%cst = arith.constant dense<0x7F800000> : tensor<3xf32>
%0 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%1 = "tosa.equal"(%0, %cst) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1>
%2 = "tosa.cast"(%1) : (tensor<3xi1>) -> tensor<3xi8>
return %2 : tensor<3xi8>
}
}
// -----// IR Dump After TosaToLinalg (tosa-to-linalg) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%cst = arith.constant dense<0x7F800000> : tensor<3xf32>
%0 = linalg.init_tensor [3] : tensor<3xf32>
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%arg0 : tensor<3xf32>) outs(%0 : tensor<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%6 = math.abs %arg1 : f32
linalg.yield %6 : f32
} -> tensor<3xf32>
%2 = linalg.init_tensor [3] : tensor<3xi1>
%3 = linalg.generic {indexing_maps = [#map, #map, #map], iterator_types = ["parallel"]} ins(%1, %cst : tensor<3xf32>, tensor<3xf32>) outs(%2 : tensor<3xi1>) {
^bb0(%arg1: f32, %arg2: f32, %arg3: i1):
%6 = arith.cmpf oeq, %arg1, %arg2 : f32
linalg.yield %6 : i1
} -> tensor<3xi1>
%4 = linalg.init_tensor [3] : tensor<3xi8>
%5 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%3 : tensor<3xi1>) outs(%4 : tensor<3xi8>) {
^bb0(%arg1: i1, %arg2: i8):
%6 = arith.extui %arg1 : i1 to i8
linalg.yield %6 : i8
} -> tensor<3xi8>
return %5 : tensor<3xi8>
}
}
// -----// IR Dump Before LinalgElementwiseOpFusion (linalg-fuse-elementwise-ops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%cst = arith.constant dense<0x7F800000> : tensor<3xf32>
%0 = linalg.init_tensor [3] : tensor<3xf32>
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%arg0 : tensor<3xf32>) outs(%0 : tensor<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%6 = math.abs %arg1 : f32
linalg.yield %6 : f32
} -> tensor<3xf32>
%2 = linalg.init_tensor [3] : tensor<3xi1>
%3 = linalg.generic {indexing_maps = [#map, #map, #map], iterator_types = ["parallel"]} ins(%1, %cst : tensor<3xf32>, tensor<3xf32>) outs(%2 : tensor<3xi1>) {
^bb0(%arg1: f32, %arg2: f32, %arg3: i1):
%6 = arith.cmpf oeq, %arg1, %arg2 : f32
linalg.yield %6 : i1
} -> tensor<3xi1>
%4 = linalg.init_tensor [3] : tensor<3xi8>
%5 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%3 : tensor<3xi1>) outs(%4 : tensor<3xi8>) {
^bb0(%arg1: i1, %arg2: i8):
%6 = arith.extui %arg1 : i1 to i8
linalg.yield %6 : i8
} -> tensor<3xi8>
return %5 : tensor<3xi8>
}
}
// -----// IR Dump After LinalgElementwiseOpFusion (linalg-fuse-elementwise-ops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%cst = arith.constant 0x7F800000 : f32
%0 = linalg.init_tensor [3] : tensor<3xi8>
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%arg0 : tensor<3xf32>) outs(%0 : tensor<3xi8>) {
^bb0(%arg1: f32, %arg2: i8):
%2 = math.abs %arg1 : f32
%3 = arith.cmpf oeq, %2, %cst : f32
%4 = arith.extui %3 : i1 to i8
linalg.yield %4 : i8
} -> tensor<3xi8>
return %1 : tensor<3xi8>
}
}
// -----// IR Dump Before LinalgBufferize (linalg-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%cst = arith.constant 0x7F800000 : f32
%0 = linalg.init_tensor [3] : tensor<3xi8>
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%arg0 : tensor<3xf32>) outs(%0 : tensor<3xi8>) {
^bb0(%arg1: f32, %arg2: i8):
%2 = math.abs %arg1 : f32
%3 = arith.cmpf oeq, %2, %cst : f32
%4 = arith.extui %3 : i1 to i8
linalg.yield %4 : i8
} -> tensor<3xi8>
return %1 : tensor<3xi8>
}
}
// -----// IR Dump After LinalgBufferize (linalg-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%cst = arith.constant 0x7F800000 : f32
%1 = linalg.init_tensor [3] : tensor<3xi8>
%c3 = arith.constant 3 : index
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%3 = bufferization.to_tensor %2 : memref<3xi8>
linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%0 : memref<3xf32>) outs(%2 : memref<3xi8>) {
^bb0(%arg1: f32, %arg2: i8):
%5 = math.abs %arg1 : f32
%6 = arith.cmpf oeq, %5, %cst : f32
%7 = arith.extui %6 : i1 to i8
linalg.yield %7 : i8
}
%4 = bufferization.to_tensor %2 : memref<3xi8>
return %4 : tensor<3xi8>
}
}
// -----// IR Dump Before LinalgLowerToParallelLoops (convert-linalg-to-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%cst = arith.constant 0x7F800000 : f32
%1 = linalg.init_tensor [3] : tensor<3xi8>
%c3 = arith.constant 3 : index
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%3 = bufferization.to_tensor %2 : memref<3xi8>
linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%0 : memref<3xf32>) outs(%2 : memref<3xi8>) {
^bb0(%arg1: f32, %arg2: i8):
%5 = math.abs %arg1 : f32
%6 = arith.cmpf oeq, %5, %cst : f32
%7 = arith.extui %6 : i1 to i8
linalg.yield %7 : i8
}
%4 = bufferization.to_tensor %2 : memref<3xi8>
return %4 : tensor<3xi8>
}
}
// -----// IR Dump After LinalgLowerToParallelLoops (convert-linalg-to-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.abs %3 : f32
%5 = arith.cmpf oeq, %4, %cst : f32
%6 = arith.extui %5 : i1 to i8
memref.store %6, %1[%arg1] : memref<3xi8>
scf.yield
}
%2 = bufferization.to_tensor %1 : memref<3xi8>
return %2 : tensor<3xi8>
}
}
// -----// IR Dump Before GpuMapParallelLoopsPass (gpu-map-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.abs %3 : f32
%5 = arith.cmpf oeq, %4, %cst : f32
%6 = arith.extui %5 : i1 to i8
memref.store %6, %1[%arg1] : memref<3xi8>
scf.yield
}
%2 = bufferization.to_tensor %1 : memref<3xi8>
return %2 : tensor<3xi8>
}
}
// -----// IR Dump After GpuMapParallelLoopsPass (gpu-map-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.abs %3 : f32
%5 = arith.cmpf oeq, %4, %cst : f32
%6 = arith.extui %5 : i1 to i8
memref.store %6, %1[%arg1] : memref<3xi8>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%2 = bufferization.to_tensor %1 : memref<3xi8>
return %2 : tensor<3xi8>
}
}
// -----// IR Dump Before ArithmeticBufferize (arith-bufferize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.abs %3 : f32
%5 = arith.cmpf oeq, %4, %cst : f32
%6 = arith.extui %5 : i1 to i8
memref.store %6, %1[%arg1] : memref<3xi8>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%2 = bufferization.to_tensor %1 : memref<3xi8>
return %2 : tensor<3xi8>
}
}
// -----// IR Dump Before FuncBufferize (func-bufferize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xi8> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.abs %3 : f32
%5 = arith.cmpf oeq, %4, %cst : f32
%6 = arith.extui %5 : i1 to i8
memref.store %6, %1[%arg1] : memref<3xi8>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%2 = bufferization.to_tensor %1 : memref<3xi8>
return %2 : tensor<3xi8>
}
}
// -----// IR Dump After FuncBufferize (func-bufferize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%5 = memref.load %1[%arg1] : memref<3xf32>
%6 = math.abs %5 : f32
%7 = arith.cmpf oeq, %6, %cst : f32
%8 = arith.extui %7 : i1 to i8
memref.store %8, %2[%arg1] : memref<3xi8>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%3 = bufferization.to_tensor %2 : memref<3xi8>
%4 = bufferization.to_memref %3 : memref<3xi8>
return %4 : memref<3xi8>
}
}
// -----// IR Dump Before ConvertParallelLoopToGpu (convert-parallel-loops-to-gpu) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%5 = memref.load %1[%arg1] : memref<3xf32>
%6 = math.abs %5 : f32
%7 = arith.cmpf oeq, %6, %cst : f32
%8 = arith.extui %7 : i1 to i8
memref.store %8, %2[%arg1] : memref<3xi8>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%3 = bufferization.to_tensor %2 : memref<3xi8>
%4 = bufferization.to_memref %3 : memref<3xi8>
return %4 : memref<3xi8>
}
}
// -----// IR Dump After ConvertParallelLoopToGpu (convert-parallel-loops-to-gpu) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%6 = affine.apply #map1(%arg1)[%c1, %c0]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.abs %7 : f32
%9 = arith.cmpf oeq, %8, %cst : f32
%10 = arith.extui %9 : i1 to i8
memref.store %10, %2[%6] : memref<3xi8>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xi8>
%5 = bufferization.to_memref %4 : memref<3xi8>
return %5 : memref<3xi8>
}
}
// -----// IR Dump Before GpuLaunchSinkIndexComputations (gpu-launch-sink-index-computations) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%6 = affine.apply #map1(%arg1)[%c1, %c0]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.abs %7 : f32
%9 = arith.cmpf oeq, %8, %cst : f32
%10 = arith.extui %9 : i1 to i8
memref.store %10, %2[%6] : memref<3xi8>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xi8>
%5 = bufferization.to_memref %4 : memref<3xi8>
return %5 : memref<3xi8>
}
}
// -----// IR Dump After GpuLaunchSinkIndexComputations (gpu-launch-sink-index-computations) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%c1_1 = arith.constant 1 : index
%c0_2 = arith.constant 0 : index
%cst_3 = arith.constant 0x7F800000 : f32
%6 = affine.apply #map1(%arg1)[%c1_1, %c0_2]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.abs %7 : f32
%9 = arith.cmpf oeq, %8, %cst_3 : f32
%10 = arith.extui %9 : i1 to i8
memref.store %10, %2[%6] : memref<3xi8>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xi8>
%5 = bufferization.to_memref %4 : memref<3xi8>
return %5 : memref<3xi8>
}
}
// -----// IR Dump Before GpuKernelOutlining (gpu-kernel-outlining) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%c1_1 = arith.constant 1 : index
%c0_2 = arith.constant 0 : index
%cst_3 = arith.constant 0x7F800000 : f32
%6 = affine.apply #map1(%arg1)[%c1_1, %c0_2]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.abs %7 : f32
%9 = arith.cmpf oeq, %8, %cst_3 : f32
%10 = arith.extui %9 : i1 to i8
memref.store %10, %2[%6] : memref<3xi8>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xi8>
%5 = bufferization.to_memref %4 : memref<3xi8>
return %5 : memref<3xi8>
}
}
// -----// IR Dump After GpuKernelOutlining (gpu-kernel-outlining) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%3, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%1 : memref<3xf32>, %2 : memref<3xi8>)
%4 = bufferization.to_tensor %2 : memref<3xi8>
%5 = bufferization.to_memref %4 : memref<3xi8>
return %5 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%cst = arith.constant 0x7F800000 : f32
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.abs %13 : f32
%15 = arith.cmpf oeq, %14, %cst : f32
%16 = arith.extui %15 : i1 to i8
memref.store %16, %arg1[%12] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump Before TensorBufferize (tensor-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%3, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%1 : memref<3xf32>, %2 : memref<3xi8>)
%4 = bufferization.to_tensor %2 : memref<3xi8>
%5 = bufferization.to_memref %4 : memref<3xi8>
return %5 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%cst = arith.constant 0x7F800000 : f32
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.abs %13 : f32
%15 = arith.cmpf oeq, %14, %cst : f32
%16 = arith.extui %15 : i1 to i8
memref.store %16, %arg1[%12] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump After TensorBufferize (tensor-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%3 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%cst = arith.constant 0x7F800000 : f32
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.abs %13 : f32
%15 = arith.cmpf oeq, %14, %cst : f32
%16 = arith.extui %15 : i1 to i8
memref.store %16, %arg1[%12] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump Before ConvertAffineToStandard (lower-affine) ('gpu.module' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%3 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%cst = arith.constant 0x7F800000 : f32
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.abs %13 : f32
%15 = arith.cmpf oeq, %14, %cst : f32
%16 = arith.extui %15 : i1 to i8
memref.store %16, %arg1[%12] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump After ConvertAffineToStandard (lower-affine) ('gpu.module' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%3 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%cst = arith.constant 0x7F800000 : f32
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.abs %14 : f32
%16 = arith.cmpf oeq, %15, %cst : f32
%17 = arith.extui %16 : i1 to i8
memref.store %17, %arg1[%13] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump Before Elixir.Manx.Lowering.PutSPVAttrPass (put_spv_attr_pass) ('gpu.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%3 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%cst = arith.constant 0x7F800000 : f32
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.abs %14 : f32
%16 = arith.cmpf oeq, %15, %cst : f32
%17 = arith.extui %16 : i1 to i8
memref.store %17, %arg1[%13] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump After Elixir.Manx.Lowering.PutSPVAttrPass (put_spv_attr_pass) ('gpu.func' operation: @Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%3 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%cst = arith.constant 0x7F800000 : f32
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.abs %14 : f32
%16 = arith.cmpf oeq, %15, %cst : f32
%17 = arith.extui %16 : i1 to i8
memref.store %17, %arg1[%13] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump Before ConvertVectorToSPIRV (convert-vector-to-spirv) ('builtin.module' operation) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%3 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%cst = arith.constant 0x7F800000 : f32
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.abs %14 : f32
%16 = arith.cmpf oeq, %15, %cst : f32
%17 = arith.extui %16 : i1 to i8
memref.store %17, %arg1[%13] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump After ConvertVectorToSPIRV (convert-vector-to-spirv) ('builtin.module' operation) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%3 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%cst = arith.constant 0x7F800000 : f32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.abs %12 : f32
%14 = arith.cmpf oeq, %13, %cst : f32
%15 = arith.extui %14 : i1 to i8
memref.store %15, %arg1[%0] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump Before ConvertArithmeticToSPIRV (convert-arith-to-spirv) ('builtin.module' operation) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cst = arith.constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%3 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%cst = arith.constant 0x7F800000 : f32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.abs %12 : f32
%14 = arith.cmpf oeq, %13, %cst : f32
%15 = arith.extui %14 : i1 to i8
memref.store %15, %arg1[%0] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump After ConvertArithmeticToSPIRV (convert-arith-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%4 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.abs %12 : f32
%14 = spv.FOrdEqual %13, %cst_f32 : f32
%cst0_i32_0 = spv.Constant 0 : i32
%cst1_i32_1 = spv.Constant 1 : i32
%15 = spv.Select %14, %cst1_i32_1, %cst0_i32_0 : i1, i32
%16 = builtin.unrealized_conversion_cast %15 : i32 to i8
memref.store %16, %arg1[%0] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump Before ConvertControlFlowToSPIRV (convert-cf-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%4 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.abs %12 : f32
%14 = spv.FOrdEqual %13, %cst_f32 : f32
%cst0_i32_0 = spv.Constant 0 : i32
%cst1_i32_1 = spv.Constant 1 : i32
%15 = spv.Select %14, %cst1_i32_1, %cst0_i32_0 : i1, i32
%16 = builtin.unrealized_conversion_cast %15 : i32 to i8
memref.store %16, %arg1[%0] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump After ConvertControlFlowToSPIRV (convert-cf-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%4 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.abs %12 : f32
%14 = spv.FOrdEqual %13, %cst_f32 : f32
%cst0_i32_0 = spv.Constant 0 : i32
%cst1_i32_1 = spv.Constant 1 : i32
%15 = spv.Select %14, %cst1_i32_1, %cst0_i32_0 : i1, i32
%16 = builtin.unrealized_conversion_cast %15 : i32 to i8
memref.store %16, %arg1[%0] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump Before ConvertMathToSPIRV (convert-math-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%4 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.abs %12 : f32
%14 = spv.FOrdEqual %13, %cst_f32 : f32
%cst0_i32_0 = spv.Constant 0 : i32
%cst1_i32_1 = spv.Constant 1 : i32
%15 = spv.Select %14, %cst1_i32_1, %cst0_i32_0 : i1, i32
%16 = builtin.unrealized_conversion_cast %15 : i32 to i8
memref.store %16, %arg1[%0] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump After ConvertMathToSPIRV (convert-math-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%4 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.FAbs %12 : f32
%14 = spv.FOrdEqual %13, %cst_f32 : f32
%cst0_i32_0 = spv.Constant 0 : i32
%cst1_i32_1 = spv.Constant 1 : i32
%15 = spv.Select %14, %cst1_i32_1, %cst0_i32_0 : i1, i32
%16 = builtin.unrealized_conversion_cast %15 : i32 to i8
memref.store %16, %arg1[%0] : memref<3xi8>
gpu.return
}
}
}
// -----// IR Dump Before ConvertGPUToSPIRV (convert-gpu-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xi8> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xi8>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xi8>)
%4 = bufferization.to_tensor %1 : memref<3xi8>
return %1 : memref<3xi8>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xi8>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst_f32 = spv.Constant 0x7F800000 : f32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.FAbs %12 : f32
%14 = spv.FOrdEqual %13, %cst_f32 : f32
%cst0_i32_0 = spv.Constant 0 : i32
%cst1_i32_1 = spv.Constant 1 : i32
%15 = spv.Select %14, %cst1_i32_1, %cst0_i32_0 : i1, i32
%16 = builtin.unrealized_conversion_cast %15 : i32 to i8
memref.store %16, %arg1[%0] : memref<3xi8>
gpu.return
}
}
}
[Beaver] [loc(unknown)] failed to legalize operation 'builtin.unrealized_conversion_cast'
// -----// IR Dump After ConvertGPUToSPIRV Failed (convert-gpu-to-spirv) ('builtin.module' operation) //----- //
"builtin.module"() ({
"func.func"() ({
^bb0(%arg0: memref<3xf32>):
%0 = "bufferization.to_tensor"(%arg0) : (memref<3xf32>) -> tensor<3xf32>
%1 = "spv.Constant"() {value = 3 : i32} : () -> i32
%2 = "spv.Constant"() {value = 0 : i32} : () -> i32
%3 = "spv.Constant"() {value = 1 : i32} : () -> i32
%4 = "spv.Constant"() {value = 0x7F800000 : f32} : () -> f32
%5 = "memref.alloc"() {alignment = 128 : i64, operand_segment_sizes = dense<0> : vector<2xi32>} : () -> memref<3xi8>
%6 = "spv.Constant"() {value = 1 : i32} : () -> i32
%7 = "builtin.unrealized_conversion_cast"(%6) : (i32) -> index
%8 = "spv.Constant"() {value = 3 : i32} : () -> i32
%9 = "builtin.unrealized_conversion_cast"(%8) : (i32) -> index
"gpu.launch_func"(%9, %7, %7, %7, %7, %7, %arg0, %5) {kernel = @"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel", operand_segment_sizes = dense<[0, 1, 1, 1, 1, 1, 1, 0, 2]> : vector<9xi32>} : (index, index, index, index, index, index, memref<3xf32>, memref<3xi8>) -> ()
%10 = "bufferization.to_tensor"(%5) : (memref<3xi8>) -> tensor<3xi8>
"func.return"(%5) : (memref<3xi8>) -> ()
}) {function_type = (memref<3xf32>) -> memref<3xi8>, llvm.emit_c_interface, sym_name = "Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880"} : () -> ()
"gpu.module"() ({
"gpu.func"() ({
^bb0(%arg0: memref<3xf32>, %arg1: memref<3xi8>):
%0 = "gpu.block_id"() {dimension = #gpu<dim x>} : () -> index
%1 = "gpu.block_id"() {dimension = #gpu<dim y>} : () -> index
%2 = "gpu.block_id"() {dimension = #gpu<dim z>} : () -> index
%3 = "gpu.thread_id"() {dimension = #gpu<dim x>} : () -> index
%4 = "gpu.thread_id"() {dimension = #gpu<dim y>} : () -> index
%5 = "gpu.thread_id"() {dimension = #gpu<dim z>} : () -> index
%6 = "gpu.grid_dim"() {dimension = #gpu<dim x>} : () -> index
%7 = "gpu.grid_dim"() {dimension = #gpu<dim y>} : () -> index
%8 = "gpu.grid_dim"() {dimension = #gpu<dim z>} : () -> index
%9 = "gpu.block_dim"() {dimension = #gpu<dim x>} : () -> index
%10 = "gpu.block_dim"() {dimension = #gpu<dim y>} : () -> index
%11 = "gpu.block_dim"() {dimension = #gpu<dim z>} : () -> index
"spv.Branch"()[^bb1] : () -> ()
^bb1: // pred: ^bb0
%12 = "spv.Constant"() {value = 1 : i32} : () -> i32
%13 = "spv.Constant"() {value = 0 : i32} : () -> i32
%14 = "spv.Constant"() {value = 0x7F800000 : f32} : () -> f32
%15 = "memref.load"(%arg0, %0) : (memref<3xf32>, index) -> f32
%16 = "spv.GLSL.FAbs"(%15) : (f32) -> f32
%17 = "spv.FOrdEqual"(%16, %14) : (f32, f32) -> i1
%18 = "spv.Constant"() {value = 0 : i32} : () -> i32
%19 = "spv.Constant"() {value = 1 : i32} : () -> i32
%20 = "spv.Select"(%17, %19, %18) : (i1, i32, i32) -> i32
%21 = "builtin.unrealized_conversion_cast"(%20) : (i32) -> i8
"memref.store"(%21, %arg1, %0) : (i8, memref<3xi8>, index) -> ()
"gpu.return"() : () -> ()
}) {function_type = (memref<3xf32>, memref<3xi8>) -> (), gpu.kernel, spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>, sym_name = "Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel", workgroup_attributions = 0 : i64} : () -> ()
"gpu.module_end"() : () -> ()
}) {sym_name = "Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"} : () -> ()
"gpu.module"() ({
"gpu.func"() ({
^bb0(%arg0: memref<3xf32>, %arg1: memref<3xi8>):
%0 = "gpu.block_id"() {dimension = #gpu<dim x>} : () -> index
%1 = "gpu.block_id"() {dimension = #gpu<dim y>} : () -> index
%2 = "gpu.block_id"() {dimension = #gpu<dim z>} : () -> index
%3 = "gpu.thread_id"() {dimension = #gpu<dim x>} : () -> index
%4 = "gpu.thread_id"() {dimension = #gpu<dim y>} : () -> index
%5 = "gpu.thread_id"() {dimension = #gpu<dim z>} : () -> index
%6 = "gpu.grid_dim"() {dimension = #gpu<dim x>} : () -> index
%7 = "gpu.grid_dim"() {dimension = #gpu<dim y>} : () -> index
%8 = "gpu.grid_dim"() {dimension = #gpu<dim z>} : () -> index
%9 = "gpu.block_dim"() {dimension = #gpu<dim x>} : () -> index
%10 = "gpu.block_dim"() {dimension = #gpu<dim y>} : () -> index
%11 = "gpu.block_dim"() {dimension = #gpu<dim z>} : () -> index
"spv.Branch"()[^bb1] : () -> ()
^bb1: // pred: ^bb0
%12 = "spv.Constant"() {value = 1 : i32} : () -> i32
%13 = "spv.Constant"() {value = 0 : i32} : () -> i32
%14 = "spv.Constant"() {value = 0x7F800000 : f32} : () -> f32
%15 = "memref.load"(%arg0, %0) : (memref<3xf32>, index) -> f32
%16 = "spv.GLSL.FAbs"(%15) : (f32) -> f32
%17 = "spv.FOrdEqual"(%16, %14) : (f32, f32) -> i1
%18 = "spv.Constant"() {value = 0 : i32} : () -> i32
%19 = "spv.Constant"() {value = 1 : i32} : () -> i32
%20 = "spv.Select"(%17, %19, %18) : (i1, i32, i32) -> i32
%21 = "builtin.unrealized_conversion_cast"(%20) : (i32) -> i8
"memref.store"(%21, %arg1, %0) : (i8, memref<3xi8>, index) -> ()
"gpu.return"() : () -> ()
}) {function_type = (memref<3xf32>, memref<3xi8>) -> (), gpu.kernel, spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>, sym_name = "Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel", workgroup_attributions = 0 : i64} : () -> ()
"gpu.module_end"() : () -> ()
}) {sym_name = "Elixir.Manx.ExprTest.-unary_is_infinity/1-fun-0-.32300880_kernel"} : () -> ()
}) {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} : () -> ()
1) test unary float ops is_infinity (Manx.ExprTest)
apps/manx/test/beaver/defn/expr_test.exs:813
** (RuntimeError) Unexpected failure running pass pipeline
code: unquote(defn_fun)(@float_tensor),
stacktrace:
(beaver 0.1.0) lib/beaver/mlir/pass/composer.ex:85: Beaver.MLIR.Pass.Composer.run!/2
(manx 0.1.0) lib/manx/nx/compiler.ex:71: Manx.Compiler.__jit__/5
(nx 0.3.0-dev) lib/nx/defn/compiler.ex:323: Nx.Defn.Compiler.__runtime__/2
test/beaver/defn/expr_test.exs:815: (test)
--max-failures reached, aborting test suite
Finished in 1.0 seconds (1.0s async, 0.00s sync)
69 tests, 1 failure, 68 excluded
Randomized with seed 633162
tsai@183eefe61145 beaver % mix test --max-failures 1 apps/manx/test/beaver/defn/expr_test.exs:788
21:59:31.670 [debug] [CMake] configuring...
21:59:32.411 [debug] [CMake] building...
21:59:32.545 [debug] [CMake] installed to /Users/tsai/oss/beaver/_build/test/native-install
==> manx
21:59:32.780 [debug] [Beaver] loading NIF
21:59:37.168 [debug] [Beaver] NIF loaded
21:59:37.180 [debug] [Beaver] global MLIR context created
21:59:37.655 [debug] [Beaver] dialect modules loaded
Excluding tags: [:test]
Including tags: [line: "788"]
21:59:38.647 [info] [Beaver] IR printing enabled
// -----// IR Dump Before Canonicalizer (canonicalize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> {
%0 = "tosa.cast"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
%1 = "tosa.log"(%0) : (tensor<3xf32>) -> tensor<3xf32>
return %1 : tensor<3xf32>
}
}
// -----// IR Dump After Canonicalizer (canonicalize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> {
%0 = "tosa.log"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before TosaMakeBroadcastable (tosa-make-broadcastable) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> {
%0 = "tosa.log"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before LLVMRequestCWrappers (llvm-request-c-wrappers) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> {
%0 = "tosa.log"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump After LLVMRequestCWrappers (llvm-request-c-wrappers) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.log"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before TosaLayerwiseConstantFoldPass (tosa-layerwise-constant-fold) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.log"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before CSE (cse) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.log"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before TosaToArith (tosa-to-arith) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.log"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before TosaToTensor (tosa-to-tensor) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.log"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before ConvertTensorToLinalg (convert-tensor-to-linalg) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.log"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump Before TosaToLinalg (tosa-to-linalg) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = "tosa.log"(%arg0) : (tensor<3xf32>) -> tensor<3xf32>
return %0 : tensor<3xf32>
}
}
// -----// IR Dump After TosaToLinalg (tosa-to-linalg) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = linalg.init_tensor [3] : tensor<3xf32>
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%arg0 : tensor<3xf32>) outs(%0 : tensor<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%2 = math.log %arg1 : f32
linalg.yield %2 : f32
} -> tensor<3xf32>
return %1 : tensor<3xf32>
}
}
// -----// IR Dump Before LinalgElementwiseOpFusion (linalg-fuse-elementwise-ops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = linalg.init_tensor [3] : tensor<3xf32>
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%arg0 : tensor<3xf32>) outs(%0 : tensor<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%2 = math.log %arg1 : f32
linalg.yield %2 : f32
} -> tensor<3xf32>
return %1 : tensor<3xf32>
}
}
// -----// IR Dump Before LinalgBufferize (linalg-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = linalg.init_tensor [3] : tensor<3xf32>
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%arg0 : tensor<3xf32>) outs(%0 : tensor<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%2 = math.log %arg1 : f32
linalg.yield %2 : f32
} -> tensor<3xf32>
return %1 : tensor<3xf32>
}
}
// -----// IR Dump After LinalgBufferize (linalg-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = linalg.init_tensor [3] : tensor<3xf32>
%c3 = arith.constant 3 : index
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%3 = bufferization.to_tensor %2 : memref<3xf32>
linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%0 : memref<3xf32>) outs(%2 : memref<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%5 = math.log %arg1 : f32
linalg.yield %5 : f32
}
%4 = bufferization.to_tensor %2 : memref<3xf32>
return %4 : tensor<3xf32>
}
}
// -----// IR Dump Before LinalgLowerToParallelLoops (convert-linalg-to-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
#map = affine_map<(d0) -> (d0)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = linalg.init_tensor [3] : tensor<3xf32>
%c3 = arith.constant 3 : index
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%3 = bufferization.to_tensor %2 : memref<3xf32>
linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%0 : memref<3xf32>) outs(%2 : memref<3xf32>) {
^bb0(%arg1: f32, %arg2: f32):
%5 = math.log %arg1 : f32
linalg.yield %5 : f32
}
%4 = bufferization.to_tensor %2 : memref<3xf32>
return %4 : tensor<3xf32>
}
}
// -----// IR Dump After LinalgLowerToParallelLoops (convert-linalg-to-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.log %3 : f32
memref.store %4, %1[%arg1] : memref<3xf32>
scf.yield
}
%2 = bufferization.to_tensor %1 : memref<3xf32>
return %2 : tensor<3xf32>
}
}
// -----// IR Dump Before GpuMapParallelLoopsPass (gpu-map-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.log %3 : f32
memref.store %4, %1[%arg1] : memref<3xf32>
scf.yield
}
%2 = bufferization.to_tensor %1 : memref<3xf32>
return %2 : tensor<3xf32>
}
}
// -----// IR Dump After GpuMapParallelLoopsPass (gpu-map-parallel-loops) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.log %3 : f32
memref.store %4, %1[%arg1] : memref<3xf32>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%2 = bufferization.to_tensor %1 : memref<3xf32>
return %2 : tensor<3xf32>
}
}
// -----// IR Dump Before ArithmeticBufferize (arith-bufferize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.log %3 : f32
memref.store %4, %1[%arg1] : memref<3xf32>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%2 = bufferization.to_tensor %1 : memref<3xf32>
return %2 : tensor<3xf32>
}
}
// -----// IR Dump Before FuncBufferize (func-bufferize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: tensor<3xf32>) -> tensor<3xf32> attributes {llvm.emit_c_interface} {
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%0 = bufferization.to_memref %arg0 : memref<3xf32>
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%3 = memref.load %0[%arg1] : memref<3xf32>
%4 = math.log %3 : f32
memref.store %4, %1[%arg1] : memref<3xf32>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%2 = bufferization.to_tensor %1 : memref<3xf32>
return %2 : tensor<3xf32>
}
}
// -----// IR Dump After FuncBufferize (func-bufferize) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%5 = memref.load %1[%arg1] : memref<3xf32>
%6 = math.log %5 : f32
memref.store %6, %2[%arg1] : memref<3xf32>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%3 = bufferization.to_tensor %2 : memref<3xf32>
%4 = bufferization.to_memref %3 : memref<3xf32>
return %4 : memref<3xf32>
}
}
// -----// IR Dump Before ConvertParallelLoopToGpu (convert-parallel-loops-to-gpu) ('builtin.module' operation) //----- //
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
scf.parallel (%arg1) = (%c0) to (%c3) step (%c1) {
%5 = memref.load %1[%arg1] : memref<3xf32>
%6 = math.log %5 : f32
memref.store %6, %2[%arg1] : memref<3xf32>
scf.yield
} {mapping = [#gpu.loop_dim_map<processor = block_x, map = (d0) -> (d0), bound = (d0) -> (d0)>]}
%3 = bufferization.to_tensor %2 : memref<3xf32>
%4 = bufferization.to_memref %3 : memref<3xf32>
return %4 : memref<3xf32>
}
}
// -----// IR Dump After ConvertParallelLoopToGpu (convert-parallel-loops-to-gpu) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%6 = affine.apply #map1(%arg1)[%c1, %c0]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.log %7 : f32
memref.store %8, %2[%6] : memref<3xf32>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
}
// -----// IR Dump Before GpuLaunchSinkIndexComputations (gpu-launch-sink-index-computations) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%6 = affine.apply #map1(%arg1)[%c1, %c0]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.log %7 : f32
memref.store %8, %2[%6] : memref<3xf32>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
}
// -----// IR Dump After GpuLaunchSinkIndexComputations (gpu-launch-sink-index-computations) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%c1_1 = arith.constant 1 : index
%c0_2 = arith.constant 0 : index
%6 = affine.apply #map1(%arg1)[%c1_1, %c0_2]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.log %7 : f32
memref.store %8, %2[%6] : memref<3xf32>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
}
// -----// IR Dump Before GpuKernelOutlining (gpu-kernel-outlining) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch blocks(%arg1, %arg2, %arg3) in (%arg7 = %3, %arg8 = %c1_0, %arg9 = %c1_0) threads(%arg4, %arg5, %arg6) in (%arg10 = %c1_0, %arg11 = %c1_0, %arg12 = %c1_0) {
%c1_1 = arith.constant 1 : index
%c0_2 = arith.constant 0 : index
%6 = affine.apply #map1(%arg1)[%c1_1, %c0_2]
%7 = memref.load %1[%6] : memref<3xf32>
%8 = math.log %7 : f32
memref.store %8, %2[%6] : memref<3xf32>
gpu.terminator
} {SCFToGPU_visited}
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
}
// -----// IR Dump After GpuKernelOutlining (gpu-kernel-outlining) ('builtin.module' operation) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%1 : memref<3xf32>, %2 : memref<3xf32>)
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.log %13 : f32
memref.store %14, %arg1[%12] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before TensorBufferize (tensor-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = bufferization.to_memref %0 : memref<3xf32>
%2 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%3 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%1 : memref<3xf32>, %2 : memref<3xf32>)
%4 = bufferization.to_tensor %2 : memref<3xf32>
%5 = bufferization.to_memref %4 : memref<3xf32>
return %5 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.log %13 : f32
memref.store %14, %arg1[%12] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After TensorBufferize (tensor-bufferize) ('func.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.log %13 : f32
memref.store %14, %arg1[%12] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertAffineToStandard (lower-affine) ('gpu.module' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel) //----- //
#map0 = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
#map1 = affine_map<(d0)[s0, s1] -> (d0 * s0 + s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map0(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = affine.apply #map1(%0)[%c1, %c0]
%13 = memref.load %arg0[%12] : memref<3xf32>
%14 = math.log %13 : f32
memref.store %14, %arg1[%12] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertAffineToStandard (lower-affine) ('gpu.module' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.log %14 : f32
memref.store %15, %arg1[%13] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before Elixir.Manx.Lowering.PutSPVAttrPass (put_spv_attr_pass) ('gpu.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.log %14 : f32
memref.store %15, %arg1[%13] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After Elixir.Manx.Lowering.PutSPVAttrPass (put_spv_attr_pass) ('gpu.func' operation: @Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.log %14 : f32
memref.store %15, %arg1[%13] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertVectorToSPIRV (convert-vector-to-spirv) ('builtin.module' operation) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = arith.muli %0, %c1 : index
%13 = arith.addi %12, %c0 : index
%14 = memref.load %arg0[%13] : memref<3xf32>
%15 = math.log %14 : f32
memref.store %15, %arg1[%13] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertVectorToSPIRV (convert-vector-to-spirv) ('builtin.module' operation) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertArithmeticToSPIRV (convert-arith-to-spirv) ('builtin.module' operation) //----- //
#map = affine_map<(d0)[s0, s1] -> ((d0 - s0) ceildiv s1)>
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%c3 = arith.constant 3 : index
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%c1_0 = arith.constant 1 : index
%2 = affine.apply #map(%c3)[%c0, %c1]
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%2, %c1_0, %c1_0) threads in (%c1_0, %c1_0, %c1_0) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%3 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertArithmeticToSPIRV (convert-arith-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertControlFlowToSPIRV (convert-cf-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
cf.br ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertControlFlowToSPIRV (convert-cf-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertMathToSPIRV (convert-math-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = math.log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertMathToSPIRV (convert-math-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertGPUToSPIRV (convert-gpu-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertGPUToSPIRV (convert-gpu-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" Logical GLSL450 {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer> {spv.interface_var_abi = #spv.interface_var_abi<(0, 0)>}, %arg1: !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer> {spv.interface_var_abi = #spv.interface_var_abi<(0, 1)>}) "None" attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>, workgroup_attributions = 0 : i64} {
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %arg0[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Log %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %arg1[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before SPIRVLowerABIAttributes (spirv-lower-abi-attrs) ('spv.module' operation: @__spv__Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" Logical GLSL450 {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer> {spv.interface_var_abi = #spv.interface_var_abi<(0, 0)>}, %arg1: !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer> {spv.interface_var_abi = #spv.interface_var_abi<(0, 1)>}) "None" attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>, workgroup_attributions = 0 : i64} {
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %arg0[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Log %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %arg1[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After SPIRVLowerABIAttributes (spirv-lower-abi-attrs) ('spv.module' operation: @__spv__Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" Logical GLSL450 {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0" bind(0, 0) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1" bind(0, 1) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"() "None" attributes {workgroup_attributions = 0 : i64} {
%Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_1_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_0_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_0_addr[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Log %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_1_addr[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
spv.EntryPoint "GLCompute" @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel", @__builtin_var_WorkgroupId__, @__builtin_var_LocalInvocationId__, @__builtin_var_NumWorkgroups__
spv.ExecutionMode @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" "LocalSize", 16, 1, 1
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before SPIRVUpdateVCE (spirv-update-vce) ('spv.module' operation: @__spv__Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" Logical GLSL450 {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0" bind(0, 0) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1" bind(0, 1) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"() "None" attributes {workgroup_attributions = 0 : i64} {
%Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_1_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_0_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_0_addr[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Log %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_1_addr[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
spv.EntryPoint "GLCompute" @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel", @__builtin_var_WorkgroupId__, @__builtin_var_LocalInvocationId__, @__builtin_var_NumWorkgroups__
spv.ExecutionMode @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" "LocalSize", 16, 1, 1
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After SPIRVUpdateVCE (spirv-update-vce) ('spv.module' operation: @__spv__Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" Logical GLSL450 requires #spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]> {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0" bind(0, 0) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1" bind(0, 1) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"() "None" attributes {workgroup_attributions = 0 : i64} {
%Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_1_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_0_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_0_addr[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Log %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_1_addr[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
spv.EntryPoint "GLCompute" @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel", @__builtin_var_WorkgroupId__, @__builtin_var_LocalInvocationId__, @__builtin_var_NumWorkgroups__
spv.ExecutionMode @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" "LocalSize", 16, 1, 1
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump Before ConvertGpuLaunchFuncToVulkanLaunchFunc (convert-gpu-launch-to-vulkan-launch) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
gpu.launch_func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"::@"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" blocks in (%3, %2, %2) threads in (%2, %2, %2) args(%arg0 : memref<3xf32>, %1 : memref<3xf32>)
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
spv.module @"__spv__Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" Logical GLSL450 requires #spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]> {
spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr<vector<3xi32>, Input>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0" bind(0, 0) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.GlobalVariable @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1" bind(0, 1) : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
spv.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"() "None" attributes {workgroup_attributions = 0 : i64} {
%Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_1_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_0_addr = spv.mlir.addressof @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0" : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>
%__builtin_var_WorkgroupId___addr = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%0 = spv.Load "Input" %__builtin_var_WorkgroupId___addr : vector<3xi32>
%1 = spv.CompositeExtract %0[0 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_0 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%2 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_0 : vector<3xi32>
%3 = spv.CompositeExtract %2[1 : i32] : vector<3xi32>
%__builtin_var_WorkgroupId___addr_1 = spv.mlir.addressof @__builtin_var_WorkgroupId__ : !spv.ptr<vector<3xi32>, Input>
%4 = spv.Load "Input" %__builtin_var_WorkgroupId___addr_1 : vector<3xi32>
%5 = spv.CompositeExtract %4[2 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%6 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr : vector<3xi32>
%7 = spv.CompositeExtract %6[0 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_2 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%8 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_2 : vector<3xi32>
%9 = spv.CompositeExtract %8[1 : i32] : vector<3xi32>
%__builtin_var_LocalInvocationId___addr_3 = spv.mlir.addressof @__builtin_var_LocalInvocationId__ : !spv.ptr<vector<3xi32>, Input>
%10 = spv.Load "Input" %__builtin_var_LocalInvocationId___addr_3 : vector<3xi32>
%11 = spv.CompositeExtract %10[2 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%12 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr : vector<3xi32>
%13 = spv.CompositeExtract %12[0 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_4 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%14 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_4 : vector<3xi32>
%15 = spv.CompositeExtract %14[1 : i32] : vector<3xi32>
%__builtin_var_NumWorkgroups___addr_5 = spv.mlir.addressof @__builtin_var_NumWorkgroups__ : !spv.ptr<vector<3xi32>, Input>
%16 = spv.Load "Input" %__builtin_var_NumWorkgroups___addr_5 : vector<3xi32>
%17 = spv.CompositeExtract %16[2 : i32] : vector<3xi32>
%cst16_i32 = spv.Constant 16 : i32
%cst1_i32 = spv.Constant 1 : i32
%cst1_i32_6 = spv.Constant 1 : i32
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32_7 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst0_i32_8 = spv.Constant 0 : i32
%cst0_i32_9 = spv.Constant 0 : i32
%cst1_i32_10 = spv.Constant 1 : i32
%18 = spv.IMul %cst1_i32_10, %1 : i32
%19 = spv.IAdd %cst0_i32_9, %18 : i32
%20 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_0_addr[%cst0_i32_8, %19] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
%21 = spv.Load "StorageBuffer" %20 : f32
%22 = spv.GLSL.Log %21 : f32
%cst0_i32_11 = spv.Constant 0 : i32
%cst0_i32_12 = spv.Constant 0 : i32
%cst1_i32_13 = spv.Constant 1 : i32
%23 = spv.IMul %cst1_i32_13, %1 : i32
%24 = spv.IAdd %cst0_i32_12, %23 : i32
%25 = spv.AccessChain %Elixir.Manx.ExprTest.-unary_log2F1-fun-0-.32300880_kernel_arg_1_addr[%cst0_i32_11, %24] : !spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>, i32, i32
spv.Store "StorageBuffer" %25, %22 : f32
spv.Return
}
spv.EntryPoint "GLCompute" @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel", @__builtin_var_WorkgroupId__, @__builtin_var_LocalInvocationId__, @__builtin_var_NumWorkgroups__
spv.ExecutionMode @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" "LocalSize", 16, 1, 1
}
gpu.module @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel" {
gpu.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"(%arg0: memref<3xf32>, %arg1: memref<3xf32>) kernel attributes {spv.entry_point_abi = #spv.entry_point_abi<local_size = dense<[16, 1, 1]> : vector<3xi32>>} {
%0 = gpu.block_id x
%1 = gpu.block_id y
%2 = gpu.block_id z
%3 = gpu.thread_id x
%4 = gpu.thread_id y
%5 = gpu.thread_id z
%6 = gpu.grid_dim x
%7 = gpu.grid_dim y
%8 = gpu.grid_dim z
%9 = gpu.block_dim x
%10 = gpu.block_dim y
%11 = gpu.block_dim z
spv.Branch ^bb1
^bb1: // pred: ^bb0
%cst1_i32 = spv.Constant 1 : i32
%cst0_i32 = spv.Constant 0 : i32
%12 = memref.load %arg0[%0] : memref<3xf32>
%13 = spv.GLSL.Log %12 : f32
memref.store %13, %arg1[%0] : memref<3xf32>
gpu.return
}
}
}
// -----// IR Dump After ConvertGpuLaunchFuncToVulkanLaunchFunc (convert-gpu-launch-to-vulkan-launch) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
call @vulkanLaunch(%3, %2, %2, %arg0, %1) {spirv_blob = "\03\02#\07\00\00\01\00\16\00\00\002\00\00\00\00\00\00\00\11\00\02\00\01\00\00\00\0A\00\0B\00SPV_KHR_storage_buffer_storage_class\00\00\00\00\0B\00\06\00.\00\00\00GLSL.std.450\00\00\00\00\0E\00\03\00\00\00\00\00\01\00\00\00\0F\00\15\00\05\00\00\00\10\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel\00\00\00\00\06\00\00\00\05\00\00\00\04\00\00\00\10\00\06\00\10\00\00\00\11\00\00\00\10\00\00\00\01\00\00\00\01\00\00\00\05\00\0A\00\04\00\00\00__builtin_var_NumWorkgroups__\00\00\00\05\00\0B\00\05\00\00\00__builtin_var_LocalInvocationId__\00\00\00\05\00\09\00\06\00\00\00__builtin_var_WorkgroupId__\00\05\00\12\00\0C\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0\00\00\05\00\12\00\0D\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1\00\00\05\00\11\00\10\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel\00\00\00\00G\00\04\00\04\00\00\00\0B\00\00\00\18\00\00\00G\00\04\00\05\00\00\00\0B\00\00\00\1B\00\00\00G\00\04\00\06\00\00\00\0B\00\00\00\1A\00\00\00G\00\04\00\09\00\00\00\06\00\00\00\04\00\00\00H\00\05\00\08\00\00\00\00\00\00\00#\00\00\00\00\00\00\00G\00\03\00\08\00\00\00\02\00\00\00G\00\04\00\0C\00\00\00!\00\00\00\00\00\00\00G\00\04\00\0C\00\00\00\22\00\00\00\00\00\00\00G\00\04\00\0D\00\00\00!\00\00\00\01\00\00\00G\00\04\00\0D\00\00\00\22\00\00\00\00\00\00\00\15\00\04\00\03\00\00\00 \00\00\00\00\00\00\00\17\00\04\00\02\00\00\00\03\00\00\00\03\00\00\00 \00\04\00\01\00\00\00\01\00\00\00\02\00\00\00;\00\04\00\01\00\00\00\04\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\05\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\06\00\00\00\01\00\00\00\16\00\03\00\0A\00\00\00 \00\00\00+\00\04\00\03\00\00\00\0B\00\00\00\03\00\00\00\1C\00\04\00\09\00\00\00\0A\00\00\00\0B\00\00\00\1E\00\03\00\08\00\00\00\09\00\00\00 \00\04\00\07\00\00\00\0C\00\00\00\08\00\00\00;\00\04\00\07\00\00\00\0C\00\00\00\0C\00\00\00;\00\04\00\07\00\00\00\0D\00\00\00\0C\00\00\00\13\00\02\00\0F\00\00\00!\00\03\00\0E\00\00\00\0F\00\00\00+\00\04\00\03\00\00\00$\00\00\00\10\00\00\00+\00\04\00\03\00\00\00%\00\00\00\01\00\00\00+\00\04\00\03\00\00\00'\00\00\00\00\00\00\00 \00\04\00*\00\00\00\0C\00\00\00\0A\00\00\006\00\05\00\0F\00\00\00\10\00\00\00\00\00\00\00\0E\00\00\00\F8\00\02\00\11\00\00\00=\00\04\00\02\00\00\00\12\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\13\00\00\00\12\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\14\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\15\00\00\00\14\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\16\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\17\00\00\00\16\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\18\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\19\00\00\00\18\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\1A\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1B\00\00\00\1A\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\1C\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1D\00\00\00\1C\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\1E\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00\1F\00\00\00\1E\00\00\00\00\00\00\00=\00\04\00\02\00\00\00 \00\00\00\04\00\00\00Q\00\05\00\03\00\00\00!\00\00\00 \00\00\00\01\00\00\00=\00\04\00\02\00\00\00\22\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00#\00\00\00\22\00\00\00\02\00\00\00\F9\00\02\00&\00\00\00\F8\00\02\00&\00\00\00\84\00\05\00\03\00\00\00(\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\00)\00\00\00'\00\00\00(\00\00\00A\00\06\00*\00\00\00+\00\00\00\0C\00\00\00'\00\00\00)\00\00\00=\00\04\00\0A\00\00\00,\00\00\00+\00\00\00\0C\00\06\00\0A\00\00\00-\00\00\00.\00\00\00\1C\00\00\00,\00\00\00\84\00\05\00\03\00\00\00/\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\000\00\00\00'\00\00\00/\00\00\00A\00\06\00*\00\00\001\00\00\00\0D\00\00\00'\00\00\000\00\00\00>\00\03\001\00\00\00-\00\00\00\FD\00\01\008\00\01\00", spirv_entry_point = "Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"} : (index, index, index, memref<3xf32>, memref<3xf32>) -> ()
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
func.func private @vulkanLaunch(index, index, index, memref<3xf32>, memref<3xf32>)
}
// -----// IR Dump Before ConvertMemRefToSPIRV (convert-memref-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
call @vulkanLaunch(%3, %2, %2, %arg0, %1) {spirv_blob = "\03\02#\07\00\00\01\00\16\00\00\002\00\00\00\00\00\00\00\11\00\02\00\01\00\00\00\0A\00\0B\00SPV_KHR_storage_buffer_storage_class\00\00\00\00\0B\00\06\00.\00\00\00GLSL.std.450\00\00\00\00\0E\00\03\00\00\00\00\00\01\00\00\00\0F\00\15\00\05\00\00\00\10\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel\00\00\00\00\06\00\00\00\05\00\00\00\04\00\00\00\10\00\06\00\10\00\00\00\11\00\00\00\10\00\00\00\01\00\00\00\01\00\00\00\05\00\0A\00\04\00\00\00__builtin_var_NumWorkgroups__\00\00\00\05\00\0B\00\05\00\00\00__builtin_var_LocalInvocationId__\00\00\00\05\00\09\00\06\00\00\00__builtin_var_WorkgroupId__\00\05\00\12\00\0C\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0\00\00\05\00\12\00\0D\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1\00\00\05\00\11\00\10\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel\00\00\00\00G\00\04\00\04\00\00\00\0B\00\00\00\18\00\00\00G\00\04\00\05\00\00\00\0B\00\00\00\1B\00\00\00G\00\04\00\06\00\00\00\0B\00\00\00\1A\00\00\00G\00\04\00\09\00\00\00\06\00\00\00\04\00\00\00H\00\05\00\08\00\00\00\00\00\00\00#\00\00\00\00\00\00\00G\00\03\00\08\00\00\00\02\00\00\00G\00\04\00\0C\00\00\00!\00\00\00\00\00\00\00G\00\04\00\0C\00\00\00\22\00\00\00\00\00\00\00G\00\04\00\0D\00\00\00!\00\00\00\01\00\00\00G\00\04\00\0D\00\00\00\22\00\00\00\00\00\00\00\15\00\04\00\03\00\00\00 \00\00\00\00\00\00\00\17\00\04\00\02\00\00\00\03\00\00\00\03\00\00\00 \00\04\00\01\00\00\00\01\00\00\00\02\00\00\00;\00\04\00\01\00\00\00\04\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\05\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\06\00\00\00\01\00\00\00\16\00\03\00\0A\00\00\00 \00\00\00+\00\04\00\03\00\00\00\0B\00\00\00\03\00\00\00\1C\00\04\00\09\00\00\00\0A\00\00\00\0B\00\00\00\1E\00\03\00\08\00\00\00\09\00\00\00 \00\04\00\07\00\00\00\0C\00\00\00\08\00\00\00;\00\04\00\07\00\00\00\0C\00\00\00\0C\00\00\00;\00\04\00\07\00\00\00\0D\00\00\00\0C\00\00\00\13\00\02\00\0F\00\00\00!\00\03\00\0E\00\00\00\0F\00\00\00+\00\04\00\03\00\00\00$\00\00\00\10\00\00\00+\00\04\00\03\00\00\00%\00\00\00\01\00\00\00+\00\04\00\03\00\00\00'\00\00\00\00\00\00\00 \00\04\00*\00\00\00\0C\00\00\00\0A\00\00\006\00\05\00\0F\00\00\00\10\00\00\00\00\00\00\00\0E\00\00\00\F8\00\02\00\11\00\00\00=\00\04\00\02\00\00\00\12\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\13\00\00\00\12\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\14\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\15\00\00\00\14\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\16\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\17\00\00\00\16\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\18\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\19\00\00\00\18\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\1A\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1B\00\00\00\1A\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\1C\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1D\00\00\00\1C\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\1E\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00\1F\00\00\00\1E\00\00\00\00\00\00\00=\00\04\00\02\00\00\00 \00\00\00\04\00\00\00Q\00\05\00\03\00\00\00!\00\00\00 \00\00\00\01\00\00\00=\00\04\00\02\00\00\00\22\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00#\00\00\00\22\00\00\00\02\00\00\00\F9\00\02\00&\00\00\00\F8\00\02\00&\00\00\00\84\00\05\00\03\00\00\00(\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\00)\00\00\00'\00\00\00(\00\00\00A\00\06\00*\00\00\00+\00\00\00\0C\00\00\00'\00\00\00)\00\00\00=\00\04\00\0A\00\00\00,\00\00\00+\00\00\00\0C\00\06\00\0A\00\00\00-\00\00\00.\00\00\00\1C\00\00\00,\00\00\00\84\00\05\00\03\00\00\00/\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\000\00\00\00'\00\00\00/\00\00\00A\00\06\00*\00\00\001\00\00\00\0D\00\00\00'\00\00\000\00\00\00>\00\03\001\00\00\00-\00\00\00\FD\00\01\008\00\01\00", spirv_entry_point = "Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"} : (index, index, index, memref<3xf32>, memref<3xf32>) -> ()
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
func.func private @vulkanLaunch(index, index, index, memref<3xf32>, memref<3xf32>)
}
// -----// IR Dump Before SCFToSPIRV (convert-scf-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
call @vulkanLaunch(%3, %2, %2, %arg0, %1) {spirv_blob = "\03\02#\07\00\00\01\00\16\00\00\002\00\00\00\00\00\00\00\11\00\02\00\01\00\00\00\0A\00\0B\00SPV_KHR_storage_buffer_storage_class\00\00\00\00\0B\00\06\00.\00\00\00GLSL.std.450\00\00\00\00\0E\00\03\00\00\00\00\00\01\00\00\00\0F\00\15\00\05\00\00\00\10\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel\00\00\00\00\06\00\00\00\05\00\00\00\04\00\00\00\10\00\06\00\10\00\00\00\11\00\00\00\10\00\00\00\01\00\00\00\01\00\00\00\05\00\0A\00\04\00\00\00__builtin_var_NumWorkgroups__\00\00\00\05\00\0B\00\05\00\00\00__builtin_var_LocalInvocationId__\00\00\00\05\00\09\00\06\00\00\00__builtin_var_WorkgroupId__\00\05\00\12\00\0C\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0\00\00\05\00\12\00\0D\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1\00\00\05\00\11\00\10\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel\00\00\00\00G\00\04\00\04\00\00\00\0B\00\00\00\18\00\00\00G\00\04\00\05\00\00\00\0B\00\00\00\1B\00\00\00G\00\04\00\06\00\00\00\0B\00\00\00\1A\00\00\00G\00\04\00\09\00\00\00\06\00\00\00\04\00\00\00H\00\05\00\08\00\00\00\00\00\00\00#\00\00\00\00\00\00\00G\00\03\00\08\00\00\00\02\00\00\00G\00\04\00\0C\00\00\00!\00\00\00\00\00\00\00G\00\04\00\0C\00\00\00\22\00\00\00\00\00\00\00G\00\04\00\0D\00\00\00!\00\00\00\01\00\00\00G\00\04\00\0D\00\00\00\22\00\00\00\00\00\00\00\15\00\04\00\03\00\00\00 \00\00\00\00\00\00\00\17\00\04\00\02\00\00\00\03\00\00\00\03\00\00\00 \00\04\00\01\00\00\00\01\00\00\00\02\00\00\00;\00\04\00\01\00\00\00\04\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\05\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\06\00\00\00\01\00\00\00\16\00\03\00\0A\00\00\00 \00\00\00+\00\04\00\03\00\00\00\0B\00\00\00\03\00\00\00\1C\00\04\00\09\00\00\00\0A\00\00\00\0B\00\00\00\1E\00\03\00\08\00\00\00\09\00\00\00 \00\04\00\07\00\00\00\0C\00\00\00\08\00\00\00;\00\04\00\07\00\00\00\0C\00\00\00\0C\00\00\00;\00\04\00\07\00\00\00\0D\00\00\00\0C\00\00\00\13\00\02\00\0F\00\00\00!\00\03\00\0E\00\00\00\0F\00\00\00+\00\04\00\03\00\00\00$\00\00\00\10\00\00\00+\00\04\00\03\00\00\00%\00\00\00\01\00\00\00+\00\04\00\03\00\00\00'\00\00\00\00\00\00\00 \00\04\00*\00\00\00\0C\00\00\00\0A\00\00\006\00\05\00\0F\00\00\00\10\00\00\00\00\00\00\00\0E\00\00\00\F8\00\02\00\11\00\00\00=\00\04\00\02\00\00\00\12\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\13\00\00\00\12\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\14\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\15\00\00\00\14\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\16\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\17\00\00\00\16\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\18\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\19\00\00\00\18\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\1A\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1B\00\00\00\1A\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\1C\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1D\00\00\00\1C\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\1E\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00\1F\00\00\00\1E\00\00\00\00\00\00\00=\00\04\00\02\00\00\00 \00\00\00\04\00\00\00Q\00\05\00\03\00\00\00!\00\00\00 \00\00\00\01\00\00\00=\00\04\00\02\00\00\00\22\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00#\00\00\00\22\00\00\00\02\00\00\00\F9\00\02\00&\00\00\00\F8\00\02\00&\00\00\00\84\00\05\00\03\00\00\00(\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\00)\00\00\00'\00\00\00(\00\00\00A\00\06\00*\00\00\00+\00\00\00\0C\00\00\00'\00\00\00)\00\00\00=\00\04\00\0A\00\00\00,\00\00\00+\00\00\00\0C\00\06\00\0A\00\00\00-\00\00\00.\00\00\00\1C\00\00\00,\00\00\00\84\00\05\00\03\00\00\00/\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\000\00\00\00'\00\00\00/\00\00\00A\00\06\00*\00\00\001\00\00\00\0D\00\00\00'\00\00\000\00\00\00>\00\03\001\00\00\00-\00\00\00\FD\00\01\008\00\01\00", spirv_entry_point = "Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"} : (index, index, index, memref<3xf32>, memref<3xf32>) -> ()
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
func.func private @vulkanLaunch(index, index, index, memref<3xf32>, memref<3xf32>)
}
[Beaver] [loc(unknown)] failed to legalize unresolved materialization from 'memref<3xf32>' to '!spv.ptr<!spv.struct<(!spv.array<3 x f32, stride=4> [0])>, StorageBuffer>' that remained live after conversion
// -----// IR Dump After SCFToSPIRV Failed (convert-scf-to-spirv) ('builtin.module' operation) //----- //
module attributes {gpu.container_module, spv.target_env = #spv.target_env<#spv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spv.resource_limits<>>} {
func.func @"Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880"(%arg0: memref<3xf32>) -> memref<3xf32> attributes {llvm.emit_c_interface} {
%0 = bufferization.to_tensor %arg0 : memref<3xf32>
%cst3_i32 = spv.Constant 3 : i32
%cst0_i32 = spv.Constant 0 : i32
%cst1_i32 = spv.Constant 1 : i32
%1 = memref.alloc() {alignment = 128 : i64} : memref<3xf32>
%cst1_i32_0 = spv.Constant 1 : i32
%2 = builtin.unrealized_conversion_cast %cst1_i32_0 : i32 to index
%cst3_i32_1 = spv.Constant 3 : i32
%3 = builtin.unrealized_conversion_cast %cst3_i32_1 : i32 to index
call @vulkanLaunch(%3, %2, %2, %arg0, %1) {spirv_blob = "\03\02#\07\00\00\01\00\16\00\00\002\00\00\00\00\00\00\00\11\00\02\00\01\00\00\00\0A\00\0B\00SPV_KHR_storage_buffer_storage_class\00\00\00\00\0B\00\06\00.\00\00\00GLSL.std.450\00\00\00\00\0E\00\03\00\00\00\00\00\01\00\00\00\0F\00\15\00\05\00\00\00\10\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel\00\00\00\00\06\00\00\00\05\00\00\00\04\00\00\00\10\00\06\00\10\00\00\00\11\00\00\00\10\00\00\00\01\00\00\00\01\00\00\00\05\00\0A\00\04\00\00\00__builtin_var_NumWorkgroups__\00\00\00\05\00\0B\00\05\00\00\00__builtin_var_LocalInvocationId__\00\00\00\05\00\09\00\06\00\00\00__builtin_var_WorkgroupId__\00\05\00\12\00\0C\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_0\00\00\05\00\12\00\0D\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel_arg_1\00\00\05\00\11\00\10\00\00\00Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel\00\00\00\00G\00\04\00\04\00\00\00\0B\00\00\00\18\00\00\00G\00\04\00\05\00\00\00\0B\00\00\00\1B\00\00\00G\00\04\00\06\00\00\00\0B\00\00\00\1A\00\00\00G\00\04\00\09\00\00\00\06\00\00\00\04\00\00\00H\00\05\00\08\00\00\00\00\00\00\00#\00\00\00\00\00\00\00G\00\03\00\08\00\00\00\02\00\00\00G\00\04\00\0C\00\00\00!\00\00\00\00\00\00\00G\00\04\00\0C\00\00\00\22\00\00\00\00\00\00\00G\00\04\00\0D\00\00\00!\00\00\00\01\00\00\00G\00\04\00\0D\00\00\00\22\00\00\00\00\00\00\00\15\00\04\00\03\00\00\00 \00\00\00\00\00\00\00\17\00\04\00\02\00\00\00\03\00\00\00\03\00\00\00 \00\04\00\01\00\00\00\01\00\00\00\02\00\00\00;\00\04\00\01\00\00\00\04\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\05\00\00\00\01\00\00\00;\00\04\00\01\00\00\00\06\00\00\00\01\00\00\00\16\00\03\00\0A\00\00\00 \00\00\00+\00\04\00\03\00\00\00\0B\00\00\00\03\00\00\00\1C\00\04\00\09\00\00\00\0A\00\00\00\0B\00\00\00\1E\00\03\00\08\00\00\00\09\00\00\00 \00\04\00\07\00\00\00\0C\00\00\00\08\00\00\00;\00\04\00\07\00\00\00\0C\00\00\00\0C\00\00\00;\00\04\00\07\00\00\00\0D\00\00\00\0C\00\00\00\13\00\02\00\0F\00\00\00!\00\03\00\0E\00\00\00\0F\00\00\00+\00\04\00\03\00\00\00$\00\00\00\10\00\00\00+\00\04\00\03\00\00\00%\00\00\00\01\00\00\00+\00\04\00\03\00\00\00'\00\00\00\00\00\00\00 \00\04\00*\00\00\00\0C\00\00\00\0A\00\00\006\00\05\00\0F\00\00\00\10\00\00\00\00\00\00\00\0E\00\00\00\F8\00\02\00\11\00\00\00=\00\04\00\02\00\00\00\12\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\13\00\00\00\12\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\14\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\15\00\00\00\14\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\16\00\00\00\06\00\00\00Q\00\05\00\03\00\00\00\17\00\00\00\16\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\18\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\19\00\00\00\18\00\00\00\00\00\00\00=\00\04\00\02\00\00\00\1A\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1B\00\00\00\1A\00\00\00\01\00\00\00=\00\04\00\02\00\00\00\1C\00\00\00\05\00\00\00Q\00\05\00\03\00\00\00\1D\00\00\00\1C\00\00\00\02\00\00\00=\00\04\00\02\00\00\00\1E\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00\1F\00\00\00\1E\00\00\00\00\00\00\00=\00\04\00\02\00\00\00 \00\00\00\04\00\00\00Q\00\05\00\03\00\00\00!\00\00\00 \00\00\00\01\00\00\00=\00\04\00\02\00\00\00\22\00\00\00\04\00\00\00Q\00\05\00\03\00\00\00#\00\00\00\22\00\00\00\02\00\00\00\F9\00\02\00&\00\00\00\F8\00\02\00&\00\00\00\84\00\05\00\03\00\00\00(\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\00)\00\00\00'\00\00\00(\00\00\00A\00\06\00*\00\00\00+\00\00\00\0C\00\00\00'\00\00\00)\00\00\00=\00\04\00\0A\00\00\00,\00\00\00+\00\00\00\0C\00\06\00\0A\00\00\00-\00\00\00.\00\00\00\1C\00\00\00,\00\00\00\84\00\05\00\03\00\00\00/\00\00\00%\00\00\00\13\00\00\00\80\00\05\00\03\00\00\000\00\00\00'\00\00\00/\00\00\00A\00\06\00*\00\00\001\00\00\00\0D\00\00\00'\00\00\000\00\00\00>\00\03\001\00\00\00-\00\00\00\FD\00\01\008\00\01\00", spirv_entry_point = "Elixir.Manx.ExprTest.-unary_log/1-fun-0-.32300880_kernel"} : (index, index, index, memref<3xf32>, memref<3xf32>) -> ()
%4 = bufferization.to_tensor %1 : memref<3xf32>
return %1 : memref<3xf32>
}
func.func private @vulkanLaunch(index, index, index, memref<3xf32>, memref<3xf32>)
}
1) test unary float ops log (Manx.ExprTest)
apps/manx/test/beaver/defn/expr_test.exs:813
** (RuntimeError) Unexpected failure running pass pipeline
code: unquote(defn_fun)(@float_tensor),
stacktrace:
(beaver 0.1.0) lib/beaver/mlir/pass/composer.ex:85: Beaver.MLIR.Pass.Composer.run!/2
(manx 0.1.0) lib/manx/nx/compiler.ex:71: Manx.Compiler.__jit__/5
(nx 0.3.0-dev) lib/nx/defn/compiler.ex:323: Nx.Defn.Compiler.__runtime__/2
test/beaver/defn/expr_test.exs:815: (test)
--max-failures reached, aborting test suite
Finished in 1.2 seconds (1.2s async, 0.00s sync)
69 tests, 1 failure, 68 excluded
Randomized with seed 679368
tsai@183eefe61145 beaver %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment