| # Copyright 2023 Google LLC |
| # |
| # Licensed 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.13.4) |
| |
| # ------------------------------------------------------------------------------ |
| # Project configuration |
| # ------------------------------------------------------------------------------ |
| project(ml-models-public) |
| |
| set_property(GLOBAL PROPERTY USE_FOLDERS ON) |
| |
| set(SPARROW_IREE_DIR "$ENV{ROOTDIR}/sw/vec_iree" CACHE PATH |
| "Sparrow IREE library path (default: $ENV{ROOTDIR}/sw/vec_iree)") |
| |
| include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}) |
| include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_BINARY_DIR}) |
| include_directories(BEFORE SYSTEM ${SPARROW_IREE_DIR}) |
| |
| # Include sparrow_iree libraries. |
| add_subdirectory(${SPARROW_IREE_DIR} sparrow_iree) |
| |
| # Add compilation options. |
| include(${SPARROW_IREE_DIR}/cmake/sparrow_ops.cmake) |
| |
| # Set default linker memory size for the whole project. |
| set(TCM_LENGTH "16M" CACHE STRING "TCM Length (default: 16M)") |
| add_link_options("LINKER:--defsym=__tcm_length__=${TCM_LENGTH}") |
| |
| # Include model directories. |
| add_subdirectory(float_models) |
| add_subdirectory(quant_models) |