Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LHCb
Rec
Commits
1691fac8
Commit
1691fac8
authored
3 years ago
by
Christoph Hasse
Browse files
Options
Downloads
Patches
Plain Diff
remove exception() indirection
parent
94dbc43e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2699
FunctorFactory, replace CLING backend with native compiler
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Phys/FunctorCore/src/Components/Factory.cpp
+7
-5
7 additions, 5 deletions
Phys/FunctorCore/src/Components/Factory.cpp
with
7 additions
and
5 deletions
Phys/FunctorCore/src/Components/Factory.cpp
+
7
−
5
View file @
1691fac8
...
...
@@ -119,8 +119,6 @@ struct FunctorFactory : public extends<Service, Functors::IFactory> {
if
(
msgLevel
(
MSG
::
DEBUG
)
)
{
debug
()
<<
m_all
.
size
()
<<
" functors were registered"
<<
endmsg
;
}
auto
exception
=
[](
auto
const
&
name
)
{
return
GaudiException
{
name
,
"FunctorFactory"
,
StatusCode
::
FAILURE
};
};
std
::
string
full_lib_code
{
"#if defined(__clang__)
\n
"
};
full_lib_code
+=
"#pragma clang diagnostic ignored
\"
-Wreturn-type-c-linkage
\"\n
"
;
full_lib_code
+=
"#endif
\n
"
;
...
...
@@ -198,7 +196,7 @@ struct FunctorFactory : public extends<Service, Functors::IFactory> {
auto
total_time
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
seconds
>
(
std
::
chrono
::
high_resolution_clock
::
now
()
-
start_time
);
info
()
<<
"Compilation of functor library took "
<<
total_time
.
count
()
<<
" seconds"
<<
endmsg
;
if
(
return_code
!=
0
)
{
throw
e
xception
(
"Non zero return code!
\n
"
)
;
}
if
(
return_code
!=
0
)
{
throw
GaudiE
xception
{
"Non zero return code!
"
,
"FunctorFactory"
,
StatusCode
::
FAILURE
}
;
}
if
(
msgLevel
(
MSG
::
VERBOSE
)
)
{
verbose
()
<<
"Rename "
<<
lib_tmp_full_path
<<
" to "
<<
lib_full_path
<<
endmsg
;
...
...
@@ -208,7 +206,9 @@ struct FunctorFactory : public extends<Service, Functors::IFactory> {
m_lib_handle
=
LibHandle
{
dlopen
(
lib_full_path
.
c_str
(),
RTLD_LOCAL
|
RTLD_LAZY
),
lib_closer
};
}
if
(
m_lib_handle
==
nullptr
)
{
throw
exception
(
std
::
string
(
"dlopen Error:
\n
"
)
+
dlerror
()
);
}
if
(
m_lib_handle
==
nullptr
)
{
throw
GaudiException
{
std
::
string
(
"dlopen Error:
\n
"
)
+
dlerror
(),
"FunctorFactory"
,
StatusCode
::
FAILURE
};
}
// at this point we have compiled the functors so now it is time to make
// sure that we initialize each algorithm's functors
...
...
@@ -217,7 +217,9 @@ struct FunctorFactory : public extends<Service, Functors::IFactory> {
auto
function_name
=
Functors
::
Cache
::
hashToFuncName
(
entry
.
first
);
auto
factory_function
=
reinterpret_cast
<
factory_function_ptr
>
(
dlsym
(
m_lib_handle
.
get
(),
function_name
.
c_str
()
)
);
if
(
factory_function
==
nullptr
)
{
throw
exception
(
std
::
string
(
"dlsym Error:
\n
"
)
+
dlerror
()
);
}
if
(
factory_function
==
nullptr
)
{
throw
GaudiException
{
std
::
string
(
"dlsym Error:
\n
"
)
+
dlerror
(),
"FunctorFactory"
,
StatusCode
::
FAILURE
};
}
for
(
auto
const
&
copy_func
:
entry
.
second
.
first
)
{
auto
functor
=
factory_function
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment