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

Cython header-only demo project should have NumPy own the data #3262

Open
jpivarski opened this issue Sep 30, 2024 · 0 comments
Open

Cython header-only demo project should have NumPy own the data #3262

jpivarski opened this issue Sep 30, 2024 · 0 comments
Labels
docs Improvements or additions to documentation

Comments

@jpivarski
Copy link
Member

Similar to #3261, but for the Cython example. It's using malloc to make buffers, but it should use np.empty.

// Allocate memory
std::map<std::string, void *> buffers = {};
for (auto it: names_nbytes) {
buffers[it.first] = malloc(it.second);
}

It should be even easier in Cython, since you can call Python directly.

Originally posted by @jpivarski in #3261 (comment)

@jpivarski jpivarski added the docs Improvements or additions to documentation label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant