diff --git a/mlir/include/mlir/ExecutionEngine/CRunnerUtils.h b/mlir/include/mlir/ExecutionEngine/CRunnerUtils.h --- a/mlir/include/mlir/ExecutionEngine/CRunnerUtils.h +++ b/mlir/include/mlir/ExecutionEngine/CRunnerUtils.h @@ -36,6 +36,31 @@ *(res + i - 1) = arr[i]; } +//===----------------------------------------------------------------------===// +// Codegen-compatible structures for Vector type. +//===----------------------------------------------------------------------===// +template +struct Vector { + Vector vector[Dim]; +}; + +template +struct Vector { + T vector[Dim]; +}; + +template +using Vector1D = Vector; +template +using Vector2D = Vector; +template +using Vector3D = Vector; +template +using Vector4D = Vector; + +//===----------------------------------------------------------------------===// +// Codegen-compatible structures for StridedMemRef type. +//===----------------------------------------------------------------------===// /// StridedMemRef descriptor type with static rank. template struct StridedMemRefType { T *basePtr; @@ -72,13 +97,18 @@ int64_t offset; }; +//===----------------------------------------------------------------------===// +// Codegen-compatible structure for UnrankedMemRef type. +//===----------------------------------------------------------------------===// // Unranked MemRef template struct UnrankedMemRefType { int64_t rank; void *descriptor; }; -// Small runtime support "lib" for vector.print lowering. +//===----------------------------------------------------------------------===// +// Small runtime support "lib" for vector.print lowering during codegen. +//===----------------------------------------------------------------------===// extern "C" MLIR_CRUNNERUTILS_EXPORT void print_f32(float f); extern "C" MLIR_CRUNNERUTILS_EXPORT void print_f64(double d); extern "C" MLIR_CRUNNERUTILS_EXPORT void print_open(); diff --git a/mlir/include/mlir/ExecutionEngine/RunnerUtils.h b/mlir/include/mlir/ExecutionEngine/RunnerUtils.h --- a/mlir/include/mlir/ExecutionEngine/RunnerUtils.h +++ b/mlir/include/mlir/ExecutionEngine/RunnerUtils.h @@ -60,18 +60,6 @@ << "descriptor@ = " << reinterpret_cast(V.descriptor) << "\n"; } -template struct Vector { - Vector vector[Dim]; -}; -template struct Vector { T vector[Dim]; }; - -template using Vector1D = Vector; -template using Vector2D = Vector; -template -using Vector3D = Vector; -template -using Vector4D = Vector; - //////////////////////////////////////////////////////////////////////////////// // Templated instantiation follows. ////////////////////////////////////////////////////////////////////////////////