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

Function SetDenormalState

tensorflow/core/platform/denormal.cc:45–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43namespace port {
44
45static void SetDenormalState(bool flush_zero_mode, bool denormals_zero_mode) {
46 // For now, we flush denormals only on SSE 3. Other architectures such as ARM
47 // can be added as needed.
48
49#ifdef DENORM_USE_INTRINSICS
50 if (TestCPUFeature(SSE3)) {
51 // Restore flags
52 _MM_SET_FLUSH_ZERO_MODE(flush_zero_mode ? _MM_FLUSH_ZERO_ON
53 : _MM_FLUSH_ZERO_OFF);
54 _MM_SET_DENORMALS_ZERO_MODE(denormals_zero_mode ? _MM_DENORMALS_ZERO_ON
55 : _MM_DENORMALS_ZERO_OFF);
56 }
57#endif
58}
59
60static std::pair<bool, bool> GetDernormalState() {
61 // For now, we flush denormals only on SSE 3. Other architectures such as ARM

Callers 3

ScopedFlushDenormalMethod · 0.85

Calls 1

TestCPUFeatureFunction · 0.85

Tested by

no test coverage detected