Support compilation of Gaudi Accumulators with nvcc
At present, Gaudi Accumulator headers cannot be compiled with nvcc. Compiling a stack with lhcb/Allen!641 (closed), with architecture x86_64_v3-centos7-clang12+cuda11_4-opt
(nvcc 11.4 for device code) results in:
FAILED: device/selections/CMakeFiles/Selections.dir/Hlt1/src/GatherSelections.cu.o
/cvmfs/sft.cern.ch/lcg/releases/cuda/11.4-166ec/x86_64-centos7-clang12-opt/bin/nvcc -forward-unknown-to-host-compiler -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SPIRIT_USE_PHOENIX_V3 -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DDD4HEP_USE_TBB -DDD4HEP_USE_XERCESC -DFMT_LOCALE -DFMT_SHARED -DGAUDI_V20_COMPAT -DJSON_USE_IMPLICIT_CONVERSIONS=1 -DMEMORY_MANAGER_SINGLE_ALLOC -DODIN_WITHOUT_GAUDI -DTARGET_DEVICE_CUDA -DWITH_ROOT -Iconfiguration/sequences -I../device/selections/Hlt1/include -I../device/selections/lines/calibration/include -I../device/selections/lines/monitoring/include -I../device/selections/lines/charm/include -I../device/selections/lines/inclusive_hadron/include -I../device/selections/lines/muon/include -I../device/selections/lines/electron/include -I../device/selections/lines/photon/include -I../device/selections/line_types/include -I../main/include -I../test/contracts/include -I../mdf/daq40 -I../backend/include -I../stream/gear/include -I../stream/sequence/include -Icode_generation/sequences/include -I../host/event_model/MC/include -I../device/event_model/associate/include -I../device/event_model/common/include -I../device/event_model/calo/include -I../device/event_model/muon/include -I../device/event_model/SciFi/include -I../device/event_model/selections/include -I../device/event_model/UT/include -I../device/event_model/velo/include -I../device/event_model/kalman/include -I../device/event_model/vertex_fit/include -I../device/event_model/PV/include -I../device/utils/prefix_sum/include -I../device/utils/binary_search/include -I../device/utils/sorting/include -I../device/utils/float_operations/include -I../device/utils/tuple_operations/include -I../device/kalman/ParKalman/include -I../device/SciFi/common/include -I../device/SciFi/preprocessing/include -I../device/SciFi/looking_forward/include -I../device/SciFi/consolidate/include -I../device/associate/include -I../device/vertex_fit/common/include -I../device/vertex_fit/two_track_mva/include -I../device/vertex_fit/vertex_fitter/include -isystem=/cvmfs/sft.cern.ch/lcg/releases/cuda/11.4-166ec/x86_64-centos7-clang12-opt/targets/x86_64-linux/include -isystem=/home/karich/commissioning-rebase/stack/Gaudi/InstallArea/x86_64_v3-centos7-clang12+cuda11_4-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/Boost/1.77.0-fd33b/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/tbb/2020_U2-daa7e/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/ROOT/6.24.06-a63a9/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/cppgsl/3.1.0-7a1b6/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/fmt/7.1.3-18428/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/jsonmcpp/3.9.1-72770/x86_64-centos7-clang12-opt/include -isystem=/home/karich/commissioning-rebase/stack/LHCb/InstallArea/x86_64_v3-centos7-clang12+cuda11_4-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/AIDA/3.2.1-3fe9f/x86_64-centos7-clang12-opt/src/cpp -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/rangev3/0.11.0-79ab4/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/eigen/3.3.7-642a5/x86_64-centos7-clang12-opt/include/eigen3 -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/GSL/2.7-30ba4/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/clhep/2.4.4.0-b903d/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/Vc/1.4.2-9e06f/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/vdt/0.4.3-992df/x86_64-centos7-clang12-opt/include -isystem=/home/karich/commissioning-rebase/stack/Detector/InstallArea/x86_64_v3-centos7-clang12+cuda11_4-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/DD4hep/01.19-9d188/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/XercesC/3.2.3-714f6/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/yamlcpp/0.6.3-d05b2/x86_64-centos7-clang12-opt/lib/cmake/yaml-cpp/../../../include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/yamlcpp/0.6.3-d05b2/x86_64-centos7-clang12-opt/include -isystem=/cvmfs/lhcb.cern.ch/lib/lcg/releases/umesimd/0.8.1-14a15/x86_64-centos7-clang12-opt -gencode=arch=compute_53,code=sm_53 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_86,code=sm_86 -gencode=arch=compute_86,code=sm_86 -Xcudafe --display_error_number --use_fast_math --expt-relaxed-constexpr -ccbin=/home/karich/commissioning-rebase/stack/Allen/build.x86_64_v3-centos7-clang12+cuda11_4-opt/toolchain -O3 -DNDEBUG --generate-line-info --generate-code=arch=compute_53,code=[compute_53,sm_53] --generate-code=arch=compute_60,code=[compute_60,sm_60] --generate-code=arch=compute_70,code=[compute_70,sm_70] --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] -Xcompiler=-fPIC -Xcompiler -pthread -std=c++17 -MD -MT device/selections/CMakeFiles/Selections.dir/Hlt1/src/GatherSelections.cu.o -MF device/selections/CMakeFiles/Selections.dir/Hlt1/src/GatherSelections.cu.o.d -x cu -dc ../device/selections/Hlt1/src/GatherSelections.cu -o device/selections/CMakeFiles/Selections.dir/Hlt1/src/GatherSelections.cu.o
/cvmfs/lhcb.cern.ch/lib/lcg/releases/Boost/1.77.0-fd33b/x86_64-centos7-clang12-opt/include/boost/histogram/detail/sub_array.hpp(88): error: "this" cannot be used in a constant expression
It is possible to make it so that Gaudi Accumulator includes are never seen by device-code compilation units, but it would be more convenient to be able to include it with no restrictions.
It should be noted that this is more of an nvcc issue not (yet) properly supporting boost, but if a compatible solution with our current architecture would be found it would be very useful and impact how code is organized.