From fc80548f5594bc6b6431a8a41d7010c306f72919 Mon Sep 17 00:00:00 2001 From: Chris Sullivan Date: Mon, 4 Oct 2021 23:09:02 -0700 Subject: [PATCH 1/5] Add USE_HEXAGON_LAUNCHER cmake configuration to build the android hexagon launcher along with a standard TVM build. --- cmake/config.cmake | 3 + cmake/modules/Hexagon.cmake | 81 ++++++++-- src/runtime/hexagon/launcher/CMakeLists.txt | 147 +++++++----------- .../hexagon/launcher/rpc_skel/CMakeLists.txt | 128 +++++++++++++++ 4 files changed, 255 insertions(+), 104 deletions(-) create mode 100644 src/runtime/hexagon/launcher/rpc_skel/CMakeLists.txt diff --git a/cmake/config.cmake b/cmake/config.cmake index 0ed9dd221e32..a920e2259b0a 100644 --- a/cmake/config.cmake +++ b/cmake/config.cmake @@ -279,6 +279,9 @@ set(USE_FALLBACK_STL_MAP OFF) set(USE_HEXAGON_DEVICE OFF) set(USE_HEXAGON_SDK /path/to/sdk) +# Whether to build the hexagon launcher +set(USE_HEXAGON_LAUNCHER OFF) + # Hexagon architecture to target when compiling TVM itself (not the target for # compiling _by_ TVM). This applies to components like the TVM runtime, but is # also used to select correct include/library paths from the Hexagon SDK when diff --git a/cmake/modules/Hexagon.cmake b/cmake/modules/Hexagon.cmake index eb3ad1f5ae4a..8c1e40aac8e1 100644 --- a/cmake/modules/Hexagon.cmake +++ b/cmake/modules/Hexagon.cmake @@ -53,23 +53,86 @@ if(BUILD_FOR_HEXAGON) include_directories(SYSTEM ${HEXAGON_SDK_INCLUDES} ${HEXAGON_QURT_INCLUDES}) endif() -if(USE_HEXAGON_DEVICE STREQUAL "OFF") - list(APPEND COMPILER_SRCS src/target/opt/build_hexagon_off.cc) - return() -elseif(NOT USE_HEXAGON_DEVICE STREQUAL "${PICK_SIM}" AND - NOT USE_HEXAGON_DEVICE STREQUAL "${PICK_HW}") - set(ERROR_MSG +if(USE_HEXAGON_LAUNCHER STREQUAL "ON") + set(USE_HEXAGON_DEVICE "${PICK_SIM}") +else() + if(USE_HEXAGON_DEVICE STREQUAL "OFF") + list(APPEND COMPILER_SRCS src/target/opt/build_hexagon_off.cc) + return() + elseif(NOT USE_HEXAGON_DEVICE STREQUAL "${PICK_SIM}" AND + NOT USE_HEXAGON_DEVICE STREQUAL "${PICK_HW}") + set(ERROR_MSG "USE_HEXAGON_DEVICE must be one of [${PICK_NONE}|${PICK_SIM}|${PICK_HW}]") - message(SEND_ERROR "${ERROR_MSG}") - return() + message(SEND_ERROR "${ERROR_MSG}") + return() + endif() endif() -# If USE_HEXAGON_DEVICE is set to a valid value, make sure that USE_HEXAGON_SDK + +# If USE_HEXAGON_DEVICE/LAUNCHER is set to a valid value, make sure that USE_HEXAGON_SDK # is defined. if(NOT USE_HEXAGON_SDK) message(SEND_ERROR "Please set USE_HEXAGON_SDK to the Hexagon SDK root") return() endif() +if(USE_HEXAGON_LAUNCHER STREQUAL "ON") + + if(DEFINED USE_ANDROID_TOOLCHAIN) + if(NOT DEFINED ANDROID_PLATFORM) + message(SEND_ERROR "Please set ANDROID_PLATFORM " + "when providing an Android cmake toolchain.") + endif() + if(NOT DEFINED ANDROID_ABI) + message(SEND_ERROR "Please set ANDROID_ABI " + "when providing an Android cmake toolchain.") + endif() + else() + message(SEND_ERROR "Please set USE_ANDROID_TOOLCHAIN to build the android " + " launcher for hexagon.") + endif() + + set(LAUNCHER_BINARY_DIR "${CMAKE_BINARY_DIR}/launcher") + ExternalProject_Add(launcher_android + SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/runtime/hexagon/launcher" + INSTALL_DIR "${LAUNCHER_BINARY_DIR}" + BUILD_ALWAYS ON + CMAKE_ARGS + "-DCMAKE_TOOLCHAIN_FILE=${USE_ANDROID_TOOLCHAIN}" + "-DANDROID_PLATFORM=${ANDROID_PLATFORM}" + "-DANDROID_ABI=${ANDROID_ABI}" + "-DFASTRPC_LIBS=STUB" + "-DUSE_HEXAGON_ARCH=v68" + "-DUSE_HEXAGON_SDK=${USE_HEXAGON_SDK}" + "-DCMAKE_INSTALL_PREFIX:PATH=" + INSTALL_COMMAND "" + ) + ExternalProject_Get_Property(launcher_android BINARY_DIR) + ExternalProject_Add_Step(launcher_android copy_binaries + COMMAND ${CMAKE_COMMAND} -E copy_directory ${BINARY_DIR} ${LAUNCHER_BINARY_DIR} + DEPENDEES install + ) + ExternalProject_Add(launcher_hexagon + SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/runtime/hexagon/launcher/rpc_skel" + INSTALL_DIR "${LAUNCHER_BINARY_DIR}" + BUILD_ALWAYS ON + CMAKE_ARGS + "-DCMAKE_C_COMPILER=${USE_HEXAGON_TOOLCHAIN}/Tools/bin/hexagon-clang" + "-DCMAKE_CXX_COMPILER=${USE_HEXAGON_TOOLCHAIN}/Tools/bin/hexagon-clang++" + "-DFASTRPC_LIBS=SKEL" + "-DUSE_HEXAGON_ARCH=v68" + "-DUSE_HEXAGON_SDK=${USE_HEXAGON_SDK}" + "-DCMAKE_INSTALL_PREFIX:PATH=" + INSTALL_COMMAND "" + ) + ExternalProject_Get_Property(launcher_hexagon BINARY_DIR) + ExternalProject_Add_Step(launcher_hexagon copy_binaries + COMMAND ${CMAKE_COMMAND} -E copy_directory ${BINARY_DIR} ${LAUNCHER_BINARY_DIR} + DEPENDEES install + ) + + set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${LAUNCHER_BINARY_DIR}") +endif() + if(USE_HEXAGON_DEVICE STREQUAL "${PICK_SIM}") find_hexagon_toolchain() message(STATUS "Hexagon toolchain: ${HEXAGON_TOOLCHAIN}") diff --git a/src/runtime/hexagon/launcher/CMakeLists.txt b/src/runtime/hexagon/launcher/CMakeLists.txt index d3a2f4f8161d..189181820121 100644 --- a/src/runtime/hexagon/launcher/CMakeLists.txt +++ b/src/runtime/hexagon/launcher/CMakeLists.txt @@ -18,11 +18,6 @@ cmake_minimum_required(VERSION 3.2) project(HexagonLauncher C CXX) -if(NOT "${FASTRPC_LIBS}" STREQUAL "SKEL" AND - NOT "${FASTRPC_LIBS}" STREQUAL "STUB") - message(SEND_ERROR "Please set FASTRPC_LIBS to either SKEL or STUB") -endif() - if(NOT DEFINED USE_HEXAGON_SDK) message(SEND_ERROR "Please set USE_HEXAGON_SDK to the location of Hexagon SDK") endif() @@ -30,6 +25,7 @@ if (NOT DEFINED USE_HEXAGON_ARCH) message(SEND_ERROR "Please set USE_HEXAGON_ARCH to the Hexagon architecture version") endif() +include(ExternalProject) include(../../../../cmake/modules/HexagonSDK.cmake) find_hexagon_sdk_root("${USE_HEXAGON_SDK}" "${USE_HEXAGON_ARCH}") @@ -64,93 +60,54 @@ add_custom_command( ) -if("${FASTRPC_LIBS}" STREQUAL "SKEL") - # Skel libraries. - # - if (NOT DEFINED TVM_RUNTIME_HEXAGON) - message(SEND_ERROR "Please set TVM_RUNTIME_HEXAGON=/path/to/libtvm_runtime.a") - endif() - - include_directories(SYSTEM ${HEXAGON_QURT_INCLUDES}) - include_directories( - "${LAUNCHER_SRC}" - "${LAUNCHER_SRC}/../../../../include" - "${LAUNCHER_SRC}/../../../../3rdparty/dlpack/include" - "${LAUNCHER_SRC}/../../../../3rdparty/dmlc-core/include" - ) - link_directories(${HEXAGON_QURT_LIBS}) - - add_definitions(-D_MACH_I32=int) - add_definitions(-DDMLC_CXX11_THREAD_LOCAL=0) - add_definitions(-DDMLC_USE_LOGGING_LIBRARY=) - - # Extra compile flags (both C and C++). - set(EXTRA_COMP_FLAGS - "-O3" - "-m${USE_HEXAGON_ARCH}" - ) - string(REGEX REPLACE ";" " " EXTRA_COMP_FLAGS_STR "${EXTRA_COMP_FLAGS}") - set(CMAKE_C_FLAGS "${EXTRA_COMP_FLAGS_STR} ${CMAKE_C_FLAGS}") - set(CMAKE_CXX_FLAGS "${EXTRA_COMP_FLAGS_STR} ${CMAKE_CXX_FLAGS}") - - set(EXTRA_LINK_FLAGS - "-lposix" - "-lqurt" - "-Wl,--export-dynamic" - "-Wl,--whole-archive ${TVM_RUNTIME_HEXAGON} -Wl,--no-whole-archive" - "-Wl,--defsym=HEAP_SIZE=0x40000000" - ) - string(REGEX REPLACE ";" " " EXTRA_LINK_FLAGS_STR "${EXTRA_LINK_FLAGS}") - - set(SKEL_SRCS - "launcher_core.cc" - "launcher_hexagon.cc" - ) - add_library(launcher_rpc_skel SHARED - "${LAUNCHER_SRC}/${LAUNCHER_RPC_H}" - "${LAUNCHER_RPC_SKEL_C}" - "${SKEL_SRCS}" - ) - - # Extra linker flags for linking shared libraries. - set_target_properties(launcher_rpc_skel PROPERTIES - LINK_FLAGS ${EXTRA_LINK_FLAGS_STR} - ) -else() - # Stub libraries. - # - if (NOT DEFINED TVM_RUNTIME_ANDROID) - message(SEND_ERROR "Please set TVM_RUNTIME_ANDROID=/path/to/libtvm_runtime.so") - endif() - - include_directories(SYSTEM - "${HEXAGON_SDK_INCLUDES}" - "${HEXAGON_RPCMEM_ROOT}/inc" - ) - include_directories( - "${LAUNCHER_SRC}" - "${LAUNCHER_SRC}/../../../../include" - "${LAUNCHER_SRC}/../../../../3rdparty/dlpack/include" - "${LAUNCHER_SRC}/../../../../3rdparty/dmlc-core/include" - ) - link_directories(${HEXAGON_REMOTE_ROOT}) - - add_definitions(-DDMLC_USE_LOGGING_LIBRARY=) - - set(STUB_SRCS - "launcher_android.cc" - "launcher_core.cc" - "launcher_main.cc" - "launcher_util.cc" - ) - - add_executable(launcher_android - "${STUB_SRCS}" - "${LAUNCHER_RPC_STUB_C}" - ) - target_link_libraries(launcher_android cdsprpc log) - - set_target_properties(launcher_android PROPERTIES - LINK_FLAGS "${TVM_RUNTIME_ANDROID}" - ) -endif() +include_directories(SYSTEM + "${HEXAGON_SDK_INCLUDES}" + "${HEXAGON_RPCMEM_ROOT}/inc" +) +include_directories( + "${LAUNCHER_SRC}" + "${LAUNCHER_SRC}/../../../../include" + "${LAUNCHER_SRC}/../../../../3rdparty/dlpack/include" + "${LAUNCHER_SRC}/../../../../3rdparty/dmlc-core/include" +) +link_directories(${HEXAGON_REMOTE_ROOT}) + +add_definitions(-DDMLC_USE_LOGGING_LIBRARY=) + +set(STUB_SRCS + "launcher_android.cc" + "launcher_core.cc" + "launcher_main.cc" + "launcher_util.cc" +) + +add_executable(launcher_android + "${STUB_SRCS}" + "${LAUNCHER_RPC_STUB_C}" +) + +ExternalProject_Add(android_tvm_runtime + SOURCE_DIR "${CMAKE_SOURCE_DIR}/../../../../" + BUILD_COMMAND $(MAKE) runtime + CMAKE_ARGS + "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" + "-DANDROID_PLATFORM=${ANDROID_PLATFORM}" + "-DANDROID_ABI=${ANDROID_ABI}" + "-DCMAKE_CXX_STANDARD=14" + "-DUSE_LIBBACKTRACE=OFF" + "-DUSE_LLVM=OFF" + "-DUSE_RPC=OFF" + INSTALL_COMMAND "" + BUILD_ALWAYS ON +) +ExternalProject_Get_Property(android_tvm_runtime BINARY_DIR) +ExternalProject_Add_Step(android_tvm_runtime copy_binaries + COMMAND ${CMAKE_COMMAND} -E copy_directory ${BINARY_DIR} ${CMAKE_INSTALL_PREFIX} + DEPENDEES install +) + +add_dependencies(launcher_android android_tvm_runtime) +add_library(tvm_runtime SHARED IMPORTED) +set_target_properties(tvm_runtime PROPERTIES IMPORTED_LOCATION "${BINARY_DIR}/libtvm_runtime.so") + +target_link_libraries(launcher_android cdsprpc log tvm_runtime) diff --git a/src/runtime/hexagon/launcher/rpc_skel/CMakeLists.txt b/src/runtime/hexagon/launcher/rpc_skel/CMakeLists.txt new file mode 100644 index 000000000000..57f1140aeeef --- /dev/null +++ b/src/runtime/hexagon/launcher/rpc_skel/CMakeLists.txt @@ -0,0 +1,128 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +cmake_minimum_required(VERSION 3.2) +project(HexagonLauncher C CXX) + +if(NOT "${FASTRPC_LIBS}" STREQUAL "SKEL" AND + NOT "${FASTRPC_LIBS}" STREQUAL "STUB") + message(SEND_ERROR "Please set FASTRPC_LIBS to either SKEL or STUB") +endif() + +if(NOT DEFINED USE_HEXAGON_SDK) + message(SEND_ERROR "Please set USE_HEXAGON_SDK to the location of Hexagon SDK") +endif() +if (NOT DEFINED USE_HEXAGON_ARCH) + message(SEND_ERROR "Please set USE_HEXAGON_ARCH to the Hexagon architecture version") +endif() + +include(ExternalProject) +include(../../../../../cmake/modules/HexagonSDK.cmake) + +find_hexagon_sdk_root("${USE_HEXAGON_SDK}" "${USE_HEXAGON_ARCH}") + +include_directories(SYSTEM ${HEXAGON_SDK_INCLUDES} ${HEXAGON_REMOTE_ROOT}) + +set(QAIC_EXE "${HEXAGON_QAIC_EXE}") +foreach(INCDIR IN LISTS HEXAGON_SDK_INCLUDES HEXAGON_REMOTE_ROOT) + list(APPEND QAIC_FLAGS "-I${INCDIR}") +endforeach() + +set(LAUNCHER_SRC "${CMAKE_CURRENT_SOURCE_DIR}") +set(CMAKE_SKIP_RPATH TRUE) + +# Qaic for the domain header. +# +# Don't add paths to these filenames, or otherwise cmake may spontaneously +# add -o option to the qaic invocation (with an undesirable path). +set(LAUNCHER_RPC_IDL "../launcher_rpc.idl") +set(LAUNCHER_RPC_H "launcher_rpc.h") +set(LAUNCHER_RPC_SKEL_C "launcher_rpc_skel.c") +set(LAUNCHER_RPC_STUB_C "launcher_rpc_stub.c") + +add_custom_command( + OUTPUT ${LAUNCHER_RPC_SKEL_C} ${LAUNCHER_RPC_STUB_C} + "${LAUNCHER_SRC}/${LAUNCHER_RPC_H}" + COMMAND ${QAIC_EXE} ${QAIC_FLAGS} + "${LAUNCHER_SRC}/${LAUNCHER_RPC_IDL}" + COMMAND ${CMAKE_COMMAND} -E rename "${LAUNCHER_RPC_H}" + "${LAUNCHER_SRC}/${LAUNCHER_RPC_H}" + MAIN_DEPENDENCY "${LAUNCHER_SRC}/${LAUNCHER_RPC_IDL}" +) + + +include_directories(SYSTEM ${HEXAGON_QURT_INCLUDES}) +include_directories( + "${LAUNCHER_SRC}" + "${LAUNCHER_SRC}/../../../../../include" + "${LAUNCHER_SRC}/../../../../../3rdparty/dlpack/include" + "${LAUNCHER_SRC}/../../../../../3rdparty/dmlc-core/include" +) +link_directories(${HEXAGON_QURT_LIBS}) + +add_definitions(-D_MACH_I32=int) +add_definitions(-DDMLC_CXX11_THREAD_LOCAL=0) +add_definitions(-DDMLC_USE_LOGGING_LIBRARY=) + +# Extra compile flags (both C and C++). +set(EXTRA_COMP_FLAGS + "-O3" + "-m${USE_HEXAGON_ARCH}" +) +string(REGEX REPLACE ";" " " EXTRA_COMP_FLAGS_STR "${EXTRA_COMP_FLAGS}") +set(CMAKE_C_FLAGS "${EXTRA_COMP_FLAGS_STR} ${CMAKE_C_FLAGS}") +set(CMAKE_CXX_FLAGS "${EXTRA_COMP_FLAGS_STR} ${CMAKE_CXX_FLAGS}") + +set(SKEL_SRCS + "../launcher_core.cc" + "../launcher_hexagon.cc" +) +add_library(launcher_rpc_skel SHARED + "${LAUNCHER_SRC}/${LAUNCHER_RPC_H}" + "${LAUNCHER_RPC_SKEL_C}" + "${SKEL_SRCS}" +) + + +ExternalProject_Add(static_hexagon_tvm_runtime + SOURCE_DIR "${CMAKE_SOURCE_DIR}/../../../../../" + BUILD_COMMAND $(MAKE) runtime + CMAKE_ARGS + "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" + "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" + "-DUSE_HEXAGON_ARCH=v68" + "-DCMAKE_CXX_STANDARD=14" + "-DUSE_LIBBACKTRACE=OFF" + "-DUSE_LLVM=OFF" + "-DUSE_RPC=OFF" + "-DBUILD_STATIC_RUNTIME=ON" + "-DUSE_HEXAGON_SDK=/opt/qualcomm/hexagon/SDK/4.2.0.2" + INSTALL_COMMAND "" + BUILD_ALWAYS ON +) +ExternalProject_Get_Property(static_hexagon_tvm_runtime BINARY_DIR) +ExternalProject_Add_Step(static_hexagon_tvm_runtime copy_binaries + COMMAND ${CMAKE_COMMAND} -E copy_directory ${BINARY_DIR} ${CMAKE_INSTALL_PREFIX} + DEPENDEES install +) + +add_dependencies(launcher_rpc_skel static_hexagon_tvm_runtime) +add_library(static_tvm_runtime STATIC IMPORTED) +set_target_properties(static_tvm_runtime PROPERTIES IMPORTED_LOCATION "${BINARY_DIR}/libtvm_runtime.a") + +target_link_libraries(launcher_rpc_skel -Wl,--whole-archive static_tvm_runtime -Wl,--no-whole-archive) + From 48971187a4fcd5607accea0934ee8f67b5b186c5 Mon Sep 17 00:00:00 2001 From: Chris Sullivan Date: Wed, 6 Oct 2021 21:35:24 -0700 Subject: [PATCH 2/5] Update hexagon launcher README.md to include instructions on how to build the launcher alongside TVM. --- src/runtime/hexagon/launcher/README.md | 46 +++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/src/runtime/hexagon/launcher/README.md b/src/runtime/hexagon/launcher/README.md index a8a570918514..db9f9039d16c 100644 --- a/src/runtime/hexagon/launcher/README.md +++ b/src/runtime/hexagon/launcher/README.md @@ -19,9 +19,7 @@ ## Compilation The launcher consists of two parts: part running on Hexagon, and part running -on Android. They need to be compiled separately. Since some source files are -shared between these two parts, make sure to delete all object files between -compilations. Compile the Hexagon code first. +on Android. Each component must be compiled separately. The supported Snapdragon architectures are 855, 865, and 888. @@ -33,7 +31,45 @@ The supported Snapdragon architectures are 855, 865, and 888. Android NDK can be downloaded from https://developer.android.com/ndk. Hexagon SDK is available at //developer.qualcomm.com/software/hexagon-dsp-sdk. -### Compilation of the Hexagon part +### Compilation with TVM + +Building the Hexagon launcher application as a component of the main TVM build +used for Hexagon codegen can be achieved by setting `USE_HEXAGON_LAUNCHER=ON`. +This option will compile core tvm, the android launcher binary and its corresponding +tvm_runtime, as well as the Hexagon launcher shared library and its corresponding +tvm_runtime. As described in the [Manual compilation](#Manual compilation) section +each component requires Hexagon and android dependencies. When building the launcher +along with TVM these configurations must be providing when invoking cmake. A minimal +example invocation for compiling TVM along with the Hexagon launcher is included below, + +``` +cmake -DCMAKE_MAKE_PROGRAM=make \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DCMAKE_CXX_FLAGS='-stdlib=libc++' \ + -DCMAKE_CXX_STANDARD=14 \ + -DUSE_LLVM=/path/to/hexagon/llvm/bin/llvm-config \ + -DUSE_HEXAGON_LAUNCHER=ON \ + -DUSE_ANDROID_TOOLCHAIN=/path/to/android-ndk/build/cmake/android.toolchain.cmake \ + -DANDROID_PLATFORM=android-28 \ + -DANDROID_ABI=arm64-v8a \ + -DUSE_HEXAGON_SDK=/path/to/hexagon/SDK \ + -DUSE_HEXAGON_TOOLCHAIN=/path/to/hexagon/Toolchain/ .. +``` + +The Hexagon launcher application is an android binary and thus requires the use +of an android toolchain for compilation. Similarly, the Hexagon tvm runtime +requires the use of the Hexagon toolchain and depends on the Hexagon SDK. The +resulting hexagon launcher binaries can be found in the `launcher` subdirectory +of the cmake build directory. + +### Manual compilation + +Since some source files are shared between the Hexagon and android builds, +make sure to delete all object files between compilations. Compile the Hexagon +code first. + +#### Compilation of the Hexagon part 1. Build the static version of TVM runtime for Hexagon. Use Hexagon clang from the Hexagon SDK. This step is the same as building the shared version, @@ -55,7 +91,7 @@ Hexagon SDK is available at //developer.qualcomm.com/software/hexagon-dsp-sdk. 3. Run `make`. This will create `liblauncher_rpc_skel.so`. -### Compilation of the Android part +#### Compilation of the Android part 1. Build TVM runtime for Android, using clang for AArch64 from the Android NDK. Unlike in the Hexagon case, this should be the dynamic library (which From 8d580a98c1108991cd0ef53f5ac5f4401b79a461 Mon Sep 17 00:00:00 2001 From: Chris Sullivan Date: Wed, 6 Oct 2021 22:17:58 -0700 Subject: [PATCH 3/5] Move Hexagon launcher into top-level apps directory. --- .../launcher => apps/hexagon_launcher}/CMakeLists.txt | 10 +++++----- .../launcher => apps/hexagon_launcher}/README.md | 0 .../hexagon_launcher}/launcher_android.cc | 0 .../hexagon_launcher}/launcher_core.cc | 0 .../launcher => apps/hexagon_launcher}/launcher_core.h | 0 .../hexagon_launcher}/launcher_hexagon.cc | 0 .../hexagon_launcher}/launcher_main.cc | 0 .../hexagon_launcher}/launcher_rpc.idl | 0 .../hexagon_launcher}/launcher_util.cc | 0 .../launcher => apps/hexagon_launcher}/launcher_util.h | 0 .../hexagon_launcher}/rpc_skel/CMakeLists.txt | 10 +++++----- cmake/modules/Hexagon.cmake | 4 ++-- 12 files changed, 12 insertions(+), 12 deletions(-) rename {src/runtime/hexagon/launcher => apps/hexagon_launcher}/CMakeLists.txt (93%) rename {src/runtime/hexagon/launcher => apps/hexagon_launcher}/README.md (100%) rename {src/runtime/hexagon/launcher => apps/hexagon_launcher}/launcher_android.cc (100%) rename {src/runtime/hexagon/launcher => apps/hexagon_launcher}/launcher_core.cc (100%) rename {src/runtime/hexagon/launcher => apps/hexagon_launcher}/launcher_core.h (100%) rename {src/runtime/hexagon/launcher => apps/hexagon_launcher}/launcher_hexagon.cc (100%) rename {src/runtime/hexagon/launcher => apps/hexagon_launcher}/launcher_main.cc (100%) rename {src/runtime/hexagon/launcher => apps/hexagon_launcher}/launcher_rpc.idl (100%) rename {src/runtime/hexagon/launcher => apps/hexagon_launcher}/launcher_util.cc (100%) rename {src/runtime/hexagon/launcher => apps/hexagon_launcher}/launcher_util.h (100%) rename {src/runtime/hexagon/launcher => apps/hexagon_launcher}/rpc_skel/CMakeLists.txt (93%) diff --git a/src/runtime/hexagon/launcher/CMakeLists.txt b/apps/hexagon_launcher/CMakeLists.txt similarity index 93% rename from src/runtime/hexagon/launcher/CMakeLists.txt rename to apps/hexagon_launcher/CMakeLists.txt index 189181820121..cc2fc11a0e25 100644 --- a/src/runtime/hexagon/launcher/CMakeLists.txt +++ b/apps/hexagon_launcher/CMakeLists.txt @@ -26,7 +26,7 @@ if (NOT DEFINED USE_HEXAGON_ARCH) endif() include(ExternalProject) -include(../../../../cmake/modules/HexagonSDK.cmake) +include(../../cmake/modules/HexagonSDK.cmake) find_hexagon_sdk_root("${USE_HEXAGON_SDK}" "${USE_HEXAGON_ARCH}") @@ -66,9 +66,9 @@ include_directories(SYSTEM ) include_directories( "${LAUNCHER_SRC}" - "${LAUNCHER_SRC}/../../../../include" - "${LAUNCHER_SRC}/../../../../3rdparty/dlpack/include" - "${LAUNCHER_SRC}/../../../../3rdparty/dmlc-core/include" + "${LAUNCHER_SRC}/../../include" + "${LAUNCHER_SRC}/../../3rdparty/dlpack/include" + "${LAUNCHER_SRC}/../../3rdparty/dmlc-core/include" ) link_directories(${HEXAGON_REMOTE_ROOT}) @@ -87,7 +87,7 @@ add_executable(launcher_android ) ExternalProject_Add(android_tvm_runtime - SOURCE_DIR "${CMAKE_SOURCE_DIR}/../../../../" + SOURCE_DIR "${CMAKE_SOURCE_DIR}/../../" BUILD_COMMAND $(MAKE) runtime CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" diff --git a/src/runtime/hexagon/launcher/README.md b/apps/hexagon_launcher/README.md similarity index 100% rename from src/runtime/hexagon/launcher/README.md rename to apps/hexagon_launcher/README.md diff --git a/src/runtime/hexagon/launcher/launcher_android.cc b/apps/hexagon_launcher/launcher_android.cc similarity index 100% rename from src/runtime/hexagon/launcher/launcher_android.cc rename to apps/hexagon_launcher/launcher_android.cc diff --git a/src/runtime/hexagon/launcher/launcher_core.cc b/apps/hexagon_launcher/launcher_core.cc similarity index 100% rename from src/runtime/hexagon/launcher/launcher_core.cc rename to apps/hexagon_launcher/launcher_core.cc diff --git a/src/runtime/hexagon/launcher/launcher_core.h b/apps/hexagon_launcher/launcher_core.h similarity index 100% rename from src/runtime/hexagon/launcher/launcher_core.h rename to apps/hexagon_launcher/launcher_core.h diff --git a/src/runtime/hexagon/launcher/launcher_hexagon.cc b/apps/hexagon_launcher/launcher_hexagon.cc similarity index 100% rename from src/runtime/hexagon/launcher/launcher_hexagon.cc rename to apps/hexagon_launcher/launcher_hexagon.cc diff --git a/src/runtime/hexagon/launcher/launcher_main.cc b/apps/hexagon_launcher/launcher_main.cc similarity index 100% rename from src/runtime/hexagon/launcher/launcher_main.cc rename to apps/hexagon_launcher/launcher_main.cc diff --git a/src/runtime/hexagon/launcher/launcher_rpc.idl b/apps/hexagon_launcher/launcher_rpc.idl similarity index 100% rename from src/runtime/hexagon/launcher/launcher_rpc.idl rename to apps/hexagon_launcher/launcher_rpc.idl diff --git a/src/runtime/hexagon/launcher/launcher_util.cc b/apps/hexagon_launcher/launcher_util.cc similarity index 100% rename from src/runtime/hexagon/launcher/launcher_util.cc rename to apps/hexagon_launcher/launcher_util.cc diff --git a/src/runtime/hexagon/launcher/launcher_util.h b/apps/hexagon_launcher/launcher_util.h similarity index 100% rename from src/runtime/hexagon/launcher/launcher_util.h rename to apps/hexagon_launcher/launcher_util.h diff --git a/src/runtime/hexagon/launcher/rpc_skel/CMakeLists.txt b/apps/hexagon_launcher/rpc_skel/CMakeLists.txt similarity index 93% rename from src/runtime/hexagon/launcher/rpc_skel/CMakeLists.txt rename to apps/hexagon_launcher/rpc_skel/CMakeLists.txt index 57f1140aeeef..26c50b836e01 100644 --- a/src/runtime/hexagon/launcher/rpc_skel/CMakeLists.txt +++ b/apps/hexagon_launcher/rpc_skel/CMakeLists.txt @@ -31,7 +31,7 @@ if (NOT DEFINED USE_HEXAGON_ARCH) endif() include(ExternalProject) -include(../../../../../cmake/modules/HexagonSDK.cmake) +include(../../../cmake/modules/HexagonSDK.cmake) find_hexagon_sdk_root("${USE_HEXAGON_SDK}" "${USE_HEXAGON_ARCH}") @@ -68,9 +68,9 @@ add_custom_command( include_directories(SYSTEM ${HEXAGON_QURT_INCLUDES}) include_directories( "${LAUNCHER_SRC}" - "${LAUNCHER_SRC}/../../../../../include" - "${LAUNCHER_SRC}/../../../../../3rdparty/dlpack/include" - "${LAUNCHER_SRC}/../../../../../3rdparty/dmlc-core/include" + "${LAUNCHER_SRC}/../../../include" + "${LAUNCHER_SRC}/../../../3rdparty/dlpack/include" + "${LAUNCHER_SRC}/../../../3rdparty/dmlc-core/include" ) link_directories(${HEXAGON_QURT_LIBS}) @@ -99,7 +99,7 @@ add_library(launcher_rpc_skel SHARED ExternalProject_Add(static_hexagon_tvm_runtime - SOURCE_DIR "${CMAKE_SOURCE_DIR}/../../../../../" + SOURCE_DIR "${CMAKE_SOURCE_DIR}/../../../" BUILD_COMMAND $(MAKE) runtime CMAKE_ARGS "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" diff --git a/cmake/modules/Hexagon.cmake b/cmake/modules/Hexagon.cmake index 8c1e40aac8e1..475c5e2c4b19 100644 --- a/cmake/modules/Hexagon.cmake +++ b/cmake/modules/Hexagon.cmake @@ -93,7 +93,7 @@ if(USE_HEXAGON_LAUNCHER STREQUAL "ON") set(LAUNCHER_BINARY_DIR "${CMAKE_BINARY_DIR}/launcher") ExternalProject_Add(launcher_android - SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/runtime/hexagon/launcher" + SOURCE_DIR "${CMAKE_SOURCE_DIR}/apps/hexagon_launcher" INSTALL_DIR "${LAUNCHER_BINARY_DIR}" BUILD_ALWAYS ON CMAKE_ARGS @@ -112,7 +112,7 @@ if(USE_HEXAGON_LAUNCHER STREQUAL "ON") DEPENDEES install ) ExternalProject_Add(launcher_hexagon - SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/runtime/hexagon/launcher/rpc_skel" + SOURCE_DIR "${CMAKE_SOURCE_DIR}/apps/hexagon_launcher/rpc_skel" INSTALL_DIR "${LAUNCHER_BINARY_DIR}" BUILD_ALWAYS ON CMAKE_ARGS From 1922cfb50489682388b2e10244f392e06d09d2fd Mon Sep 17 00:00:00 2001 From: Chris Sullivan Date: Wed, 6 Oct 2021 23:56:05 -0700 Subject: [PATCH 4/5] Refactor hexagon launcher cmake directory structure and group common code into cmake/HexagonLauncher.cmake. --- .../cmake/HexagonLauncher.cmake | 61 +++++++++++++++++++ .../{ => cmake/android}/CMakeLists.txt | 58 ++++-------------- .../hexagon}/CMakeLists.txt | 60 +++--------------- cmake/modules/Hexagon.cmake | 4 +- 4 files changed, 82 insertions(+), 101 deletions(-) create mode 100644 apps/hexagon_launcher/cmake/HexagonLauncher.cmake rename apps/hexagon_launcher/{ => cmake/android}/CMakeLists.txt (57%) rename apps/hexagon_launcher/{rpc_skel => cmake/hexagon}/CMakeLists.txt (59%) diff --git a/apps/hexagon_launcher/cmake/HexagonLauncher.cmake b/apps/hexagon_launcher/cmake/HexagonLauncher.cmake new file mode 100644 index 000000000000..4a7f803ce1ab --- /dev/null +++ b/apps/hexagon_launcher/cmake/HexagonLauncher.cmake @@ -0,0 +1,61 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +if(NOT "${FASTRPC_LIBS}" STREQUAL "SKEL" AND + NOT "${FASTRPC_LIBS}" STREQUAL "STUB") + message(SEND_ERROR "Please set FASTRPC_LIBS to either SKEL or STUB") +endif() + +if(NOT DEFINED USE_HEXAGON_SDK) + message(SEND_ERROR "Please set USE_HEXAGON_SDK to the location of Hexagon SDK") +endif() +if (NOT DEFINED USE_HEXAGON_ARCH) + message(SEND_ERROR "Please set USE_HEXAGON_ARCH to the Hexagon architecture version") +endif() + +set(TVM_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../") + +include(ExternalProject) +include("${TVM_SOURCE_DIR}/cmake/modules/HexagonSDK.cmake") + +find_hexagon_sdk_root("${USE_HEXAGON_SDK}" "${USE_HEXAGON_ARCH}") + +include_directories(SYSTEM ${HEXAGON_SDK_INCLUDES} ${HEXAGON_REMOTE_ROOT}) + +set(QAIC_EXE "${HEXAGON_QAIC_EXE}") +foreach(INCDIR IN LISTS HEXAGON_SDK_INCLUDES HEXAGON_REMOTE_ROOT) + list(APPEND QAIC_FLAGS "-I${INCDIR}") +endforeach() + +set(LAUNCHER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/../../") +set(CMAKE_SKIP_RPATH TRUE) + +# Qaic for the domain header. +# +# Don't add paths to these filenames, or otherwise cmake may spontaneously +# add -o option to the qaic invocation (with an undesirable path). +set(LAUNCHER_RPC_IDL "launcher_rpc.idl") +set(LAUNCHER_RPC_H "launcher_rpc.h") +set(LAUNCHER_RPC_SKEL_C "launcher_rpc_skel.c") +set(LAUNCHER_RPC_STUB_C "launcher_rpc_stub.c") + +include_directories( + "${LAUNCHER_SRC}" + "${TVM_SOURCE_DIR}/include" + "${TVM_SOURCE_DIR}/3rdparty/dlpack/include" + "${TVM_SOURCE_DIR}/3rdparty/dmlc-core/include" +) diff --git a/apps/hexagon_launcher/CMakeLists.txt b/apps/hexagon_launcher/cmake/android/CMakeLists.txt similarity index 57% rename from apps/hexagon_launcher/CMakeLists.txt rename to apps/hexagon_launcher/cmake/android/CMakeLists.txt index cc2fc11a0e25..c000b0e97cad 100644 --- a/apps/hexagon_launcher/CMakeLists.txt +++ b/apps/hexagon_launcher/cmake/android/CMakeLists.txt @@ -16,69 +16,33 @@ # under the License. cmake_minimum_required(VERSION 3.2) -project(HexagonLauncher C CXX) +project(HexagonAndroidLauncher C CXX) -if(NOT DEFINED USE_HEXAGON_SDK) - message(SEND_ERROR "Please set USE_HEXAGON_SDK to the location of Hexagon SDK") -endif() -if (NOT DEFINED USE_HEXAGON_ARCH) - message(SEND_ERROR "Please set USE_HEXAGON_ARCH to the Hexagon architecture version") -endif() - -include(ExternalProject) -include(../../cmake/modules/HexagonSDK.cmake) - -find_hexagon_sdk_root("${USE_HEXAGON_SDK}" "${USE_HEXAGON_ARCH}") - -include_directories(SYSTEM ${HEXAGON_SDK_INCLUDES} ${HEXAGON_REMOTE_ROOT}) - -set(QAIC_EXE "${HEXAGON_QAIC_EXE}") -foreach(INCDIR IN LISTS HEXAGON_SDK_INCLUDES HEXAGON_REMOTE_ROOT) - list(APPEND QAIC_FLAGS "-I${INCDIR}") -endforeach() - -set(LAUNCHER_SRC "${CMAKE_CURRENT_SOURCE_DIR}") -set(CMAKE_SKIP_RPATH TRUE) - -# Qaic for the domain header. -# -# Don't add paths to these filenames, or otherwise cmake may spontaneously -# add -o option to the qaic invocation (with an undesirable path). -set(LAUNCHER_RPC_IDL "launcher_rpc.idl") -set(LAUNCHER_RPC_H "launcher_rpc.h") -set(LAUNCHER_RPC_SKEL_C "launcher_rpc_skel.c") -set(LAUNCHER_RPC_STUB_C "launcher_rpc_stub.c") +include("${CMAKE_CURRENT_SOURCE_DIR}/../HexagonLauncher.cmake") add_custom_command( - OUTPUT ${LAUNCHER_RPC_SKEL_C} ${LAUNCHER_RPC_STUB_C} - "${LAUNCHER_SRC}/${LAUNCHER_RPC_H}" + OUTPUT ${LAUNCHER_RPC_STUB_C} COMMAND ${QAIC_EXE} ${QAIC_FLAGS} - "${LAUNCHER_SRC}/${LAUNCHER_RPC_IDL}" + "${LAUNCHER_SRC}/${LAUNCHER_RPC_IDL}" COMMAND ${CMAKE_COMMAND} -E rename "${LAUNCHER_RPC_H}" - "${LAUNCHER_SRC}/${LAUNCHER_RPC_H}" + "${LAUNCHER_SRC}/${LAUNCHER_RPC_H}" MAIN_DEPENDENCY "${LAUNCHER_SRC}/${LAUNCHER_RPC_IDL}" ) - include_directories(SYSTEM "${HEXAGON_SDK_INCLUDES}" "${HEXAGON_RPCMEM_ROOT}/inc" ) -include_directories( - "${LAUNCHER_SRC}" - "${LAUNCHER_SRC}/../../include" - "${LAUNCHER_SRC}/../../3rdparty/dlpack/include" - "${LAUNCHER_SRC}/../../3rdparty/dmlc-core/include" -) + link_directories(${HEXAGON_REMOTE_ROOT}) add_definitions(-DDMLC_USE_LOGGING_LIBRARY=) set(STUB_SRCS - "launcher_android.cc" - "launcher_core.cc" - "launcher_main.cc" - "launcher_util.cc" + "${LAUNCHER_SRC}/launcher_android.cc" + "${LAUNCHER_SRC}/launcher_core.cc" + "${LAUNCHER_SRC}/launcher_main.cc" + "${LAUNCHER_SRC}/launcher_util.cc" ) add_executable(launcher_android @@ -87,7 +51,7 @@ add_executable(launcher_android ) ExternalProject_Add(android_tvm_runtime - SOURCE_DIR "${CMAKE_SOURCE_DIR}/../../" + SOURCE_DIR "${TVM_SOURCE_DIR}" BUILD_COMMAND $(MAKE) runtime CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" diff --git a/apps/hexagon_launcher/rpc_skel/CMakeLists.txt b/apps/hexagon_launcher/cmake/hexagon/CMakeLists.txt similarity index 59% rename from apps/hexagon_launcher/rpc_skel/CMakeLists.txt rename to apps/hexagon_launcher/cmake/hexagon/CMakeLists.txt index 26c50b836e01..ffd6b64b9690 100644 --- a/apps/hexagon_launcher/rpc_skel/CMakeLists.txt +++ b/apps/hexagon_launcher/cmake/hexagon/CMakeLists.txt @@ -16,62 +16,19 @@ # under the License. cmake_minimum_required(VERSION 3.2) -project(HexagonLauncher C CXX) +project(HexagonLauncherRPCSkel C CXX) -if(NOT "${FASTRPC_LIBS}" STREQUAL "SKEL" AND - NOT "${FASTRPC_LIBS}" STREQUAL "STUB") - message(SEND_ERROR "Please set FASTRPC_LIBS to either SKEL or STUB") -endif() - -if(NOT DEFINED USE_HEXAGON_SDK) - message(SEND_ERROR "Please set USE_HEXAGON_SDK to the location of Hexagon SDK") -endif() -if (NOT DEFINED USE_HEXAGON_ARCH) - message(SEND_ERROR "Please set USE_HEXAGON_ARCH to the Hexagon architecture version") -endif() - -include(ExternalProject) -include(../../../cmake/modules/HexagonSDK.cmake) - -find_hexagon_sdk_root("${USE_HEXAGON_SDK}" "${USE_HEXAGON_ARCH}") - -include_directories(SYSTEM ${HEXAGON_SDK_INCLUDES} ${HEXAGON_REMOTE_ROOT}) - -set(QAIC_EXE "${HEXAGON_QAIC_EXE}") -foreach(INCDIR IN LISTS HEXAGON_SDK_INCLUDES HEXAGON_REMOTE_ROOT) - list(APPEND QAIC_FLAGS "-I${INCDIR}") -endforeach() - -set(LAUNCHER_SRC "${CMAKE_CURRENT_SOURCE_DIR}") -set(CMAKE_SKIP_RPATH TRUE) - -# Qaic for the domain header. -# -# Don't add paths to these filenames, or otherwise cmake may spontaneously -# add -o option to the qaic invocation (with an undesirable path). -set(LAUNCHER_RPC_IDL "../launcher_rpc.idl") -set(LAUNCHER_RPC_H "launcher_rpc.h") -set(LAUNCHER_RPC_SKEL_C "launcher_rpc_skel.c") -set(LAUNCHER_RPC_STUB_C "launcher_rpc_stub.c") +include("${CMAKE_CURRENT_SOURCE_DIR}/../HexagonLauncher.cmake") add_custom_command( - OUTPUT ${LAUNCHER_RPC_SKEL_C} ${LAUNCHER_RPC_STUB_C} - "${LAUNCHER_SRC}/${LAUNCHER_RPC_H}" + OUTPUT ${LAUNCHER_RPC_SKEL_C} ${LAUNCHER_RPC_H} COMMAND ${QAIC_EXE} ${QAIC_FLAGS} - "${LAUNCHER_SRC}/${LAUNCHER_RPC_IDL}" - COMMAND ${CMAKE_COMMAND} -E rename "${LAUNCHER_RPC_H}" - "${LAUNCHER_SRC}/${LAUNCHER_RPC_H}" + "${LAUNCHER_SRC}/${LAUNCHER_RPC_IDL}" MAIN_DEPENDENCY "${LAUNCHER_SRC}/${LAUNCHER_RPC_IDL}" ) - include_directories(SYSTEM ${HEXAGON_QURT_INCLUDES}) -include_directories( - "${LAUNCHER_SRC}" - "${LAUNCHER_SRC}/../../../include" - "${LAUNCHER_SRC}/../../../3rdparty/dlpack/include" - "${LAUNCHER_SRC}/../../../3rdparty/dmlc-core/include" -) + link_directories(${HEXAGON_QURT_LIBS}) add_definitions(-D_MACH_I32=int) @@ -88,8 +45,8 @@ set(CMAKE_C_FLAGS "${EXTRA_COMP_FLAGS_STR} ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "${EXTRA_COMP_FLAGS_STR} ${CMAKE_CXX_FLAGS}") set(SKEL_SRCS - "../launcher_core.cc" - "../launcher_hexagon.cc" + "${LAUNCHER_SRC}/launcher_core.cc" + "${LAUNCHER_SRC}/launcher_hexagon.cc" ) add_library(launcher_rpc_skel SHARED "${LAUNCHER_SRC}/${LAUNCHER_RPC_H}" @@ -97,9 +54,8 @@ add_library(launcher_rpc_skel SHARED "${SKEL_SRCS}" ) - ExternalProject_Add(static_hexagon_tvm_runtime - SOURCE_DIR "${CMAKE_SOURCE_DIR}/../../../" + SOURCE_DIR "${TVM_SOURCE_DIR}" BUILD_COMMAND $(MAKE) runtime CMAKE_ARGS "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" diff --git a/cmake/modules/Hexagon.cmake b/cmake/modules/Hexagon.cmake index 475c5e2c4b19..1491a4558611 100644 --- a/cmake/modules/Hexagon.cmake +++ b/cmake/modules/Hexagon.cmake @@ -93,7 +93,7 @@ if(USE_HEXAGON_LAUNCHER STREQUAL "ON") set(LAUNCHER_BINARY_DIR "${CMAKE_BINARY_DIR}/launcher") ExternalProject_Add(launcher_android - SOURCE_DIR "${CMAKE_SOURCE_DIR}/apps/hexagon_launcher" + SOURCE_DIR "${CMAKE_SOURCE_DIR}/apps/hexagon_launcher/cmake/android" INSTALL_DIR "${LAUNCHER_BINARY_DIR}" BUILD_ALWAYS ON CMAKE_ARGS @@ -112,7 +112,7 @@ if(USE_HEXAGON_LAUNCHER STREQUAL "ON") DEPENDEES install ) ExternalProject_Add(launcher_hexagon - SOURCE_DIR "${CMAKE_SOURCE_DIR}/apps/hexagon_launcher/rpc_skel" + SOURCE_DIR "${CMAKE_SOURCE_DIR}/apps/hexagon_launcher/cmake/hexagon" INSTALL_DIR "${LAUNCHER_BINARY_DIR}" BUILD_ALWAYS ON CMAKE_ARGS From 4eb49a0dea4bd3cdfada709c78596c37ecc9e71d Mon Sep 17 00:00:00 2001 From: Chris Sullivan Date: Fri, 8 Oct 2021 11:15:09 -0700 Subject: [PATCH 5/5] Address CRs from @kparzysz-quic. --- apps/hexagon_launcher/README.md | 1 + apps/hexagon_launcher/cmake/hexagon/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/hexagon_launcher/README.md b/apps/hexagon_launcher/README.md index db9f9039d16c..85e6897b74a3 100644 --- a/apps/hexagon_launcher/README.md +++ b/apps/hexagon_launcher/README.md @@ -53,6 +53,7 @@ cmake -DCMAKE_MAKE_PROGRAM=make \ -DUSE_ANDROID_TOOLCHAIN=/path/to/android-ndk/build/cmake/android.toolchain.cmake \ -DANDROID_PLATFORM=android-28 \ -DANDROID_ABI=arm64-v8a \ + -DUSE_HEXAGON_ARCH=v68 \ -DUSE_HEXAGON_SDK=/path/to/hexagon/SDK \ -DUSE_HEXAGON_TOOLCHAIN=/path/to/hexagon/Toolchain/ .. ``` diff --git a/apps/hexagon_launcher/cmake/hexagon/CMakeLists.txt b/apps/hexagon_launcher/cmake/hexagon/CMakeLists.txt index ffd6b64b9690..c76fcccc5a1a 100644 --- a/apps/hexagon_launcher/cmake/hexagon/CMakeLists.txt +++ b/apps/hexagon_launcher/cmake/hexagon/CMakeLists.txt @@ -60,13 +60,13 @@ ExternalProject_Add(static_hexagon_tvm_runtime CMAKE_ARGS "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" - "-DUSE_HEXAGON_ARCH=v68" + "-DUSE_HEXAGON_ARCH=${USE_HEXAGON_ARCH}" "-DCMAKE_CXX_STANDARD=14" "-DUSE_LIBBACKTRACE=OFF" "-DUSE_LLVM=OFF" "-DUSE_RPC=OFF" "-DBUILD_STATIC_RUNTIME=ON" - "-DUSE_HEXAGON_SDK=/opt/qualcomm/hexagon/SDK/4.2.0.2" + "-DUSE_HEXAGON_SDK=${USE_HEXAGON_SDK}" INSTALL_COMMAND "" BUILD_ALWAYS ON )