Skip to content

Commit 59cab32

Browse files
committed
[FORK][FIX] Add dl library when ITT is used
1 parent 3ab1dd8 commit 59cab32

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/common/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ if(DNNL_ENABLE_JIT_PROFILING OR DNNL_ENABLE_ITT_TASKS)
4040
endif()
4141
list(APPEND SOURCES ${ITT_PT})
4242
endif()
43+
44+
set_property(GLOBAL APPEND PROPERTY DNNL_SUBDIR_EXTRA_SHARED_LIBS ${CMAKE_DL_LIBS})
4345
endif()
4446
endif()
4547

src/common/cpp_compat.hpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,24 @@ namespace cpp_compat {
2929
// been deprecated in C++17, which triggers deprecations warnings. This file
3030
// contains a compatibility layer for such C++ features.
3131

32-
// Older than C++17.
33-
#if defined(__cplusplus) && __cplusplus < 201703L || defined(_MSVC_LANG) && _MSVC_LANG < 201703L
32+
// Newer than C++17.
33+
#if defined(__cplusplus) && __cplusplus >= 201703L || defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
34+
3435
inline int uncaught_exceptions() {
35-
return (int)std::uncaught_exception();
36+
return std::uncaught_exceptions();
3637
}
3738

3839
template <class F, class... ArgTypes>
39-
using invoke_result = typename std::result_of<F(ArgTypes...)>;
40+
using invoke_result = std::invoke_result<F, ArgTypes...>;
41+
4042
#else
4143

4244
inline int uncaught_exceptions() {
43-
return std::uncaught_exceptions();
45+
return (int)std::uncaught_exception();
4446
}
4547

4648
template <class F, class... ArgTypes>
47-
using invoke_result = std::invoke_result<F, ArgTypes...>;
49+
using invoke_result = typename std::result_of<F(ArgTypes...)>;
4850

4951
#endif
5052
} // namespace cpp_compat

0 commit comments

Comments
 (0)