Kokkos: parallel_reduce compiles with no result argument

Created on 8 Jun 2018  路  3Comments  路  Source: kokkos/kokkos

Apparently, commit 9f504ef6bcd502f4a574a9743f2727d4ab91f1b4 added support for parallel_reduce(policy, functor) with no return value. This was problematic in today's tutorial because new users forgot to include the result value and their code just silently compiled and ran without updating the value. What is the use case for this variant?

InDevelop enhancement

Most helpful comment

If you have a "final" function inside of a functor this is valid. But we should make sure that that exists.

All 3 comments

If you have a "final" function inside of a functor this is valid. But we should make sure that that exists.

running tests on this right now.

Error Message if you violate rules:

/home/crtrott/Kokkos/kokkos/core/src/Kokkos_Parallel_Reduce.hpp:1105:3: error: static assertion failed: Calling parallel_reduce without either return value or final function.
Was this page helpful?
0 / 5 - 0 ratings