<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - clang crashes when compiling OpenCL kernel"
href="https://bugs.freedesktop.org/show_bug.cgi?id=105869#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - clang crashes when compiling OpenCL kernel"
href="https://bugs.freedesktop.org/show_bug.cgi?id=105869">bug 105869</a>
from <span class="vcard"><a class="email" href="mailto:jan.vesely@rutgers.edu" title="Jan Vesely <jan.vesely@rutgers.edu>"> <span class="fn">Jan Vesely</span></a>
</span></b>
<pre>What is the clang/llvm version? I cannot reproduce using clang-5.0.1:
$ cat foo.cl
#pragma OPENCL EXTENSION cl_khr_fp64: enable
kernel void PulseWave(global float* buffer, size_t num_harmonics,
float duty_cycle)
{
size_t index = get_global_id(0);
float phase = buffer[index];
float sample = duty_cycle;
float precompute1 = (phase - duty_cycle / 2.0) * 2.0 * M_PI;
for (size_t i = 1; i <= num_harmonics; ++i)
{
float harmonic = 2.0 / (i * M_PI) * sin(M_PI * i * duty_cycle)
*
cos(i * precompute1);
sample += harmonic;
}
buffer[index] = sample * 2.0 - 1.0;
}
$ clang-5.0 -target amdgcn-mesa-mesa3d -Xclang -mlink-bitcode-file -Xclang
/usr/lib64/clc/carrizo-amdgcn-mesa-mesa3d.bc -include clc/clc.h -S foo.cl
$ clang-5.0 --version
clang version 5.0.1 (tags/RELEASE_501/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>