[Mlir-commits] [mlir] [NFC][mlir][emitc] fix misspelling in description of emitc.global (PR #115548)
Andrey Timonin
llvmlistbot at llvm.org
Fri Nov 8 14:55:30 PST 2024
EtoAndruwa wrote:
> > It seems that something is wrong in the parser of emitc.global due to:
> > > error: expected '>'
> > > emitc.global @x : !emitc.array<2xf32> = dense<0.0, 2.0>
>
> Wrong usage of `dense` here. Right example of usage is:
>
> ```
> emitc.global @myglobal : !emitc.array<2xf32> = dense<4.000000e+00>
> // CPP-DEFAULT: float myglobal[2] = {4.000000000e+00f, 4.000000000e+00f};
> // CPP-DECLTOP: float myglobal[2] = {4.000000000e+00f, 4.000000000e+00f};
> ```
I guess author wanted to get something like:
```
int32_t global_array[3] = {0, 1, 2};
```
Therefore, the right version will be:
```
emitc.global @global_array : !emitc.array<3xi32> = dense<[0, 1, 2]>
```
https://github.com/llvm/llvm-project/pull/115548
More information about the Mlir-commits
mailing list