Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KOKKOS_FUNCTION macro to Details::Sink::operator() #1010

Merged
merged 1 commit into from
Dec 31, 2023

Conversation

Shihab-Shahriar
Copy link
Contributor

@Shihab-Shahriar Shihab-Shahriar commented Dec 31, 2023

While compiling ArborX for cuda, I had this warning:

warning #20014-D: calling a __host__ function from a __host__ __device__ function is not allowed
        out(i);
        ^
          detected during:
            instantiation of "void ExcludeSelfCollision::operator()(const Predicate &, int, const OutputFunctor &) const [with Predicate=ArborX::PredicateWithAttachment<ArborX::Intersects<ArborX::Sphere>, int>, OutputFunctor=ArborX::Details::Sink<int>]" at line 3261 of /usr/include/c++/11/type_traits

This small change got rid of that.

The ExcludeSelfCollision callback is defined as:

struct ExcludeSelfCollision
{
  template <class Predicate, class OutputFunctor>
  KOKKOS_FUNCTION void operator()(Predicate const &predicate, int i,
                                  OutputFunctor const &out) const
  {
    int const j = ArborX::getData(predicate);
    if (i != j)
    {
      out(i);
    }
  }
};

@aprokop
Copy link
Contributor

aprokop commented Dec 31, 2023

@Shihab-Shahriar Thank you for the contribution.

We get this warnings in our testing too, but we don't catch them in CI due to #272. Confirmed that with this patch, the warnings disappeared from the CI. Also confirmed that we had this warning for at least few weeks, can't trace further back as CI logs are gone.

Perhaps, this started happening when switching to invoke_result in the Callbacks file in August.

@aprokop aprokop merged commit 6b95c1a into arborx:master Dec 31, 2023
1 check failed
@aprokop aprokop mentioned this pull request Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants