# How to set set\_flush\_denormal in C++

**URL:** <https://discuss.pytorch.org/t/how-to-set-set-flush-denormal-in-c/80984>\
**Category:** C++\
**Created:** [May 13, 2020, 7:36am UTC](https://discuss.pytorch.org/t/how-to-set-set-flush-denormal-in-c/80984 "2020-05-13T07:36:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsting](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/bsting/32/11452_2.png) [@bsting](https://discuss.pytorch.org/u/bsting)\
**Post date:** [May 13, 2020, 7:36am UTC](https://discuss.pytorch.org/t/how-to-set-set-flush-denormal-in-c/80984/1 "2020-05-13T07:36:03Z")

</div>

In python, we can set set\_flush\_denormal by calling torch.set\_flush\_denormal(True).  
How to achieve this in C++?

Update:  
I found it by calling torch::globalContext().setFlushDenormal(true); thanks.
