Skip to content

Commit

Permalink
build: Accept vlen for power of 2
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Dec 18, 2024
1 parent 2b094f5 commit 4d2538e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ option(FLB_AWS "Enable AWS support" Yes)
option(FLB_STATIC_CONF "Build binary using static configuration")
option(FLB_STREAM_PROCESSOR "Enable Stream Processor" Yes)
option(FLB_SIMD "Enable SIMD support" No)
option(FLB_RVV_VLEN "Specify RVV VLEN length")
option(FLB_CORO_STACK_SIZE "Set coroutine stack size")
option(FLB_AVRO_ENCODER "Build with Avro encoding support" No)
option(FLB_AWS_ERROR_REPORTER "Build with aws error reporting support" No)
Expand Down
8 changes: 8 additions & 0 deletions cmake/riscv64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,13 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(riscv64)")
endif()
if(FLB_SIMD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=rv64gcv_zba")
if(FLB_RVV_VLEN)
set(vlens 128 256 512 1024 2048 4096)
foreach(size ${sizes})
if (FLB_RVV_VLEN EQUAL size)
add_definitions(-DFLB_RVV_VLEN=${FLB_RVV_VLEN})
set(FLB_BUILD_FLAGS "${FLB_BUILD_FLAGS}#ifndef FLB_RVV_VLEN\n#define FLB_RVV_VLEN ${FLB_RVV_VLEN}\n#endif\n")
endif()
endforeach()
endif()
endif ()

0 comments on commit 4d2538e

Please sign in to comment.