diff options
| author | nmostafa <nagy.h.mostafa@intel.com> | 2019-12-06 16:03:16 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-06 16:03:51 -0800 |
| commit | fcc215e39979b0f678de84b37a5e2ab208839a8c (patch) | |
| tree | 189da02cdee88c4fe80d804e7075b3d4b43afd67 /mlir | |
| parent | 6500b7e0c085432873c250e75b6ff47cced22239 (diff) | |
| download | bcm5719-llvm-fcc215e39979b0f678de84b37a5e2ab208839a8c.tar.gz bcm5719-llvm-fcc215e39979b0f678de84b37a5e2ab208839a8c.zip | |
Fix langref code snippet - NFC
Closes tensorflow/mlir#294
PiperOrigin-RevId: 284281172
Diffstat (limited to 'mlir')
| -rw-r--r-- | mlir/g3doc/LangRef.md | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/mlir/g3doc/LangRef.md b/mlir/g3doc/LangRef.md index fa22fa5a35e..a810330d37e 100644 --- a/mlir/g3doc/LangRef.md +++ b/mlir/g3doc/LangRef.md @@ -811,17 +811,25 @@ exposed to codegen but one may query the rank of an unranked memref (a special op will be needed for this purpose) and perform a switch and cast to a ranked memref as a prerequisite to codegen. -Example ```mlir {.mlir} // With static ranks, we need a function for each -possible argument type %A = alloc() : memref<16x32xf32> %B = alloc() : -memref<16x32x64xf32> call @helper_2D(%A) : (memref<16x32xf32>)->() call -@helper_3D(%B) : (memref<16x32x64xf32>)->() - -// With unknown rank, the functions can be unified under one unranked type %A = -alloc() : memref<16x32xf32> %B = alloc() : memref<16x32x64xf32> // Remove rank -info %A_u = memref_cast %A : memref<16x32xf32> -> memref<*xf32> %B_u = -memref_cast %B : memref<16x32x64xf32> -> memref<*xf32> // call same function -with dynamic ranks call @helper(%A_u) : (memref<*xf32>)->() call @helper(%B_u) : -(memref<*xf32>)->() ``` +Example +```mlir {.mlir} +// With static ranks, we need a function for each +// possible argument type +%A = alloc() : memref<16x32xf32> +%B = alloc() : memref<16x32x64xf32> +call @helper_2D(%A) : (memref<16x32xf32>)->() +call @helper_3D(%B) : (memref<16x32x64xf32>)->() + +// With unknown rank, the functions can be unified under one unranked type +%A = alloc() : memref<16x32xf32> +%B = alloc() : memref<16x32x64xf32> +// Remove rank info +%A_u = memref_cast %A : memref<16x32xf32> -> memref<*xf32> +%B_u = memref_cast %B : memref<16x32x64xf32> -> memref<*xf32> +// call same function with dynamic ranks +call @helper(%A_u) : (memref<*xf32>)->() +call @helper(%B_u) : (memref<*xf32>)->() +``` The core syntax and representation of a layout specification is a [semi-affine map](Dialects/Affine.md#semi-affine-maps). Additionally, syntactic |

