Codebase list fp16 / c635b0b
debianization Mo Zhou 4 years ago
4 changed file(s) with 120 addition(s) and 39 deletion(s). Raw diff Collapse all Expand all
00 Source: fp16
1 Section: math
2 Homepage: https://github.com/Maratyszcza/FP16
13 Priority: optional
2 Maintainer: Felix Salfelder <felix@salfelder.org>
3 Build-Depends: debhelper (>= 11)
4 Standards-Version: 4.1.3
5 Section: libs
6 Homepage: <insert the upstream URL, if relevant>
7 #Vcs-Browser: https://salsa.debian.org/debian/fp16
8 #Vcs-Git: https://salsa.debian.org/debian/fp16.git
4 Standards-Version: 4.5.0
5 Vcs-Browser: https://salsa.debian.org/deeplearning-team/fp16
6 Vcs-Git: https://salsa.debian.org/deeplearning-team/fp16.git
7 Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
8 Uploaders: Felix Salfelder <felix@salfelder.org>,
9 Mo Zhou <lumin@debian.org>
10 Build-Depends: debhelper-compat (= 12), cmake, libpsimd-dev,
11 Rules-Requires-Root: no
912
10 Package: fp16-dev
11 Section: libdevel
13 Package: libfp16-dev
1214 Architecture: any
13 Multi-Arch: same
14 Depends: fp16BROKEN (= ${binary:Version}), ${misc:Depends}
15 Description: <insert up to 60 chars description>
16 <insert long description, indented with spaces>
17
18 Package: fp16BROKEN
19 Architecture: any
20 Multi-Arch: same
21 Depends: ${shlibs:Depends}, ${misc:Depends}
22 Description: <insert up to 60 chars description>
23 <insert long description, indented with spaces>
15 Depends: ${misc:Depends},
16 Description: Conversion to/from half-precision floating point formats
17 Header-only library for conversion to/from half-precision floating point
18 formats Features
19 .
20 + Supports IEEE and ARM alternative half-precision floating-point format
21 - Property converts infinities and NaNs
22 - Properly converts denormal numbers, even on systems without denormal support
23 + Header-only library, no installation or build required
24 + Compatible with C99 and C++11
25 + Fully covered with unit tests and microbenchmarks
26 .
27 This is a header-only library.
0 --- a/CMakeLists.txt
1 +++ b/CMakeLists.txt
2 @@ -34,13 +34,8 @@
3 CACHE PATH "Confu-style dependencies binary directory")
4
5 IF(NOT DEFINED PSIMD_SOURCE_DIR)
6 - MESSAGE(STATUS "Downloading PSimd to ${CONFU_DEPENDENCIES_SOURCE_DIR}/psimd (define PSIMD_SOURCE_DIR to avoid it)")
7 - CONFIGURE_FILE(cmake/DownloadPSimd.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/psimd-download/CMakeLists.txt")
8 - EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
9 - WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/psimd-download")
10 - EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" --build .
11 - WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/psimd-download")
12 - SET(PSIMD_SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/psimd" CACHE STRING "PSimd source directory")
13 + find_file(PSIMD_HEADER "/usr/include/psimd.h")
14 + message("Found psimd: ${PSIMD_HEADER}")
15 ENDIF()
16
17 IF(FP16_BUILD_TESTS AND NOT DEFINED GOOGLETEST_SOURCE_DIR)
18 @@ -54,13 +49,10 @@
19 ENDIF()
20
21 IF(FP16_BUILD_BENCHMARKS AND NOT DEFINED GOOGLEBENCHMARK_SOURCE_DIR)
22 - MESSAGE(STATUS "Downloading Google Benchmark to ${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark (define GOOGLEBENCHMARK_SOURCE_DIR to avoid it)")
23 - CONFIGURE_FILE(cmake/DownloadGoogleBenchmark.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark-download/CMakeLists.txt")
24 - EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
25 - WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark-download")
26 - EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" --build .
27 - WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark-download")
28 - SET(GOOGLEBENCHMARK_SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark" CACHE STRING "Google Benchmark source directory")
29 + add_library(benchmark SHARED IMPORTED)
30 + find_library(BENCHMARK_LIBRARY benchmark)
31 + message("-- Found benchmark: ${BENCHMARK_LIBRARY}")
32 + set_target_properties(benchmark PROPERTIES IMPORTED_LOCATION "${BENCHMARK_LIBRARY}")
33 ENDIF()
34
35 # ---[ FP16 library
36 @@ -89,13 +81,6 @@
37 include/fp16/avx2.py
38 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fp16)
39
40 -# ---[ Configure psimd
41 -IF(NOT TARGET psimd)
42 - ADD_SUBDIRECTORY(
43 - "${PSIMD_SOURCE_DIR}"
44 - "${CONFU_DEPENDENCIES_BINARY_DIR}/psimd")
45 -ENDIF()
46 -
47 IF(FP16_BUILD_TESTS)
48 # ---[ Build google test
49 IF(NOT TARGET gtest)
50 @@ -154,28 +139,28 @@
51 ADD_EXECUTABLE(ieee-element-bench bench/ieee-element.cc)
52 TARGET_COMPILE_DEFINITIONS(ieee-element-bench PRIVATE FP16_COMPARATIVE_BENCHMARKS=1)
53 TARGET_INCLUDE_DIRECTORIES(ieee-element-bench PRIVATE ${PROJECT_SOURCE_DIR})
54 - TARGET_LINK_LIBRARIES(ieee-element-bench fp16 psimd benchmark)
55 + TARGET_LINK_LIBRARIES(ieee-element-bench fp16 benchmark pthread)
56
57 ADD_EXECUTABLE(alt-element-bench bench/alt-element.cc)
58 - TARGET_LINK_LIBRARIES(alt-element-bench fp16 psimd benchmark)
59 + TARGET_LINK_LIBRARIES(alt-element-bench fp16 benchmark pthread)
60
61 ADD_EXECUTABLE(from-ieee-array-bench bench/from-ieee-array.cc)
62 FP16_TARGET_ENABLE_CXX11(from-ieee-array-bench)
63 TARGET_COMPILE_DEFINITIONS(from-ieee-array-bench PRIVATE FP16_COMPARATIVE_BENCHMARKS=1)
64 TARGET_INCLUDE_DIRECTORIES(from-ieee-array-bench PRIVATE ${PROJECT_SOURCE_DIR})
65 - TARGET_LINK_LIBRARIES(from-ieee-array-bench fp16 psimd benchmark)
66 + TARGET_LINK_LIBRARIES(from-ieee-array-bench fp16 benchmark pthread)
67
68 ADD_EXECUTABLE(from-alt-array-bench bench/from-alt-array.cc)
69 FP16_TARGET_ENABLE_CXX11(from-alt-array-bench)
70 - TARGET_LINK_LIBRARIES(from-alt-array-bench fp16 psimd benchmark)
71 + TARGET_LINK_LIBRARIES(from-alt-array-bench fp16 benchmark pthread)
72
73 ADD_EXECUTABLE(to-ieee-array-bench bench/to-ieee-array.cc)
74 FP16_TARGET_ENABLE_CXX11(to-ieee-array-bench)
75 TARGET_COMPILE_DEFINITIONS(to-ieee-array-bench PRIVATE FP16_COMPARATIVE_BENCHMARKS=1)
76 TARGET_INCLUDE_DIRECTORIES(to-ieee-array-bench PRIVATE ${PROJECT_SOURCE_DIR})
77 - TARGET_LINK_LIBRARIES(to-ieee-array-bench fp16 psimd benchmark)
78 + TARGET_LINK_LIBRARIES(to-ieee-array-bench fp16 benchmark pthread)
79
80 ADD_EXECUTABLE(to-alt-array-bench bench/to-alt-array.cc)
81 FP16_TARGET_ENABLE_CXX11(to-alt-array-bench)
82 - TARGET_LINK_LIBRARIES(to-alt-array-bench fp16 psimd benchmark)
83 + TARGET_LINK_LIBRARIES(to-alt-array-bench fp16 benchmark pthread)
84 ENDIF()
00 #!/usr/bin/make -f
1 # See debhelper(7) (uncomment to enable)
2 # output every command that modifies files on the build system.
3 #export DH_VERBOSE = 1
4
5
6 # see FEATURE AREAS in dpkg-buildflags(1)
7 #export DEB_BUILD_MAINT_OPTIONS = hardening=+all
8
9 # see ENVIRONMENT in dpkg-buildflags(1)
10 # package maintainers to append CFLAGS
11 #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
12 # package maintainers to append LDFLAGS
13 #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
14
15
161 %:
172 dh $@
183
4 override_dh_auto_configure:
5 dh_auto_configure -- -DGOOGLETEST_SOURCE_DIR=/usr/src/googletest
196
20 # dh_make generated override targets
21 # This is example for Cmake (See https://bugs.debian.org/641051 )
22 #override_dh_auto_configure:
23 # dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
7 override_dh_auto_test:
8 dh_auto_test
9 -find . -type f -executable -name '*bench' -exec '{}' \;
2410
11 override_dh_auto_install:
12 dh_auto_install
13 -$(RM) -rf debian/libfp16-dev/usr/lib
14 -$(RM) -rf debian/libfp16-dev/usr/include/gmock
15 -$(RM) -rf debian/libfp16-dev/usr/include/gtest