Skip to content

Commit

Permalink
vir-simd 0.3.200 (beta 1)
Browse files Browse the repository at this point in the history
ChangeLog:

	* .github/workflows/CI.yml: Test installation. On MSVC builds
	compile the check target.
	* CMakeLists.txt: Require cmake 3.5. Set
	CMAKE_CXX_VISIBILITY_PRESET and CMAKE_VISIBILITY_INLINES_HIDDEN.
	Build test.cpp only for the check target, not all.
	* Makefile: Interpret patchlevel as release, development, alpha,
	or beta and print on 'debug' and 'install'.
	* vir/simd_version.h: Bump patchlevel to 200.
	* vir/test.cpp: Remove tests for exact version number.
  • Loading branch information
mattkretz committed Sep 13, 2024
1 parent e457940 commit 751fea5
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ jobs:
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.version }} g++-${{ matrix.version }}
- name: Test installation
env:
CXX: g++-${{ matrix.version }}
run: |
cmake -S vir-simd -B cmake-build -DCMAKE_INSTALL_PREFIX:STRING=$HOME/vir-simd-cmake
cmake --build cmake-build --target install
cd vir-simd && make prefix=$HOME/vir-simd-make install
diff -r $HOME/vir-simd-cmake/include $HOME/vir-simd-make/include && echo "cmake and make installations match ✅"
- name: Run test suite
env:
CXX: g++-${{ matrix.version }}
Expand Down Expand Up @@ -188,4 +197,4 @@ jobs:
run: cmake -S vir-simd -B build -DCMAKE_BUILD_TYPE:STRING=Release

- name: Compile test
run: cmake --build build --config Release
run: cmake --build build --config Release --target check
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.5)
project(vir-simd CXX)

# Define main library
Expand Down Expand Up @@ -37,10 +37,15 @@ install(
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
PATTERN "*.cpp" EXCLUDE)

set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

# Define test targets
add_library(vir-simd-test-stdlib vir/test.cpp)
add_library(vir-simd-test-stdlib EXCLUDE_FROM_ALL vir/test.cpp)
target_link_libraries(vir-simd-test-stdlib PRIVATE vir-simd)

add_library(vir-simd-test-fallback vir/test.cpp)
add_library(vir-simd-test-fallback EXCLUDE_FROM_ALL vir/test.cpp)
target_link_libraries(vir-simd-test-fallback PRIVATE vir-simd)
target_compile_definitions(vir-simd-test-fallback PRIVATE VIR_DISABLE_STDX_SIMD)

add_custom_target(check DEPENDS vir-simd-test-stdlib vir-simd-test-fallback)
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,21 @@ endif

std=$(shell env CXX=$(CXX) ./latest_std_flag.sh)

version=$(shell grep '\<VIR_SIMD_VERSION\>' vir/simd_version.h | \
version:=$(shell grep '\<VIR_SIMD_VERSION\>' vir/simd_version.h | \
sed -e 's/.*0x/0x/' -e 's/'\''//g' | \
(read v; echo $$((v/0x10000)).$$((v%0x10000/0x100)).$$((v%0x100));))

version_patchlevel:=$(lastword $(subst ., ,$(version)))

version_info=$(shell test $(version_patchlevel) -lt 100 && echo release || \
(test $(version_patchlevel) -lt 190 && echo development || \
(test $(version_patchlevel) -lt 200 && echo alpha $$(($(version_patchlevel)-189)) || \
echo beta $$(($(version_patchlevel)-199)))))

check: check-extensions check-constexpr_wrapper testsuite-O2 testsuite-Os

debug:
@echo "vir::simd_version: $(version)"
@echo "vir::simd_version: $(version) ($(version_info))"
@echo "build_dir: $(build_dir)"
@echo "triplet: $(triplet)"
@echo "testflags: $(testflags)"
Expand Down Expand Up @@ -80,7 +87,7 @@ testsuite-%: testsuite/$(build_dir)-%/Makefile
@cat testsuite/$(build_dir)-$*/.simd.summary && rm testsuite/$(build_dir)-$*/.simd.summary

install:
@echo "Installing vir::stdx::simd $(version) to $(includedir)/vir"
@echo "Installing vir::stdx::simd $(version) ($(version_info)) to $(includedir)/vir"
install -d $(includedir)/vir
install -m 644 -t $(includedir)/vir vir/*.h

Expand Down
6 changes: 5 additions & 1 deletion vir/simd_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
#define VIR_HAVE_SPACESHIP 0
#endif

#define VIR_SIMD_VERSION 0x0'03'64
// release >= 0x00
// development >= 0x64
// alpha >= 0xbe
// beta >= 0xc8
#define VIR_SIMD_VERSION 0x0'03'c8

#define VIR_SIMD_VERSION_MAJOR (VIR_SIMD_VERSION / 0x10000)

Expand Down
2 changes: 0 additions & 2 deletions vir/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#define SIMD_IS_CONSTEXPR_ENOUGH 0
#endif

static_assert(vir::simd_version == vir::simd_version_t{0,3,100});
static_assert(vir::simd_version <= vir::simd_version_t{0,3,100});
static_assert(vir::simd_version >= vir::simd_version_t{0,3,100});
static_assert(vir::simd_version != vir::simd_version_t{0,3,0});
static_assert(vir::simd_version >= vir::simd_version_t{0,3,0});
Expand Down

0 comments on commit 751fea5

Please sign in to comment.