[Beignet] Problems compiling the OCL20 branch
Pan, Xiuli
xiuli.pan at intel.com
Thu Oct 27 01:33:36 UTC 2016
Hi Jesper,
It is a known issue that clang will have some error with our codes, you can try to have some patches on Beignet code and here are some references from master branch:
https://cgit.freedesktop.org/beignet/commit/?id=c7d3c107303f5b511087aa37d20811bbd3bb4565
https://cgit.freedesktop.org/beignet/commit/?id=cba0180d9cd40dd71fba2e2858944a13f81c162d
https://cgit.freedesktop.org/beignet/commit/?id=93ff2a4d9a88ade24dd80fa5a935b6eeaa18e897
Thanks
Xiuli
-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Jesper Puge (s113443)
Sent: Thursday, October 27, 2016 1:15 AM
To: Pan, Xiuli <xiuli.pan at intel.com>; beignet at lists.freedesktop.org
Subject: Re: [Beignet] Problems compiling the OCL20 branch
Hi Xiuli
Thanks for the patches. I managed to compile the OCL20 branch and use the shared virtual memory features. I have looked a bit into the generated Gen assembly, which is closer to what I need compared to release 1.2, so I am very happy.
I was not able to compile Beignet itself with the patched LLVM/Clang compiler. Instead I compiled it using GCC but used headers from the patched compiler to build Beignet, and then use the patched compiler to compile OpenCL 2.0 programs.
Is this expected? This is the output from compiling with the Clang:
cd /home/s113443/gpgpu/git/ocl20/build/backend/src && /home/s113443/gpgpu/llvm38/bin/bin/clang++-3.8 -DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND -DLLVM_38 -Dgbe_EXPORTS -I/home/s113443/gpgpu/git/ocl20/build -I/home/s113443/gpgpu/git/ocl20 -I/usr/include/libdrm -I/home/s113443/gpgpu/git/ocl20/build/backend -I/home/s113443/gpgpu/git/ocl20/backend/src/. -funroll-loops -fstrict-aliasing -msse2 -msse3 -mssse3 -msse4.1 -fPIC -Wall -std=c++0x -Wno-invalid-offsetof -fno-rtti -I/home/s113443/gpgpu/llvm38/bin/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DGBE_DEBUG_MEMORY=0 -DGBE_COMPILER_AVAILABLE=1 -fvisibility=hidden -O0 -g -DGBE_DEBUG=1 -fPIC -o CMakeFiles/gbe.dir/llvm/llvm_gen_backend.cpp.o -c /home/s113443/gpgpu/git/ocl20/backend/src/llvm/llvm_gen_backend.cpp
/home/s113443/gpgpu/git/ocl20/backend/src/llvm/llvm_gen_backend.cpp:4067:23: error: variable length array of non-POD element type 'ir::Register'
ir::Register src[argNum];
^
Thanks,
Jesper
> -----Original Message-----
> From: Pan, Xiuli [mailto:xiuli.pan at intel.com]
> Sent: 26. oktober 2016 05:31
> To: Jesper Puge (s113443) <s113443 at student.dtu.dk>;
> beignet at lists.freedesktop.org
> Subject: RE: [Beignet] Problems compiling the OCL20 branch
>
> Hi Jesper,
>
> The OCL20 branch can only build with LLVM3.8+ for some OpenCL 2.0
> features need frontend support, and for LLVM3.8 we need some patch for
> clang. And for LLVM3.9 there are some change we have not merged into
> OCL20 branch. So if you would try the OCL20 branch, I suggest you
> build a llvm 3.8 and I will provide the patch set for clang in another mail.
>
> Thanks
> Xiuli
>
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf
> Of Jesper Puge (s113443)
> Sent: Wednesday, October 26, 2016 5:14 AM
> To: beignet at lists.freedesktop.org
> Subject: [Beignet] Problems compiling the OCL20 branch
>
> Hi,
> I am trying to compile the head of the OCL20 branch to test shared
> virtual memory, but it will not compile.
> I have previously compiled the 1.2 release using LLVM 3.6, but I can
> see API changes in the code that suggest a newer version of LLVM is
> required.
> What version of LLVM is known to work with the branch? Do I need to
> supply any special parameters to CMake to make the build work?
>
> I run cmake with the following command:
> CC=clang-3.6 CXX=clang++-3.6 cmake -
> DCMAKE_VERBOSE_MAKEFILE=true -DCMAKE_BUILD_TYPE=Debug -
> DLLVM_INSTALL_DIR=/usr/bin
> -DCMAKE_C_COMPILER=clang-3.6 -DCOMPILER=LLVM --
> DCMAKE_INSTALL_PREFIX:PATH=/path/to/project/bin ../
>
> The first error I encounter is that it does not know atomic_int:
> cd /home/s113443/gpgpu/git/ocl20/build/backend/src/libocl &&
> /usr/bin/clang-3.6 -cc1 -fno-builtin -ffp-contract=off -cl-kernel-arg-
> info -fblocks -triple spir64 -DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND
> -cl-
> std=CL2.0 -I
> /home/s113443/gpgpu/git/ocl20/build/backend/src/libocl//usr/local/lib/
> be
> igne
> t//include/ -emit-llvm-bc -o
> /home/s113443/gpgpu/git/ocl20/build/backend/src/libocl//usr/local/lib/
> be
> igne
> t//ocl_atom.bc -x cl
> /home/s113443/gpgpu/git/ocl20/build/backend/src/libocl/src/ocl_atom.cl
> In file included from
> /home/s113443/gpgpu/git/ocl20/build/backend/src/libocl/src/ocl_atom.cl
> :1
> 8:
>
> /home/s113443/gpgpu/git/ocl20/build/backend/src/libocl//usr/local/lib/
> be
> igne
> t//include/ocl_atom.h:116:22: error: unknown type name 'atomic_int'
> ATOMIC_GEN_FUNCTIONS(atomic_int, int, 32)
> ^
> I have tried to include stdatomic.h that defines atomic_int, but this
> let to other errors.
>
> Any help on this would be much appreciated.
>
> Best regards,
> Jesper
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list