From fd10e6f1c81706b94731ed64bc05fb425e2892cb Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Wed, 8 Apr 2026 09:48:00 -0700 Subject: [PATCH 1/3] add missing ISA constants also refactors enable_instructions test --- mkl/_mkl_service.pxd | 2 ++ mkl/_mkl_service.pyx | 2 ++ mkl/tests/test_mkl_service.py | 24 ++++++++++++++++-------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/mkl/_mkl_service.pxd b/mkl/_mkl_service.pxd index ea22e1c..74dc458 100644 --- a/mkl/_mkl_service.pxd +++ b/mkl/_mkl_service.pxd @@ -73,10 +73,12 @@ cdef extern from "mkl.h": int MKL_ENABLE_AVX512_E3 int MKL_ENABLE_AVX512_E4 int MKL_ENABLE_AVX512_E1 + int MKL_ENABLE_AVX512_E5 int MKL_ENABLE_AVX512 int MKL_ENABLE_AVX2 int MKL_ENABLE_AVX2_E1 int MKL_ENABLE_SSE4_2 + int MKL_ENABLE_AVX10 # MPI Implementation Constants int MKL_BLACS_CUSTOM diff --git a/mkl/_mkl_service.pyx b/mkl/_mkl_service.pyx index 3b59b08..5b1339e 100644 --- a/mkl/_mkl_service.pyx +++ b/mkl/_mkl_service.pyx @@ -773,10 +773,12 @@ cdef object __enable_instructions(isa=None) except *: "avx512_e3": mkl.MKL_ENABLE_AVX512_E3, "avx512_e2": mkl.MKL_ENABLE_AVX512_E2, "avx512_e1": mkl.MKL_ENABLE_AVX512_E1, + "avx512_e5": mkl.MKL_ENABLE_AVX512_E5, "avx512": mkl.MKL_ENABLE_AVX512, "avx2_e1": mkl.MKL_ENABLE_AVX2_E1, "avx2": mkl.MKL_ENABLE_AVX2, "sse4_2": mkl.MKL_ENABLE_SSE4_2, + "avx10": mkl.MKL_ENABLE_AVX10, }, } cdef int c_mkl_isa = __mkl_str_to_int(isa, __variables["input"]) diff --git a/mkl/tests/test_mkl_service.py b/mkl/tests/test_mkl_service.py index 7c9c97a..3432efb 100644 --- a/mkl/tests/test_mkl_service.py +++ b/mkl/tests/test_mkl_service.py @@ -247,16 +247,24 @@ def test_cbwr_get_auto_branch(): mkl.cbwr_get_auto_branch() -def test_enable_instructions_avx512(): - mkl.enable_instructions("avx512") - - -def test_enable_instructions_avx2(): - mkl.enable_instructions("avx2") +instructions = [ + "single_path", + "avx512_e4", + "avx512_e3", + "avx512_e2", + "avx512_e1", + "avx512_e5", + "avx512", + "avx2_e1", + "avx2", + "sse4_2", + "avx10", +] -def test_enable_instructions_sse4_2(): - mkl.enable_instructions("sse4_2") +@pytest.mark.parametrize("isa", instructions) +def test_enable_instructions(isa): + mkl.enable_instructions(isa) def test_set_env_mode(): From b63c9c154528a7873fd22ef74e1009427ae33b9b Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Wed, 8 Apr 2026 09:50:53 -0700 Subject: [PATCH 2/3] add gh-175 to changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9c36a1..733aad3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [dev] (MM/DD/YYYY) +### Added +* Added support for ISA constants `"avx10"` and `"avx512_e5"` [gh-175](https://github.com/IntelPython/mkl-service/pull/175) + ### Removed * Dropped support for Python 3.9 [gh-118](https://github.com/IntelPython/mkl-service/pull/118) * Dropped support for `"ssse3"`, `"sse4_1"`, `"avx"`, `"avx512_mic"`, `"avx512_mic,strict"`, and `"avx512_mic_e1"` cbwr branches [gh-173](https://github.com/IntelPython/mkl-service/pull/173) From c3fc367dd8bf63e7344d2d67152fad3c4d5c93a6 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Wed, 8 Apr 2026 10:43:45 -0700 Subject: [PATCH 3/3] add CNR constant for avx10 --- CHANGELOG.md | 2 +- mkl/_mkl_service.pxd | 1 + mkl/_mkl_service.pyx | 6 ++++++ mkl/tests/test_mkl_service.py | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 733aad3..bf36141 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [dev] (MM/DD/YYYY) ### Added -* Added support for ISA constants `"avx10"` and `"avx512_e5"` [gh-175](https://github.com/IntelPython/mkl-service/pull/175) +* Added support for ISA constants `"avx10"` and `"avx512_e5"` and CNR constants `"avx10"` and `"avx10,strict"` [gh-175](https://github.com/IntelPython/mkl-service/pull/175) ### Removed * Dropped support for Python 3.9 [gh-118](https://github.com/IntelPython/mkl-service/pull/118) diff --git a/mkl/_mkl_service.pxd b/mkl/_mkl_service.pxd index 74dc458..7319339 100644 --- a/mkl/_mkl_service.pxd +++ b/mkl/_mkl_service.pxd @@ -59,6 +59,7 @@ cdef extern from "mkl.h": int MKL_CBWR_AVX2 int MKL_CBWR_AVX512 int MKL_CBWR_AVX512_E1 + int MKL_CBWR_AVX10 int MKL_CBWR_SUCCESS int MKL_CBWR_ERR_INVALID_SETTINGS diff --git a/mkl/_mkl_service.pyx b/mkl/_mkl_service.pyx index 5b1339e..710bd8f 100644 --- a/mkl/_mkl_service.pyx +++ b/mkl/_mkl_service.pyx @@ -684,6 +684,8 @@ cdef object __cbwr_set(branch=None) except *: "avx512,strict": mkl.MKL_CBWR_AVX512 | mkl.MKL_CBWR_STRICT, "avx512_e1": mkl.MKL_CBWR_AVX512_E1, "avx512_e1,strict": mkl.MKL_CBWR_AVX512_E1 | mkl.MKL_CBWR_STRICT, + "avx10": mkl.MKL_CBWR_AVX10, + "avx10,strict": mkl.MKL_CBWR_AVX10 | mkl.MKL_CBWR_STRICT, }, "output": { mkl.MKL_CBWR_SUCCESS: "success", @@ -721,6 +723,8 @@ cdef inline __cbwr_get(cnr_const=None) except *: mkl.MKL_CBWR_AVX512 | mkl.MKL_CBWR_STRICT: "avx512,strict", mkl.MKL_CBWR_AVX512_E1: "avx512_e1", mkl.MKL_CBWR_AVX512_E1 | mkl.MKL_CBWR_STRICT: "avx512_e1,strict", + mkl.MKL_CBWR_AVX10: "avx10", + mkl.MKL_CBWR_AVX10 | mkl.MKL_CBWR_STRICT: "avx10,strict", mkl.MKL_CBWR_ERR_INVALID_INPUT: "err_invalid_input", }, } @@ -749,6 +753,8 @@ cdef object __cbwr_get_auto_branch() except *: mkl.MKL_CBWR_AVX512 | mkl.MKL_CBWR_STRICT: "avx512,strict", mkl.MKL_CBWR_AVX512_E1: "avx512_e1", mkl.MKL_CBWR_AVX512_E1 | mkl.MKL_CBWR_STRICT: "avx512_e1,strict", + mkl.MKL_CBWR_AVX10: "avx10", + mkl.MKL_CBWR_AVX10 | mkl.MKL_CBWR_STRICT: "avx10,strict", mkl.MKL_CBWR_SUCCESS: "success", mkl.MKL_CBWR_ERR_INVALID_INPUT: "err_invalid_input", }, diff --git a/mkl/tests/test_mkl_service.py b/mkl/tests/test_mkl_service.py index 3432efb..0080ae6 100644 --- a/mkl/tests/test_mkl_service.py +++ b/mkl/tests/test_mkl_service.py @@ -223,6 +223,7 @@ def check_cbwr(branch, cnr_const): "avx2", "avx512", "avx512_e1", + "avx10", ] @@ -230,6 +231,7 @@ def check_cbwr(branch, cnr_const): "avx2,strict", "avx512,strict", "avx512_e1,strict", + "avx10,strict", ]