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

"More than one tag given" error in Experimental::require() #2608

Closed
brian-kelley opened this issue Dec 19, 2019 · 3 comments
Closed

"More than one tag given" error in Experimental::require() #2608

brian-kelley opened this issue Dec 19, 2019 · 3 comments
Assignees
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)

Comments

@brian-kelley
Copy link
Contributor

When the base policy (happens with team and range) passed to Kokkos::Experimental::require() has an explicit tag, there's an error in AnalyzePolicy saying multiple tag types were given (it always thinks the other one is void). A one-line example that replicates this:
auto pol = require(Kokkos::RangePolicy<Exec, TagType>(execInstance, 0, 100), Experimental::WorkItemProperty::HintLightWeight); where execInstance has type Exec, and TagType is anything other than void.

I have a branch "RequireTagIssue" in the fork git@github.com:brian-kelley/kokkos that builds this this as an example on whatever device(s) are enabled. It should work with generate_makefile or CMake but I had some trouble with a CMake build (include path was broken in all examples - Kokkos_Core.hpp wasn't found) so I can only promise it works with generate_makefile.

The error:

In file included from kokkos/core/src/Kokkos_ExecPolicy.hpp:51,
                 from kokkos/core/src/Kokkos_Threads.hpp:235,
                 from kokkos/core/src/Kokkos_Core.hpp:74,
                 from kokkos/example/require_tag_issue/main.cpp:47:
.../core/src/impl/Kokkos_AnalyzePolicy.hpp: In instantiation of ‘struct Kokkos::Impl::SetWorkTag<Kokkos::Impl::PolicyTraitsBase<Kokkos::Threads, Kokkos::Schedule<Kokkos::Static>, Tag1, Kokkos::IndexType<long unsigned int>, void, void, Kokkos::Experimental::WorkItemProperty::ImplWorkItemProperty<0> >, void>’:
.../core/src/impl/Kokkos_AnalyzePolicy.hpp:161:8:   recursively required from ‘struct Kokkos::Impl::AnalyzePolicy<Kokkos::Impl::PolicyTraitsBase<Kokkos::Threads, void, void, void, void, void, Kokkos::Experimental::WorkItemProperty::ImplWorkItemProperty<0> >, Kokkos::Schedule<Kokkos::Static>, Tag1, long unsigned int, void, Kokkos::LaunchBounds<0, 0>, Kokkos::Experimental::WorkItemProperty::ImplWorkItemProperty<1> >’
.../core/src/impl/Kokkos_AnalyzePolicy.hpp:161:8:   required from ‘struct Kokkos::Impl::AnalyzePolicy<Kokkos::Impl::PolicyTraitsBase<>, Kokkos::Threads, Kokkos::Schedule<Kokkos::Static>, Tag1, long unsigned int, void, Kokkos::LaunchBounds<0, 0>, Kokkos::Experimental::WorkItemProperty::ImplWorkItemProperty<1> >’
.../core/src/impl/Kokkos_AnalyzePolicy.hpp:226:8:   required from ‘struct Kokkos::Impl::PolicyTraits<Kokkos::Threads, Kokkos::Schedule<Kokkos::Static>, Tag1, long unsigned int, void, Kokkos::LaunchBounds<0, 0>, Kokkos::Experimental::WorkItemProperty::ImplWorkItemProperty<1> >’
.../core/src/Kokkos_ExecPolicy.hpp:93:7:   required from ‘class Kokkos::RangePolicy<Kokkos::Threads, Kokkos::Schedule<Kokkos::Static>, Tag1, long unsigned int, void, Kokkos::LaunchBounds<0, 0>, Kokkos::Experimental::WorkItemProperty::ImplWorkItemProperty<1> >’
.../example/require_tag_issue/main.cpp:80:24:   required from ‘void demonstrate() [with Device = Kokkos::Threads]’
.../example/require_tag_issue/main.cpp:101:34:   required from here
.../core/src/impl/Kokkos_AnalyzePolicy.hpp:113:57: error: static assertion failed: Kokkos Error: More than one work tag given
  113 |   static_assert(is_void<typename PolicyBase::work_tag>::value,
@crtrott crtrott self-assigned this Dec 19, 2019
@crtrott crtrott added Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) bug - experimental feature labels Dec 19, 2019
@crtrott
Copy link
Member

crtrott commented Dec 19, 2019

Ok thanks for reporting this. Pretty sure this is a bug in the logic of require which modifies the template parameters of the policy ...

@crtrott
Copy link
Member

crtrott commented Dec 20, 2019

I have the unit test written for RangePolicy and it fails to compile as expected.

crtrott added a commit to crtrott/kokkos that referenced this issue Dec 27, 2019
crtrott added a commit to crtrott/kokkos that referenced this issue Dec 27, 2019
masterleinad pushed a commit to masterleinad/kokkos that referenced this issue Feb 24, 2020
masterleinad pushed a commit to masterleinad/kokkos that referenced this issue Feb 24, 2020
@kyungjoo-kim
Copy link
Contributor

kyungjoo-kim commented Feb 25, 2020

@crtrott This needs to go into trilinos too.

@crtrott crtrott closed this as completed Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Projects
None yet
Development

No branches or pull requests

3 participants