Summary: | Incorrect result with __attribute__((packed)) | ||
---|---|---|---|
Product: | Beignet | Reporter: | Kai <kai.scorpio> |
Component: | Beignet | Assignee: | Xiuli Pan <xiuli.pan> |
Status: | RESOLVED MOVED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Minimal example to reproduce |
Description
Kai
2016-11-14 12:15:16 UTC
Hi Kai, I have tried your code and there is another error here, and I have fixed this bug. What beinget version your are runing? I will try your version to see if there is the same problem. Thanks Xiuli It happens with 1.2.1 and latest git master (git-75b6f38). What was the error in my example? It seems to work for me (though it might need `-std=c11`). Hi Kai, I will get an assert in compiling the kernel and could not get the result. I think you have built release version? This bug is very complex and not only related to packed structure, it also related to the llvm optimization that on my machine, the structure type was optimized to int3. I have a workaround on llvm 3.8 and I am not sure if it works fine with other llvm and I will send a patch to fix this problem as soon as I figured out which optimization caused the bug. Thanks Xiuli Ah - I think my mistake might be in the LLVM version. I have LLVM 3.9.0, which looking here (https://www.freedesktop.org/wiki/Software/Beignet/) is not officially supported. Hi Kai, Now we support llvm3.9 on master. Could you try again with a debug version to verify if we meet the same problem? Thanks Xiuli Sorry for the long delay. I can confirm that the issue still occurs with the latest version 'OpenCL 1.2 beignet 1.3 (git-989db5f)' and LLVM 3.9.1 on a Release build. Is there an easy way to use a local build of beignet without removing the system install? I have tried the following, but get an error (where <...> is just a long directory name): $ env OPENCL_VENDOR_PATH=<...>/beignet/build LD_LIBRARY_PATH=<...>/beignet/build/backend/src/ ./a.out unable to load /usr/local/lib64/beignet//libgbeinterp.so which is part of the driver, please check! a.out: packbug.c:84: main: Assertion `err == 0' failed. fish: “env OPENCL_VENDOR_PATH=/home/ka…” terminated by signal SIGABRT (Abort) Hi Kai, We found the bug is about the structure is treated as int3 in backend, and as OpenCL spec int3 is treated as int4, such as the alignment and offset. We will meet an assert when use the debug version beignet. If you want to build the program with some standalone beignet but not over through the ICD, you can use some build option like: gcc test.c -o test -L/usr/local/lib/beignet -lcl these will by pass the ICD and using the build and installed beinet, if you did not want to install, maybe you can try the libcl.so in <...>/beignet/build/ and refer the setenv.sh in <...>/beignet/build/utests/ Thanks Xiuli -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/beignet/beignet/issues/26. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.