|
| 1 | +// RUN: triton-opt %s --gluon-inline | FileCheck %s |
| 2 | + |
| 3 | +#blocked = #ttg.blocked<{sizePerThread = [1], threadsPerWarp = [32], warpsPerCTA = [4], order = [0]}> |
| 4 | + |
| 5 | +module attributes {"ttg.target" = "cuda:90", "ttg.num-ctas" = 1 : i32, "ttg.num-warps" = 4 : i32, "ttg.threads-per-warp" = 32 : i32} { |
| 6 | + tt.func private @set_encoding(%arg0 : tensor<16xi32, #gluon.auto_encoding>) -> tensor<16xi32, #blocked> { |
| 7 | + %cvt = gluon.set_auto_layout %arg0 : tensor<16xi32, #gluon.auto_encoding> -> tensor<16xi32, #blocked> |
| 8 | + tt.return %cvt : tensor<16xi32, #blocked> |
| 9 | + } |
| 10 | + |
| 11 | + tt.func public @infer_make_range() -> tensor<16xi32, #blocked> { |
| 12 | + // CHECK-DAG: [[BLOCKED:#.*]] = #ttg.blocked<{sizePerThread = [1], threadsPerWarp = [32], warpsPerCTA = [4], order = [0]}> |
| 13 | + // CHECK: [[CST:%.*]] = arith.constant dense<0> : tensor<16xi32, #gluon.auto_encoding> |
| 14 | + // CHECK: [[SET:%.*]] = gluon.set_auto_layout [[CST]] : tensor<16xi32, #gluon.auto_encoding> -> tensor<16xi32, [[BLOCKED]]> |
| 15 | + // CHECK: tt.return [[SET]] : tensor<16xi32, [[BLOCKED]]> |
| 16 | + %cst = arith.constant dense<0> : tensor<16xi32, #gluon.auto_encoding> |
| 17 | + %0 = tt.call @"set_encoding"(%cst) : (tensor<16xi32, #gluon.auto_encoding>) -> tensor<16xi32, #blocked> |
| 18 | + tt.return %0 : tensor<16xi32, #blocked> |
| 19 | + } |
| 20 | +} |
0 commit comments