Skip to content

[SYCL] Enable algorithm support for sub_group #1392

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
merged 17 commits into from
Mar 27, 2020

Conversation

Pennycook
Copy link
Contributor

  • Adds static members to sub_group class.
  • sub_group member functions marked deprecated, to be removed later.
  • SPIR-V helpers expanded to convert SYCL group to SPIR-V scope.

Signed-off-by: John Pennycook john.pennycook@intel.com

@Pennycook Pennycook added the spec extension All issues/PRs related to extensions specifications label Mar 25, 2020
Signed-off-by: John Pennycook <john.pennycook@intel.com>
- sub_group member functions marked deprecated, to be removed later.
- SPIR-V helpers expanded to convert SYCL group to SPIR-V scope.

Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Multiple definition errors again...

Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Takes message as a string.

Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
@Pennycook Pennycook force-pushed the sub-group-algorithms-prototype branch from 8c7725e to 38f2906 Compare March 27, 2020 14:24
Signed-off-by: John Pennycook <john.pennycook@intel.com>
EnableIfIsScalarArithmetic<T> reduce(T x, T init, BinaryOperation op) const {
return op(init, reduce(x, op));
}

template <typename T, class BinaryOperation>
#if __cplusplus >= 201402L
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need this #if anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Other than this small clean-up, the patch looks good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, you're right. Thanks!

Signed-off-by: John Pennycook <john.pennycook@intel.com>
@bader bader merged commit 017af4e into intel:sycl Mar 27, 2020
@Pennycook Pennycook deleted the sub-group-algorithms-prototype branch March 27, 2020 18:56
jsji pushed a commit that referenced this pull request 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 pull request 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
spec extension All issues/PRs related to extensions specifications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants