Skip to content

[SYCL][ABI-Break] Drop pi::assertion #14624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

AlexeySachkov
Copy link
Contributor

@AlexeySachkov AlexeySachkov commented Jul 18, 2024

This function should not be exported and looking at its uses it seems like they call can be replaced with regular assert or a static_assert without hurting any functionality.

This is patch is essentially a by-product of #14145 and it is done to simplify that change, i.e. PI plugins removal should not be ABI-breaking by itself, we just need to cleanup some of our exported symbols.

This function should not be exported, but looking at its uses it seems
like they call can be replaced with regular `assert` or a
`static_assert` without hurting any functionality.
@AlexeySachkov AlexeySachkov added the abi-break change that's breaking abi and waiting for the next window to be able to merge label Jul 18, 2024
@AlexeySachkov AlexeySachkov requested a review from a team as a code owner July 18, 2024 13:14
// TODO: see if more sanity checks are possible.
sycl::detail::pi::assertion((sizeof(From) == sizeof(To)),
"assert: cast failed size check");
static_assert(sizeof(From) == sizeof(To), "cast failed size check");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could even have performance benefits! 🥳

value.size() == 1,
"Temporary workaround requires that the "
"size of the input vector for make_event be equal to one.");
assert(value.size() == 1 &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically, it's different behavior in release build (where new assert will be simply ignored), but I'm fine with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is more for correctness of our own SYCL RT code an all our tests are done with assertions enabled, so we should be able to catch it early still

@AlexeySachkov
Copy link
Contributor Author

TIMEOUT: SYCL :: OneapiDeviceSelector/sub-devices.cpp (1969 of 2106)
******************** TEST 'SYCL :: OneapiDeviceSelector/sub-devices.cpp' FAILED ********************
Exit Code: -9
Timeout: Reached timeout of 600 seconds

Command Output (stdout):
--
# RUN: at line 9
/__w/llvm/llvm/toolchain/bin//clang++   -fsycl -fsycl-targets=nvptx64-nvidia-cuda  /__w/llvm/llvm/llvm/sycl/test-e2e/OneapiDeviceSelector/sub-devices.cpp -o /__w/llvm/llvm/build-e2e/OneapiDeviceSelector/Output/sub-devices.cpp.tmp.out
# executed command: /__w/llvm/llvm/toolchain/bin//clang++ -fsycl -fsycl-targets=nvptx64-nvidia-cuda /__w/llvm/llvm/llvm/sycl/test-e2e/OneapiDeviceSelector/sub-devices.cpp -o /__w/llvm/llvm/build-e2e/OneapiDeviceSelector/Output/sub-devices.cpp.tmp.out
# note: command had no output on stdout or stderr
# RUN: at line 14
env ONEAPI_DEVICE_SELECTOR="*:*.*" env SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT=1  /__w/llvm/llvm/build-e2e/OneapiDeviceSelector/Output/sub-devices.cpp.tmp.out
# executed command: env 'ONEAPI_DEVICE_SELECTOR=*:*.*' env SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT=1 /__w/llvm/llvm/build-e2e/OneapiDeviceSelector/Output/sub-devices.cpp.tmp.out
# .---command stdout------------
# | 0 devices found.
# `-----------------------------
# RUN: at line 15
env ONEAPI_DEVICE_SELECTOR="*:*.*.*" env SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT=1  /__w/llvm/llvm/build-e2e/OneapiDeviceSelector/Output/sub-devices.cpp.tmp.out
# executed command: env 'ONEAPI_DEVICE_SELECTOR=*:*.*.*' env SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT=1 /__w/llvm/llvm/build-e2e/OneapiDeviceSelector/Output/sub-devices.cpp.tmp.out
# .---command stdout------------
# | 0 devices found.
# `-----------------------------
# error: command failed with exit status: -9
# error: command reached timeout: True

I doubt that it is caused by my changes, but I don't know if that's a known issue or not

@AlexeySachkov
Copy link
Contributor Author

I've reported the failure in #14653. Considering that this patch should effectively be a non-functional change, I will proceed with the merge.

@AlexeySachkov AlexeySachkov merged commit d4085bd into intel:sycl Jul 19, 2024
13 of 14 checks passed
@AlexeySachkov AlexeySachkov deleted the private/asachkov/remove-pi-assertion branch October 9, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abi-break change that's breaking abi and waiting for the next window to be able to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants