<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 12, 2015 at 8:38 PM, Aaron Watry <span dir="ltr"><<a href="mailto:awatry@gmail.com" target="_blank">awatry@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">LGTM<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 6, 2015 at 7:01 PM, Tom Stellard <span dir="ltr"><<a href="mailto:thomas.stellard@amd.com" target="_blank">thomas.stellard@amd.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is a generic implementation which just calls sqrt.  Targets should<br>
override this if they want a faster implementation.<br>
---<br>
 generic/include/clc/clc.h            |  1 +<br>
 generic/include/clc/math/half_sqrt.h | 31 +++++++++++++++++++++++++++++++<br>
 generic/lib/SOURCES                  |  1 +<br>
 generic/lib/math/<a href="http://half_sqrt.cl" target="_blank">half_sqrt.cl</a>        | 30 ++++++++++++++++++++++++++++++<br>
 generic/lib/math/half_sqrt.inc       | 25 +++++++++++++++++++++++++<br>
 5 files changed, 88 insertions(+)<br>
 create mode 100644 generic/include/clc/math/half_sqrt.h<br>
 create mode 100644 generic/lib/math/<a href="http://half_sqrt.cl" target="_blank">half_sqrt.cl</a><br>
 create mode 100644 generic/lib/math/half_sqrt.inc<br>
<br>
diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h<br>
index 2fb818a..d657cad 100644<br>
--- a/generic/include/clc/clc.h<br>
+++ b/generic/include/clc/clc.h<br>
@@ -48,6 +48,7 @@<br>
 #include <clc/math/fmax.h><br>
 #include <clc/math/fmin.h><br>
 #include <clc/math/fmod.h><br>
+#include <clc/math/half_sqrt.h><br>
 #include <clc/math/hypot.h><br>
 #include <clc/math/log.h><br>
 #include <clc/math/log1p.h><br>
diff --git a/generic/include/clc/math/half_sqrt.h b/generic/include/clc/math/half_sqrt.h<br>
new file mode 100644<br>
index 0000000..5e9c8a9<br>
--- /dev/null<br>
+++ b/generic/include/clc/math/half_sqrt.h<br>
@@ -0,0 +1,31 @@<br>
+/*<br>
+ * Copyright (c) 2014,2015 Advanced Micro Devices, Inc.<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a copy<br>
+ * of this software and associated documentation files (the "Software"), to deal<br>
+ * in the Software without restriction, including without limitation the rights<br>
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
+ * copies of the Software, and to permit persons to whom the Software is<br>
+ * furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice shall be included in<br>
+ * all copies or substantial portions of the Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
+ * THE SOFTWARE.<br>
+ */<br>
+<br>
+#undef half_sqrt<br>
+<br>
+#define __CLC_BODY <clc/math/unary_decl.inc><br>
+#define __CLC_FUNCTION half_sqrt<br>
+<br>
+#include <clc/math/gentype.inc><br>
+<br>
+#undef __CLC_BODY<br>
+#undef __CLC_FUNCTION<br>
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES<br>
index 9ac2c05..fb56135 100644<br>
--- a/generic/lib/SOURCES<br>
+++ b/generic/lib/SOURCES<br>
@@ -64,6 +64,7 @@ math/<a href="http://copysign.cl" target="_blank">copysign.cl</a><br>
 math/<a href="http://cos.cl" target="_blank">cos.cl</a><br>
 math/<a href="http://exp.cl" target="_blank">exp.cl</a><br>
 math/<a href="http://exp10.cl" target="_blank">exp10.cl</a><br>
+math/<a href="http://half_sqrt.cl" target="_blank">half_sqrt.cl</a><br></blockquote></div></div></div></div></blockquote><div><br></div><div>I didn't notice this before, but the <a href="http://half_sqrt.cl">half_sqrt.cl</a> line is not sorted alphabetically.<br><br></div><div>The same issue exists in patch 7 (for half_rsqrt).<br></div><div><br></div><div>--Aaron<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 math/<a href="http://fmax.cl" target="_blank">fmax.cl</a><br>
 math/<a href="http://fmin.cl" target="_blank">fmin.cl</a><br>
 math/<a href="http://fmod.cl" target="_blank">fmod.cl</a><br>
diff --git a/generic/lib/math/<a href="http://half_sqrt.cl" target="_blank">half_sqrt.cl</a> b/generic/lib/math/<a href="http://half_sqrt.cl" target="_blank">half_sqrt.cl</a><br>
new file mode 100644<br>
index 0000000..e1716cf<br>
--- /dev/null<br>
+++ b/generic/lib/math/<a href="http://half_sqrt.cl" target="_blank">half_sqrt.cl</a><br>
@@ -0,0 +1,30 @@<br>
+/*<br>
+ * Copyright (c) 2014,2015 Advanced Micro Devices, Inc.<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a copy<br>
+ * of this software and associated documentation files (the "Software"), to deal<br>
+ * in the Software without restriction, including without limitation the rights<br>
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
+ * copies of the Software, and to permit persons to whom the Software is<br>
+ * furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice shall be included in<br>
+ * all copies or substantial portions of the Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
+ * THE SOFTWARE.<br>
+ */<br>
+<br>
+#include <clc/clc.h><br>
+<br>
+#ifdef cl_khr_fp64<br>
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable<br>
+#endif<br>
+<br>
+#define __CLC_BODY <half_sqrt.inc><br>
+#include <clc/math/gentype.inc><br>
diff --git a/generic/lib/math/half_sqrt.inc b/generic/lib/math/half_sqrt.inc<br>
new file mode 100644<br>
index 0000000..bcdc6a9<br>
--- /dev/null<br>
+++ b/generic/lib/math/half_sqrt.inc<br>
@@ -0,0 +1,25 @@<br>
+/*<br>
+ * Copyright (c) 2014,2015 Advanced Micro Devices, Inc.<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a copy<br>
+ * of this software and associated documentation files (the "Software"), to deal<br>
+ * in the Software without restriction, including without limitation the rights<br>
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
+ * copies of the Software, and to permit persons to whom the Software is<br>
+ * furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice shall be included in<br>
+ * all copies or substantial portions of the Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
+ * THE SOFTWARE.<br>
+ */<br>
+<br>
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE half_sqrt(__CLC_GENTYPE val) {<br>
+  return sqrt(val);<br>
+}<br>
<span><font color="#888888">--<br>
2.0.4<br>
<br>
<br>
_______________________________________________<br>
Libclc-dev mailing list<br>
<a href="mailto:Libclc-dev@pcc.me.uk" target="_blank">Libclc-dev@pcc.me.uk</a><br>
<a href="http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev" target="_blank">http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev</a><br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>