Skip to content

Commit

Permalink
enabling PROF_API find_path (#1001)
Browse files Browse the repository at this point in the history
enabling PROF_API find_path
  • Loading branch information
eshcherb authored and scchan committed Jan 28, 2019
1 parent d0e9cef commit 0a55faa
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required( VERSION 3.0 )
cmake_minimum_required( VERSION 3.4.3 )
project (HCC)

include(GNUInstallDirs)
Expand Down Expand Up @@ -173,18 +173,21 @@ endif (USE_CODEXL_ACTIVITY_LOGGER EQUAL 1)
# Detect profiling API
################
if(USE_PROF_API EQUAL 1)
add_definitions(-DUSE_PROF_API=1)
if (NOT DEFINED PROF_API_HEADER_PATH)
set(PROF_API_HEADER_PATH ${ROCM_ROOT}/roctracer/include/ext)
endif()
find_path(PROF_API_HEADER_DIR NAMES prof_protocol.h PATHS ${PROF_API_HEADER_PATH} NO_DEFAULT_PATH)
if(NOT PROF_API_HEADER_DIR)
MESSAGE("PROF_API_HEADER_PATH = ${PROF_API_HEADER_PATH}")
MESSAGE(FATAL_ERROR "Profiling API header not found, use -DPROF_API_HEADER_PATH=<path to prof_protocol.h header>")
else()
include_directories ( ${PROF_API_HEADER_DIR} )
MESSAGE("Profiling API: ${PROF_API_HEADER_DIR}")
endif()
find_path(PROF_API_HEADER_DIR prof_protocol.h
HINTS
${PROF_API_HEADER_PATH}
PATHS
${ROCM_ROOT}/roctracer
PATH_SUFFIXES
include/ext
)
if(NOT PROF_API_HEADER_DIR)
MESSAGE(FATAL_ERROR "Profiling API header not found, use -DPROF_API_HEADER_PATH=<path to prof_protocol.h header>")
else()
add_definitions(-DUSE_PROF_API=1)
include_directories ( ${PROF_API_HEADER_DIR} )
MESSAGE("Profiling API: ${PROF_API_HEADER_DIR}")
endif()
endif()

#################
Expand Down

0 comments on commit 0a55faa

Please sign in to comment.