MCPcopy Create free account
hub / github.com/numpy/numpy / _opt_info

Function _opt_info

numpy/lib/utils.py:1123–1148  ·  view source on GitHub ↗

Returns a string contains the supported CPU features by the current build. The string format can be explained as follows: - dispatched features that are supported by the running machine end with `*`. - dispatched features that are "not" supported by the running ma

()

Source from the content-addressed store, hash-verified

1121 return result
1122
1123def _opt_info():
1124 """
1125 Returns a string contains the supported CPU features by the current build.
1126
1127 The string format can be explained as follows:
1128 - dispatched features that are supported by the running machine
1129 end with `*`.
1130 - dispatched features that are "not" supported by the running machine
1131 end with `?`.
1132 - remained features are representing the baseline.
1133 """
1134 from numpy.core._multiarray_umath import (
1135 __cpu_features__, __cpu_baseline__, __cpu_dispatch__
1136 )
1137
1138 if len(__cpu_baseline__) == 0 and len(__cpu_dispatch__) == 0:
1139 return ''
1140
1141 enabled_features = ' '.join(__cpu_baseline__)
1142 for feature in __cpu_dispatch__:
1143 if __cpu_features__[feature]:
1144 enabled_features += f" {feature}*"
1145 else:
1146 enabled_features += f" {feature}?"
1147
1148 return enabled_features
1149
1150
1151def drop_metadata(dtype, /):

Callers 1

show_cpu_featuresFunction · 0.90

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected