-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL] FE support for optional device features. #5166
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
This patch implements 2 new attributes [[sycl::device_has()]] and [[__sycl_detail__::__uses_aspects__()]]. Both attributes accept 0 or more device aspects (cl::sycl::aspect) as arguments. [[sycl::device_has()]] can be applied only to functions. If a function is decorated with this attribute, !intel_declared_aspects metadata, listing the aspects specified in attribute argument, is added to the function metadata. [[__sycl_detail__::__uses_aspects__()]] is an undocumented internal attribute which can be applied to records (type declarations) and function. If a function is decorated with this attribute, !intel_used_aspects metadata, listing the aspects specified in attribute argument, is added to the function metadata. If a record is decorated with this attribute, a named metadata node !intel_types_that_use_aspects is generated. The value of the this metadata is a list of unnamed metadata nodes, each of which describes one type that is decorated with this attribute. The value of each unnamed metadata node starts with a string giving the name of the type which is followed by a list of i32 constants, where each constant is a value from cl::sycl::aspect enum class, telling the numerical value of an aspect from the type's [[sycl_detail::uses_aspects()]] attribute. E.g. !intel_types_that_use_aspects = !{!0, !1, !2} !0 = !{!"class.cl::sycl::detail::half_impl::half", i32 8} !1 = !{!"class.cl::sycl::amx_type", i32 9} !2 = !{!"class.cl::sycl::other_type", i32 8, i32 9} In the example above, the type cl::sycl::detail::half_impl::half uses an aspect whose numerical value is 8 and the type cl::sycl::other_type uses two aspects 8 and 9. Spec: github.com/intel/llvm/blob/sycl/sycl/doc/OptionalDeviceFeatures.md Signed-off-by: Elizabeth Andrews <elizabeth.andrews@intel.com>
Signed-off-by: Elizabeth Andrews <elizabeth.andrews@intel.com>
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.
Mostly looks good to me. Just a couple nits.
…rations Signed-off-by: Elizabeth Andrews <elizabeth.andrews@intel.com>
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.
Changes look good to me.
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.
No more concerns from my side.
Signed-off-by: Elizabeth Andrews <elizabeth.andrews@intel.com>
dc49c74
Thanks for the reviews everyone! |
/summary:run |
@bader is anything holding this up? I believe I've received the required approvals and tests pass. |
The original implementation of this attribute in intel#5166, did not support applying the attribute on the kernel itself. This patch fixes that. The attribute can be applied to the operator method of kernel functor or on the kernel lambda. Signed-off-by: Elizabeth Andrews <elizabeth.andrews@intel.com>
The original implementation of this attribute in #5166, did not support applying the attribute on the kernel itself. This patch fixes that. The attribute can be applied to the operator method of kernel functor or on the kernel lambda. Signed-off-by: Elizabeth Andrews <elizabeth.andrews@intel.com>
This patch implements 2 new attributes [[sycl::device_has()]]
and [[sycl_detail::uses_aspects()]]. Both attributes
accept 0 or more device aspects (cl::sycl::aspect) as arguments.
[[sycl::device_has()]] can be applied only to functions. If a
function is decorated with this attribute, !intel_declared_aspects
metadata, listing the aspects specified in attribute argument, is
added to the function metadata.
[[sycl_detail::uses_aspects()]] is an undocumented internal
attribute which can be applied to records (type declarations) and
function. If a function is decorated with this attribute,
!intel_used_aspects metadata, listing the aspects specified in
attribute argument, is added to the function metadata. If a record
is decorated with this attribute, a named metadata node
!intel_types_that_use_aspects is generated. The value of the this
metadata is a list of unnamed metadata nodes, each of which
describes one type that is decorated with this attribute. The value
of each unnamed metadata node starts with a string giving the name
of the type which is followed by a list of i32 constants, where each
constant is a value from cl::sycl::aspect enum class, telling the
numerical value of an aspect from the type's
[[sycl_detail::uses_aspects()]] attribute.
E.g.
!intel_types_that_use_aspects = !{!0, !1, !2}
!0 = !{!"class.cl::sycl::detail::half_impl::half", i32 8}
!1 = !{!"class.cl::sycl::amx_type", i32 9}
!2 = !{!"class.cl::sycl::other_type", i32 8, i32 9}
In the example above, the type cl::sycl::detail::half_impl::half uses
an aspect whose numerical value is 8 and the type cl::sycl::other_type
uses two aspects 8 and 9.
Spec:
github.com/intel/llvm/blob/sycl/sycl/doc/OptionalDeviceFeatures.md
Signed-off-by: Elizabeth Andrews elizabeth.andrews@intel.com