Skip to content

Commit 1724a3d

Browse files
authored
Merge pull request #175 from IntelPython/add-missing-isa-constants
Add missing ISA constants
2 parents e2d504b + c3fc367 commit 1724a3d

4 files changed

Lines changed: 32 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [dev] (MM/DD/YYYY)
88

9+
### Added
10+
* 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)
11+
912
### Removed
1013
* Dropped support for Python 3.9 [gh-118](https://github.com/IntelPython/mkl-service/pull/118)
1114
* 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)

mkl/_mkl_service.pxd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ cdef extern from "mkl.h":
5959
int MKL_CBWR_AVX2
6060
int MKL_CBWR_AVX512
6161
int MKL_CBWR_AVX512_E1
62+
int MKL_CBWR_AVX10
6263

6364
int MKL_CBWR_SUCCESS
6465
int MKL_CBWR_ERR_INVALID_SETTINGS
@@ -73,10 +74,12 @@ cdef extern from "mkl.h":
7374
int MKL_ENABLE_AVX512_E3
7475
int MKL_ENABLE_AVX512_E4
7576
int MKL_ENABLE_AVX512_E1
77+
int MKL_ENABLE_AVX512_E5
7678
int MKL_ENABLE_AVX512
7779
int MKL_ENABLE_AVX2
7880
int MKL_ENABLE_AVX2_E1
7981
int MKL_ENABLE_SSE4_2
82+
int MKL_ENABLE_AVX10
8083

8184
# MPI Implementation Constants
8285
int MKL_BLACS_CUSTOM

mkl/_mkl_service.pyx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,8 @@ cdef object __cbwr_set(branch=None) except *:
684684
"avx512,strict": mkl.MKL_CBWR_AVX512 | mkl.MKL_CBWR_STRICT,
685685
"avx512_e1": mkl.MKL_CBWR_AVX512_E1,
686686
"avx512_e1,strict": mkl.MKL_CBWR_AVX512_E1 | mkl.MKL_CBWR_STRICT,
687+
"avx10": mkl.MKL_CBWR_AVX10,
688+
"avx10,strict": mkl.MKL_CBWR_AVX10 | mkl.MKL_CBWR_STRICT,
687689
},
688690
"output": {
689691
mkl.MKL_CBWR_SUCCESS: "success",
@@ -721,6 +723,8 @@ cdef inline __cbwr_get(cnr_const=None) except *:
721723
mkl.MKL_CBWR_AVX512 | mkl.MKL_CBWR_STRICT: "avx512,strict",
722724
mkl.MKL_CBWR_AVX512_E1: "avx512_e1",
723725
mkl.MKL_CBWR_AVX512_E1 | mkl.MKL_CBWR_STRICT: "avx512_e1,strict",
726+
mkl.MKL_CBWR_AVX10: "avx10",
727+
mkl.MKL_CBWR_AVX10 | mkl.MKL_CBWR_STRICT: "avx10,strict",
724728
mkl.MKL_CBWR_ERR_INVALID_INPUT: "err_invalid_input",
725729
},
726730
}
@@ -749,6 +753,8 @@ cdef object __cbwr_get_auto_branch() except *:
749753
mkl.MKL_CBWR_AVX512 | mkl.MKL_CBWR_STRICT: "avx512,strict",
750754
mkl.MKL_CBWR_AVX512_E1: "avx512_e1",
751755
mkl.MKL_CBWR_AVX512_E1 | mkl.MKL_CBWR_STRICT: "avx512_e1,strict",
756+
mkl.MKL_CBWR_AVX10: "avx10",
757+
mkl.MKL_CBWR_AVX10 | mkl.MKL_CBWR_STRICT: "avx10,strict",
752758
mkl.MKL_CBWR_SUCCESS: "success",
753759
mkl.MKL_CBWR_ERR_INVALID_INPUT: "err_invalid_input",
754760
},
@@ -773,10 +779,12 @@ cdef object __enable_instructions(isa=None) except *:
773779
"avx512_e3": mkl.MKL_ENABLE_AVX512_E3,
774780
"avx512_e2": mkl.MKL_ENABLE_AVX512_E2,
775781
"avx512_e1": mkl.MKL_ENABLE_AVX512_E1,
782+
"avx512_e5": mkl.MKL_ENABLE_AVX512_E5,
776783
"avx512": mkl.MKL_ENABLE_AVX512,
777784
"avx2_e1": mkl.MKL_ENABLE_AVX2_E1,
778785
"avx2": mkl.MKL_ENABLE_AVX2,
779786
"sse4_2": mkl.MKL_ENABLE_SSE4_2,
787+
"avx10": mkl.MKL_ENABLE_AVX10,
780788
},
781789
}
782790
cdef int c_mkl_isa = __mkl_str_to_int(isa, __variables["input"])

mkl/tests/test_mkl_service.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,15 @@ def check_cbwr(branch, cnr_const):
223223
"avx2",
224224
"avx512",
225225
"avx512_e1",
226+
"avx10",
226227
]
227228

228229

229230
strict = [
230231
"avx2,strict",
231232
"avx512,strict",
232233
"avx512_e1,strict",
234+
"avx10,strict",
233235
]
234236

235237

@@ -247,16 +249,24 @@ def test_cbwr_get_auto_branch():
247249
mkl.cbwr_get_auto_branch()
248250

249251

250-
def test_enable_instructions_avx512():
251-
mkl.enable_instructions("avx512")
252-
253-
254-
def test_enable_instructions_avx2():
255-
mkl.enable_instructions("avx2")
252+
instructions = [
253+
"single_path",
254+
"avx512_e4",
255+
"avx512_e3",
256+
"avx512_e2",
257+
"avx512_e1",
258+
"avx512_e5",
259+
"avx512",
260+
"avx2_e1",
261+
"avx2",
262+
"sse4_2",
263+
"avx10",
264+
]
256265

257266

258-
def test_enable_instructions_sse4_2():
259-
mkl.enable_instructions("sse4_2")
267+
@pytest.mark.parametrize("isa", instructions)
268+
def test_enable_instructions(isa):
269+
mkl.enable_instructions(isa)
260270

261271

262272
def test_set_env_mode():

0 commit comments

Comments
 (0)