cholla-hydro / cholla-hydro/cholla
Convert all indexing variables to `size_t`/`ptrdiff_t`
- Dominant language
- C++
- Stars
- 74
- Forks
- 41
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 3
Description
Currently many of the indexing variables we use are of type 'int' when they should be `size_t` (or `ptrdiff_t` if they're a difference). This could potentially lead to issues with the range of `int` as the size of VRAM on GPUs grows and this change would allow us to enable the following clang-tidy checks:
- `bugprone-implicit-widening-of-multiplication-result`
- `bugprone-narrowing-conversions` (alias of `cppcoreguidelines-narrowing-conversions`)
This conversion wouldn't be too difficult but would be time consuming and would be a good project for a new student/collaborator to become familiar with the code.
See [this discussion](https://github.com/cholla-hydro/cholla/discussions/217#discussioncomment-5360242) for the original discussion on the topic.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the discussion linked in the issue, then search the repository for indexing variables declared as int and identify cases requiring size_t or ptrdiff_t. Track the conversion across the affected code and verify that the bugprone-implicit-widening-of-multiplication-result and bugprone-narrowing-conversions checks can be enabled without remaining relevant findings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- hpc
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100