|
1 | 1 | // RUN: mlir-opt %s -split-input-file -verify-diagnostics |
2 | 2 |
|
3 | 3 | // ----- |
4 | | -func.func @create_nd_tdesc_vc_1(%src: memref<24xf32>) { |
| 4 | +func.func @create_nd_tdesc_1(%src: memref<24xf32>) { |
5 | 5 | // expected-error@+1 {{Expecting the TensorDesc rank is not greater than the ranks of shape, strides, offsets or the memref source}} |
6 | 6 | %1 = xegpu.create_nd_tdesc %src[0] : memref<24xf32> -> !xegpu.tensor_desc<8x16xf32> |
7 | 7 | return |
8 | 8 | } |
9 | 9 |
|
10 | 10 | // ----- |
11 | 11 |
|
12 | | -func.func @create_nd_tdesc_vc_2(%src: memref<24x32xf32>) { |
| 12 | +func.func @create_nd_tdesc_2(%src: memref<24x32xf32>) { |
13 | 13 | // expected-error@+1 {{TensorDesc should have the same element type with the source if it is a memref}} |
14 | 14 | %1 = xegpu.create_nd_tdesc %src[0, 0] : memref<24x32xf32> -> !xegpu.tensor_desc<8x16xf16> |
15 | 15 | return |
16 | 16 | } |
17 | 17 |
|
18 | 18 | // ----- |
19 | | -func.func @create_nd_tdesc_vc_3(%src: memref<2x24x32xf32, 3>) { |
| 19 | +func.func @create_nd_tdesc_3(%src: memref<2x24x32xf32, 3>) { |
20 | 20 | // expected-error@+1 {{SLM is only supported for 1D block tensor}} |
21 | 21 | %1 = xegpu.create_nd_tdesc %src[0, 0, 0] : memref<2x24x32xf32, 3> -> !xegpu.tensor_desc<8x16xf32, #xegpu.block_tdesc_attr<memory_space = slm>> |
22 | 22 | return |
23 | 23 | } |
24 | 24 |
|
25 | 25 | // ----- |
26 | | -func.func @create_nd_tdesc_vc_4(%src: memref<2x24x32xf32, 3>) { |
| 26 | +func.func @create_nd_tdesc_4(%src: memref<2x24x32xf32, 3>) { |
27 | 27 | // expected-error@+1 {{Memory space mismatch}} |
28 | 28 | %1 = xegpu.create_nd_tdesc %src[0, 0, 0] : memref<2x24x32xf32, 3> -> !xegpu.tensor_desc<16xf32> |
29 | 29 | return |
30 | 30 | } |
31 | 31 |
|
32 | 32 | // ----- |
33 | | -func.func @create_nd_tdesc_subgroup_1(%src: memref<128x128xf32>) { |
| 33 | +func.func @create_nd_tdesc_5(%src: memref<128x128xf32>) { |
34 | 34 | // expected-error@+1 {{cannot distribute [128, 128] using #xegpu.layout<sg_layout = [4, 2], sg_data = [24, 48]>}} |
35 | 35 | %1 = xegpu.create_nd_tdesc %src[0, 0] : memref<128x128xf32> -> !xegpu.tensor_desc<128x128xf32, #xegpu.layout<sg_layout = [4, 2], sg_data = [24, 48]>> |
36 | 36 | return |
37 | 37 | } |
38 | 38 |
|
39 | 39 | // ----- |
40 | | -func.func @create_nd_tdesc_subgroup_1(%src: memref<128x128xf32>) { |
| 40 | +func.func @create_nd_tdesc_6(%src: memref<128x128xf32>) { |
41 | 41 | // expected-error@+1 {{cannot distribute [128, 128] using #xegpu.layout<sg_layout = [4, 2], sg_data = [32, 64], inst_data = [24, 48]>}} |
42 | 42 | %1 = xegpu.create_nd_tdesc %src[0, 0] : memref<128x128xf32> -> !xegpu.tensor_desc<128x128xf32, #xegpu.layout<sg_layout = [4, 2], sg_data = [32, 64], inst_data = [24, 48]>> |
43 | 43 | return |
44 | 44 | } |
45 | 45 |
|
46 | 46 | // ----- |
47 | | -func.func @create_nd_tdesc_subgroup_1(%src: memref<128x128xf32>) { |
| 47 | +func.func @create_nd_tdesc_7(%src: memref<128x128xf32>) { |
48 | 48 | // expected-error@+1 {{cannot distribute [128, 128] using #xegpu.layout<sg_layout = [4, 2], sg_data = [32, 64], inst_data = [64, 32]>}} |
49 | 49 | %1 = xegpu.create_nd_tdesc %src[0, 0] : memref<128x128xf32> -> !xegpu.tensor_desc<128x128xf32, #xegpu.layout<sg_layout = [4, 2], sg_data = [32, 64], inst_data = [64, 32]>> |
50 | 50 | return |
51 | 51 | } |
52 | 52 |
|
| 53 | +// ----- |
| 54 | +func.func @create_nd_tdesc_8(%src: ui64) { |
| 55 | + // expected-error@+1 {{'xegpu.create_nd_tdesc' op Expecting strides and shape to be present for integer source}} |
| 56 | + %1 = xegpu.create_nd_tdesc %src : ui64-> !xegpu.tensor_desc<128x128xf32> |
| 57 | + return |
| 58 | +} |
| 59 | + |
| 60 | +// ----- |
| 61 | +func.func @create_nd_tdesc_9(%src: ui64) { |
| 62 | + // expected-error@+1 {{expected mixed offsets rank to match mixed sizes rank}} |
| 63 | + %1 = xegpu.create_nd_tdesc %src[0, 0] : ui64-> !xegpu.tensor_desc<128x128xf32> |
| 64 | + return |
| 65 | +} |
| 66 | + |
| 67 | + |
53 | 68 | // ----- |
54 | 69 | func.func @prefetch_nd_vc_1(%src: memref<24x32xf16>) { |
55 | 70 | %1 = xegpu.create_nd_tdesc %src[0, 0] : memref<24x32xf16> -> !xegpu.tensor_desc<8x16xf16> |
|
0 commit comments