@@ -511,6 +511,11 @@ namespace ExperimentalOps {
511511static const OpCodeTableID TableID = OpCodeTableID::ExperimentalOps;
512512// Enumeration for ExperimentalOps DXIL operations
513513enum class OpCode : unsigned {
514+ //
515+ LinAlgMatrixReserved0 = 30 , // reserved
516+ LinAlgMatrixReserved1 = 31 , // reserved
517+ LinAlgMatrixReserved2 = 32 , // reserved
518+
514519 // Group Wave Ops
515520 GetGroupWaveCount = 2 , // returns the number of waves in the thread group
516521 GetGroupWaveIndex = 1 , // returns the index of the wave in the thread group
@@ -523,6 +528,43 @@ enum class OpCode : unsigned {
523528 RayQuery_CommittedTriangleObjectPosition =
524529 9 , // returns committed triangle vertices in object space as <9 x float>
525530
531+ // Linear Algebra Operations
532+ CopyConvertMatrix =
533+ 13 , // Converts and copies the element and use type of the source matrix
534+ // to the destination matrix with optional transpose
535+ CreateMatrix = 11 , // creates a handle to a Matrix
536+ FillMatrix = 12 , // fills a matrix with a scalar value
537+ MatrixAccumulate = 24 , // accumulate A or B matrix into Accumulator matrix
538+ // following LHS += RHS
539+ MatrixAccumulateToDescriptor =
540+ 27 , // accumulates a matrix to a RWByteAddressBuffer
541+ MatrixAccumulateToMemory = 28 , // accumulates a matrix to groupshared memory
542+ MatrixGetCoordinate =
543+ 17 , // returns a two element vector containing the column and row of the
544+ // matrix that the thread-local index corresponds to
545+ MatrixGetElement = 18 , // returns the element of the matrix corresponding to
546+ // the provided thread-local index
547+ MatrixLength = 16 , // returns the number of elements stored in thread-local
548+ // storage on the active thread for the provided matrix
549+ MatrixLoadFromDescriptor =
550+ 14 , // fills a matrix with data from a [RW]ByteAddressBuffer
551+ MatrixLoadFromMemory =
552+ 15 , // fills a matrix with data from a groupshared array
553+ MatrixMulOp =
554+ 23 , // applies a multiplication op to matrix C using A and B as parameters
555+ MatrixOuterProduct = 29 , // Outer products an M sized vector and a K sized
556+ // vector producing an MxK matrix
557+ MatrixQueryAccumulatorLayout = 22 , // returns comptime 0 when accumulator
558+ // matrix are A layout, 1 when B layout
559+ MatrixSetElement = 19 , // sets the element of the matrix corresponding to the
560+ // provided thread-local index
561+ MatrixStoreToDescriptor = 20 , // stores a matrix to a RWByteAddressBuffer
562+ MatrixStoreToMemory = 21 , // stores a matrix to groupshared memory
563+ MatrixVecMul =
564+ 25 , // Multiplies a MxK dimension matrix and a K sized input vector
565+ MatrixVecMulAdd = 26 , // Multiplies a MxK dimension matrix and a K sized input
566+ // vector then adds a M sized bias vector
567+
526568 // No-op
527569 ExperimentalNop = 0 , // nop does nothing
528570
@@ -538,7 +580,7 @@ enum class OpCode : unsigned {
538580 HitObject_TriangleObjectPosition =
539581 10 , // returns triangle vertices in object space as <9 x float>
540582
541- NumOpCodes = 11 , // exclusive last value of enumeration
583+ NumOpCodes = 33 , // exclusive last value of enumeration
542584};
543585} // namespace ExperimentalOps
544586static const unsigned NumOpCodeTables = 2 ;
@@ -1187,6 +1229,66 @@ enum class OpCode : unsigned {
11871229 EXP_OPCODE (ExperimentalOps,
11881230 HitObject_TriangleObjectPosition), // returns triangle vertices in
11891231 // object space as <9 x float>
1232+ EXP_OPCODE (ExperimentalOps, CreateMatrix), // creates a handle to a Matrix
1233+ EXP_OPCODE (ExperimentalOps, FillMatrix), // fills a matrix with a scalar value
1234+ EXP_OPCODE (ExperimentalOps,
1235+ CopyConvertMatrix), // Converts and copies the element and use type
1236+ // of the source matrix to the destination
1237+ // matrix with optional transpose
1238+ EXP_OPCODE (ExperimentalOps,
1239+ MatrixLoadFromDescriptor), // fills a matrix with data from a
1240+ // [RW]ByteAddressBuffer
1241+ EXP_OPCODE (ExperimentalOps, MatrixLoadFromMemory), // fills a matrix with data
1242+ // from a groupshared array
1243+ EXP_OPCODE (
1244+ ExperimentalOps,
1245+ MatrixLength), // returns the number of elements stored in thread-local
1246+ // storage on the active thread for the provided matrix
1247+ EXP_OPCODE (ExperimentalOps,
1248+ MatrixGetCoordinate), // returns a two element vector containing
1249+ // the column and row of the matrix that the
1250+ // thread-local index corresponds to
1251+ EXP_OPCODE (
1252+ ExperimentalOps,
1253+ MatrixGetElement), // returns the element of the matrix corresponding to
1254+ // the provided thread-local index
1255+ EXP_OPCODE (ExperimentalOps,
1256+ MatrixSetElement), // sets the element of the matrix corresponding
1257+ // to the provided thread-local index
1258+ EXP_OPCODE (
1259+ ExperimentalOps,
1260+ MatrixStoreToDescriptor), // stores a matrix to a RWByteAddressBuffer
1261+ EXP_OPCODE (ExperimentalOps,
1262+ MatrixStoreToMemory), // stores a matrix to groupshared memory
1263+ EXP_OPCODE (
1264+ ExperimentalOps,
1265+ MatrixQueryAccumulatorLayout), // returns comptime 0 when accumulator
1266+ // matrix are A layout, 1 when B layout
1267+ EXP_OPCODE (ExperimentalOps,
1268+ MatrixMulOp), // applies a multiplication op to matrix C using A
1269+ // and B as parameters
1270+ EXP_OPCODE (ExperimentalOps,
1271+ MatrixAccumulate), // accumulate A or B matrix into Accumulator
1272+ // matrix following LHS += RHS
1273+ EXP_OPCODE (ExperimentalOps,
1274+ MatrixVecMul), // Multiplies a MxK dimension matrix and a K sized
1275+ // input vector
1276+ EXP_OPCODE (
1277+ ExperimentalOps,
1278+ MatrixVecMulAdd), // Multiplies a MxK dimension matrix and a K sized input
1279+ // vector then adds a M sized bias vector
1280+ EXP_OPCODE (ExperimentalOps,
1281+ MatrixAccumulateToDescriptor), // accumulates a matrix to a
1282+ // RWByteAddressBuffer
1283+ EXP_OPCODE (
1284+ ExperimentalOps,
1285+ MatrixAccumulateToMemory), // accumulates a matrix to groupshared memory
1286+ EXP_OPCODE (ExperimentalOps,
1287+ MatrixOuterProduct), // Outer products an M sized vector and a K
1288+ // sized vector producing an MxK matrix
1289+ EXP_OPCODE (ExperimentalOps, LinAlgMatrixReserved0), // reserved
1290+ EXP_OPCODE (ExperimentalOps, LinAlgMatrixReserved1), // reserved
1291+ EXP_OPCODE (ExperimentalOps, LinAlgMatrixReserved2), // reserved
11901292};
11911293// OPCODE-ENUM:END
11921294#undef EXP_OPCODE
@@ -1342,8 +1444,27 @@ enum class OpCodeClass : unsigned {
13421444 CreateHandleForLib,
13431445
13441446 // Linear Algebra Operations
1447+ CopyConvertMatrix,
1448+ CreateMatrix,
1449+ FillMatrix,
13451450 MatVecMul,
13461451 MatVecMulAdd,
1452+ MatrixAccumulate,
1453+ MatrixAccumulateToDescriptor,
1454+ MatrixAccumulateToMemory,
1455+ MatrixGetCoordinate,
1456+ MatrixGetElement,
1457+ MatrixLength,
1458+ MatrixLoadFromDescriptor,
1459+ MatrixLoadFromMemory,
1460+ MatrixMulOp,
1461+ MatrixOuterProduct,
1462+ MatrixQueryAccumulatorLayout,
1463+ MatrixSetElement,
1464+ MatrixStoreToDescriptor,
1465+ MatrixStoreToMemory,
1466+ MatrixVecMul,
1467+ MatrixVecMulAdd,
13471468 OuterProductAccumulate,
13481469 VectorAccumulate,
13491470
@@ -1532,7 +1653,7 @@ enum class OpCodeClass : unsigned {
15321653 NodeOutputIsValid,
15331654 OutputComplete,
15341655
1535- NumOpClasses = 204 , // exclusive last value of enumeration
1656+ NumOpClasses = 223 , // exclusive last value of enumeration
15361657};
15371658// OPCODECLASS-ENUM:END
15381659
0 commit comments