Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"` and CNR constants `"avx10"` and `"avx10,strict"` [gh-175](https://github.com/IntelPython/mkl-service/pull/175)
Comment thread
ndgrigorian marked this conversation as resolved.

### 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)
Expand Down
3 changes: 3 additions & 0 deletions mkl/_mkl_service.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Comment thread
ndgrigorian marked this conversation as resolved.
int MKL_CBWR_SUCCESS
int MKL_CBWR_ERR_INVALID_SETTINGS
Expand All @@ -73,10 +74,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
Comment thread
ndgrigorian marked this conversation as resolved.

# MPI Implementation Constants
int MKL_BLACS_CUSTOM
Expand Down
8 changes: 8 additions & 0 deletions mkl/_mkl_service.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
},
}
Expand Down Expand Up @@ -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",
},
Expand All @@ -773,10 +779,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"])
Expand Down
26 changes: 18 additions & 8 deletions mkl/tests/test_mkl_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,15 @@ def check_cbwr(branch, cnr_const):
"avx2",
"avx512",
"avx512_e1",
"avx10",
]


strict = [
"avx2,strict",
"avx512,strict",
"avx512_e1,strict",
"avx10,strict",
]


Expand All @@ -247,16 +249,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():
Expand Down
Loading