[WIP] AVX 10.2 and APX support#592
Open
stefanatwork wants to merge 14 commits intomasterfrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends Embree’s ISA detection, build configuration, and runtime dispatch to add a new APX (and related AVX10.2) codepath, including updates to CPU feature bitmask width and AVX10.2-specific SIMD helper intrinsics.
Changes:
- Widen CPU feature/ISA bitmasks and plumbing from
inttoint64_tacross state/config/verify paths. - Add APX target support to CMake (flags, target library, config export) and extend runtime symbol-selection macros to include APX.
- Extend CPU feature detection + SIMD helpers to recognize and use AVX10.2/APX-related capabilities.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tutorials/verify/verify.h | Switch ISA storage/params to int64_t for wider feature masks. |
| tutorials/verify/verify.cpp | Use int64_t ISA masks and add APX to verify ISA list. |
| tutorials/common/tutorial/application.cpp | Document apx in CLI help output. |
| kernels/common/state.h | Update ISA-related APIs/fields to int64_t. |
| kernels/common/state.cpp | Update ISA handling and add APX debug verification + AVX10 string parsing. |
| kernels/common/rtcore.cpp | Extend geometry factory dispatch to include APX-capable symbol selection. |
| kernels/common/isa.h | Add APX namespace and new ISA selection macro combinations (AVX512+APX, etc.). |
| kernels/common/device.cpp | Print CPU features with int64_t and include APX in supported target list string. |
| kernels/CMakeLists.txt | Add embree_apx static library target and integrate APX into file selection. |
| kernels/bvh/bvh8_factory.h | Widen builder/intersector feature masks to int64_t. |
| kernels/bvh/bvh8_factory.cpp | Use APX-aware selection macros for BVH8 intersectors. |
| kernels/bvh/bvh4_factory.h | Widen builder/intersector feature masks to int64_t. |
| kernels/bvh/bvh4_factory.cpp | Use APX-aware selection macros for BVH4 intersectors. |
| kernels/bvh/bvh_intersector1_bvh4.cpp | Return int64_t from getISA() for wider ISA values. |
| common/sys/sysinfo.h | Add APX/AVX10.* feature bits and widen ISA constants/APIs to int64_t. |
| common/sys/sysinfo.cpp | Implement AVX10/APX CPUID + XCR0 detection and widen feature handling. |
| common/simd/vuint16_avx512.h | Use AVX10.2 reductions when available; adjust multiply intrinsic. |
| common/simd/vllong8_avx512.h | Use AVX10.2 reduction intrinsics when available. |
| common/simd/vfloat16_avx512.h | Use AVX10.2 abs/minmax/reduce helpers when available. |
| common/simd/vdouble8_avx512.h | Use AVX10.2 abs/minmax/reduce helpers when available. |
| common/simd/vboolf8_avx512.h | Use AVX10.2 mask intrinsics where applicable. |
| common/simd/vboolf4_avx512.h | Use AVX10.2 mask intrinsics where applicable. |
| common/simd/vboolf16_avx512.h | Use AVX10.2 mask intrinsics where applicable. |
| common/simd/vboold8_avx512.h | Use AVX10.2 mask intrinsics where applicable. |
| common/simd/vboold4_avx512.h | Use AVX10.2 mask intrinsics where applicable. |
| common/cmake/msvc.cmake | Add MSVC flags for APX target builds. |
| common/cmake/gnu.cmake | Add GNU flags for APX target builds. |
| common/cmake/embree-config.cmake | Export APX target setting and include APX targets for static builds. |
| common/cmake/dpcpp.cmake | Add DPCPP flags for APX target builds. |
| common/cmake/clang.cmake | Add Clang flags for APX target builds. |
| common/cmake/check_isa.cpp | Extend ISA probe to detect/report APX. |
| CMakeLists.txt | Add APX to max-ISA selection and enable APX build option/defines. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+18
to
+19
| #if define((__APX_F__) && defined(__AVX10_2__) | ||
| char const *info_isa = "ISA" ":" "APX" |
Comment on lines
+252
to
+253
| else if (isa == "avx10.1") return AVX512; | ||
| else if (isa == "avx10.2") return APX; |
| if (hasISA(features,AVX2)) v += "AVX2 "; | ||
| if (hasISA(features,AVX512)) v += "AVX512 "; | ||
|
|
||
| if (hasISA(features, CPU_FEATURE_APX)) v += "APX "; |
Comment on lines
+18
to
+24
| /* Allow build system to override via -Disa=... -DISA=... on the command line */ | ||
| #if !defined(isa) | ||
| #if defined(__APX_F__) && defined(__AVX10_2__) | ||
| # define isa apx | ||
| # define ISA APX | ||
| # define ISA_STR "APX" | ||
| #elif defined (__AVX512VL__) |
| " avx2: select AVX2 codepath\n" | ||
| " avx512: select AVX512 codepath\n"); | ||
| " avx512: select AVX512 codepath\n" | ||
| " apx: select APX codepath\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding support for the AVX 10.2 and APX instruction sets