Comments (7)
@fredRos what do you think? Feasible?
from galario.
yes, we should do that. I'm profiling the code right now and see a number of things we can improve. This one is high-level and makes perfect sense
from galario.
It is more work and requires more decisions:
- should
fft2d
accept a real image? It could not work in place anymore - chi2 and sample don't provide access to the Fourier space image, so here it is easy to do
- could we
fftshift
the real image? We could save half of the memory transfer
from galario.
A realistic use-case of galario employs only the sample()
and/or the chi2()
functions.
The other functions are for those who want to play with galario more in detail (like us) and I think it's fine to keep data as complex for all of them.
For sample()
and chi2()
functions it is easy to implement the change and I would start with them. In this way, internally nothing should change since we cast from dreal*
to dcomplex*
at the very beginning, before starting any operation.
For the CUDA version, I would do the casting after dreal* data
has been copied to the GPU and then I would feed it to the dcomplex* data_d
array that has been initialized with 0 imaginary part.
from galario.
What about shifting the real image? It seems to me like we could do that and only after the shift we'd add the imaginary part, perhaps on the device
from galario.
kernel unsigned int to float: https://stackoverflow.com/questions/9153861/typecasting-in-cuda-and-cublas
I'm following your suggestion now. I tried to do it in place but that would not allow multiple threads to operate concurrently. But then we have to use 50 % extra memory on the GPU to have a real and complex image until the complex image is properly constructed. This may be a problem for users with high-res images and small memory GPUs
Perhaps I can do the profiling to see if it's faster to do the construction on the CPU and then transfer. On all system I have seen so far it is safe to assume that there is more memory on the host available.
from galario.
fixed by #45
from galario.
Related Issues (20)
- Add link to paper citations HOT 2
- Coordinate mesh grid
- Update Copyright statement for 2020
- AttributeError: 'function' object has no attribute 'called' HOT 5
- Initial guess for the parameters HOT 1
- galario.c still in source
- travis tests are not reported anymore... HOT 1
- Docs deploy is broken HOT 3
- Perform tests for Python 3.8
- Move to GitHub Actions HOT 2
- Fix numpy warnings
- Move docs to readthedocs
- Update 2020->2021 in Copyright notices
- Trouble building galario for GPU use HOT 7
- Test building GPU version on CUDA 11
- Scaling with CUDA cores and changing GPUs
- Move uvtable.txt to a permanent repository HOT 4
- dxy returned by get_image_size is radians - Fix typo in docs HOT 1
- origin at chi2Image HOT 1
- unrecognized argument when running ctest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from galario.