本文整理汇总了Python中mkl.get_max_threads方法的典型用法代码示例。如果您正苦于以下问题:Python mkl.get_max_threads方法的具体用法?Python mkl.get_max_threads怎么用?Python mkl.get_max_threads使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mkl
的用法示例。
在下文中一共展示了mkl.get_max_threads方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_max_threads
# 需要导入模块: import mkl [as 别名]
# 或者: from mkl import get_max_threads [as 别名]
def get_max_threads(self):
"""Returns the maximum number of threads the solver will use"""
return mkl.get_max_threads()
示例2: get_cpu_count
# 需要导入模块: import mkl [as 别名]
# 或者: from mkl import get_max_threads [as 别名]
def get_cpu_count(self):
max_threads = self.get_max_threads_count()
if self.cpu_count is None:
self.cpu_count = os_cpu_count()
if self.cpu_count > max_threads:
warnings.warn(
("os.cpu_count() returned value of {} greater than mkl.get_max_threads()'s value of {}. "
"Using negative values of worker option may amount to requesting more threads than "
"Intel(R) MKL can acommodate."
).format(self.cpu_count, max_threads))
return self.cpu_count
示例3: get_max_threads_count
# 需要导入模块: import mkl [as 别名]
# 或者: from mkl import get_max_threads [as 别名]
def get_max_threads_count(self):
if self.max_threads_count is None:
self.max_threads_count = mkl.get_max_threads()
return self.max_threads_count