Skip to content
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

[SYCL][Matrix] Correct Prefetch instruction usage #12623

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions sycl/include/CL/__spirv/spirv_ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ extern __DPCPP_SYCL_EXTERNAL __spv::__spirv_JointMatrixINTEL<T, R, C, L, S, U> *
__spirv_VectorInsertDynamic(__spv::__spirv_JointMatrixINTEL<T, R, C, L, S, U> *,
Ts val, size_t i);

template <typename T, std::size_t NumRows, std::size_t NumCols>
extern __DPCPP_SYCL_EXTERNAL void __spirv_JointMatrixPrefetchINTEL(
T *Ptr, std::size_t coordX, std::size_t coordY, unsigned int CacheLevel,
__spv::MatrixLayout Layout, std::size_t Stride);
template <typename T>
extern __DPCPP_SYCL_EXTERNAL void __spirv_CooperativeMatrixPrefetchINTEL(
T *Ptr, std::size_t coordX, std::size_t coordY, std::size_t NumRows,
std::size_t NumCols, unsigned int CacheLevel, __spv::MatrixLayout Layout,
std::size_t Stride);

#ifndef __SPIRV_BUILTIN_DECLARATIONS__
#error \
Expand Down
5 changes: 3 additions & 2 deletions sycl/include/sycl/ext/oneapi/matrix/matrix-unified.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,9 @@ joint_matrix_prefetch(Group sg, T *Ptr, size_t stride,
// Will be removed once SPIRV implementation also uses offsetpointer
size_t coordX = 0;
size_t coordY = 0;
__spirv_JointMatrixPrefetchINTEL<T, NumRows, NumCols>(
Ptr, coordX, coordY, detail::PropertyMetaInfo<decltype(prop)>::value,
__spirv_CooperativeMatrixPrefetchINTEL<T>(
Ptr, coordX, coordY, NumRows, NumCols,
detail::PropertyMetaInfo<decltype(prop)>::value,
sycl::detail::joint_matrix_layout_to_spv(Layout), stride);
#endif // defined(__NVPTX__)
#else
Expand Down
Loading