Skip to content

kokkos-implicit-this-capture warns for explicit *this capture #20

Open
@masterleinad

Description

@masterleinad

Using KOKKOS_CLASS_LAMBDA with Kokkos' clang-tidy gives

/var/jenkins/workspace/Kokkos/containers/unit_tests/TestErrorReporter.hpp:198:9: error: Lambda passed to parallel_for implicitly captures this. [kokkos-implicit-this-capture,-warnings-as-errors]
        KOKKOS_CLASS_LAMBDA(const int work_idx) {
        ^
/var/jenkins/workspace/Kokkos/core/src/setup/Kokkos_Setup_Cuda.hpp:87:29: note: expanded from macro 'KOKKOS_CLASS_LAMBDA'
#define KOKKOS_CLASS_LAMBDA [ =, *this ] __host__ __device__
                            ^
/var/jenkins/workspace/Kokkos/containers/unit_tests/TestErrorReporter.hpp:198:9: note: the captured variable is used here.
        KOKKOS_CLASS_LAMBDA(const int work_idx) {
        ^
/var/jenkins/workspace/Kokkos/core/src/setup/Kokkos_Setup_Cuda.hpp:87:34: note: expanded from macro 'KOKKOS_CLASS_LAMBDA'
#define KOKKOS_CLASS_LAMBDA [ =, *this ] __host__ __device__
                                 ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions