[SYCL][SPIR-V] Implement fix for Windows/MSVC SPIR-V device target support#208196
Draft
schittir wants to merge 4 commits into
Draft
[SYCL][SPIR-V] Implement fix for Windows/MSVC SPIR-V device target support#208196schittir wants to merge 4 commits into
schittir wants to merge 4 commits into
Conversation
…pport
The following are five gaps identified ing the existing host-adaptation
mechanism in BaseSPIRTargetInfo, causing incorrect behaviour on Windows.
1. SizeType/PtrDiffType/IntPtrType: not copied from host; hardcoded to
LP64 defaults in derived classes, giving 32-bit size_t on Win64.
2. UseMicrosoftManglingForC: never inherited; operator new mangles as
_Znwm (unsigned long) instead of _Znwy (unsigned long long).
3. getBuiltinVaListKind(): returns VoidPtr unconditionally instead of
delegating to the host's va_list kind.
4. checkCallingConvention(): rejects host calling conventions
(__vectorcall, __regcall) that device code inherits from shared
headers.
5. Derived-class defaults: unconditionally overwrite host-adapted
values, working on Linux only by coincidence.
This patch extends BaseSPIRTargetInfo's host-adaptation mechanism to
attempt fixing existing issues for Windows support, by copying pointer-related
types from the host, querying for the right mangling, delegating va_list and
calling convention checks to the host, and guarding derived-class fallbacks
behind if(!HostTarget).
This patch also introduces SPIRVPhysicalTargetInfo as a unified base for
spirv32/spirv64 that derives pointer width from the host target when available.
Overall, this patch takes advantage of the existing OS-agnostic aux-triple
mechanism currently used for Linux, to work for Windows without introducing
new triples.
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The following are five gaps identified in the existing host-adaptation mechanism in BaseSPIRTargetInfo, which are causing incorrect behaviour on Windows.
This patch extends BaseSPIRTargetInfo's host-adaptation mechanism to attempt fixing existing issues for Windows support, by copying pointer-related types from the host, querying for the right mangling, delegating va_list and calling convention checks to the host, and guarding derived-class fallbacks behind if(!HostTarget).
This patch also introduces SPIRVPhysicalTargetInfo as a unified base for spirv32/spirv64 that derives pointer width from the host target when available.
Overall, this patch attempts to fix issues and take advantage of the existing OS-agnostic aux-triple mechanism used for Linux, to work for Windows too, without introducing new triples.