diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-05-29 16:36:49 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-29 16:36:49 -0700 |
| commit | 984d7f22f8a0909dc870c65bb927094c54f55402 (patch) | |
| tree | ab255bf44e14f6cbaa09522f90b12464f1c6a339 /source/slang/slang-ir.cpp | |
| parent | f4d7954e088966c2ae8618b1cc17aac4d64ef013 (diff) | |
Implement MapElement for CoopMat (#7159)
With this PR, MapElement works for the following signatures:
- CoopMat<...>::MapElement(functype(...));
- CoopMat<...>::MapElement(capturing-lambda);
- CoopMat<...>::MapElement(not-capturing-lambda);
- Tuple<CoopMat<...>,...>::MapElement(functype(...));
- Tuple<CoopMat<...>,...>::MapElement(capturing-lambda);
- Tuple<CoopMat<...>,...>::MapElement(not-capturing-lambda);
Diffstat (limited to 'source/slang/slang-ir.cpp')
| -rw-r--r-- | source/slang/slang-ir.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 6d5bd9a25..85fe2fa04 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -4467,6 +4467,12 @@ IRInst* IRBuilder::emitGetTupleElement(IRType* type, IRInst* tuple, UInt element return emitGetTupleElement(type, tuple, getIntValue(getIntType(), element)); } +IRInst* IRBuilder::emitCoopMatMapElementFunc(IRType* type, IRInst* tuple, IRInst* func) +{ + IRInst* args[] = {tuple, func}; + return emitIntrinsicInst(type, kIROp_CoopMatMapElementIFunc, 2, args); +} + IRInst* IRBuilder::emitMakeResultError(IRType* resultType, IRInst* errorVal) { return emitIntrinsicInst(resultType, kIROp_MakeResultError, 1, &errorVal); |
