|
27 | 27 |
|
28 | 28 | extern __DPCPP_SYCL_EXTERNAL float __spirv_RoundFToTF32INTEL(float a);
|
29 | 29 |
|
| 30 | +#ifndef __SPIRV_USE_COOPERATIVE_MATRIX |
30 | 31 | template <typename T, typename Tp, std::size_t R, std::size_t C,
|
31 | 32 | __spv::MatrixUse U,
|
32 | 33 | __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor,
|
@@ -174,6 +175,136 @@ 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 // __SPIRV_USE_COOPERATIVE_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 | + |
| 189 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 190 | + __spv::MatrixUse U, |
| 191 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 192 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 193 | +extern __DPCPP_SYCL_EXTERNAL void __spirv_CooperativeMatrixStoreKHR( |
| 194 | + T *Ptr, __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> *Object, |
| 195 | + __spv::MatrixLayout Layout = L, std::size_t Stride = 0, int MemOperand = 0); |
| 196 | + |
| 197 | +template <typename T, std::size_t R, std::size_t C, __spv::MatrixUse U, |
| 198 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 199 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 200 | +extern __DPCPP_SYCL_EXTERNAL size_t __spirv_CooperativeMatrixLengthKHR( |
| 201 | + __spv::__spirv_CooperativeMatrixKHR<T, S, R, C, U> *); |
| 202 | + |
| 203 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 204 | + __spv::MatrixUse U, |
| 205 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 206 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 207 | +extern __DPCPP_SYCL_EXTERNAL |
| 208 | + __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> * |
| 209 | + __spirv_CooperativeMatrixConstructCheckedINTEL(const T Value, size_t Height, |
| 210 | + size_t Stride, size_t Width, |
| 211 | + size_t CoordX, |
| 212 | + size_t CoordY); |
| 213 | + |
| 214 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 215 | + __spv::MatrixUse U, |
| 216 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 217 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 218 | +extern __DPCPP_SYCL_EXTERNAL |
| 219 | + __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> * |
| 220 | + __spirv_CooperativeMatrixLoadCheckedINTEL(T *Ptr, std::size_t Stride, |
| 221 | + size_t Height, size_t Width, |
| 222 | + size_t CoordX, size_t CoordY, |
| 223 | + __spv::MatrixLayout Layout = L, |
| 224 | + int MemOperand = 0); |
| 225 | + |
| 226 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 227 | + __spv::MatrixUse U, |
| 228 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 229 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 230 | +extern __DPCPP_SYCL_EXTERNAL void __spirv_CooperativeMatrixStoreCheckedINTEL( |
| 231 | + T *Ptr, __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> *Object, |
| 232 | + std::size_t Stride, size_t Height, size_t Width, size_t CoordX, |
| 233 | + size_t CoordY, __spv::MatrixLayout Layout = L, int MemOperand = 0); |
| 234 | + |
| 235 | +template <typename TA, typename TB, typename TC, std::size_t M, std::size_t K, |
| 236 | + std::size_t N, __spv::MatrixUse UA, __spv::MatrixUse UB, |
| 237 | + __spv::MatrixUse UC, |
| 238 | + __spv::MatrixLayout LA = __spv::MatrixLayout::RowMajor, |
| 239 | + __spv::MatrixLayout LB = __spv::MatrixLayout::RowMajor, |
| 240 | + __spv::MatrixLayout LC = __spv::MatrixLayout::RowMajor, |
| 241 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 242 | +extern __DPCPP_SYCL_EXTERNAL |
| 243 | + __spv::__spirv_CooperativeMatrixKHR<TC, S, M, N, UC> * |
| 244 | + __spirv_CooperativeMatrixMulAddKHR( |
| 245 | + __spv::__spirv_CooperativeMatrixKHR<TA, S, M, K, UA> *A, |
| 246 | + __spv::__spirv_CooperativeMatrixKHR<TB, S, K, N, UB> *B, |
| 247 | + __spv::__spirv_CooperativeMatrixKHR<TC, S, M, N, UC> *C, |
| 248 | + size_t Operands = 0); |
| 249 | + |
| 250 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 251 | + __spv::MatrixUse U, |
| 252 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 253 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 254 | +extern __DPCPP_SYCL_EXTERNAL |
| 255 | + __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> * |
| 256 | + __spirv_CompositeConstruct(const T v); |
| 257 | + |
| 258 | +// TODO: replace with __spirv_CooperativeMatrixGetElementCoordINTEL when ready |
| 259 | +template <typename T, std::size_t R, std::size_t C, __spv::MatrixUse U, |
| 260 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 261 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 262 | +extern __DPCPP_SYCL_EXTERNAL __ocl_vec_t<uint32_t, 2> |
| 263 | +__spirv_JointMatrixGetElementCoordINTEL( |
| 264 | + __spv::__spirv_CooperativeMatrixKHR<T, S, R, C, U> *, size_t i); |
| 265 | + |
| 266 | +// AccessChain followed by load/store serves to extract/insert and element |
| 267 | +// from/to the matrix |
| 268 | +template <typename Ts, typename T, std::size_t R, std::size_t C, |
| 269 | + __spv::MatrixUse U, |
| 270 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 271 | +extern __DPCPP_SYCL_EXTERNAL Ts * |
| 272 | +__spirv_AccessChain(__spv::__spirv_CooperativeMatrixKHR<T, S, R, C, U> **, |
| 273 | + size_t i); |
| 274 | + |
| 275 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 276 | + __spv::MatrixUse U, |
| 277 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 278 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 279 | +extern __DPCPP_SYCL_EXTERNAL |
| 280 | + __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> * |
| 281 | + __spirv_CooperativeMatrixConstructCheckedINTEL(int32_t CoordX, |
| 282 | + int32_t CoordY, |
| 283 | + uint32_t Height, |
| 284 | + uint32_t Width, |
| 285 | + const T Value); |
| 286 | + |
| 287 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 288 | + __spv::MatrixUse U, |
| 289 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 290 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 291 | +extern __DPCPP_SYCL_EXTERNAL |
| 292 | + __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> * |
| 293 | + __spirv_CooperativeMatrixLoadCheckedINTEL( |
| 294 | + T *Ptr, int32_t CoordX, int32_t CoordY, __spv::MatrixLayout Layout = L, |
| 295 | + uint32_t Height = 0, uint32_t Width = 0, std::size_t Stride = 0, |
| 296 | + int MemOperand = 0); |
| 297 | + |
| 298 | +template <typename T, typename Tp, std::size_t R, std::size_t C, |
| 299 | + __spv::MatrixUse U, |
| 300 | + __spv::MatrixLayout L = __spv::MatrixLayout::RowMajor, |
| 301 | + __spv::Scope::Flag S = __spv::Scope::Flag::Subgroup> |
| 302 | +extern __DPCPP_SYCL_EXTERNAL void __spirv_CooperativeMatrixStoreCheckedINTEL( |
| 303 | + T *Ptr, int32_t CoordX, int32_t CoordY, |
| 304 | + __spv::__spirv_CooperativeMatrixKHR<Tp, S, R, C, U> *Object, |
| 305 | + __spv::MatrixLayout Layout = L, uint32_t Height = 0, uint32_t Width = 0, |
| 306 | + std::size_t Stride = 0, int MemOperand = 0); |
| 307 | +#endif // __SPIRV_USE_COOPERATIVE_MATRIX |
177 | 308 |
|
178 | 309 | template <typename T>
|
179 | 310 | extern __DPCPP_SYCL_EXTERNAL void __spirv_CooperativeMatrixPrefetchINTEL(
|
|
0 commit comments