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

Expose DType size through the C api #39

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Conversation

louen
Copy link
Contributor

@louen louen commented Oct 23, 2024

This PR exposes DType::size() through the C API, via a new function : mlx_array_dtype_size
Currently, the only way to do this is by using mlx_array_itemsize(mlx_array arr) on an existing array.

Copy link
Member

@andresy andresy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Sorry for the delay, was working on the new version C API.
Would you mind rebasing on it?

  • mlx_array_dtype now mlx_dtype
  • so mlx_array_dtype_size becomes mlx_dtype_size
  • MLX_CPP_ARRAY_DTYPE is now mlx_dtype_to_cpp

Copy link
Member

@angeloskath angeloskath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@andresy andresy merged commit 43c06a7 into ml-explore:main Nov 19, 2024
@andresy
Copy link
Member

andresy commented Nov 19, 2024

@davidkoski , you might now want to follow up on ml-explore/mlx-swift#158

@davidkoski
Copy link
Collaborator

@davidkoski , you might now want to follow up on ml-explore/mlx-swift#158

I just need a tag to pick it up (along with the new API)

@louen louen deleted the val/dtype_size branch December 7, 2024 00:10
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

Successfully merging this pull request may close these issues.

4 participants