Skip to content

[SYCL][ESIMD] Implement accessor-based gather/scatter and scalar I/O #2700

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 1 commit into from
Nov 11, 2020

Conversation

kbobrovs
Copy link
Contributor

@kbobrovs kbobrovs commented Oct 28, 2020

This PR implements accessor-based gather/scatter and scalar memory access.
Functional tests: intel/llvm-test-suite#43

Signed-off-by: Konstantin S Bobrovsky [email protected]

/// Load a scalar value from an accessor.
template <typename T, typename AccessorTy, CacheHint L1H = CacheHint::None,
CacheHint L3H = CacheHint::None>
ESIMD_INLINE ESIMD_NODEBUG T load(AccessorTy acc, uint32_t offset) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is basically redundant to SIMD1 gather, which is not commonly used in CM for performance reason. Do we really need to expose a dedicated API for this? The naming is too general and could be a source of confusion, perhaps change to scalar_load to make a clear distinction with block_load.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is basically redundant to SIMD1 gather

This is a convenient shortcut to calling generic gather/scatter. So I don't think it is redundant. scalar_load sounds good.

is not commonly used in CM for performance reason. Do we really need to expose a dedicated API for this?

there are cases when scalar access is needed by algorithm (e.g. haar), so yes, I think we need this API for scalar access via accessors.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK. Please update name to scalar_load/scalar_store.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok


// surface index-based gather/scatter:
// num blocks, scale, surface index, global offset, elem offsets
{"surf_read", {"gather.scaled2", {t(3), c16(0), aSI(1), a(2), a(3)}}},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not map to gather.scaled? It may need general predicate support.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. I'm actually following advice from the BE team (@aus-intel) who recommended to use this one for now. When predication is needed, we can add this w/o breaking user code.

@kbobrovs kbobrovs force-pushed the esimd_acc_gather_scatter branch from 607cb77 to 198e799 Compare November 10, 2020 10:29
@kbobrovs kbobrovs force-pushed the esimd_acc_gather_scatter branch from 198e799 to 4883ae0 Compare November 10, 2020 10:36
@kbobrovs kbobrovs requested a review from kychendev November 10, 2020 15:14
@vladimirlaz vladimirlaz self-assigned this Nov 11, 2020
@vladimirlaz
Copy link
Contributor

Doing compatibility testing. Please do not merge.

@vladimirlaz vladimirlaz merged commit 0aac708 into intel:sycl Nov 11, 2020
@kbobrovs kbobrovs deleted the esimd_acc_gather_scatter branch January 19, 2022 22:54
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.

3 participants