Skip to content
Snippets Groups Projects
Commit 59c6c3f2 authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Compile soc_simulator and gpu_profiler automatically

parent 9b7795f9
No related branches found
No related tags found
No related merge requests found
cmake_minimum_required (VERSION 3.17)
project (hpvm-tensor-rt)
project(hpvm-tensor-rt)
find_package(CUDA 6.5 REQUIRED)
set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "")
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
......@@ -71,16 +71,18 @@ foreach(FILE ${RUNTIME_SRCS_FILENAME})
list(APPEND RUNTIME_SRCS "tensor_runtime/src/${FILE}")
endforeach()
# Default link libraries
find_library(GPU_PROFILER_LIB
NAMES libgpu_profiler.a
HINTS ../gpu_profiler/lib
)
find_library(SOC_SIMULATOR_LIB
NAMES libpromise_profiler.a
HINTS ../soc_simulator/lib
)
set(LINK_LIBS cudnn cufft stdc++fs curand)
# Compile gpu_profiler and soc_simulator
# Conditionally add gpu_profiler project if we're building independently
# (not building the whole hpvm)
get_filename_component(root_dir ${CMAKE_SOURCE_DIR} REALPATH)
get_filename_component(our_dir ${CMAKE_CURRENT_SOURCE_DIR} REALPATH)
if(${root_dir} STREQUAL ${our_dir})
message("Compiling hpvm-tensor-rt independently")
message("Also compiling gpu_profiler and soc_simulator")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../gpu_profiler ${CMAKE_CURRENT_BINARY_DIR}/gpu_profiler)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../soc_simulator ${CMAKE_CURRENT_BINARY_DIR}/soc_simulator)
endif()
set(LINK_LIBS gpu_profiler promise_profiler cudnn cufft stdc++fs curand)
if(USE_GFLAGS)
list(APPEND LINK_LIBS gflags)
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment