MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetRuntimeEnabledPaths

Method GetRuntimeEnabledPaths

tensorflow/lite/experimental/ruy/context.cc:27–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27Path Context::GetRuntimeEnabledPaths() {
28 // This function should always return the same value on a given machine.
29 // When runtime_enabled_paths_ has its initial value kNone, it performs
30 // some platform detection to resolve it to specific Path values.
31
32 // Fast path: already resolved.
33 if (runtime_enabled_paths_ != Path::kNone) {
34 return runtime_enabled_paths_;
35 }
36
37 // Need to resolve now. Start by considering all paths enabled.
38 runtime_enabled_paths_ = kAllPaths;
39
40#if RUY_PLATFORM(ARM)
41 // Now selectively disable paths that aren't supported on this machine.
42 if ((runtime_enabled_paths_ & Path::kNeonDotprod) != Path::kNone) {
43 if (!DetectDotprod()) {
44 runtime_enabled_paths_ = runtime_enabled_paths_ ^ Path::kNeonDotprod;
45 // Sanity check.
46 RUY_DCHECK((runtime_enabled_paths_ & Path::kNeonDotprod) == Path::kNone);
47 }
48 }
49#endif
50
51 // Sanity check. We can't possibly have disabled all paths, as some paths
52 // are universally available (kReference, kStandardCpp).
53 RUY_DCHECK(runtime_enabled_paths_ != Path::kNone);
54 return runtime_enabled_paths_;
55}
56
57} // namespace ruy

Callers 3

TestOneNeonDot3x3Function · 0.80
GetCpuFlagsFunction · 0.80
MakeResultPathsMethod · 0.80

Calls 1

DetectDotprodFunction · 0.85

Tested by 2

TestOneNeonDot3x3Function · 0.64
MakeResultPathsMethod · 0.64