From 2e31570c1677575166e33a7ec547226298adb79b Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Sat, 11 Sep 2021 20:24:42 -0700 Subject: [PATCH] Fix tuple_test after gpu_test_helper update. Duplicating the namespace `tuple_impl` caused a conflict with the `arch/GPU/Tuple.h` definitions for the `tuple_test`. We can't just use `Eigen::internal` either, since there exists a different `Eigen::internal::get`. Renaming the namespace to `test_detail` fixes the issue. --- test/gpu_test_helper.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/test/gpu_test_helper.h b/test/gpu_test_helper.h index c8941fcf7..590746881 100644 --- a/test/gpu_test_helper.h +++ b/test/gpu_test_helper.h @@ -25,19 +25,24 @@ namespace Eigen { namespace internal { - -namespace tuple_impl { +// Note: cannot re-use tuple_impl, since that will cause havoc for +// tuple_test. +namespace test_detail { // Use std::tuple on CPU, otherwise use the GPU-specific versions. #if !EIGEN_USE_CUSTOM_TUPLE using std::tuple; using std::get; using std::make_tuple; using std::tie; +#else +using tuple_impl::tuple; +using tuple_impl::get; +using tuple_impl::make_tuple; +using #endif #undef EIGEN_USE_CUSTOM_TUPLE - -} +} // namespace test_detail template struct extract_output_indices_helper; @@ -131,9 +136,9 @@ template, index_sequence, Kernel kernel, uint8_t* buffer, size_t capacity) { - using Eigen::internal::tuple_impl::get; - using Eigen::internal::tuple_impl::make_tuple; - using Eigen::internal::tuple_impl::tuple; + using test_detail::get; + using test_detail::make_tuple; + using test_detail::tuple; // Deserialize input size and inputs. size_t input_size; uint8_t* buff_ptr = Eigen::deserialize(buffer, input_size); @@ -268,9 +273,9 @@ auto run_serialized_on_gpu(size_t buffer_capacity_hint, } // Deserialize outputs. - auto args_tuple = Eigen::internal::tuple_impl::tie(args...); + auto args_tuple = test_detail::tie(args...); EIGEN_UNUSED_VARIABLE(args_tuple) // Avoid NVCC compile warning. - host_ptr = Eigen::deserialize(host_ptr, Eigen::internal::tuple_impl::get(args_tuple)...); + host_ptr = Eigen::deserialize(host_ptr, test_detail::get(args_tuple)...); // Maybe deserialize return value, properly handling void. typename void_helper::ReturnType result;