Skip to content
Snippets Groups Projects
Commit 2694547b authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny:
Browse files

Merge branch 'opt2.GeoModelKernel-20210408' into 'master'

GeoModelKernel: Compile GeoAlignableTransform.cxx with optimization, even in debug builds.

See merge request GeoModelDev/GeoModel!65
parents 09b969ef b6ac5eb1
No related branches found
No related tags found
1 merge request!65GeoModelKernel: Compile GeoAlignableTransform.cxx with optimization, even in debug builds.
...@@ -28,6 +28,7 @@ set_target_properties( GeoModelKernel PROPERTIES ...@@ -28,6 +28,7 @@ set_target_properties( GeoModelKernel PROPERTIES
if ( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" ) if ( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" )
set_source_files_properties( set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/src/GeoXF.cxx ${CMAKE_CURRENT_SOURCE_DIR}/src/GeoXF.cxx
${CMAKE_CURRENT_SOURCE_DIR}/src/GeoAlignableTransform.cxx
PROPERTIES PROPERTIES
COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}"
COMPILE_DEFINITIONS "FLATTEN" ) COMPILE_DEFINITIONS "FLATTEN" )
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/ */
#include "GeoModelKernel/GeoAlignableTransform.h" #include "GeoModelKernel/GeoAlignableTransform.h"
...@@ -19,6 +19,14 @@ GeoAlignableTransform::~GeoAlignableTransform() ...@@ -19,6 +19,14 @@ GeoAlignableTransform::~GeoAlignableTransform()
delete m_delta; delete m_delta;
} }
#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
GeoTrf::Transform3D GeoAlignableTransform::getTransform(const GeoVAlignmentStore* store) const GeoTrf::Transform3D GeoAlignableTransform::getTransform(const GeoVAlignmentStore* store) const
{ {
const GeoTrf::Transform3D* delta = (store==nullptr ? m_delta : store->getDelta(this)); const GeoTrf::Transform3D* delta = (store==nullptr ? m_delta : store->getDelta(this));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment