<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Yes, though it has width 80 bits, we're using 128 bit to perform atomic operations on this data (alignment allows us to do that).<br>
<pre class="moz-signature" cols="72">Best regards,
Alexey Bataev
=============
Software Engineer
Intel Compiler Team</pre>
<div class="moz-cite-prefix">15.03.2016 13:15, Stefan Illy via Openmp-dev пишет:<br>
</div>
<blockquote cite="mid:56E7E0CE.3010800@web.de" type="cite">Thanks for the reply, <br>
<br>
in fact "long double" is the x86 extended precision which needs 80 bits (10 bytes) only. It is not a full 128 bit floating point data type (as the quad precision provided by gcc and the Intel compiler).
<br>
Nevertheless, sizeof(long double) gives a value of 16 (due to alignment reasons, I assume); 6 bytes are unused.
<br>
<br>
-- Stefan <br>
<br>
Am 15.03.2016 um 10:43 schrieb Cownie, James H: <br>
<blockquote type="cite">This looks like an inconsistency in our knowledge of LLVM/Clang.
<br>
<br>
Historically LLVM did not support 16 byte floating point, so the OpenMP runtime does not have support for them when compiled with clang (because the necessary routines couldn't be compiled!).
<br>
<br>
If your code really is using 16 byte floating point numbers, then the tests in the runtime that don't compile those routines need to be enabled.
<br>
<br>
It'd be worth checking, though, that the "long double" really is 16 bytes, so maybe you could just check sizeof(real_t).
<br>
<br>
p.s. You don't need to initialize max_val; whatever value you put there will be ignored anyway, since the OpenMP standard says that the per-thread reduction values are initialized with the most negative value of the type.
<br>
</blockquote>
Thanks for the hint - I was not aware of that! <br>
<br>
<blockquote type="cite"><br>
-- Jim <br>
<br>
James Cownie <a class="moz-txt-link-rfc2396E" href="mailto:james.h.cownie@intel.com">
<james.h.cownie@intel.com></a> <br>
SSG/DPD/TCAR (Technical Computing, Analyzers and Runtimes) <br>
Tel: +44 117 9071438 <br>
<br>
-----Original Message----- <br>
From: Openmp-dev [<a class="moz-txt-link-freetext" href="mailto:openmp-dev-bounces@lists.llvm.org">mailto:openmp-dev-bounces@lists.llvm.org</a>] On Behalf Of Stefan Illy via Openmp-dev
<br>
Sent: Friday, March 11, 2016 7:36 AM <br>
To: <a class="moz-txt-link-abbreviated" href="mailto:openmp-dev@lists.llvm.org">openmp-dev@lists.llvm.org</a>
<br>
Subject: [Openmp-dev] Bug in clang/openmp: max-reduction fails if data type is "long double"
<br>
<br>
Hello everybody, <br>
<br>
When I compile the simple test program attached below I get the <br>
following error message: <br>
<br>
openmpbug.cc:(.text+0x2de): undefined reference to <br>
`__sync_val_compare_and_swap_16' <br>
openmpbug.cc:(.text+0x3a7): undefined reference to <br>
`__sync_val_compare_and_swap_16' <br>
clang-3.8: error: linker command failed with exit code 1 (use -v to see <br>
invocation) <br>
<br>
This is caused by the OMP max-reduction statement. It also fails if I <br>
switch from "max" to "min". <br>
I use version 3.8 of clang on an Ubuntu 14.04 LTS system. It also fails <br>
with version 3.9 (trunk, self-compiled). <br>
If I switch the floating point data type (real_t) from "long double" to <br>
"double" or "float", the code compiles and runs without problems. <br>
<br>
I hope this helps to make clang+openmp even better! <br>
<br>
<br>
Here comes the simple test program: <br>
---------------------------------------SNIP-------------------------------------------
<br>
#include <iostream> <br>
<br>
using namespace std; <br>
<br>
//typedef float real_t; <br>
//typedef double real_t; <br>
typedef long double real_t; <br>
<br>
int <br>
main() <br>
{ <br>
    real_t maxval = -1.0e-10; <br>
#pragma omp parallel for reduction(max: maxval) <br>
    for (int i = 1; i <= 1000; i++) maxval = max(maxval, real_t(i)); <br>
    cout << maxval << endl; <br>
    return 0; <br>
} <br>
------------------------------------SNIP------------------------------------------------
<br>
<br>
--------------------------------------------------------------------- <br>
Intel Corporation (UK) Limited <br>
Registered No. 1134945 (England) <br>
Registered Office: Pipers Way, Swindon SN3 1RJ <br>
VAT No: 860 2173 47 <br>
<br>
This e-mail and any attachments may contain confidential material for <br>
the sole use of the intended recipient(s). Any review or distribution <br>
by others is strictly prohibited. If you are not the intended <br>
recipient, please contact the sender and delete all copies. <br>
<br>
</blockquote>
<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre wrap="">_______________________________________________
Openmp-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Openmp-dev@lists.llvm.org">Openmp-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>