Skip to content

Commit 7efe76d

Browse files
committed
add win11 arm
1 parent dbc5fc4 commit 7efe76d

File tree

3 files changed

+53
-28
lines changed

3 files changed

+53
-28
lines changed

.github/workflows/pythonapp.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ name: pyXCP
55

66
on:
77
push:
8-
branches: [master, develop]
98
pull_request:
109
branches: [master, develop]
1110

@@ -17,14 +16,19 @@ jobs:
1716
strategy:
1817
fail-fast: false
1918
matrix:
20-
os:
21-
- macos-latest
22-
- ubuntu-24.04-arm
23-
- ubuntu-latest
24-
- windows-latest
19+
include:
20+
- os: macos-latest
21+
- os: ubuntu-24.04-arm
22+
- os: ubuntu-latest
23+
- os: windows-11-arm
24+
cibw_archs_windows: ARM64
25+
- os: windows-latest
26+
cibw_archs_windows: AMD64
2527
steps:
26-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v5
2729
- uses: pypa/[email protected]
30+
env:
31+
CIBW_ARCHS_WINDOWS: ${{ matrix.cibw_archs_windows || '' }}
2832
- uses: actions/upload-artifact@v4
2933
with:
3034
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
@@ -34,7 +38,7 @@ jobs:
3438
name: Build source distribution
3539
runs-on: ubuntu-latest
3640
steps:
37-
- uses: actions/checkout@v3
41+
- uses: actions/checkout@v5
3842
- name: Build sdist
3943
run: |
4044
pip install -U build
@@ -52,7 +56,7 @@ jobs:
5256
# alternatively, to publish when a GitHub Release is created, use the following rule:
5357
# if: github.event_name == 'release' && github.event.action == 'published'
5458
steps:
55-
- uses: actions/download-artifact@v4
59+
- uses: actions/download-artifact@v5
5660
with:
5761
path: dist
5862
merge-multiple: true

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,6 @@ build = "cp3{10,11,12,13,14}-*"
173173
skip = ["*_i686", "*-musllinux*"]
174174
build-frontend = "build"
175175

176-
[tool.cibuildwheel.windows]
177-
archs = ["AMD64"]
178-
179176
[tool.pyright]
180177
include = ["pyxcp", "build_ext.py"]
181178
ignore = ["pyxcp/recorder/converter/**", "pyxcp/recorder/simdjson/**","pyxcp/recorder/mio/**", "pyxcp/recorder/lz4/**"]

pyxcp/daq_stim/scheduler.cpp

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,52 @@
1-
21
#include "scheduler.hpp"
32

43
#if defined(_WIN32)
4+
#include <cstdio>
5+
#include <stdexcept>
56

7+
// Timer callback function
68
VOID CALLBACK TimerRoutine(PVOID lpParam, BOOLEAN TimerOrWaitFired) {
7-
if (lpParam == NULL) {
8-
printf("TimerRoutine lpParam is NULL\n");
9+
if (lpParam == nullptr) {
10+
printf("TimerRoutine: Invalid parameter (null)\n");
11+
return;
12+
}
13+
14+
const auto* value = static_cast<const int*>(lpParam);
15+
printf("Timer routine called. Parameter: %d\n", *value);
16+
17+
if (TimerOrWaitFired) {
18+
printf("Timer expired\n");
919
} else {
10-
// lpParam points to the argument; in this case it is an int
11-
12-
printf("Timer routine called. Parameter is %d.\n", *(int*)lpParam);
13-
if (TimerOrWaitFired) {
14-
printf("The wait timed out.\n");
15-
} else {
16-
printf("The wait event was signaled.\n");
17-
}
20+
printf("Wait event signaled\n");
1821
}
1922
}
2023

24+
#endif // _WIN32
25+
26+
// Vectorized square operation (separate from Windows-specific code)
27+
constexpr size_t VECTOR_SIZE = 4;
28+
29+
void square_vector(float* ptr) {
30+
if (ptr == nullptr) {
31+
throw std::invalid_argument("Null pointer passed to square_vector");
32+
}
33+
34+
#if defined(__SSE__)
2135
#include <xmmintrin.h>
36+
__m128 vec = _mm_loadu_ps(ptr);
37+
vec = _mm_mul_ps(vec, vec);
38+
_mm_storeu_ps(ptr, vec);
2239

23-
void mul4_vectorized(float* ptr) {
24-
__m128 f = _mm_loadu_ps(ptr);
25-
f = _mm_mul_ps(f, f);
26-
_mm_storeu_ps(ptr, f);
27-
}
40+
#elif defined(__ARM_NEON)
41+
#include <arm_neon.h>
42+
float32x4_t vec = vld1q_f32(ptr);
43+
vec = vmulq_f32(vec, vec);
44+
vst1q_f32(ptr, vec);
45+
46+
#else
47+
// Scalar fallback
48+
for (size_t i = 0; i < VECTOR_SIZE; ++i) {
49+
ptr[i] *= ptr[i];
50+
}
2851
#endif
52+
}

0 commit comments

Comments
 (0)