From 984d7f22f8a0909dc870c65bb927094c54f55402 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Thu, 29 May 2025 16:36:49 -0700 Subject: 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,...>::MapElement(functype(...)); - Tuple,...>::MapElement(capturing-lambda); - Tuple,...>::MapElement(not-capturing-lambda); --- source/slang/slang-ir.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/slang-ir.cpp') 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); -- cgit v1.2.3