<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68859>68859</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
CUDA code compile error: no member named 'max' in namespace 'std'
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zhiweij1
</td>
</tr>
</table>
<pre>
```
#include <cuda_runtime.h>
const float FP8_E4M3_MAX = 480.0f;
__global__ void foo() {
float max = -10000.f;
float quant_ptr = std::max(max / FP8_E4M3_MAX, 1.0f / 32.f);
}
```
This code can be built by nvcc: https://godbolt.org/z/WTx1fToEP
But cannot be built with clang: https://godbolt.org/z/sqYz9oYPE
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMkktvnDAQxz_NcBkFmTHPA4dNdrlFyiFVmxMyxiyOjL3BJq9PX0FoV82pEjKW5z-_eQrv9dkqVUN2C9kxEksY3Vx_jvpN6eck6lz_UUPO9o8dgR2AuLbSLL1C4Hdy6UU7LzboScUj8NMu2k7prA84GCcCNg9le0rveXt_-IXAj5iWLGYD8NsvbduejeuEaVt8dbrHwTmgEqhCKHYJ7qhJvG-Em4QxxuIr44_gZRE2tJcwbzIfeuAH4IdJvAOVmzc1_yQEdIdJzIbNwCkegKq_VCiO--VbI7bzcdQepesVSmGxU9gt2gTsPtC-Sgn8gGMIF79mQA1Qc3Z950yI3XwGaj6Bmp-P78nw6E4PX8DbJawo68KV9qbDiNIIe_4foH95-qzc08Mp6mveV7wSkaqTvCpYlRJLo7HOE57liRzSdMiKMqvEUIlS5IPIiaTiLNI1MeIJS4gVjBPFAx9EJaTKKUuVlAWkTE1Cm9iY12mNHWnvF1XnZZlVkRGdMn7bKiKr3nAzAtG6ZHO9-tx0y9lDyoz2wV8pQQej6rsfx8PeVDddtFGo5tnNa_HW4aSmTs1oxaR6BCq2uRao7fbkL0Kq9XmdOxXRMpv6W8d0GJculm4CatbI--_mMrtnJQNQs-XrgZqtnt8BAAD__6dI8Xg">