SPECTGPU:starting point; created SPECTGPU_projector folder and schel… - #1687
danieldeidda wants to merge 16 commits into
Conversation
…eton classe, atm a lot of copy from niftyGPU
…calls the kernels; we need to double check that the kernel can write into the sino but probably we need to dodevice_to_host(stir_sino,cuda_array_created_by_forward)
… that calls the kernels; we need to double check that the kernel can write into the sino but probably we need to dodevice_to_host(stir_sino,cuda_array_created_by_forward)
| float* dev_image; | ||
| cudaMalloc(&dev_image, stir_image.size_all() * sizeof(float)); |
There was a problem hiding this comment.
could use
CuVec<float> dev_image(stir_image.size_all());
then you don't need to free at the end. If so, you can pass it to a kernel as dev_image.data().
Also, you probably want to have this out of the loop.
There was a problem hiding this comment.
ignoring Cuvec for now
addition of wrappers for actual_FP/BP removal of most of helper currently FP and BP work pretty well and are very close to spectUB rough speed estimate on debug mode were: SPECTUB 3min36s SPECTGPU 20s 3x3x3 gaussian kernel was fine for FP but introduced holes artifact in BP it was necessary to change the kernel to a 5x5x7 with sigma 2 to make a BPimage very close to SPECTUB. Speed above is related to 5x5x7.
addition of wrappers for actual_FP/BP removal of most of helper currently FP and BP work pretty well and are very close to spectUB rough speed estimate on debug mode were: SPECTUB 3min36s SPECTGPU 20s 3x3x3 gaussian kernel was fine for FP but introduced holes artifact in BP it was necessary to change the kernel to a 5x5x7 with sigma 2 to make a BPimage very close to SPECTUB. Speed above is related to 5x5x7.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 65 |
| Duplication | 15 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
adapted PairProjectorByBinUsingSPECTGPU to be able to run reconstruction
|
Hi. looks like great progress! Obviously, I'm interested to know some timings :-)
no, we don't. The SPECTUB projector backprojector is adjoint (as it uses the matrix), so has the correct scale. |
|
I thought there was some scaling in SPECTUB as I always need to multiply by the number of views to get images in the right scale. Anyway in debug mode with no OMP around 300s 2 iterations fully 3D PSF and AC I am reconstructing with SPECTUB now but it's been running for a while and not finished the first iter yet. GPU recon with no correction is 90 s and 160s only AC |
Added Hei Yin Jowett Chan as an author to the file.
pdate authorship
Jowett: Revert authorship added to the wrong file
|
interesting. only with OMP? I think it's indeed the case that the There's various issues here:
I guess the last one is the main one. |
|
Yes that's it! I think that is because the image needs to be updated as the function is called for every view. But then I should copy outside of this call maybe in start_accumulating and free in get_output? so that the BP just updates the output image |
|
Definitely try to do as much of allocation/transfer as you can upfront, or at the back, e.g. For the forward projector, you'd still run into trouble I think with the output viewgrams, not sure. For this reason, the parallelprojand NiftyPET interface do all the work upfront/at the end. This however creates trouble as well, as it means we'll be forward projecting all of the data, even if we only do a subset. There's considerably overhead there. |
fix problem with OMP by allocating images outside of the kernel







…eton classe, atm a lot of copy from niftyGPU
Changes in this pull request
Testing performed
Related issues
Checklist before requesting a review
documentation/release_XXX.mdhas been updated with any functionality change (if applicable)Contribution Notes
Please tick the following: