Skip to content

[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

Merged
merged 6 commits into from
May 5, 2021

Conversation

DenisBakhvalov
Copy link
Contributor

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.

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.
@DenisBakhvalov DenisBakhvalov changed the title [ESIMD] Add support for widening SIMT functions - FE part [ESIMD] Add support for vectorizing scalar functions - FE part Apr 23, 2021
kbobrovs
kbobrovs previously approved these changes Apr 23, 2021
Copy link
Contributor

@kbobrovs kbobrovs left a 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.

Copy link
Contributor

@AaronBallman AaronBallman left a 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.

Copy link
Contributor

@premanandrao premanandrao left a 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.

AaronBallman
AaronBallman previously approved these changes Apr 29, 2021
Copy link
Contributor

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

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

LGTM!

@romanovvlad romanovvlad merged commit 3fc66cc into intel:sycl May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants