Skip to content

Commit

Permalink
ittnotify: use untouched library
Browse files Browse the repository at this point in the history
  • Loading branch information
clementperon committed Jul 24, 2024
1 parent fd3960d commit e307f4a
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 8,773 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ if (TBB_FIND_PACKAGE AND TBB_DIR)
message(STATUS "Using external TBB for testing")
find_package(TBB REQUIRED)
else()
add_subdirectory(src/ittapi)
if (TBB_BUILD)
add_subdirectory(src/tbb)
endif()
Expand Down
21 changes: 21 additions & 0 deletions src/ittapi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include(FetchContent)

# Fetch the ittapi library if it doesn't exist
if(NOT TARGET ittapi::ittnotify)
FetchContent_Declare(
ittapi
# https://github.com/intel/ittapi/archive/refs/tags/v3.25.1.tar.gz
URL ${CMAKE_CURRENT_SOURCE_DIR}/ittapi-3.25.1.tar.gz
URL_HASH
SHA256=866a5a75a287a7440760146f99bd1093750c3fb5bf572c3bff2d4795628ebc7c
)
FetchContent_MakeAvailable(ittapi)
add_library(ittapi::ittnotify ALIAS ittnotify)
endif()

if(NOT TARGET ittapi::ittnotify)
message(
ERROR
"Failed to add Intel® Instrumentation and Tracing Technology (ITT) library"
)
endif()
Binary file added src/ittapi/ittapi-3.25.1.tar.gz
Binary file not shown.
1 change: 1 addition & 0 deletions src/tbb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ endif()

target_link_libraries(tbb
PRIVATE
ittapi::ittnotify
Threads::Threads
${TBB_LIB_LINK_LIBS}
${TBB_COMMON_LINK_LIBS}
Expand Down
7 changes: 5 additions & 2 deletions src/tbb/itt_notify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@
#pragma weak dlopen
#pragma weak dlsym
#pragma weak dlerror
#include <limits.h>
#include <dlfcn.h>
#include <errno.h>
#endif /* WIN */

#include "itt_notify.h"

#if __TBB_BUILD

extern "C" void ITT_DoOneTimeInitialization();
Expand All @@ -40,8 +45,6 @@ extern "C" void MallocInitializeITT();
#error This file is expected to be used for either TBB or TBB allocator build.
#endif // __TBB_BUILD

#include "tools_api/ittnotify_static.c"

namespace tbb {
namespace detail {
namespace r1 {
Expand Down
30 changes: 28 additions & 2 deletions src/tbb/itt_notify.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,36 @@
#define INTEL_ITTNOTIFY_API_PRIVATE
#endif

#include "tools_api/ittnotify.h"
#include "tools_api/legacy/ittnotify.h"
#include "ittnotify.h"
#include "legacy/ittnotify.h"

typedef enum ___itt_group_id
{
__itt_group_none = 0,
__itt_group_legacy = 1<<0,
__itt_group_control = 1<<1,
__itt_group_thread = 1<<2,
__itt_group_mark = 1<<3,
__itt_group_sync = 1<<4,
__itt_group_fsync = 1<<5,
__itt_group_jit = 1<<6,
__itt_group_model = 1<<7,
__itt_group_splitter_min = 1<<7,
__itt_group_counter = 1<<8,
__itt_group_frame = 1<<9,
__itt_group_stitch = 1<<10,
__itt_group_heap = 1<<11,
__itt_group_splitter_max = 1<<12,
__itt_group_structure = 1<<12,
__itt_group_suppress = 1<<13,
__itt_group_arrays = 1<<14,
__itt_group_module = 1<<15,
__itt_group_all = -1
} __itt_group_id;

extern "C" void __itt_fini_ittlib(void);
extern "C" void __itt_release_resources(void);
extern "C" int __itt_init_ittlib(const char *, __itt_group_id);

#if _WIN32||_WIN64
#undef _T
Expand Down
39 changes: 0 additions & 39 deletions src/tbb/tools_api/disable_warnings.h

This file was deleted.

Loading

0 comments on commit e307f4a

Please sign in to comment.