Skip to content

Commit db8517f

Browse files
Changed declaration from def to cpdef in public interface
1 parent fc788b2 commit db8517f

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

mkl-service/_mkl_service.pyx

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ cpdef get_version():
3636
return __get_version()
3737

3838

39-
def get_version_string():
39+
cpdef get_version_string():
4040
"""
4141
Returns the Intel MKL version in a character string.
4242
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-get-version-string
@@ -45,55 +45,55 @@ def get_version_string():
4545

4646

4747
# Threading
48-
def set_num_threads(num_threads):
48+
cpdef set_num_threads(num_threads):
4949
"""
5050
Specifies the number of OpenMP* threads to use.
5151
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-set-num-threads
5252
"""
5353
return __set_num_threads(num_threads)
5454

5555

56-
def domain_set_num_threads(num_threads, domain='all'):
56+
cpdef domain_set_num_threads(num_threads, domain='all'):
5757
"""
5858
Specifies the number of OpenMP* threads for a particular function domain.
5959
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-domain-set-num-threads
6060
"""
6161
return __domain_set_num_threads(num_threads, domain)
6262

6363

64-
def set_num_threads_local(num_threads):
64+
cpdef set_num_threads_local(num_threads):
6565
"""
6666
Specifies the number of OpenMP* threads for all Intel MKL functions on the current execution thread.
6767
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-set-num-threads-local
6868
"""
6969
return __set_num_threads_local(num_threads)
7070

7171

72-
def set_dynamic(enable):
72+
cpdef set_dynamic(enable):
7373
"""
7474
Enables Intel MKL to dynamically change the number of OpenMP* threads.
7575
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-set-dynamic
7676
"""
7777
return __set_dynamic(enable)
7878

7979

80-
def get_max_threads():
80+
cpdef get_max_threads():
8181
"""
8282
Gets the number of OpenMP* threads targeted for parallelism.
8383
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-get-max-threads
8484
"""
8585
return __get_max_threads()
8686

8787

88-
def domain_get_max_threads(domain='all'):
88+
cpdef domain_get_max_threads(domain='all'):
8989
"""
9090
Gets the number of OpenMP* threads targeted for parallelism for a particular function domain.
9191
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-domain-get-max-threads
9292
"""
9393
return __domain_get_max_threads(domain)
9494

9595

96-
def get_dynamic():
96+
cpdef get_dynamic():
9797
"""
9898
Determines whether Intel MKL is enabled to dynamically change the number of OpenMP* threads.
9999
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-get-dynamic
@@ -102,7 +102,7 @@ def get_dynamic():
102102

103103

104104
# Timing
105-
def second():
105+
cpdef second():
106106
"""
107107
Returns elapsed time in seconds.
108108
Use to estimate real time between two calls to this function.
@@ -111,7 +111,7 @@ def second():
111111
return __second()
112112

113113

114-
def dsecnd():
114+
cpdef dsecnd():
115115
"""
116116
Returns elapsed time in seconds.
117117
Use to estimate real time between two calls to this function.
@@ -120,31 +120,31 @@ def dsecnd():
120120
return __dsecnd()
121121

122122

123-
def get_cpu_clocks():
123+
cpdef get_cpu_clocks():
124124
"""
125125
Returns elapsed CPU clocks.
126126
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-get-cpu-clocks
127127
"""
128128
return __get_cpu_clocks()
129129

130130

131-
def get_cpu_frequency():
131+
cpdef get_cpu_frequency():
132132
"""
133133
Returns the current CPU frequency value in GHz.
134134
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-get-cpu-frequency
135135
"""
136136
return __get_cpu_frequency()
137137

138138

139-
def get_max_cpu_frequency():
139+
cpdef get_max_cpu_frequency():
140140
"""
141141
Returns the maximum CPU frequency value in GHz.
142142
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-get-max-cpu-frequency
143143
"""
144144
return __get_max_cpu_frequency()
145145

146146

147-
def get_clocks_frequency():
147+
cpdef get_clocks_frequency():
148148
"""
149149
Returns the frequency value in GHz based on constant-rate Time Stamp Counter.
150150
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-get-clocks-frequency
@@ -153,47 +153,47 @@ def get_clocks_frequency():
153153

154154

155155
# Memory Management. See the Intel MKL Developer Guide for more memory usage information.
156-
def free_buffers():
156+
cpdef free_buffers():
157157
"""
158158
Frees unused memory allocated by the Intel MKL Memory Allocator.
159159
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-free-buffers
160160
"""
161161
__free_buffers()
162162

163163

164-
def thread_free_buffers():
164+
cpdef thread_free_buffers():
165165
"""
166166
Frees unused memory allocated by the Intel MKL Memory Allocator in the current thread.
167167
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-thread-free-buffers
168168
"""
169169
__thread_free_buffers()
170170

171171

172-
def disable_fast_mm():
172+
cpdef disable_fast_mm():
173173
"""
174174
Turns off the Intel MKL Memory Allocator for Intel MKL functions to directly use the system malloc/free functions.
175175
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-disable-fast-mm
176176
"""
177177
return __disable_fast_mm()
178178

179179

180-
def mem_stat():
180+
cpdef mem_stat():
181181
"""
182182
Reports the status of the Intel MKL Memory Allocator.
183183
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-mem-stat
184184
"""
185185
return __mem_stat()
186186

187187

188-
def peak_mem_usage(mem_const):
188+
cpdef peak_mem_usage(mem_const):
189189
"""
190190
Reports the peak memory allocated by the Intel MKL Memory Allocator.
191191
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-peak-mem-usage
192192
"""
193193
return __peak_mem_usage(mem_const)
194194

195195

196-
def set_memory_limit(limit):
196+
cpdef set_memory_limit(limit):
197197
"""
198198
On Linux, sets the limit of memory that Intel MKL can allocate for a specified type of memory.
199199
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-set-memory-limit
@@ -202,23 +202,23 @@ def set_memory_limit(limit):
202202

203203

204204
# Conditional Numerical Reproducibility
205-
def cbwr_set(branch=None):
205+
cpdef cbwr_set(branch=None):
206206
"""
207207
Configures the CNR mode of Intel MKL.
208208
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-cbwr-set
209209
"""
210210
return __cbwr_set(branch)
211211

212212

213-
def cbwr_get(cnr_const=None):
213+
cpdef cbwr_get(cnr_const=None):
214214
"""
215215
Returns the current CNR settings.
216216
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-cbwr-get
217217
"""
218218
return __cbwr_get(cnr_const)
219219

220220

221-
def cbwr_get_auto_branch():
221+
cpdef cbwr_get_auto_branch():
222222
"""
223223
Automatically detects the CNR code branch for your platform.
224224
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-cbwr-get-auto-branch
@@ -227,39 +227,39 @@ def cbwr_get_auto_branch():
227227

228228

229229
# Miscellaneous
230-
def enable_instructions(isa=None):
230+
cpdef enable_instructions(isa=None):
231231
"""
232232
Enables dispatching for new Intel architectures or restricts the set of Intel instruction sets available for dispatching.
233233
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-enable-instructions
234234
"""
235235
return __enable_instructions(isa)
236236

237237

238-
def set_env_mode():
238+
cpdef set_env_mode():
239239
"""
240240
Sets up the mode that ignores environment settings specific to Intel MKL. See mkl_set_env_mode(1).
241241
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-set-env-mode
242242
"""
243243
return __set_env_mode()
244244

245245

246-
def get_env_mode():
246+
cpdef get_env_mode():
247247
"""
248248
Query the current environment mode. See mkl_set_env_mode(0).
249249
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-set-env-mode
250250
"""
251251
return __get_env_mode()
252252

253253

254-
def verbose(enable):
254+
cpdef verbose(enable):
255255
"""
256256
Enables or disables Intel MKL Verbose mode.
257257
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-verbose
258258
"""
259259
return __verbose(enable)
260260

261261

262-
def set_mpi(vendor, custom_library_name):
262+
cpdef set_mpi(vendor, custom_library_name):
263263
"""
264264
Sets the implementation of the message-passing interface to be used by Intel MKL.
265265
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-set-mpi
@@ -268,39 +268,39 @@ def set_mpi(vendor, custom_library_name):
268268

269269

270270
# VM Service Functions
271-
def vml_set_mode(accuracy, ftzdaz, errmode):
271+
cpdef vml_set_mode(accuracy, ftzdaz, errmode):
272272
"""
273273
Sets a new mode for VM functions according to the mode parameter and stores the previous VM mode to oldmode.
274274
https://software.intel.com/en-us/mkl-developer-reference-c-vmlsetmode
275275
"""
276276
return __vml_set_mode(accuracy, ftzdaz, errmode)
277277

278278

279-
def vml_get_mode():
279+
cpdef vml_get_mode():
280280
"""
281281
Gets the VM mode.
282282
https://software.intel.com/en-us/mkl-developer-reference-c-vmlgetmode
283283
"""
284284
return __vml_get_mode()
285285

286286

287-
def vml_set_err_status(status):
287+
cpdef vml_set_err_status(status):
288288
"""
289289
Sets the new VM Error Status according to err and stores the previous VM Error Status to olderr.
290290
https://software.intel.com/en-us/mkl-developer-reference-c-vmlseterrstatus
291291
"""
292292
return __vml_set_err_status(status)
293293

294294

295-
def vml_get_err_status():
295+
cpdef vml_get_err_status():
296296
"""
297297
Gets the VM Error Status.
298298
https://software.intel.com/en-us/mkl-developer-reference-c-vmlgeterrstatus
299299
"""
300300
return __vml_get_err_status()
301301

302302

303-
def vml_clear_err_status():
303+
cpdef vml_clear_err_status():
304304
"""
305305
Sets the VM Error Status to VML_STATUS_OK and stores the previous VM Error Status to olderr.
306306
https://software.intel.com/en-us/mkl-developer-reference-c-vmlclearerrstatus

0 commit comments

Comments
 (0)