[Bug 105869] clang crashes when compiling OpenCL kernel

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Apr 4 20:15:57 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=105869

--- Comment #1 from Jan Vesely <jan.vesely at rutgers.edu> ---
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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180404/4fa7331e/attachment.html>


More information about the dri-devel mailing list