Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem about laplace example in readme #44

Open
lethean1 opened this issue Jan 11, 2022 · 2 comments
Open

problem about laplace example in readme #44

lethean1 opened this issue Jan 11, 2022 · 2 comments

Comments

@lethean1
Copy link

I saw that I should call void _mlir_ciface_laplace(MemRefType3D *input, MemRefType3D *output); in my main.c, but I wonder how can I build a MemRefType3D* type argument in C file?

@gysit
Copy link
Collaborator

gysit commented Jan 11, 2022

for example, as follows:

// mlir array type
template <typename Elem, size_t Rank> struct MemRef {
  Elem *allocatedPtr;
  Elem *alignedPtr;
  int32_t offset;
  std::array<int32_t, Rank> sizes;   
  std::array<int32_t, Rank> strides; 
};
typedef MemRef<ElementType, 1> MemRefType1D;
typedef MemRef<ElementType, 2> MemRefType2D;
typedef MemRef<ElementType, 3> MemRefType3D;

Edit: Deleted the index operators since they are only there for convenience,

@lethean1
Copy link
Author

I got it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants