-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy path_mkl_service.pxd
More file actions
175 lines (155 loc) · 5.35 KB
/
_mkl_service.pxd
File metadata and controls
175 lines (155 loc) · 5.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# Copyright (c) 2018, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Intel Corporation nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ctypedef long long MKL_INT64
ctypedef unsigned long long MKL_UINT64
ctypedef int MKL_INT
cdef extern from "mkl.h" nogil:
# MKL Function Domains Constants
int MKL_DOMAIN_BLAS
int MKL_DOMAIN_FFT
int MKL_DOMAIN_VML
int MKL_DOMAIN_PARDISO
int MKL_DOMAIN_ALL
# MKL Peak Memory Usage Constants
int MKL_PEAK_MEM_ENABLE
int MKL_PEAK_MEM_DISABLE
int MKL_PEAK_MEM
int MKL_PEAK_MEM_RESET
int MKL_MEM_MCDRAM
# CNR Control Constants
int MKL_CBWR_BRANCH
int MKL_CBWR_ALL
int MKL_CBWR_STRICT
int MKL_CBWR_OFF
int MKL_CBWR_BRANCH_OFF
int MKL_CBWR_AUTO
int MKL_CBWR_COMPATIBLE
int MKL_CBWR_SSE2
int MKL_CBWR_SSE4_2
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
int MKL_CBWR_ERR_INVALID_INPUT
int MKL_CBWR_ERR_UNSUPPORTED_BRANCH
int MKL_CBWR_ERR_UNKNOWN_BRANCH
int MKL_CBWR_ERR_MODE_CHANGE_FAILURE
# ISA Constants
int MKL_SINGLE_PATH_ENABLE
int MKL_ENABLE_AVX512_E2
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
int MKL_BLACS_MSMPI
int MKL_BLACS_INTELMPI
int MKL_BLACS_MPICH2
int MKL_BLACS_LASTMPI
# VML Constants
int VML_HA
int VML_LA
int VML_EP
int VML_FTZDAZ_ON
int VML_FTZDAZ_OFF
int VML_ERRMODE_IGNORE
int VML_ERRMODE_ERRNO
int VML_ERRMODE_STDERR
int VML_ERRMODE_EXCEPT
int VML_ERRMODE_CALLBACK
int VML_ERRMODE_DEFAULT
int VML_STATUS_OK
int VML_STATUS_ACCURACYWARNING
int VML_STATUS_BADSIZE
int VML_STATUS_BADMEM
int VML_STATUS_ERRDOM
int VML_STATUS_SING
int VML_STATUS_OVERFLOW
int VML_STATUS_UNDERFLOW
int VML_ACCURACY_MASK
int VML_FTZDAZ_MASK
int VML_ERRMODE_MASK
ctypedef struct MKLVersion:
int MajorVersion
int MinorVersion
int UpdateVersion
char* ProductStatus
char* Build
char* Processor
char* Platform
# MKL support functions
void mkl_get_version(MKLVersion* pv)
void mkl_get_version_string(char* buf, int len)
# Threading
void mkl_set_num_threads(int nth)
int mkl_domain_set_num_threads(int nt, int domain)
int mkl_set_num_threads_local(int nth)
void mkl_set_dynamic(int flag)
int mkl_get_max_threads()
int mkl_domain_get_max_threads(int domain)
int mkl_get_dynamic()
int mkl_get_num_stripes()
void mkl_set_num_stripes(int)
# Timing
float second()
double dsecnd()
void mkl_get_cpu_clocks(MKL_UINT64* clocks)
double mkl_get_cpu_frequency()
double mkl_get_max_cpu_frequency()
double mkl_get_clocks_frequency()
# Memory
void mkl_free_buffers()
void mkl_thread_free_buffers()
int mkl_disable_fast_mm()
MKL_INT64 mkl_mem_stat(int* buf)
MKL_INT64 mkl_peak_mem_usage(int mode)
int mkl_set_memory_limit(int mem_type, size_t limit)
void *mkl_malloc(size_t size, int alignment)
void *mkl_realloc(void *ptr, size_t size)
void *mkl_calloc(size_t num, size_t size, int alignment)
void mkl_free(void *ptr)
# Conditional Numerical Reproducibility
int mkl_cbwr_set(int settings)
int mkl_cbwr_get(int option)
int mkl_cbwr_get_auto_branch()
# Miscellaneous
int mkl_enable_instructions(int isa)
int mkl_set_env_mode(int mode)
int mkl_verbose(int enable)
int mkl_set_mpi(int vendor, const char* custom_library_name)
# VM Service Functions
unsigned int vmlSetMode(unsigned int mode)
unsigned int vmlGetMode()
int vmlSetErrStatus(const MKL_INT status)
int vmlGetErrStatus()
int vmlClearErrStatus()