-
Notifications
You must be signed in to change notification settings - Fork 788
[ESIMD] Add support for vectorizing scalar functions - FE part #3603
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 is one of the few patches to provide a functionality to reuse existing scalar function implementations in a vector context. For example, based on scalar version of `float cos(float)`, implement simd<float,N> cos(simd<float,N>) - "widened" version of the original scalar function. To achieve that, we mark such functions with `sycl_esimd_widen` attribute which will be later used by vector compiler backend to widen it. For now, this functionality will be used only in internal implementation of specific public ESIMD APIs. It is not supposed to be used directly in the user code. It is a temporary solution to enable ESIMD math functions by reusing existing scalar implementations. Later it is supposed to be replaced by a more generic mechanism.
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.
LGTM from my side.
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 just nits from 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.
LGTM, other than the changes already requested by others.
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.
LGTM!
44cc121
This reverts commit 44cc121.
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.
LGTM!
This patch is one of the few patches to provide a functionality to reuse
existing scalar function implementations in a vector context.
For example, based on scalar version of
float cos(float)
, implementsimd<float,N> cos(simd<float,N>) - "widened" version of the original
scalar function.
To achieve that, we mark such functions with
sycl_esimd_widen
attributewhich will be later used by vector compiler backend to widen it.
For now, this functionality will be used only in internal implementation of
specific public ESIMD APIs. It is not supposed to be used directly in the
user code. It is a temporary solution to enable ESIMD math functions by
reusing existing scalar implementations. Later it is supposed to be
replaced by a more generic mechanism.