Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-numpy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ permissions: read-all
jobs:
np-multiarray-tgl:

if: github.repository == 'intel/x86-simd-sort'
runs-on: intel-ubuntu-24.04
if: github.repository == 'numpy/x86-simd-sort'
runs-on: ubuntu-24.04

steps:
- name: Checkout x86-simd-sort
Expand Down Expand Up @@ -79,8 +79,8 @@ jobs:

np-multiarray-spr:

if: github.repository == 'intel/x86-simd-sort'
runs-on: intel-ubuntu-24.04
if: github.repository == 'numpy/x86-simd-sort'
runs-on: ubuntu-24.04

steps:
- name: Checkout x86-simd-sort
Expand Down
93 changes: 42 additions & 51 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,40 @@ on:
permissions: read-all

jobs:
build-windows-msvc:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

# Set up MSVC environment
- name: Set up MSVC Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

# Install Python (Meson requires it)
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

# Install Meson and Ninja
- name: Install Meson + Ninja
run: |
python -m pip install --upgrade pip
pip install meson ninja

# Configure and build with Meson (MSVC will be used automatically)
- name: Configure (Meson)
run: meson setup --warnlevel 2 --buildtype release builddir --backend=ninja

- name: Build (Ninja)
run: ninja -C builddir

SKL-gcc9:

runs-on: intel-ubuntu-24.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -41,7 +72,7 @@ jobs:

SKX-gcc10:

runs-on: intel-ubuntu-24.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -71,7 +102,7 @@ jobs:

TGL-gcc11:

runs-on: intel-ubuntu-24.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -100,7 +131,7 @@ jobs:

SPR-gcc13:

runs-on: intel-ubuntu-24.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -135,9 +166,9 @@ jobs:
- name: Run test suite on SPR
run: sde -spr -- ./builddir/testexe

ADL-ASAN-clang18:
ASAN-clang18:

runs-on: intel-ubuntu-24.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -170,51 +201,11 @@ jobs:
ninja

- name: Run test suite on SPR
run: sde -adl -- ./builddir/testexe

SPR-ASAN-clang18:

runs-on: intel-ubuntu-24.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install dependencies
run: |
sudo apt update
sudo apt -y install clang-18 libomp-18-dev libgtest-dev meson curl git

- name: Install Intel SDE
run: |
curl -o /tmp/sde.tar.xz https://downloadmirror.intel.com/859732/sde-external-9.58.0-2025-06-16-lin.tar.xz
mkdir /tmp/sde && tar -xvf /tmp/sde.tar.xz -C /tmp/sde/
sudo mv /tmp/sde/* /opt/sde && sudo ln -s /opt/sde/sde64 /usr/bin/sde

- name: Build examples
env:
CXX: clang++-18
run: |
cd examples
make all

- name: Build
env:
CXX: clang++-18
run: |
make clean
meson setup -Dbuild_tests=true -Duse_openmp=true -Db_sanitize=address,undefined -Dfatal_sanitizers=true -Dasan_ci_dont_validate=true -Db_lundef=false --warnlevel 0 --buildtype release builddir
cd builddir
ninja

- name: Run test suite on SPR
run: sde -spr -- ./builddir/testexe
- name: Run ICL fp16 tests
# Note: This filters for the _Float16 tests based on the number assigned to it, which could change in the future
run: sde -icx -- ./builddir/testexe --gtest_filter="*/simdsort/2*"
run: ./builddir/testexe

SKX-SKL-openmp:

runs-on: intel-ubuntu-24.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -246,7 +237,7 @@ jobs:

SPR-gcc13-special-cases:

runs-on: intel-ubuntu-24.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -281,7 +272,7 @@ jobs:

manylinux-32bit:

runs-on: intel-ubuntu-24.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -293,7 +284,7 @@ jobs:

SPR-icpx:

runs-on: intel-ubuntu-24.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions: read-all
jobs:
clang-format:

runs-on: intel-ubuntu-24.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#define MY_BENCHMARK_CAPTURE(func, T, test_case_name, ...) \
BENCHMARK_PRIVATE_DECLARE(func) \
= (::benchmark::internal::RegisterBenchmarkInternal( \
std::unique_ptr<benchmark::internal::Benchmark>( \
new ::benchmark::internal::FunctionBenchmark( \
#func "/" #test_case_name "/" #T, \
[](::benchmark::State &st) { \
func<T>(st, __VA_ARGS__); \
}))))
std::unique_ptr<benchmark::internal::Benchmark>( \
new ::benchmark::internal::FunctionBenchmark( \
#func "/" #test_case_name "/" #T, \
[](::benchmark::State &st) { \
func<T>(st, __VA_ARGS__); \
}))))

#define BENCH_SORT(func, type) \
MY_BENCHMARK_CAPTURE(func, type, random_128, 128, std::string("random")); \
Expand Down
63 changes: 28 additions & 35 deletions lib/meson.build
Original file line number Diff line number Diff line change
@@ -1,48 +1,41 @@
libtargets = []
libtargets += static_library('libavx',
files(
'x86simdsort-avx2.cpp',
),
include_directories : [src],
cpp_args : cpp.get_id() == 'msvc' ? ['/arch:AVX2'] : ['-march=haswell'],
gnu_symbol_visibility : 'inlineshidden',
dependencies: [omp_dep],
)

if cpp.has_argument('-march=haswell')
libtargets += static_library('libavx',
files(
'x86simdsort-avx2.cpp',
),
include_directories : [src],
cpp_args : ['-march=haswell'],
gnu_symbol_visibility : 'inlineshidden',
dependencies: [omp_dep],
)
endif

if cpp.has_argument('-march=skylake-avx512')
libtargets += static_library('libskx',
files(
'x86simdsort-skx.cpp',
),
include_directories : [src],
cpp_args : ['-march=skylake-avx512'],
gnu_symbol_visibility : 'inlineshidden',
dependencies: [omp_dep],
)
endif
libtargets += static_library('libskx',
files(
'x86simdsort-skx.cpp',
),
include_directories : [src],
cpp_args : cpp.get_id() == 'msvc' ? ['/arch:AVX512'] : ['-march=skylake-avx512'],
gnu_symbol_visibility : 'inlineshidden',
dependencies: [omp_dep],
)

if cpp.has_argument('-march=icelake-client')
libtargets += static_library('libicl',
files(
'x86simdsort-icl.cpp',
),
include_directories : [src],
cpp_args : ['-march=icelake-client'],
gnu_symbol_visibility : 'inlineshidden',
dependencies: [omp_dep],
)
endif
libtargets += static_library('libicl',
files(
'x86simdsort-icl.cpp',
),
include_directories : [src],
cpp_args : cpp.get_id() == 'msvc' ? ['/arch:AVX512'] : ['-march=icelake-client'],
gnu_symbol_visibility : 'inlineshidden',
dependencies: [omp_dep],
)

if cancompilefp16
libtargets += static_library('libspr',
files(
'x86simdsort-spr.cpp',
),
include_directories : [src],
cpp_args : ['-march=sapphirerapids'],
cpp_args : cpp.get_id() == 'msvc' ? ['/arch:AVX512'] : ['-march=sapphirerapids'],
gnu_symbol_visibility : 'inlineshidden',
dependencies: [omp_dep],
)
Expand Down
4 changes: 4 additions & 0 deletions lib/x86simdsort-icl.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// ICL specific routines:
#include "x86simdsort-static-incl.h"
#include "x86simdsort-internal.h"
#ifdef _MSC_VER
#include "avx512-16bit-qsort.hpp"
#endif


namespace xss {
namespace avx512 {
Expand Down
Loading
Loading