Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,10 @@ endif()
if(EXECUTORCH_BUILD_VULKAN)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/vulkan)
endif()
if(EXECUTORCH_BUILD_VGF)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a readme under backends/arm?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should to that! I will add one in a separate patch, I will have some updates for this soon

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/arm)
endif()


if(EXECUTORCH_BUILD_ANDROID_JNI)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/android)
Expand Down
52 changes: 50 additions & 2 deletions backends/arm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ if(NOT EXECUTORCH_ROOT)
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
endif()

add_compile_options("-Wall" "-Werror")

include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)

set(_common_include_directories ${EXECUTORCH_ROOT}/.. ${EXECUTORCH_ROOT}/runtime/core/portable_type/c10)
add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS)


# bare metal backend builds
if(EXECUTORCH_BUILD_ARM_BAREMETAL)

add_compile_options("-Wall" "-Werror")

# Third-party folder and Ethos-U driver inclued
set(THIRD_PARTY_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/third-party")
set(DRIVER_ETHOSU_INCLUDE_DIR "${THIRD_PARTY_ROOT}/ethos-u-core-driver/include")
Expand All @@ -36,3 +40,47 @@ target_include_directories(
target_include_directories(
executorch_delegate_ethos_u PUBLIC ${DRIVER_ETHOSU_INCLUDE_DIR}
)

# end config for bare metal builds
endif()


# VGF backend builds
if(EXECUTORCH_BUILD_VGF)

# include libvgf
set(LIBVGF_PATH "${EXECUTORCH_ROOT}/examples/arm/ethos-u-scratch/ml-sdk-for-vulkan-manifest/sw/vgf-lib/")

set(VULKAN_THIRD_PARTY_PATH ${EXECUTORCH_ROOT}/backends/vulkan/third-party)
set(VULKAN_HEADERS_PATH ${VULKAN_THIRD_PARTY_PATH}/Vulkan-Headers/include)
set(VOLK_HEADERS_PATH ${VULKAN_THIRD_PARTY_PATH}/volk)

set(LIBVGF_STATIC "${LIBVGF_PATH}/build/src/libvgf.a")
set(LIBVGF_INCLUDE "${LIBVGF_PATH}/include/")

add_library(vgf STATIC IMPORTED)
set_property( TARGET vgf PROPERTY IMPORTED_LOCATION "${LIBVGF_STATIC}" )
target_include_directories(vgf INTERFACE "${LIBVGF_INCLUDE}")

# Add backend delegate for VGF
set(_vgf_backend_sources backends/arm/runtime/VGFBackend.cpp
backends/arm/runtime/VGFSetup.cpp )

# vgf backend
list(TRANSFORM _vgf_backend_sources PREPEND "${EXECUTORCH_ROOT}/")
add_library(vgf_backend ${_vgf_backend_sources})
target_include_directories(
vgf_backend PUBLIC
${_common_include_directories}
${VULKAN_HEADERS_PATH}
${VOLK_HEADERS_PATH}
)
target_compile_options(vgf_backend PRIVATE -DUSE_VULKAN_WRAPPER -DUSE_VULKAN_VOLK)


target_link_libraries(vgf_backend PRIVATE executorch_core)
target_link_libraries(vgf_backend PRIVATE vgf)
executorch_target_link_options_shared_lib(vgf_backend)

# end config for VGF builds
endif()
Loading
Loading