Skip to content

Commit

Permalink
[fp16] create a new port (#16340)
Browse files Browse the repository at this point in the history
* [psimd] create a new port

* [psimd] update baseline and port SHA

* [fp16] create a new port

* [fp16] update baseline and port SHA

* [fp16] apply PR feedback
  • Loading branch information
luncliff authored Apr 1, 2021
1 parent b05fe02 commit 67d8f45
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
31 changes: 31 additions & 0 deletions ports/fp16/find-psimd.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,7 +33,8 @@ SET(CONFU_DEPENDENCIES_SOURCE_DIR ${CMAKE_SOURCE_DIR}/deps
SET(CONFU_DEPENDENCIES_BINARY_DIR ${CMAKE_BINARY_DIR}/deps
CACHE PATH "Confu-style dependencies binary directory")

-IF(NOT DEFINED PSIMD_SOURCE_DIR)
+find_path(PSIMD_INCLUDE_DIRS "psimd.h")
+IF(FALSE)
MESSAGE(STATUS "Downloading PSimd to ${CONFU_DEPENDENCIES_SOURCE_DIR}/psimd (define PSIMD_SOURCE_DIR to avoid it)")
CONFIGURE_FILE(cmake/DownloadPSimd.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/psimd-download/CMakeLists.txt")
EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
@@ -76,7 +77,7 @@ ELSE()
ENDIF()
TARGET_INCLUDE_DIRECTORIES(fp16 INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:include>)
+ $<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:${PSIMD_INCLUDE_DIRS}>)

INSTALL(FILES include/fp16.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
@@ -90,7 +91,7 @@ INSTALL(FILES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fp16)

# ---[ Configure psimd
-IF(NOT TARGET psimd)
+IF(FALSE)
ADD_SUBDIRECTORY(
"${PSIMD_SOURCE_DIR}"
"${CONFU_DEPENDENCIES_BINARY_DIR}/psimd")
19 changes: 19 additions & 0 deletions ports/fp16/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Maratyszcza/fp16
REF 4dfe081cf6bcd15db339cf2680b9281b8451eeb3
SHA512 e79a1f6f8d4aeca85982158d5b070923d31d4f2062ed84cfa6f26c47a34f2e8ac49e0f330b7d49f5732d5e1eec6e7afccdac43645070060fb7827e2ce261dd3e
PATCHES
find-psimd.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DFP16_BUILD_TESTS=OFF
-DFP16_BUILD_BENCHMARKS=OFF
)
vcpkg_install_cmake()

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)
9 changes: 9 additions & 0 deletions ports/fp16/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "fp16",
"version-date": "2021-02-21",
"description": "Header-only library for conversion to/from half-precision floating point formats",
"homepage": "https://github.com/Maratyszcza/FP16",
"dependencies": [
"psimd"
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2036,6 +2036,10 @@
"baseline": "1.0.5",
"port-version": 0
},
"fp16": {
"baseline": "2021-02-21",
"port-version": 0
},
"fplus": {
"baseline": "0.2.13-p0",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/f-/fp16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "849acf1f87e0194fda4cd5459e51c564874c60ed",
"version-date": "2021-02-21",
"port-version": 0
}
]
}

0 comments on commit 67d8f45

Please sign in to comment.