Skip to content

Fix linux CI and AVX512-128/256 - #1412

Merged
AntoinePrv merged 5 commits into
xtensor-stack:masterfrom
AntoinePrv:fix-linux
Sep 15, 2026
Merged

AntoinePrv merged 5 commits into
xtensor-stack:masterfrom
AntoinePrv:fix-linux

Conversation

@AntoinePrv

Copy link
Copy Markdown
Contributor

No description provided.

@AntoinePrv AntoinePrv changed the title Fix linux CI and AVX512 Fix linux CI and AVX512-128/256 Sep 14, 2026
Comment thread .github/workflows/linux.yml
@AntoinePrv

Copy link
Copy Markdown
Contributor Author

@serge-sans-paille these architectures were not properly tested in CI.
Would you mind reviewing the fixes?

@serge-sans-paille serge-sans-paille left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions, but nice work, thanks a lot!

CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DTARGET_ARCH=knm"
fi
if [[ '${{ matrix.sys.flags }}' == 'i386' ]]; then
CXX_FLAGS="$CXX_FLAGS -m32"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's so error prone, thanks for fixing this.

else if constexpr (std::is_signed_v<T>)
{
auto mask = (other >> (8 * sizeof(T) - 1));
auto other_is_negative = other < batch<T, A>(T(0));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much more idiomatic

const uint32_t magic = (0x80 + 0x4000 + 0x200000 + 0x10000000);

unsigned char res = ((data * magic) >> 24) & 0xFF;
unsigned char res = (data * magic) >> 28;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel ashamed. But also very proud of that trick ;-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to write all magic numbers as result of constexpr functions. Mostly because I cannot reverse engineer other people magic numbers 😅

Comment thread test/CMakeLists.txt Outdated

add_subdirectory(doc)
add_subdirectory(architectures)
OPTION(BUILD_ARCHITECTURE_TESTS "xsimd compilation tests for various -march targets" OFF)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why didn't you turn this ON by default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can turn this on by default. The current issue is that it does not play well with XSIMD_DEFAULT_ARCH (needed to build avx512_128 etc).
I plan to submit another PR for making it easier to select the architectures so perhaps I'll find a better way there.
Making it the default in the meantime

@AntoinePrv
AntoinePrv merged commit 28f6c62 into xtensor-stack:master Sep 15, 2026
90 checks passed
@AntoinePrv
AntoinePrv deleted the fix-linux branch September 15, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants