• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      https://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# Skip installation when xnnpack is used since it also has fp16 headers.
17if(TARGET fp16_headers OR fp16_headers_POPULATED OR TFLITE_ENABLE_XNNPACK)
18  return()
19endif()
20
21include(FetchContent)
22
23OverridableFetchContent_Declare(
24  fp16_headers
25  GIT_REPOSITORY https://github.com/Maratyszcza/FP16
26  # Sync with https://github.com/google/XNNPACK/blob/master/cmake/DownloadFP16.cmake
27  GIT_TAG 0a92994d729ff76a58f692d3028ca1b64b145d91
28  GIT_PROGRESS TRUE
29  PREFIX "${CMAKE_BINARY_DIR}"
30  SOURCE_DIR "${CMAKE_BINARY_DIR}/fp16_headers"
31)
32
33OverridableFetchContent_GetProperties(fp16_headers)
34if(NOT fp16_headers)
35  OverridableFetchContent_Populate(fp16_headers)
36endif()
37
38include_directories(
39  AFTER
40   "${fp16_headers_SOURCE_DIR}/include"
41)
42