kokkos / kokkos-comm

Experimental MPI Wrapper for Kokkos
https://kokkos.org/kokkos-comm/
Other
12 stars 9 forks source link

Can't use upstream gtest with nvcc #71

Closed cwpearson closed 1 month ago

cwpearson commented 1 month ago

Since we use lambdas in the unit tests.

Produces errors like

.../unit_tests/test_alltoall.cpp(46): error: The enclosing parent function ("TestBody") for an extended __host__ __device__ lambda cannot have private or protected access within its class
                     __attribute__((host)) __attribute__((device))(const int i) { sv(i) = rank + i; });
                                                                  ^

.../unit_tests/test_alltoall.cpp(53): error: The enclosing parent function ("TestBody") for an extended __host__ __device__ lambda cannot have private or protected access within its class
       __attribute__((host)) __attribute__((device))(const int &i, int &lsum) {
                                                    ^

.../unit_tests/test_alltoall.cpp(75): error: The enclosing parent function ("TestBody") for an extended __host__ __device__ lambda cannot have private or protected access within its class
                     __attribute__((host)) __attribute__((device))(const int i) { rv(i) = rank + i; });
                                                                  ^

.../unit_tests/test_alltoall.cpp(82): error: The enclosing parent function ("TestBody") for an extended __host__ __device__ lambda cannot have private or protected access within its class
       __attribute__((host)) __attribute__((device))(const int &i, int &lsum) {
cwpearson commented 1 month ago

I think we can just patch a couple places in gtest when we pull it down during CMake

masterleinad commented 1 month ago

See https://github.com/google/googletest/issues/4104.