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) cmake_minimum_required (VERSION 3.17)
project (hpvm-tensor-rt) project(hpvm-tensor-rt)
find_package(CUDA 6.5 REQUIRED) find_package(CUDA 6.5 REQUIRED)
set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "") set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "")
set(CUDA_PROPAGATE_HOST_FLAGS OFF) set(CUDA_PROPAGATE_HOST_FLAGS OFF)
...@@ -71,16 +71,18 @@ foreach(FILE ${RUNTIME_SRCS_FILENAME}) ...@@ -71,16 +71,18 @@ foreach(FILE ${RUNTIME_SRCS_FILENAME})
list(APPEND RUNTIME_SRCS "tensor_runtime/src/${FILE}") list(APPEND RUNTIME_SRCS "tensor_runtime/src/${FILE}")
endforeach() endforeach()
# Default link libraries # Compile gpu_profiler and soc_simulator
find_library(GPU_PROFILER_LIB # Conditionally add gpu_profiler project if we're building independently
NAMES libgpu_profiler.a # (not building the whole hpvm)
HINTS ../gpu_profiler/lib get_filename_component(root_dir ${CMAKE_SOURCE_DIR} REALPATH)
) get_filename_component(our_dir ${CMAKE_CURRENT_SOURCE_DIR} REALPATH)
find_library(SOC_SIMULATOR_LIB if(${root_dir} STREQUAL ${our_dir})
NAMES libpromise_profiler.a message("Compiling hpvm-tensor-rt independently")
HINTS ../soc_simulator/lib message("Also compiling gpu_profiler and soc_simulator")
) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../gpu_profiler ${CMAKE_CURRENT_BINARY_DIR}/gpu_profiler)
set(LINK_LIBS cudnn cufft stdc++fs curand) 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) if(USE_GFLAGS)
list(APPEND LINK_LIBS gflags) list(APPEND LINK_LIBS gflags)
endif() 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