acts-project / vecmem

Vectorised data model base and helper classes.
https://acts-project.github.io/vecmem/
Mozilla Public License 2.0
19 stars 13 forks source link

EDM Device Test Fix, main branch (2024.02.05.) #263

Closed krasznaa closed 9 months ago

krasznaa commented 10 months ago

Fixed "variable shadowing" warnings coming from MSVC. Things like:

[ 93%] Building CXX object tests/cuda/CMakeFiles/vecmem_test_cuda.dir/test_cuda_edm.cpp.obj
test_cuda_edm.cpp
C:\Users\krasz\ATLAS\vecmem\vecmem\tests\common\soa_device_tests.ipp(19): warning C4459: declaration of 'host_mr' hides global declaration
C:\Users\krasz\ATLAS\vecmem\vecmem\tests\cuda\test_cuda_edm.cpp(22): note: see declaration of 'host_mr'
C:\Users\krasz\ATLAS\vecmem\vecmem\tests\common\soa_device_tests.ipp(19): note: the template instantiation context (the oldest one first) is
C:\Users\krasz\ATLAS\vecmem\vecmem\tests\common\soa_device_tests.ipp(135): note: see reference to class template instantiation 'soa_device_tests_base<vecmem::testing::simple_soa_container>' being compiled
C:\Users\krasz\ATLAS\vecmem\vecmem\tests\common\soa_device_tests.ipp(16): note: while compiling class template member function 'void soa_device_tests_base<vecmem::testing::simple_soa_container>::modify_managed(const soa_device_test_parameters &)'
C:\Users\krasz\ATLAS\vecmem\vecmem\tests\common\soa_device_tests.ipp(137): note: see the first reference to 'soa_device_tests_base<vecmem::testing::simple_soa_container>::modify_managed' in 'soa_device_tests_simple_modify_managed_Test::TestBody'
...

And:

[100%] Building SYCL object tests/sycl/CMakeFiles/vecmem_test_sycl.dir/test_sycl_edm.sycl.obj
In file included from C:\Users\krasz\ATLAS\vecmem\vecmem\tests\sycl\test_sycl_edm.sycl:13:
In file included from C:\Users\krasz\ATLAS\vecmem\vecmem\tests\common\soa_device_tests.hpp:53:
C:\Users\krasz\ATLAS\vecmem\vecmem\tests\common\soa_device_tests.ipp(19,30): warning: declaration shadows a variable in
      the global namespace [-Wshadow]
   19 |     vecmem::memory_resource& host_mr = std::get<0>(params);
      |                              ^
C:\Users\krasz\ATLAS\vecmem\vecmem\tests\sycl\test_sycl_edm.sycl(31,43): note: previous declaration is here
   31 | static vecmem::sycl::host_memory_resource host_mr{&queue};
      |                                           ^
In file included from C:\Users\krasz\ATLAS\vecmem\vecmem\tests\sycl\test_sycl_edm.sycl:13:
In file included from C:\Users\krasz\ATLAS\vecmem\vecmem\tests\common\soa_device_tests.hpp:53:
C:\Users\krasz\ATLAS\vecmem\vecmem\tests\common\soa_device_tests.ipp(53,30): warning: declaration shadows a variable in
      the global namespace [-Wshadow]
   53 |     vecmem::memory_resource& host_mr = std::get<0>(params);
      |                              ^
C:\Users\krasz\ATLAS\vecmem\vecmem\tests\sycl\test_sycl_edm.sycl(31,43): note: previous declaration is here
   31 | static vecmem::sycl::host_memory_resource host_mr{&queue};
      |                                           ^
...

Since these only show up with CUDA and SYCL on Windows, the CI is blind to it. The HIP tests are not processed by MSVC ever, but it would've been silly not updating that code as well. 🤔