MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / torch_parallel_backend

Function torch_parallel_backend

setup.py:57–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55
56
57def torch_parallel_backend():
58 try:
59 match = re.search("^ATen parallel backend: (?P<backend>.*)$", torch._C._parallel_info(), re.MULTILINE)
60 if match is None:
61 return None
62 backend = match.group("backend")
63 if backend == "OpenMP":
64 return "AT_PARALLEL_OPENMP"
65 if backend == "native thread pool":
66 return "AT_PARALLEL_NATIVE"
67 if backend == "native thread pool and TBB":
68 return "AT_PARALLEL_NATIVE_TBB"
69 except (NameError, AttributeError): # no torch or no binaries
70 warnings.warn("Could not determine torch parallel_info.")
71 return None
72
73
74def omp_flags():

Callers 1

get_extensionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…