From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 105869] clang crashes when compiling OpenCL kernel Date: Wed, 04 Apr 2018 20:15:57 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2023744581==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id A74646E5DA for ; Wed, 4 Apr 2018 20:15:57 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============2023744581== Content-Type: multipart/alternative; boundary="15228729571.DaA813d.25980" Content-Transfer-Encoding: 7bit --15228729571.DaA813d.25980 Date: Wed, 4 Apr 2018 20:15:57 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D105869 --- Comment #1 from Jan Vesely --- What is the clang/llvm version? I cannot reproduce using clang-5.0.1: $ cat foo.cl=20 #pragma OPENCL EXTENSION cl_khr_fp64: enable kernel void PulseWave(global float* buffer, size_t num_harmonics, float duty_cycle) { size_t index =3D get_global_id(0); float phase =3D buffer[index]; float sample =3D duty_cycle; float precompute1 =3D (phase - duty_cycle / 2.0) * 2.0 * M_PI; for (size_t i =3D 1; i <=3D num_harmonics; ++i) { float harmonic =3D 2.0 / (i * M_PI) * sin(M_PI * i * duty_c= ycle) * cos(i * precompute1); sample +=3D harmonic; } buffer[index] =3D 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 --=20 You are receiving this mail because: You are the assignee for the bug.= --15228729571.DaA813d.25980 Date: Wed, 4 Apr 2018 20:15:57 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 1 on bug 10586= 9 from Jan Vesely
What is the clang/llvm version? I cannot reproduce using clang=
-5.0.1:
$ cat foo.cl=20
#pragma OPENCL EXTENSION cl_khr_fp64: enable

kernel void PulseWave(global float* buffer, size_t num_harmonics,
        float duty_cycle)
{
        size_t index =3D get_global_id(0);
        float phase =3D buffer[index];
        float sample =3D duty_cycle;
        float precompute1 =3D (phase - duty_cycle / 2.0) * 2.0 * M_PI;
        for (size_t i =3D 1; i <=3D num_harmonics; ++i)
        {
                float harmonic =3D 2.0 / (i * M_PI) * sin(M_PI * i * duty_c=
ycle)
*
                        cos(i * precompute1);
                sample +=3D harmonic;
        }
        buffer[index] =3D 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.
= --15228729571.DaA813d.25980-- --===============2023744581== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============2023744581==--