diff --git a/CMakeLists.txt b/CMakeLists.txt index e91d7c62..0852fa54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,12 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11 set(CMAKE_POSITION_INDEPENDENT_CODE ON) +###### options ###### +option(AVA_GEN_TF_SPEC "Enable cuda spec used by tensorflow" OFF) +option(AVA_GEN_ONNXRT_SPEC "Enable cuda spec used by onnxruntime" OFF) +message(STATUS "ava gen tf spec" ${AVA_GEN_TF_SPEC}) +message("ava gen onnxrt spec true" ${AVA_GEN_ONNXRT_SPEC}) + # Always include debug info add_compile_options("$<$:-g>") @@ -218,6 +224,8 @@ ExternalProject_Add(ava-spec -Dlibconfig++_DIR:PATH=${EXTERNAL_BINARY_DIR}/libconfig/lib/cmake/libconfig -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER} + -DAVA_GEN_TF_SPEC:BOOL=${AVA_GEN_TF_SPEC} + -DAVA_GEN_ONNXRT_SPEC:BOOL=${AVA_GEN_ONNXRT_SPEC} BUILD_ALWAYS ON DEPENDS flatbuffers libconfig ) diff --git a/cava/.gitignore b/cava/.gitignore index ca5b7ad7..5dad30e8 100644 --- a/cava/.gitignore +++ b/cava/.gitignore @@ -25,3 +25,5 @@ gti_nw/ cudart_nw/ onnx_dump_nw/ onnx_opt_nw/ +tf_dump_nw +tf_opt_nw \ No newline at end of file diff --git a/cava/CMakeLists.txt b/cava/CMakeLists.txt index a5fe4727..79b5f84a 100644 --- a/cava/CMakeLists.txt +++ b/cava/CMakeLists.txt @@ -86,3 +86,18 @@ ExternalProject_Add(cu_nw #) ###### Define your compilation below ###### +message(STATUS "Whether to compile tensorflow spec") +if(AVA_GEN_TF_SPEC) + message(STATUS "ON") + include(samples/tensorflow/CMakeLists.txt) +else() + message(STATUS "OFF") +endif() + +message(STATUS "Whether to compile onnxruntime spec") +if(AVA_GEN_ONNXRT_SPEC) + message(STATUS "ON") + include(samples/onnxruntime/CMakeLists.txt) +else() + message(STATUS "OFF") +endif() diff --git a/cava/samples/onnxruntime/CMakeLists.txt b/cava/samples/onnxruntime/CMakeLists.txt index 921d9eb4..ff6eb031 100644 --- a/cava/samples/onnxruntime/CMakeLists.txt +++ b/cava/samples/onnxruntime/CMakeLists.txt @@ -8,23 +8,10 @@ foreach(var ${vars}) endif() endforeach() -project(ava-spec) +project(ava-spec-onnxruntime) include(ExternalProject) -###### Build customized LLVM ###### - -ExternalProject_Add(cava - PREFIX ava-llvm - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../llvm/build - URL "https://github.com/utcs-scea/ava-llvm/releases/download/v7.1.0/ava-llvm-release-7.1.0.tar.gz" - URL_HASH MD5=400832522ed255314d6a5848e8f7af6c - BUILD_COMMAND "" - CONFIGURE_COMMAND "" - INSTALL_COMMAND "" - UPDATE_DISCONNECTED ON -) - ###### Compile onnxruntime/onnx_dump.c ###### find_package(PkgConfig REQUIRED) diff --git a/cava/samples/tensorflow/CMakeLists.txt b/cava/samples/tensorflow/CMakeLists.txt index 5c171b47..2c2cecc8 100644 --- a/cava/samples/tensorflow/CMakeLists.txt +++ b/cava/samples/tensorflow/CMakeLists.txt @@ -8,23 +8,10 @@ foreach(var ${vars}) endif() endforeach() -project(ava-spec) +project(ava-spec-tf) include(ExternalProject) -###### Build customized LLVM ###### - -ExternalProject_Add(cava - PREFIX ava-llvm - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../llvm/build - URL "https://github.com/utcs-scea/ava-llvm/releases/download/v7.1.0/ava-llvm-release-7.1.0.tar.gz" - URL_HASH MD5=400832522ed255314d6a5848e8f7af6c - BUILD_COMMAND "" - CONFIGURE_COMMAND "" - INSTALL_COMMAND "" - UPDATE_DISCONNECTED ON -) - ###### Compile tensorflow/tf_dump.c ###### find_package(PkgConfig REQUIRED)