24
24
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
25
26
26
27
- cimport _mkl_service as mkl
28
27
import six
28
+ cimport _mkl_service as mkl
29
29
30
30
31
31
# Version Information
@@ -260,7 +260,7 @@ cpdef verbose(enable):
260
260
return __verbose(enable)
261
261
262
262
263
- cpdef set_mpi(vendor, custom_library_name):
263
+ cpdef set_mpi(vendor, custom_library_name = None ):
264
264
"""
265
265
Sets the implementation of the message-passing interface to be used by Intel MKL.
266
266
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-set-mpi
@@ -781,7 +781,7 @@ cdef inline __verbose(enable):
781
781
return bool (mkl.mkl_verbose(enable))
782
782
783
783
784
- cdef inline __set_mpi(vendor, custom_library_name):
784
+ cdef inline __set_mpi(vendor, custom_library_name = None ):
785
785
"""
786
786
Sets the implementation of the message-passing interface to be used by Intel MKL.
787
787
https://software.intel.com/en-us/mkl-developer-reference-c-mkl-set-mpi
@@ -801,9 +801,14 @@ cdef inline __set_mpi(vendor, custom_library_name):
801
801
},
802
802
}
803
803
mkl_vendor = __mkl_str_to_int(vendor, __variables[' input' ])
804
-
805
- cdef bytes c_bytes = custom_library_name.encode()
806
- cdef char * c_string = c_bytes
804
+ assert ((vendor is ' custom' and custom_library_name is not None ) or
805
+ (vendor is not ' custom' and custom_library_name is None ))
806
+
807
+ cdef bytes c_bytes
808
+ cdef char * c_string = ' '
809
+ if custom_library_name is not None :
810
+ c_bytes = custom_library_name.encode()
811
+ c_string = c_bytes
807
812
mkl_status = mkl.mkl_set_mpi(mkl_vendor, c_string)
808
813
809
814
status = __mkl_int_to_str(mkl_status, __variables[' output' ])
0 commit comments