Skip to content
Discussion options

You must be logged in to vote

It might help you going through https://github.com/PhilipVinc/numba4jax or https://github.com/mpi4jax/mpi4jax where we do exactly this kind of things.

By quickly looking at your code I see those possible problems:

  • You cast the input pointers in_ptr[0] and in_ptr[1] to MatrixXd, but are you sure that is legal? MatrixXd should contain a pointer to the actual memory, and the shape of the matrix. I doubt that the data that XLA is passing you is aligned the same way that Eigen Expects? Or maybe you do the unpacking correctly, but its quite tricky.
  • You cast the out_ptr[0] to a matrixXd, which for the same reason above, I'm quite sure is wrong. out_ptr[0] should be a pointer to the bare memory …

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@nickmcgreivy
Comment options

@PhilipVinc
Comment options

Answer selected by nickmcgreivy
Comment options

You must be logged in to vote
3 replies
@PhilipVinc
Comment options

@nickmcgreivy
Comment options

@PhilipVinc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants