-
Notifications
You must be signed in to change notification settings - Fork 787
[ESIMD] Add Simd constructor from simd_view #15174
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
simd(const sycl::ext::oneapi::experimental::simd<Ty, N1> &v) | ||
: simd(static_cast<raw_vector_type>(v)) {} | ||
|
||
// Implicit conversion constructor from simd_view | ||
template <typename BaseTy> | ||
simd(simd_view<BaseTy, region1d_t<Ty, N, 1>> &v) : simd(v.read()) {} |
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 think the read
function is const
, so can we make this a const ref?
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.
It conflicts with simd operator of simd_view
simd(const sycl::ext::oneapi::experimental::simd<Ty, N1> &v) | ||
: simd(static_cast<raw_vector_type>(v)) {} | ||
|
||
// Implicit conversion constructor from simd_view | ||
template <typename BaseTy> | ||
simd(simd_view<BaseTy, region1d_t<Ty, N, 1>> &v) : simd(v.read()) {} |
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.
does this also work with other region types, which I guess could be:
// The region applied on the base object. Its type could be
// - region1d_t
// - region2d_t
// - std::pair<top_region_type, base_region_type>
//
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.
It doesn't and the reason is that it must infer Ty, and N class template parameters from constructor parameter type. While it is doable for 1d case I am not sure how to infer N in 2d case where length is a product of X size and Y Size but doesn't appear as a single parameter that can be inferred.
The interface with pair is even more complicated as it could be a long chain of views with actual size can be inferred only at the very end
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.
So the suggestion is to provide it for 1d first and if there will be an interest we can get back to it
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.
thanks, will review as-is
No description provided.