# Min and max statements in Mako

**URL:** <https://pyfr.discourse.group/t/min-and-max-statements-in-mako/75>\
**Category:** General\
**Created:** [17 June 2015 14:35 UTC](https://pyfr.discourse.group/t/min-and-max-statements-in-mako/75 "2015-06-17T14:35:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loppi\_Niki](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@Loppi\_Niki](https://pyfr.discourse.group/u/Loppi_Niki)\
**Post date:** [17 June 2015 14:35 UTC](https://pyfr.discourse.group/t/min-and-max-statements-in-mako/75/1 "2015-06-17T14:35:45Z")

</div>

Hi all,

I'm implementing a low Mach fix into the Roe Riemann solver and I'm using min and max statements inside a mako macro. Jin Seok has also used them in the RoeM implementation, however, they are not listed as allowed functionalities in the PyFR developer guide. Does anyone know if they work in all backends?

Thanks,  
Niki

---

<div class="post-metadata">

**Author:** ![Jin\_Seok\_Park](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jin\_Seok\_Park](https://pyfr.discourse.group/u/Jin_Seok_Park)\
**Post date:** [17 June 2015 15:32 UTC](https://pyfr.discourse.group/t/min-and-max-statements-in-mako/75/2 "2015-06-17T15:32:33Z")

</div>

Hi Niki,

I think min/max work. I tested my RoeM for all backend and it works well.

For OpenMP, these are defined in pyfr.backends.openmp.kernels.base.mako.

> From my understanding, min and max are built-in functions for CUDA and OpenCL.

Regards,

Jin Seok

Dr. Jin Seok Park PhD  
Postdoctoral Researcher  
Department of Aeronautics  
Imperial College London  
London, UK, SW7 2AZ

---

<div class="post-metadata">

**Author:** ![Loppi\_Niki](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@Loppi\_Niki](https://pyfr.discourse.group/u/Loppi_Niki)\
**Post date:** [17 June 2015 18:27 UTC](https://pyfr.discourse.group/t/min-and-max-statements-in-mako/75/3 "2015-06-17T18:27:52Z")

</div>

Thanks Jin Seok!

Niki
