Add helper method for efficiently combining logical operations
Open
@publixsubfan is already working on this.
Since Nov 8, 2021.
Core
design
GPU
Primal
question
Reviewed
- Dominant language
- C++
- Stars
- 196
- Forks
- 34
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 11
Description
In #577, it was discovered that using bitwise AND to combine the results of single-dimension checks was considerably faster than using logical AND on the GPU:
bool status = true;
for (int idim = 0; idim < NDIMS; idim++)
{
// generates predicated branches: slower on GPU, faster on CPU
status = status && detail::intersect(...);
// faster on GPU
status = status & detail::intersect(...);
}
Conversely, the logical AND seems to be faster than the bitwise AND on the CPU.
We should create a helper macro/method that can pick between bitwise and logical AND depending on whether the code is being compiled for the CPU or the GPU.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.