CFD-GO / TCLB

TCLB - Templated MPI+CUDA/CPU Lattice Boltzmann code
https://tclb.io
GNU General Public License v3.0
178 stars 70 forks source link

Constant memory refactor #455

Closed kubagalecki closed 10 months ago

kubagalecki commented 10 months ago

GPU data pointers stored in LatticeData and similar classes have thus far been stored in constant device memory and manually updated when needed. The idea is to now pass them directly to kernels via const arguments, which should automatically get placed in constant memory. This significantly simplifies the code and allows for greater flexibility going forward.

codecov-commenter commented 10 months ago

Codecov Report

Attention: 70 lines in your changes are missing coverage. Please review.

Comparison is base (365770c) 42.81% compared to head (0890776) 44.52%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #455 +/- ## =========================================== + Coverage 42.81% 44.52% +1.70% =========================================== Files 168 169 +1 Lines 7455 7879 +424 =========================================== + Hits 3192 3508 +316 - Misses 4263 4371 +108 ``` | [Flag](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO) | Coverage Δ | | |---|---|---| | [d2q9](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO) | `30.67% <60.71%> (+0.11%)` | :arrow_up: | | [d2q9_bc](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO) | `26.96% <52.55%> (+0.07%)` | :arrow_up: | | [d2q9_kuper](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO) | `27.76% <52.79%> (+0.08%)` | :arrow_up: | | [d3q27_PSM_NEBB](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO) | `36.22% <68.85%> (+0.04%)` | :arrow_up: | | [d3q27_pf_velocity](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO) | `30.77% <62.98%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO) | Coverage Δ | | |---|---|---| | [src/CartLatticeAccess.hpp.Rt](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO#diff-c3JjL0NhcnRMYXR0aWNlQWNjZXNzLmhwcC5SdA==) | `96.55% <100.00%> (+1.09%)` | :arrow_up: | | [src/Lattice.h.Rt](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO#diff-c3JjL0xhdHRpY2UuaC5SdA==) | `61.53% <ø> (ø)` | | | [src/LatticeData.hpp.Rt](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO#diff-c3JjL0xhdHRpY2VEYXRhLmhwcC5SdA==) | `92.85% <ø> (ø)` | | | [src/Node.hpp.Rt](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO#diff-c3JjL05vZGUuaHBwLlJ0) | `100.00% <100.00%> (ø)` | | | [src/Region.h](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO#diff-c3JjL1JlZ2lvbi5o) | `75.00% <ø> (ø)` | | | [src/SolidAll.h](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO#diff-c3JjL1NvbGlkQWxsLmg=) | `100.00% <100.00%> (ø)` | | | [src/SolidGrid.h](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO#diff-c3JjL1NvbGlkR3JpZC5o) | `100.00% <100.00%> (ø)` | | | [src/SolidTree.h](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO#diff-c3JjL1NvbGlkVHJlZS5o) | `100.00% <100.00%> (ø)` | | | [src/Solver.cpp.Rt](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO#diff-c3JjL1NvbHZlci5jcHAuUnQ=) | `56.90% <100.00%> (-0.15%)` | :arrow_down: | | [src/cross.h](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO#diff-c3JjL2Nyb3NzLmg=) | `95.23% <ø> (+1.12%)` | :arrow_up: | | ... and [5 more](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO) | | ... and [10 files with indirect coverage changes](https://app.codecov.io/gh/CFD-GO/TCLB/pull/455/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CFD-GO)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kubagalecki commented 10 months ago

@llaniewski I think this is nearly everything we discussed. One outstanding item is renaming GetThreads.X. My suggestion would be LaunchUtils.X.

kubagalecki commented 10 months ago

By the way, I ran the benchmark Travis gave me on Gadi, there was a 0.737% slowdown, which I'd write off as noise. This is without __grid_constant__. Full log: taylor-bubble-benchmark.log