-
Notifications
You must be signed in to change notification settings - Fork 795
[ESIMD] Refactor esimd intrinsic mapping to BE intrinsics. #4720
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
c3aaa91
to
cf61023
Compare
This patch - makes names and parameter lists of __esimd* intrinsics match their @llvm.genx counterparts. The benefits are: * this removes the extra logical translation layer between __esimd* and @llvm.genx thus simplifying overall user-level esimd intrinsic translation * allows to reuse lots of functionality between SLM and surface memory accesses - moves some of the translations and argument setting (like accessor field to surface index, setting scale) from LowerESIMD.cpp to the ESIMD headers, which simplifies code base. - for all memory intrinsics moves host and device implementations to the same intrinsic function prototype separating them via __SYCL_DEVICE_ONLY__ macro thus avoiding duplication of the prototypes - removes certain redundant __esimd* intrinsics, such as SLM memory accesses (which are normal surface accesses with special surface index 254), and __esimd_reduced_fmax,... which have the same functionality as usual fmax,... This is also a preparatory step for fixing SLM memory accesses (revising vector lengths, element types restirictions) Signed-off-by: Konstantin S Bobrovsky <[email protected]>
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
8d51cac
to
abf8a6a
Compare
@vladimirlaz, @bader - for some reason buildbot/sycl-ubu-x64-pr testing can't proceed. Can you please take a look? |
|
@kbobrovs, please, contact tools team for the issues with Buildbot/Jenkins CI testing. |
template <typename AccessorTy> | ||
ESIMD_INLINE ESIMD_NODEBUG SurfaceIndex get_surface_index(AccessorTy acc) { | ||
#ifdef __SYCL_DEVICE_ONLY__ | ||
if constexpr (std::is_same_v<detail::LocalAccessorMarker, AccessorTy>) { |
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.
While trying to revise memory_intrin.hpp
(#4748) for ESIMD_EMU support, I cannot find out how SLM_BTI
value can be passed to SLM feature implementation for ESIMD_EMU support (host mode currently). Am I missing something?
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.
SLM_BTI can be passed to __esimd* memory intrinsics w/o problems.
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.
HOW can SLM_BTI be passed to SLM intrinsic implementations for host mode? The only return detail::SLM_BTI
line is enclosed by #ifdef __SYCL_DEVICE_ONLY
- line 52 of this file.
And, in line 66 of this file, the wrapping macro is dummy one for host mode compilation. This means
const auto si = __ESIMD_GET_SURF_HANDLE(detail::LocalAccessorMarker());
at line 793 becomes
const auto si = detail::LocalAccessorMarker();
for host mode.
This patch
@llvm.genx counterparts. The benefits are:
@llvm.genx thus simplifying overall user-level esimd intrinsic translation
accesses
surface index, setting scale) from LowerESIMD.cpp to the ESIMD headers, which
simplifies code base.
intrinsic function prototype separating them via SYCL_DEVICE_ONLY macro
thus avoiding duplication of the prototypes
(which are normal surface accesses with special surface index 254), and
__esimd_reduced_fmax,... which have the same functionality as usual fmax,...
This is also a preparatory step for fixing SLM memory accesses (revising vector
lengths, element types restirictions)
Signed-off-by: Konstantin S Bobrovsky [email protected]