Skip to content

[SYCL] Add STL wrapper for corecrt.h and define _invalid_parameter as SYCL_EXTERNAL #18400

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

Open
wants to merge 2 commits into
base: sycl
Choose a base branch
from

Conversation

ianayl
Copy link
Contributor

@ianayl ianayl commented May 10, 2025

In the same vein as #18213, but this PR addresses failures in SYCL benchmarks for sgemm and the "histogram" sample in oneAPI-samples on Windows due to device code calling _invalid_parameter from MSVC's STL. Example failure is from histograms example in oneAPI-samples:

c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.43.34808/include\array(535,9): error: SYCL kernel cannot call an undefined function without SYCL_EXTERNAL attribute
  535 |         _STL_VERIFY(_Pos < _Size, "array subscript out of range");
      |         ^
[...]
c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.43.34808/include\yvals.h(178,7): note: expanded from macro '_STL_CRT_SECURE_INVALID_PARAMETER'
  178 |     ::_invalid_parameter(_CRT_WIDE(#expr), L"", __FILEW__, static_cast<unsigned int>(__LINE__), 0)
      |       ^
c:/Program files (x86)/Windows Kits/10/include/10.0.26100.0/ucrt\corecrt.h(362,27): note: '_invalid_parameter' declared here
  362 |     _ACRTIMP void __cdecl _invalid_parameter(
      |                           ^

This PR wraps corecrt.h and adds SYCL_EXTERNAL to _invalid_parameter during device code pass, in order to allow device code to use _invalid_parameter.

@ianayl ianayl temporarily deployed to WindowsCILock May 10, 2025 18:52 — with GitHub Actions Inactive
@ianayl ianayl temporarily deployed to WindowsCILock May 10, 2025 19:16 — with GitHub Actions Inactive
@ianayl ianayl temporarily deployed to WindowsCILock May 10, 2025 19:16 — with GitHub Actions Inactive
@ianayl ianayl marked this pull request as ready for review May 12, 2025 02:51
@ianayl ianayl requested a review from a team as a code owner May 12, 2025 02:51
@ianayl ianayl requested a review from cperkinsintel May 12, 2025 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant