<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jun 15, 2014, at 2:43 PM, Matt Arsenault <<a href="mailto:arsenm2@gmail.com">arsenm2@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>On Jun 11, 2014, at 4:34 PM, Aaron Watry <<a href="mailto:awatry@gmail.com">awatry@gmail.com</a>> wrote:<br><br><blockquote type="cite">v2: use __builtin_inff() and also add nan/huge_val definitions<br><br>Signed-off-by: Aaron Watry <<a href="mailto:awatry@gmail.com">awatry@gmail.com</a>><br>---<br>generic/include/clc/float/definitions.h | 6 ++++++<br>generic/lib/gen_convert.py              | 2 --<br>2 files changed, 6 insertions(+), 2 deletions(-)<br><br>diff --git a/generic/include/clc/float/definitions.h b/generic/include/clc/float/definitions.h<br>index af54fdf..c286bb9 100644<br>--- a/generic/include/clc/float/definitions.h<br>+++ b/generic/include/clc/float/definitions.h<br>@@ -1,3 +1,7 @@<br>+#define INFINITY __builtin_inff()<br>+#define NAN __builtin_nanf()<br>+#define HUGE_VALF __builtin_huge_valf()<br></blockquote><br><br>I’m getting an error when I try to use this. Apparently __builtin_nanf expects a string argument<br><br>4 errors generated.<br>95:          divide<span class="Apple-tab-span" style="white-space: pre;">      </span><span class="Apple-tab-span" style="white-space: pre;">  </span>FAILED -- clBuildProgram() failed: (-11)<br>Log: input.cl:18:40: error: too few arguments to function call, expected 1, have 0<br>              f0 = (float3)( in[3*i], NAN, NAN );<br>                                      ^~~<br>/usr/local/include/clc/float/definitions.h:2:28: note: expanded from macro 'NAN'<br>#define NAN __builtin_nanf()<br>           ~~~~~~~~~~~~~~ ^<br>input.cl:19:41: error: too few arguments to function call, expected 1, have 0<br>              f1 = (float3)( in2[3*i], NAN, NAN );<br>                                       ^~~<br>/usr/local/include/clc/float/definitions.h:2:28: note: expanded from macro 'NAN'<br>#define NAN __builtin_nanf()<br>           ~~~~~~~~~~~~~~ ^<br>input.cl:22:51: error: too few arguments to function call, expected 1, have 0<br>              f0 = (float3)( in[3*i], in[3*i+1], NAN );<br>                                                 ^~~<br>/usr/local/include/clc/float/definitions.h:2:28: note: expanded from macro 'NAN'<br>#define NAN __builtin_nanf()<br>           ~~~~~~~~~~~~~~ ^<br>input.cl:23:53: error: too few arguments to function call, expected 1, have 0<br>              f1 = (float3)( in2[3*i], in2[3*i+1], NAN );<br>                                                   ^~~<br>/usr/local/include/clc/float/definitions.h:2:28: note: expanded from macro 'NAN'<br>#define NAN __builtin_nanf()<br>           ~~~~~~~~~~~~~~ ^</div></blockquote></div><br><div>This needs to be replaced with: </div><div><br></div><div>:#define NAN __builtin_nanf((const __attribute__((address_space(2))) char *)(""))</div></body></html>