-
Notifications
You must be signed in to change notification settings - Fork 131
[SYCL][CUDA] Add unit test for local arguments alignment #608
Conversation
This issue was solved in intel/llvm#5113, local kernel arguments have to be aligned to the type size.
/verify with intel/llvm#5113 |
@npmiller it looks like the test is failing on Linux (OpenCL BE). I have restarted it with the latest compiler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@npmiller could you please fix CI issue reported for OpenCL BE.
[2022-02-10T07:00:45.849Z] ******************** TEST 'SYCL :: Regression/local-arg-align.cpp' FAILED ********************
[2022-02-10T07:00:45.849Z] Script:
[2022-02-10T07:00:45.849Z] --
[2022-02-10T07:00:45.849Z] : 'RUN: at line 1'; /runDir/jenkins-dir/workspace/llvm.obj/bin/clang++ -fsycl -fsycl-targets=spir64 /runDir/jenkins-dir/workspace/llvm-test-suite/SYCL/Regression/local-arg-align.cpp -o /runDir/jenkins-dir/workspace/build/SYCL/Regression/Output/local-arg-align.cpp.tmp.out
[2022-02-10T07:00:45.849Z] : 'RUN: at line 3'; env SYCL_DEVICE_FILTER=host /runDir/jenkins-dir/workspace/build/SYCL/Regression/Output/local-arg-align.cpp.tmp.out
[2022-02-10T07:00:45.849Z] : 'RUN: at line 4'; env SYCL_DEVICE_FILTER=opencl:cpu,host /runDir/jenkins-dir/workspace/build/SYCL/Regression/Output/local-arg-align.cpp.tmp.out
[2022-02-10T07:00:45.849Z] : 'RUN: at line 5'; env SYCL_DEVICE_FILTER=opencl:gpu,host /runDir/jenkins-dir/workspace/build/SYCL/Regression/Output/local-arg-align.cpp.tmp.out
[2022-02-10T07:00:45.849Z] : 'RUN: at line 6'; env SYCL_DEVICE_FILTER=acc /runDir/jenkins-dir/workspace/build/SYCL/Regression/Output/local-arg-align.cpp.tmp.out
[2022-02-10T07:00:45.849Z] --
[2022-02-10T07:00:45.849Z] Exit Code: 255
[2022-02-10T07:00:45.849Z]
[2022-02-10T07:00:45.849Z] Command Output (stdout):
[2022-02-10T07:00:45.849Z] --
[2022-02-10T07:00:45.849Z] $ ":" "RUN: at line 1"
[2022-02-10T07:00:45.849Z] note: command had no output on stdout or stderr
[2022-02-10T07:00:45.849Z] $ "/runDir/jenkins-dir/workspace/llvm.obj/bin/clang++" "-fsycl" "-fsycl-targets=spir64" "/runDir/jenkins-dir/workspace/llvm-test-suite/SYCL/Regression/local-arg-align.cpp" "-o" "/runDir/jenkins-dir/workspace/build/SYCL/Regression/Output/local-arg-align.cpp.tmp.out"
[2022-02-10T07:00:45.849Z] note: command had no output on stdout or stderr
[2022-02-10T07:00:45.849Z] $ ":" "RUN: at line 3"
[2022-02-10T07:00:45.849Z] note: command had no output on stdout or stderr
[2022-02-10T07:00:45.849Z] $ "env" "SYCL_DEVICE_FILTER=host" "/runDir/jenkins-dir/workspace/build/SYCL/Regression/Output/local-arg-align.cpp.tmp.out"
[2022-02-10T07:00:45.849Z] # command output:
[2022-02-10T07:00:45.849Z] Error: incorrect alignment for argument b, required alignment: 32, address: 0x1af3730
[2022-02-10T07:00:45.849Z]
[2022-02-10T07:00:45.849Z] error: command failed with exit status: 255
[2022-02-10T07:00:45.849Z]
[2022-02-10T07:00:45.849Z] --
[2022-02-10T07:00:45.849Z]
[2022-02-10T07:00:45.849Z] ********************
Oh that's interesting, do you have more details on what OpenCL runtime and device is being used in the CI? I've had another look through the test, and I can't really see anything wrong with it, I think this is likely a problem in the OpenCL runtime, or potentially how the SPIR-V binaries are generated, I'll try to see if I can track it down a bit further. |
I'm actually able to reproduce this with the Nvidia OpenCL so I reckon this is likely what the CI also uses. |
Okay, so I have tracked this down, it's actually not an issue with OpenCL at all, it's a host problem. Local accessors for host are allocated as Which is exactly what happens in this test. Replacing this with an aligned allocation on |
Local kernel arguments must be aligned to the type size, simply using `std::vector<char>` doesn't always provide the correct alignment. So this patch adds extra padding to the vector and ensures that the pointer returned for the accessor is actually aligned to the type size. This issue was exposed by: intel/llvm-test-suite#608, which was a follow up to fixing local accessor alignment for the CUDA plugin.
The failing test should be fixed now that intel/llvm#5554 was merged |
will wait till next compiler nightly to ensure that the test will pass with it before merge |
CMPLRTST-15545: fixed git related issue, test driver is able to identify good commit.
This issue was solved in intel/llvm#5113, local kernel arguments have to be aligned to the type size.
…test-suite#608) This issue was solved in intel#5113, local kernel arguments have to be aligned to the type size.
This issue was solved in intel/llvm#5113, local kernel arguments have to
be aligned to the type size.
cc @romanovvlad