<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 02/25/2015 04:24 PM, Aaron Watry
wrote:<br>
</div>
<blockquote
cite="mid:CAM+GqJY+qBiQCUjGLK0s6_0SgmZ6O+tZemBnwwu_ZN-OY-Q8gA@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div dir="ltr">
<div>
<div>Looks good to me.<br>
<br>
</div>
Do we have a test case for this somewhere?<br>
<br>
</div>
--Aaron<br>
</div>
<div class="gmail_extra"><br>
</div>
</blockquote>
Things like this are the main thing the OpenCL conformance tests are
good at<br>
<br>
<br>
<blockquote
cite="mid:CAM+GqJY+qBiQCUjGLK0s6_0SgmZ6O+tZemBnwwu_ZN-OY-Q8gA@mail.gmail.com"
type="cite">
<div class="gmail_extra">
<div class="gmail_quote">On Tue, Feb 24, 2015 at 2:15 PM, Tom
Stellard <span dir="ltr"><<a moz-do-not-send="true"
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">---<br>
generic/include/clc/clc.h | 1 +<br>
generic/include/clc/geometric/degrees.h | 24
+++++++++++++++++<br>
generic/include/clc/geometric/degrees.inc | 23
++++++++++++++++<br>
generic/lib/SOURCES | 1 +<br>
generic/lib/geometric/<a moz-do-not-send="true"
href="http://degrees.cl" target="_blank">degrees.cl</a>
| 45 +++++++++++++++++++++++++++++++<br>
5 files changed, 94 insertions(+)<br>
create mode 100644 generic/include/clc/geometric/degrees.h<br>
create mode 100644
generic/include/clc/geometric/degrees.inc<br>
create mode 100644 generic/lib/geometric/<a
moz-do-not-send="true" href="http://degrees.cl"
target="_blank">degrees.cl</a><br>
<br>
diff --git a/generic/include/clc/clc.h
b/generic/include/clc/clc.h<br>
index bd92fdb..02ecc1c 100644<br>
--- a/generic/include/clc/clc.h<br>
+++ b/generic/include/clc/clc.h<br>
@@ -110,6 +110,7 @@<br>
<br>
/* 6.11.5 Geometric Functions */<br>
#include <clc/geometric/cross.h><br>
+#include <clc/geometric/degrees.h><br>
#include <clc/geometric/dot.h><br>
#include <clc/geometric/length.h><br>
#include <clc/geometric/normalize.h><br>
diff --git a/generic/include/clc/geometric/degrees.h
b/generic/include/clc/geometric/degrees.h<br>
new file mode 100644<br>
index 0000000..dfccdd3<br>
--- /dev/null<br>
+++ b/generic/include/clc/geometric/degrees.h<br>
@@ -0,0 +1,24 @@<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>
+#define __CLC_BODY <clc/geometric/degrees.inc><br>
+#include <clc/geometric/floatn.inc><br>
diff --git a/generic/include/clc/geometric/degrees.inc
b/generic/include/clc/geometric/degrees.inc<br>
new file mode 100644<br>
index 0000000..c4b2247<br>
--- /dev/null<br>
+++ b/generic/include/clc/geometric/degrees.inc<br>
@@ -0,0 +1,23 @@<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_DECL __CLC_FLOATN degrees(__CLC_FLOATN
x);<br>
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES<br>
index b76fec9..fd90781 100644<br>
--- a/generic/lib/SOURCES<br>
+++ b/generic/lib/SOURCES<br>
@@ -29,6 +29,7 @@ cl_khr_local_int32_extended_atomics/<a
moz-do-not-send="true" href="http://atom_xor.cl"
target="_blank">atom_xor.cl</a><br>
<a moz-do-not-send="true" href="http://convert.cl"
target="_blank">convert.cl</a><br>
common/<a moz-do-not-send="true" href="http://sign.cl"
target="_blank">sign.cl</a><br>
geometric/<a moz-do-not-send="true" href="http://cross.cl"
target="_blank">cross.cl</a><br>
+geometric/<a moz-do-not-send="true"
href="http://degrees.cl" target="_blank">degrees.cl</a><br>
geometric/<a moz-do-not-send="true" href="http://dot.cl"
target="_blank">dot.cl</a><br>
geometric/<a moz-do-not-send="true" href="http://length.cl"
target="_blank">length.cl</a><br>
geometric/<a moz-do-not-send="true"
href="http://normalize.cl" target="_blank">normalize.cl</a><br>
diff --git a/generic/lib/geometric/<a moz-do-not-send="true"
href="http://degrees.cl" target="_blank">degrees.cl</a>
b/generic/lib/geometric/<a moz-do-not-send="true"
href="http://degrees.cl" target="_blank">degrees.cl</a><br>
new file mode 100644<br>
index 0000000..5de56f8<br>
--- /dev/null<br>
+++ b/generic/lib/geometric/<a moz-do-not-send="true"
href="http://degrees.cl" target="_blank">degrees.cl</a><br>
@@ -0,0 +1,45 @@<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>
+#include "../clcmacro.h"<br>
+<br>
+_CLC_OVERLOAD _CLC_DEF float degrees(float radians) {<br>
+ // 180/pi = ~57.29577951308232087685 or
0x1.ca5dc1a63c1f8p+5 or 0x1.ca5dc2p+5F<br>
+ return 0x1.ca5dc2p+5F * radians;<br>
+}<br>
+<br>
+_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float,
degrees, float);<br>
+<br>
+<br>
+#ifdef cl_khr_fp64<br>
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable<br>
+<br>
+_CLC_OVERLOAD _CLC_DEF double degrees(double radians) {<br>
+ // 180/pi = ~57.29577951308232087685 or
0x1.ca5dc1a63c1f8p+5 or 0x1.ca5dc2p+5F<br>
+ return 0x1.ca5dc1a63c1f8p+5 * radians;<br>
+}<br>
+<br>
+_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double,
degrees, double);<br>
+<br>
+#endif<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.0.4<br>
<br>
<br>
_______________________________________________<br>
Libclc-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:Libclc-dev@pcc.me.uk">Libclc-dev@pcc.me.uk</a><br>
<a moz-do-not-send="true"
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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Libclc-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libclc-dev@pcc.me.uk">Libclc-dev@pcc.me.uk</a>
<a class="moz-txt-link-freetext" href="http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev">http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>