Skip to content

Add a useful warning to warn for any functionality which isn't supported without generic address space #2728

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

Closed
srividya-sundaram opened this issue Nov 3, 2020 · 5 comments · Fixed by #2722
Labels

Comments

@srividya-sundaram
Copy link
Contributor

Input from @rolandschulz

Raw pointers for SYCL_EXTERNAL are prohibited without generic address space. Generic address space doesn't exist in 1.2.1 and is optional in 2020. Our implementation isn't spec compliant to 1.2.1 because we use generic address space (among other).

It seems useless to warn about a detail (SYCL_EXTERNAL with pointers) if the base functionality (pointers using inference rules vs generic address space) isn't implemented spec compliant and the reason for the spec rule is based on the assumption of the implementation.

And this diagnostic has no practical value to users. We aren't warning about something which has any impact for our implementation based on generic address space. And it isn't useful for portability to other implementation. Because this is only a portability concern if the other implementation doesn't support generic address space.

But in that case a useful warning needs to warn for any functionality which isn't supported without generic address space (using the SYCL inference rules instead). This is among other SYCL_EXTERNAL with raw pointer, assignment of raw pointers which can't be inferred (e.g. in conditionals), function ptrs with raw pointers. That warning would allow a user to target implementation which don't support generic address space. And as part of that warning its useful to warn for SYCL_EXTERNAL. But just warning for SYCL_EXTERNAL without also warning for all other features which depend on generic address space is useless.

We might want to create a new issue to add such a useful warning and partially revert this commit and make it a part of such a new optional warning. I'm not sure whether users need that or would just use a different SYCL implementation without generic address space if they need to get diagnostic regarding features not available without generic address space.

@srividya-sundaram
Copy link
Contributor Author

Hi @romanovvlad , this issue was created as a follow up for #2722 to add a new warning based on @rolandschulz's input.
This is not implemented yet, so I am not sure we can close this issue now.

@romanovvlad romanovvlad reopened this Nov 5, 2020
@romanovvlad
Copy link
Contributor

Hi @srividya-sundaram, sorry, not sure how it happened. Reopened.

@romanovvlad
Copy link
Contributor

It seems it happened because I've merged the PR this issue is linked to. https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue

@github-actions
Copy link
Contributor

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be automatically closed in 30 days.

@github-actions github-actions bot added the Stale label Feb 18, 2022
@github-actions
Copy link
Contributor

This issue was closed because it has been stalled for 30 days with no activity. Please, re-open if the issue still exists.

jsji pushed a commit that referenced this issue Oct 10, 2024
This storage class is used for function pointers. It's added as based on cl_intel_function_pointers specification, it is not guaranteed that sizeof(void(*)(void) == sizeof(void *) - to allow consumers use this fact, we cannot say that function pointer belongs to the same storage class as data pointers.

It wasn't added during initial implementation, now it's time to fill this gap. As it would be a breaking change its generation is added only under -spirv-emit-function-ptr-addr-space option. Also SPIR-V consumer may pass this option during reverse translation to get new address space even in a case, when OpConstantFunctionPointerINTEL doesn't reside in CodeSectionINTEL storage class.

Expected behavior:

No option is passed to the forward translation stage and function pointers are in addrspace(9):
no CodeSectionINTEL storage class in SPIR-V
The option is passed to the forward translation stage and function pointers are in addrepace(9):
CodeSectionINTEL storage class is generated
No option is passed to the reverse translation stage: function pointers are in private address space
The option is passed to the reverse translation stage: function pointers are in addrspace(9)
Spec:
https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_function_pointers.asciidoc

The previous approach: #1392

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@46c9eb9ea9b4c6f
jsji pushed a commit that referenced this issue Oct 10, 2024
This storage class is used for function pointers. It's added as based on cl_intel_function_pointers specification, it is not guaranteed that sizeof(void(*)(void) == sizeof(void *) - to allow consumers use this fact, we cannot say that function pointer belongs to the same storage class as data pointers.

It wasn't added during initial implementation, now it's time to fill this gap. As it would be a breaking change its generation is added only under -spirv-emit-function-ptr-addr-space option. Also SPIR-V consumer may pass this option during reverse translation to get new address space even in a case, when OpConstantFunctionPointerINTEL doesn't reside in CodeSectionINTEL storage class.

Expected behavior:

No option is passed to the forward translation stage and function pointers are in addrspace(9):
no CodeSectionINTEL storage class in SPIR-V
The option is passed to the forward translation stage and function pointers are in addrepace(9):
CodeSectionINTEL storage class is generated
No option is passed to the reverse translation stage: function pointers are in private address space
The option is passed to the reverse translation stage: function pointers are in addrspace(9)
Spec:
https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_function_pointers.asciidoc

The previous approach: #1392

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@46c9eb9ea9b4c6f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants