Skip to content
Snippets Groups Projects
Commit b85fcd8c authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'opt.TrkExSTEP_Propagator-20210325' into 'master'

TrkExSTEP_Propagator: Optimize some functions, even in dbg builds.

See merge request atlas/athena!42000
parents acd76b12 72bb4675
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( TrkExSTEP_Propagator )
......@@ -14,3 +14,17 @@ atlas_add_component( TrkExSTEP_Propagator
LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives EventPrimitives TrkGeometry TrkEventPrimitives
TrkMaterialOnTrack TrkParameters TrkExInterfaces TrkExUtils GaudiKernel TrkDetDescrUtils TrkSurfaces TrkTrack
MagFieldElements MagFieldConditions CxxUtils)
# Code in this file makes heavy use of eigen and runs orders of magnitude
# more slowly without optimization. So force this to be optimized even
# in debug builds. If you need to debug it you might want to change this.
# Specifying optimization via an attribute on the particular
# function didn't work, because that still didn't allow inlining.
if ( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" )
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/src/STEP_Propagator.cxx
PROPERTIES
COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}"
COMPILE_DEFINITIONS "FLATTEN" )
endif()
......@@ -1924,12 +1924,13 @@ Trk::STEP_Propagator::propagateWithJacobian (Cache& cache,
// This is the default STEP method
/////////////////////////////////////////////////////////////////////////////////
// Force this function to be optimized, even in unoptimized builds:
// this makes heavy use of Eigen, and Eigen is extremely slow if optimization
// is disabled. If you do need to debug this function, you can comment
// this out.
#if defined(__GNUC__) && !defined(__OPTIMIZE__)
__attribute__ ((optimize(2)))
#if defined(FLATTEN) && defined(__GNUC__)
// We compile this package with optimization, even in debug builds; otherwise,
// the heavy use of Eigen makes it too slow. However, from here we may call
// to out-of-line Eigen code that is linked from other DSOs; in that case,
// it would not be optimized. Avoid this by forcing all Eigen code
// to be inlined here if possible.
__attribute__ ((flatten))
#endif
bool
Trk::STEP_Propagator::rungeKuttaStep( Cache& cache,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment