Skip to content

Commit

Permalink
add api_callback_tracing_memcpy_bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jmellorcrummey committed Jun 30, 2024
1 parent fd67e03 commit b217192
Show file tree
Hide file tree
Showing 6 changed files with 771 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ add_subdirectory(common)

# actual samples
add_subdirectory(api_callback_tracing)
add_subdirectory(api_callback_tracing_memcpy_bug)
add_subdirectory(api_buffered_tracing)
add_subdirectory(code_object_tracing)
add_subdirectory(counter_collection)
Expand Down
2 changes: 2 additions & 0 deletions samples/api_callback_tracing_memcpy_bug/BUG_DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
for an internal correlation id, the external correlation id popped is supposed to be the same as the external correlation id pushed.
these are not the same for when using callback api tracing for ROCPROFILER_CALLBACK_TRACING_MEMORY_COPY. the value popped is always 0.
61 changes: 61 additions & 0 deletions samples/api_callback_tracing_memcpy_bug/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
#
#
cmake_minimum_required(VERSION 3.21.0 FATAL_ERROR)

if(NOT CMAKE_HIP_COMPILER)
find_program(
amdclangpp_EXECUTABLE
NAMES amdclang++
HINTS ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
PATHS ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
PATH_SUFFIXES bin llvm/bin NO_CACHE)
mark_as_advanced(amdclangpp_EXECUTABLE)

if(amdclangpp_EXECUTABLE)
set(CMAKE_HIP_COMPILER "${amdclangpp_EXECUTABLE}")
endif()
endif()

project(rocprofiler-sdk-samples-callback-api-tracing-memcpy-bug LANGUAGES CXX HIP)

foreach(_TYPE DEBUG MINSIZEREL RELEASE RELWITHDEBINFO)
if("${CMAKE_HIP_FLAGS_${_TYPE}}" STREQUAL "")
set(CMAKE_HIP_FLAGS_${_TYPE} "${CMAKE_CXX_FLAGS_${_TYPE}}")
endif()
endforeach()

find_package(rocprofiler-sdk REQUIRED)

add_library(callback-api-tracing-client-memcpy-bug SHARED)
target_sources(callback-api-tracing-client-memcpy-bug PRIVATE client.cpp client.hpp)
target_link_libraries(
callback-api-tracing-client-memcpy-bug
PRIVATE rocprofiler-sdk::rocprofiler-sdk rocprofiler-sdk::samples-build-flags
rocprofiler-sdk::samples-common-library)

set_source_files_properties(main.cpp PROPERTIES LANGUAGE HIP)

find_package(Threads REQUIRED)
find_package(rocprofiler-sdk-roctx REQUIRED)

add_executable(callback-api-tracing-memcpy-bug)
target_sources(callback-api-tracing-memcpy-bug PRIVATE main.cpp)
target_link_libraries(
callback-api-tracing-memcpy-bug
PRIVATE callback-api-tracing-client-memcpy-bug Threads::Threads
rocprofiler-sdk-roctx::rocprofiler-sdk-roctx
rocprofiler-sdk::samples-build-flags)

rocprofiler_samples_get_preload_env(PRELOAD_ENV callback-api-tracing-client-memcpy-bug)
rocprofiler_samples_get_ld_library_path_env(
LIBRARY_PATH_ENV rocprofiler-sdk-roctx::rocprofiler-sdk-roctx-shared-library)

set(callback-api-tracing-memcpy-bug-env ${PRELOAD_ENV} ${LIBRARY_PATH_ENV})

add_test(NAME callback-api-tracing-memcpy-bug COMMAND $<TARGET_FILE:callback-api-tracing-memcpy-bug>)

set_tests_properties(
callback-api-tracing-memcpy-bug
PROPERTIES TIMEOUT 45 LABELS "samples" ENVIRONMENT "${callback-api-tracing-memcpy-bug-env}"
FAIL_REGULAR_EXPRESSION "${ROCPROFILER_DEFAULT_FAIL_REGEX}")
Loading

0 comments on commit b217192

Please sign in to comment.