Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XPTI][Framework] Reference implementation of the Xpti framework to be used with instrumentation in SYCL #1557

Merged
merged 18 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions xptifw/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CMakeCache.txt
CMakeFiles/
Makefile
basic_test/CMakeFiles/
basic_test/Makefile
basic_test/cmake_install.cmake
cmake_install.cmake
lib/
samples/basic_collector/CMakeFiles/
samples/basic_collector/Makefile
samples/basic_collector/cmake_install.cmake
samples/basic_collector/xpti_timers.hpp
src/CMakeFiles/
src/Makefile
src/cmake_install.cmake
unit_test/CMakeFiles/
unit_test/Makefile
unit_test/cmake_install.cmake
unit_test/googletest-build/
unit_test/googletest-download/
unit_test/googletest-src/

31 changes: 31 additions & 0 deletions xptifw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 2.8.9)

set(XPTI_VERSION 0.4.1)
set(XPTIFW_DIR ${CMAKE_CURRENT_LIST_DIR})
# The XPTI framework requires the includes from
# the proxy implementation of XPTI
set(XPTI_DIR ${CMAKE_CURRENT_LIST_DIR}/../xpti)

# Create a soft option for enabling the use of TBB
option(XPTI_ENABLE_TBB "Enable TBB in the framework" OFF)

if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE)
endif()

project (xptifw)

set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/lib/${CMAKE_BUILD_TYPE})
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})

include_directories(${CMAKE_SOURCE_DIR}/include ${XPTI_DIR}/include)
add_subdirectory(src)
add_subdirectory(unit_test)
add_subdirectory(samples/basic_collector)
# The tests in basic_test are written using TBB, so these tests are enabled
# only if TBB has been enabled.
if (XPTI_ENABLE_TBB)
add_subdirectory(basic_test)
endif()
15 changes: 15 additions & 0 deletions xptifw/CMakeLists.txt.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 2.8.2)

project(googletest-download NONE)

include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
16 changes: 16 additions & 0 deletions xptifw/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# XPTI Framework Library

Implementation of the instrumentation framework library to support
instrumentation of arbitrary regions of code. This implementation requires the
specification header files used by the proxy library in `xpti/`. This
library is not necessary for building the SYCL runtime library and only required
to build tools that extract the traces from instrumented code.

To see the implementation of the basic collector and how it can be attached to
an application that has been instrumented with XPTI, see [samples/basic_collector/README.md](samples/basic_collector/README.md).

To see how to determine the cost of the APIs, see the tests under [basic_test/](basic_test/README.md).

Unit tests are available under [unit_test](unit_test/README.md).

To see the complete documentation on XPTI framework API, please see [XPTI Framework library documentation](doc/XPTI_Framework.md)
22 changes: 22 additions & 0 deletions xptifw/basic_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 2.8.9)
project (run_test)

file(GLOB SOURCES *.cpp *.hpp)
include_directories(${XPTIFW_DIR}/include)
include_directories(${XPTI_DIR}/include)

remove_definitions(-DXPTI_STATIC_LIBRARY)
add_definitions(-DXPTI_API_EXPORTS -g -O3)
add_executable(run_test ${SOURCES})
add_dependencies(run_test xptifw)
target_link_libraries(run_test PRIVATE xptifw)
if(UNIX)
target_link_libraries(run_test PRIVATE dl)
endif()

if (XPTI_ENABLE_TBB)
target_link_libraries(run_test PRIVATE tbb)
endif()

# Set the location of the library installation
install(TARGETS run_test DESTINATION ${CMAKE_BINARY_DIR})
16 changes: 16 additions & 0 deletions xptifw/basic_test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Basic tests

In order to capture the cost of various API calls in the framework and test the
correctness of the API, a set of basic tests have been created. They primarily
fall under two categories:

1. Semantic tests: These tests perform correctness checks on the API call to
ensure the right data is being retrieved. The semantic tests are categorized
into string table tests, trace point tests and notification tests.

2. Performance tests: These test attempt to capture the average cost of various
operations that are a part of creating trace points in applications. The tests
are categorized into data structure tests and instrumentation tests.

For more detail on the framework, the tests that are provided and their usage,
please consult the [XPTI Framework library documentation](doc/XPTI_Framework.md).
Loading