mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
guarding from benchmark + rvv
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
name: Ubuntu rvv VLEN=1024 (clang 18)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install packages
|
||||
run: |
|
||||
sudo apt-get update -q -y
|
||||
sudo apt-get install -y cmake make g++-riscv64-linux-gnu qemu-user-static clang-18
|
||||
- name: Build
|
||||
run: |
|
||||
CXX=clang++-18 CXXFLAGS="--target=riscv64-linux-gnu -march=rv64gcv_zvbb" \
|
||||
cmake --toolchain=cmake/toolchains-ci/riscv64-linux-gnu.cmake -DCMAKE_BUILD_TYPE=Release -B build
|
||||
cmake --build build/ -j$(nproc)
|
||||
- name: Test VLEN=1024
|
||||
run: |
|
||||
export QEMU_LD_PREFIX="/usr/riscv64-linux-gnu"
|
||||
export QEMU_CPU="rv64,v=on,zvbb=on,vlen=1024,rvv_ta_all_1s=on,rvv_ma_all_1s=on"
|
||||
ctest --timeout 1800 --output-on-failure --test-dir build -j $(nproc)
|
||||
@@ -0,0 +1,29 @@
|
||||
name: Ubuntu rvv VLEN=128 (clang 17)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install packages
|
||||
run: |
|
||||
sudo apt-get update -q -y
|
||||
sudo apt-get install -y cmake make g++-riscv64-linux-gnu qemu-user-static clang-17
|
||||
- name: Build
|
||||
run: |
|
||||
CXX=clang++-17 CXXFLAGS="--target=riscv64-linux-gnu -march=rv64gcv" \
|
||||
cmake --toolchain=cmake/toolchains-ci/riscv64-linux-gnu.cmake -DCMAKE_BUILD_TYPE=Release -B build
|
||||
cmake --build build/ -j$(nproc)
|
||||
- name: Test VLEN=128
|
||||
run: |
|
||||
export QEMU_LD_PREFIX="/usr/riscv64-linux-gnu"
|
||||
export QEMU_CPU="rv64,v=on,vlen=128,rvv_ta_all_1s=on,rvv_ma_all_1s=on"
|
||||
ctest --timeout 1800 --output-on-failure --test-dir build -j $(nproc)
|
||||
@@ -0,0 +1,29 @@
|
||||
name: Ubuntu rvv VLEN=256 (gcc 14)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install packages
|
||||
run: |
|
||||
sudo apt-get update -q -y
|
||||
sudo apt-get install -y cmake make g++-14-riscv64-linux-gnu qemu-user-static
|
||||
- name: Build
|
||||
run: |
|
||||
CXX=riscv64-linux-gnu-g++-14 CXXFLAGS=-march=rv64gcv \
|
||||
cmake --toolchain=cmake/toolchains-ci/riscv64-linux-gnu.cmake -DCMAKE_BUILD_TYPE=Release -B build
|
||||
cmake --build build/ -j$(nproc)
|
||||
- name: Test VLEN=256
|
||||
run: |
|
||||
export QEMU_LD_PREFIX="/usr/riscv64-linux-gnu"
|
||||
export QEMU_CPU="rv64,v=on,zvbb=on,vlen=256,rvv_ta_all_1s=on,rvv_ma_all_1s=on"
|
||||
ctest --timeout 1800 --output-on-failure --test-dir build -j $(nproc)
|
||||
@@ -2,8 +2,9 @@
|
||||
add_executable(from_benchmark from_benchmark.cpp)
|
||||
|
||||
# Compile for C++20.
|
||||
target_compile_features(from_benchmark PRIVATE cxx_std_20)
|
||||
|
||||
if(CMAKE_CXX_STANDARD LESS 20)
|
||||
target_compile_features(from_benchmark PRIVATE cxx_std_20)
|
||||
endif()
|
||||
# Check if -march=native is supported
|
||||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag("-march=native" SIMDJSON_SUPPORTS_MARCH_NATIVE)
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_PROCESSOR riscv64)
|
||||
|
||||
set(CMAKE_CROSSCOMPILING_EMULATOR "qemu-riscv64-static")
|
||||
@@ -45,6 +45,22 @@ using std::size_t;
|
||||
#define SIMDJSON_IS_ARM64 1
|
||||
#elif defined(__riscv) && __riscv_xlen == 64
|
||||
#define SIMDJSON_IS_RISCV64 1
|
||||
#if __riscv_v_intrinsic >= 11000
|
||||
#define SIMDJSON_HAS_RVV_INTRINSICS 1
|
||||
#endif
|
||||
|
||||
#define SIMDJSON_HAS_ZVBB_INTRINSICS \
|
||||
0 // there is currently no way to detect this
|
||||
|
||||
#if SIMDJSON_HAS_RVV_INTRINSICS && __riscv_vector && \
|
||||
__riscv_v_min_vlen >= 128 && __riscv_v_elen >= 64
|
||||
// RISC-V V extension
|
||||
#define SIMDJSON_IS_RVV 1
|
||||
#if SIMDJSON_HAS_ZVBB_INTRINSICS && __riscv_zvbb >= 1000000
|
||||
// RISC-V Vector Basic Bit-manipulation
|
||||
#define SIMDJSON_IS_ZVBB 1
|
||||
#endif
|
||||
#endif
|
||||
#elif defined(__loongarch_lp64)
|
||||
#define SIMDJSON_IS_LOONGARCH64 1
|
||||
#elif defined(__PPC64__) || defined(_M_PPC64)
|
||||
|
||||
Reference in New Issue
Block a user