|
26 | 26 |
|
27 | 27 | extern __DPCPP_SYCL_EXTERNAL float __spirv_RoundFToTF32INTEL(float a); |
28 | 28 |
|
| 29 | +#ifndef USE_COOP_MATRIX |
29 | 30 | template <typename T, typename Tp, std::size_t R, std::size_t C, |
30 | 31 | __spv::MatrixUse U, |
31 | 32 | __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
@@ -174,6 +175,105 @@ template <typename Ts, typename T, std::size_t R, std::size_t C, |
174 | 175 | extern __DPCPP_SYCL_EXTERNAL __spv::__spirv_JointMatrixINTEL<T, R, C, L, S, U> * |
175 | 176 | __spirv_VectorInsertDynamic(__spv::__spirv_JointMatrixINTEL<T, R, C, L, S, U> *, |
176 | 177 | Ts val, size_t i); |
| 178 | +#else // USE_COOP_MATRIX |
| 179 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 180 | + __spv::MatrixUse U, |
| 181 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 182 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 183 | +extern __DPCPP_SYCL_EXTERNAL |
| 184 | + __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> * |
| 185 | + __spirv_CooperativeMatrixLoadKHR(T *Ptr, __spv::MatrixLayout Layout = L, |
| 186 | + std::size_t Stride = 0, |
| 187 | + int MemOperand = 0); |
| 188 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 189 | + __spv::MatrixUse U, |
| 190 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 191 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 192 | +extern __DPCPP_SYCL_EXTERNAL void __spirv_CooperativeMatrixStoreKHR( |
| 193 | + T *Ptr, __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> *Object, |
| 194 | + __spv::MatrixLayout Layout = L, std::size_t Stride = 0, int MemOperand = 0); |
| 195 | + |
| 196 | +template <typename T, std::size_t R, std::size_t C, __spv::MatrixUse U, |
| 197 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 198 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 199 | +extern __DPCPP_SYCL_EXTERNAL size_t __spirv_CooperativeMatrixLengthKHR( |
| 200 | + __spv::__spirv_CooperativeMatrixKHR<T, S, R, C, U> *); |
| 201 | + |
| 202 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 203 | + __spv::MatrixUse U, |
| 204 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 205 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 206 | +extern __DPCPP_SYCL_EXTERNAL |
| 207 | + __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> * |
| 208 | + __spirv_CooperativeMatrixConstructCheckedINTEL(const T Value, size_t Height, |
| 209 | + size_t Stride, size_t Width, |
| 210 | + size_t CoordX, |
| 211 | + size_t CoordY); |
| 212 | + |
| 213 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 214 | + __spv::MatrixUse U, |
| 215 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 216 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 217 | +extern __DPCPP_SYCL_EXTERNAL |
| 218 | + __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> * |
| 219 | + __spirv_CooperativeMatrixLoadCheckedINTEL(T *Ptr, std::size_t Stride, |
| 220 | + size_t Height, size_t Width, |
| 221 | + size_t CoordX, size_t CoordY, |
| 222 | + __spv::MatrixLayout Layout = L, |
| 223 | + int MemOperand = 0); |
| 224 | + |
| 225 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 226 | + __spv::MatrixUse U, |
| 227 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 228 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 229 | +extern __DPCPP_SYCL_EXTERNAL void __spirv_CooperativeMatrixStoreCheckedINTEL( |
| 230 | + T *Ptr, __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> *Object, |
| 231 | + std::size_t Stride, size_t Height, size_t Width, size_t CoordX, |
| 232 | + size_t CoordY, __spv::MatrixLayout Layout = L, int MemOperand = 0); |
| 233 | + |
| 234 | +template <typename TA, typename TB, typename TC, std::size_t M, std::size_t K, |
| 235 | + std::size_t N, __spv::MatrixUse UA, __spv::MatrixUse UB, |
| 236 | + __spv::MatrixUse UC, |
| 237 | + __spv::MatrixLayout LA = __spv::MatrixLayout::RowMajor, |
| 238 | + __spv::MatrixLayout LB = __spv::MatrixLayout::RowMajor, |
| 239 | + __spv::MatrixLayout LC = __spv::MatrixLayout::RowMajor, |
| 240 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 241 | +extern __DPCPP_SYCL_EXTERNAL |
| 242 | + __spv::__spirv_CooperativeMatrixKHR<TC, S, M, N, UC> * |
| 243 | + __spirv_CooperativeMatrixMulAddKHR( |
| 244 | + __spv::__spirv_CooperativeMatrixKHR<TA, S, M, K, UA> *A, |
| 245 | + __spv::__spirv_CooperativeMatrixKHR<TB, S, K, N, UB> *B, |
| 246 | + __spv::__spirv_CooperativeMatrixKHR<TC, S, M, N, UC> *C, |
| 247 | + size_t Operands = 0); |
| 248 | + |
| 249 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 250 | + __spv::MatrixUse U, |
| 251 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 252 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 253 | +extern __DPCPP_SYCL_EXTERNAL |
| 254 | + __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> * |
| 255 | + __spirv_CompositeConstruct(const T v); |
| 256 | + |
| 257 | +template <typename T, std::size_t R, std::size_t C, __spv::MatrixUse U, |
| 258 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 259 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 260 | +extern __DPCPP_SYCL_EXTERNAL __ocl_vec_t<uint32_t, 2> |
| 261 | +__spirv_CooperativeMatrixGetElementCoordINTEL( |
| 262 | + __spv::__spirv_CooperativeMatrixKHR<T, S, R, C, U> *, size_t i); |
| 263 | + |
| 264 | +// AccessChain followed by load/store serves to extract/insert and element |
| 265 | +// from/to the matrix |
| 266 | +template <typename T, std::size_t R, std::size_t C, __spv::MatrixUse U, |
| 267 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 268 | +extern __DPCPP_SYCL_EXTERNAL T * |
| 269 | +__spirv_AccessChain(__spv::__spirv_CooperativeMatrixKHR<T, S, R, C, U> **, |
| 270 | + size_t i); |
| 271 | + |
| 272 | +template <typename T> extern __DPCPP_SYCL_EXTERNAL T __spirv_Load(T *Ptr); |
| 273 | + |
| 274 | +template <typename T> |
| 275 | +extern __DPCPP_SYCL_EXTERNAL void __spirv_Store(T *Ptr, T Obj); |
| 276 | +#endif // USE_COOP_MATRIX |
177 | 277 |
|
178 | 278 | template <typename T> |
179 | 279 | extern __DPCPP_SYCL_EXTERNAL void __spirv_CooperativeMatrixPrefetchINTEL( |
|
0 commit comments