Skip to content

Commit

Permalink
[FORK][FIX] Add dl library when ITT is used
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Mar 9, 2024
1 parent 3ab1dd8 commit 59cab32
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ if(DNNL_ENABLE_JIT_PROFILING OR DNNL_ENABLE_ITT_TASKS)
endif()
list(APPEND SOURCES ${ITT_PT})
endif()

set_property(GLOBAL APPEND PROPERTY DNNL_SUBDIR_EXTRA_SHARED_LIBS ${CMAKE_DL_LIBS})
endif()
endif()

Expand Down
14 changes: 8 additions & 6 deletions src/common/cpp_compat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,24 @@ namespace cpp_compat {
// been deprecated in C++17, which triggers deprecations warnings. This file
// contains a compatibility layer for such C++ features.

// Older than C++17.
#if defined(__cplusplus) && __cplusplus < 201703L || defined(_MSVC_LANG) && _MSVC_LANG < 201703L
// Newer than C++17.
#if defined(__cplusplus) && __cplusplus >= 201703L || defined(_MSVC_LANG) && _MSVC_LANG >= 201703L

inline int uncaught_exceptions() {
return (int)std::uncaught_exception();
return std::uncaught_exceptions();
}

template <class F, class... ArgTypes>
using invoke_result = typename std::result_of<F(ArgTypes...)>;
using invoke_result = std::invoke_result<F, ArgTypes...>;

#else

inline int uncaught_exceptions() {
return std::uncaught_exceptions();
return (int)std::uncaught_exception();
}

template <class F, class... ArgTypes>
using invoke_result = std::invoke_result<F, ArgTypes...>;
using invoke_result = typename std::result_of<F(ArgTypes...)>;

#endif
} // namespace cpp_compat
Expand Down

0 comments on commit 59cab32

Please sign in to comment.