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

Enable dtype memory #49

Merged
merged 34 commits into from
Mar 23, 2023
Merged

Enable dtype memory #49

merged 34 commits into from
Mar 23, 2023

Conversation

StRigaud
Copy link
Member

For now, only float type memory was possible in pyclesperanto.

The aim here is to make possible to create, push, and pull array of float, int32, int16 and int8 (and their unsigned equivalent).

  • 'Create can now take a dType
  • Push is now templated on numpy type
  • Pull is now type specific: PullFloat, PullInt32, etc.

Possible Issue:

  • ImageOperator python class to mimic Numpy API request import of the wrapper function _Pull instead of the pythonised pull which now manage type return. Not a bloquing issue but code quality could be improve if we could rely on the pythonised pull instead.
  • Any uses of non-valide CLIc type, should be cast as float32. Tests are needed.

How it look like for now :

import pyclesperanto as cle
import numpy as np

buffer_short = cle.create( (5,5), cle.int16)          # <-- create an empty buffer space of short type
buffer_int = cle.push( np,ones((5,5), dtype=np.int32) )    # <-- push an array of int type
arr_int = cle.pull(buffer_int)                        # <-- pull a buffer of int into an array of int

@StRigaud StRigaud added request New feature or request wrapper labels Dec 16, 2022
@StRigaud StRigaud self-assigned this Dec 16, 2022
@StRigaud StRigaud linked an issue Dec 16, 2022 that may be closed by this pull request
@StRigaud StRigaud merged commit 78dd9d1 into main Mar 23, 2023
@StRigaud StRigaud deleted the enable-dtype-memory branch March 23, 2023 12:23
@StRigaud StRigaud mentioned this pull request Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

buffer and image data type restricted to float
1 participant