Skip to content

Commit fd10e6f

Browse files
committed
add missing ISA constants
also refactors enable_instructions test
1 parent e2d504b commit fd10e6f

3 files changed

Lines changed: 20 additions & 8 deletions

File tree

mkl/_mkl_service.pxd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ cdef extern from "mkl.h":
7373
int MKL_ENABLE_AVX512_E3
7474
int MKL_ENABLE_AVX512_E4
7575
int MKL_ENABLE_AVX512_E1
76+
int MKL_ENABLE_AVX512_E5
7677
int MKL_ENABLE_AVX512
7778
int MKL_ENABLE_AVX2
7879
int MKL_ENABLE_AVX2_E1
7980
int MKL_ENABLE_SSE4_2
81+
int MKL_ENABLE_AVX10
8082

8183
# MPI Implementation Constants
8284
int MKL_BLACS_CUSTOM

mkl/_mkl_service.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,10 +773,12 @@ cdef object __enable_instructions(isa=None) except *:
773773
"avx512_e3": mkl.MKL_ENABLE_AVX512_E3,
774774
"avx512_e2": mkl.MKL_ENABLE_AVX512_E2,
775775
"avx512_e1": mkl.MKL_ENABLE_AVX512_E1,
776+
"avx512_e5": mkl.MKL_ENABLE_AVX512_E5,
776777
"avx512": mkl.MKL_ENABLE_AVX512,
777778
"avx2_e1": mkl.MKL_ENABLE_AVX2_E1,
778779
"avx2": mkl.MKL_ENABLE_AVX2,
779780
"sse4_2": mkl.MKL_ENABLE_SSE4_2,
781+
"avx10": mkl.MKL_ENABLE_AVX10,
780782
},
781783
}
782784
cdef int c_mkl_isa = __mkl_str_to_int(isa, __variables["input"])

mkl/tests/test_mkl_service.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,24 @@ def test_cbwr_get_auto_branch():
247247
mkl.cbwr_get_auto_branch()
248248

249249

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

257264

258-
def test_enable_instructions_sse4_2():
259-
mkl.enable_instructions("sse4_2")
265+
@pytest.mark.parametrize("isa", instructions)
266+
def test_enable_instructions(isa):
267+
mkl.enable_instructions(isa)
260268

261269

262270
def test_set_env_mode():

0 commit comments

Comments
 (0)