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

Function GetDernormalState

tensorflow/core/platform/denormal.cc:60–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60static std::pair<bool, bool> GetDernormalState() {
61 // For now, we flush denormals only on SSE 3. Other architectures such as ARM
62 // can be added as needed.
63
64#ifdef DENORM_USE_INTRINSICS
65 if (TestCPUFeature(SSE3)) {
66 // Save existing flags
67 bool flush_zero_mode = _MM_GET_FLUSH_ZERO_MODE() == _MM_FLUSH_ZERO_ON;
68 bool denormals_zero_mode =
69 _MM_GET_DENORMALS_ZERO_MODE() == _MM_DENORMALS_ZERO_ON;
70 return {flush_zero_mode, denormals_zero_mode};
71 }
72#endif
73 return {false, false};
74}
75
76ScopedRestoreFlushDenormalState::ScopedRestoreFlushDenormalState() {
77 std::tie(flush_zero_mode_, denormals_zero_mode_) = GetDernormalState();

Callers 1

Calls 1

TestCPUFeatureFunction · 0.85

Tested by

no test coverage detected