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

Rescale to int cpu/gpu agnostic #157

Merged
merged 10 commits into from
Sep 30, 2024
Merged

Rescale to int cpu/gpu agnostic #157

merged 10 commits into from
Sep 30, 2024

Conversation

dkazanc
Copy link
Collaborator

@dkazanc dkazanc commented Sep 20, 2024

CPU-GPU rescale_to_int function. All tests modified to compare the results of CPU with GPU results.

I discovered that the GPU function accepts only float32 array as an input yet the CPU one can accept any data type (because of the cast to float64). The GPU implementation is significantly more memory efficient because of the elementwise loop and casting scalars instead of arrays compared to Python one-liners.

So far I don't see the reason to satisfy other data type inputs, however, in future we might work with uint16 then this code must be adapted accordingly.

I'll modify image saver in here accordingly, we need to remove redundant parameters.

@dkazanc dkazanc changed the title Rescale cpu/gpu agnostic Rescale to int cpu/gpu agnostic Sep 20, 2024
@yousefmoazzam
Copy link
Contributor

Apologies for the broken IRIS CI job, it looks like maybe IRIS isn't happy, the conda env failed to be created... https://github.com/DiamondLightSource/httomolibgpu/actions/runs/11052312862/job/30704122840?pr=157

@dkazanc
Copy link
Collaborator Author

dkazanc commented Sep 30, 2024

Detailed docs page added
https://diamondlightsource.github.io/httomolibgpu/reference/methods_list/rescale_to_int.html

Seems like IRIS is down, I'm merging this PR...

@dkazanc dkazanc merged commit cb45787 into main Sep 30, 2024
1 of 2 checks passed
@dkazanc dkazanc deleted the rescale_agnostic branch September 30, 2024 15:18
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.

2 participants