llnl / llnl/axom

Add helper method for efficiently combining logical operations

Open
#582 3 comments 1 reaction 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.