-
Notifications
You must be signed in to change notification settings - Fork 800
[SYCL] Add _invoke_watson
to corecrt STL wrapper
#19897
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
Conversation
Note to reviewers: This error can be reproduced with an existing E2E test, |
@@ -36,6 +36,14 @@ extern "C" inline void __cdecl _invalid_parameter(wchar_t const *, | |||
// Do nothing when called in device code | |||
} | |||
|
|||
extern "C" __declspec(noreturn) void __cdecl |
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.
Can you update the comment at line 22?
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.
I've reworked the entire comment. Hopefully, it is succinct and clear now.
4d71aaf
to
fb445db
Compare
**Problem** `Basic/std_array.cpp` fails to compile with MSVC 19.44.35207.1 with the following error ``` $ ./clang-cl.exe -fsycl -D_DEBUG -fsycl-device-only ./sycl/test-e2e/Basic/std_array.cpp /Od /MDd /Zi /EHsc In file included from ../../sycl/test-e2e/Basic/std_array.cpp:8: In file included from D:\iusers\uagarwal\llvm\build\bin\..\include\sycl/queue.hpp:12: In file included from D:\iusers\uagarwal\llvm\build\bin\..\include\sycl/accessor.hpp:12: In file included from D:\iusers\uagarwal\llvm\build\bin\..\include\sycl/buffer.hpp:14: In file included from D:\iusers\uagarwal\llvm\build\bin\..\include\sycl/detail/common.hpp:17: c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.44.35207/include\array(531,9): error: SYCL kernel cannot call an undefined function without SYCL_EXTERNAL attribute 531 | _STL_VERIFY(_Pos < _Size, "array subscript out of range"); | ^ c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.44.35207/include\yvals.h(259,9): note: expanded from macro '_STL_VERIFY' 259 | _STL_REPORT_ERROR(mesg); \ | ^ c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.44.35207/include\yvals.h(255,5): note: expanded from macro '_STL_REPORT_ERROR' 255 | _MSVC_STL_DOOM_FUNCTION(mesg) | ^ c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.44.35207/include\yvals.h(249,41): note: expanded from macro '_MSVC_STL_DOOM_FUNCTION' 249 | #define _MSVC_STL_DOOM_FUNCTION(mesg) ::_invoke_watson(nullptr, nullptr, nullptr, 0, 0) | ^ c:/Program files (x86)/Windows Kits/10/include/10.0.26100.0/ucrt\corecrt.h(375,23): note: '_invoke_watson' declared here 375 | _ACRTIMP void __cdecl _invoke_watson( | ^ c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.44.35207/include\array(529,39): note: called by 'operator[]' 529 | _NODISCARD _CONSTEXPR17 reference operator[](_In_range_(<, _Size) size_type _Pos) noexcept /* strengthened */ { | ^ 1 error generated. ``` **Solution** Similar to what we did for `_invalid_parameter` (intel#18400), mock `_invoke_watson` in corecrt STL wrapper.
This is a cherry-pick of #19897 **Problem** `Basic/std_array.cpp` fails to compile with MSVC 19.44.35207.1 with the following error ``` $ ./clang-cl.exe -fsycl -D_DEBUG -fsycl-device-only ./sycl/test-e2e/Basic/std_array.cpp /Od /MDd /Zi /EHsc In file included from ../../sycl/test-e2e/Basic/std_array.cpp:8: In file included from D:\iusers\uagarwal\llvm\build\bin\..\include\sycl/queue.hpp:12: In file included from D:\iusers\uagarwal\llvm\build\bin\..\include\sycl/accessor.hpp:12: In file included from D:\iusers\uagarwal\llvm\build\bin\..\include\sycl/buffer.hpp:14: In file included from D:\iusers\uagarwal\llvm\build\bin\..\include\sycl/detail/common.hpp:17: c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.44.35207/include\array(531,9): error: SYCL kernel cannot call an undefined function without SYCL_EXTERNAL attribute 531 | _STL_VERIFY(_Pos < _Size, "array subscript out of range"); | ^ c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.44.35207/include\yvals.h(259,9): note: expanded from macro '_STL_VERIFY' 259 | _STL_REPORT_ERROR(mesg); \ | ^ c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.44.35207/include\yvals.h(255,5): note: expanded from macro '_STL_REPORT_ERROR' 255 | _MSVC_STL_DOOM_FUNCTION(mesg) | ^ c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.44.35207/include\yvals.h(249,41): note: expanded from macro '_MSVC_STL_DOOM_FUNCTION' 249 | #define _MSVC_STL_DOOM_FUNCTION(mesg) ::_invoke_watson(nullptr, nullptr, nullptr, 0, 0) | ^ c:/Program files (x86)/Windows Kits/10/include/10.0.26100.0/ucrt\corecrt.h(375,23): note: '_invoke_watson' declared here 375 | _ACRTIMP void __cdecl _invoke_watson( | ^ c:/Program files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.44.35207/include\array(529,39): note: called by 'operator[]' 529 | _NODISCARD _CONSTEXPR17 reference operator[](_In_range_(<, _Size) size_type _Pos) noexcept /* strengthened */ { | ^ 1 error generated. ``` **Solution** Similar to what we did for `_invalid_parameter` (#18400), mock `_invoke_watson` in corecrt STL wrapper. Patch-by: Udit Kumar Agarwal <udit.agarwal@intel.com>
Problem
Basic/std_array.cpp
fails to compile with MSVC 19.44.35207.1 with the following errorSolution
Similar to what we did for
_invalid_parameter
(#18400), mock_invoke_watson
in corecrt STL wrapper.