Skip to content

Commit 1d1555e

Browse files
authored
Merge pull request #5716 from kexinzhao/float16
Add half precision float16 data type
2 parents 06a3a88 + 36df67b commit 1d1555e

File tree

6 files changed

+1079
-0
lines changed

6 files changed

+1079
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ option(GLIDE_INSTALL "Download and install go dependencies " ON)
5858
option(USE_NNPACK "Compile PaddlePaddle with NNPACK library" OFF)
5959
option(WITH_DISTRIBUTE "Compile with grpc distributed support" OFF)
6060
option(USE_EIGEN_FOR_BLAS "Use matrix multiplication in Eigen" OFF)
61+
option(WITH_ARM_FP16 "Use half precision support on armv8.2-a cpu" OFF)
6162

6263
# CMAKE_BUILD_TYPE
6364
if(NOT CMAKE_BUILD_TYPE)

cmake/configure.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ if(WITH_DOUBLE)
2424
add_definitions(-DPADDLE_TYPE_DOUBLE)
2525
endif(WITH_DOUBLE)
2626

27+
if(WITH_ARM_FP16)
28+
add_definitions(-DPADDLE_ARM_FP16)
29+
add_definitions("-march=armv8.2-a+fp16+simd")
30+
endif(WITH_ARM_FP16)
31+
2732
if(WITH_TESTING)
2833
add_definitions(-DPADDLE_WITH_TESTING)
2934
endif(WITH_TESTING)

0 commit comments

Comments
 (0)