diff options
| author | Yong He <yonghe@outlook.com> | 2023-09-27 11:36:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-27 11:36:31 -0700 |
| commit | 771b3ef47d48f5277ac9f23ee8a49548a430d107 (patch) | |
| tree | caee840980980d694c0429c40f77c37dd7099bde /source | |
| parent | ebe8ddefc48478307d5f206cd3e40c41d28a36e3 (diff) | |
Avoid make copies of __ref parameters when doing autodiff. (#3242)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-emit-cpp.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-ir-autodiff-fwd.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp index ec797bcf4..81bc2203a 100644 --- a/source/slang/slang-emit-cpp.cpp +++ b/source/slang/slang-emit-cpp.cpp @@ -1041,7 +1041,7 @@ void CPPSourceEmitter::_emitType(IRType* type, DeclaratorInfo* declarator) case kIROp_RefType: { auto ptrType = cast<IRPtrTypeBase>(type); - RefDeclaratorInfo refDeclarator(declarator); + PtrDeclaratorInfo refDeclarator(declarator); _emitType(ptrType->getValueType(), &refDeclarator); } break; diff --git a/source/slang/slang-ir-autodiff-fwd.cpp b/source/slang/slang-ir-autodiff-fwd.cpp index 560f3f64e..2465c1b74 100644 --- a/source/slang/slang-ir-autodiff-fwd.cpp +++ b/source/slang/slang-ir-autodiff-fwd.cpp @@ -1605,7 +1605,7 @@ void insertTempVarForMutableParams(IRModule* module, IRFunc* func) List<IRParam*> params; for (auto param : firstBlock->getParams()) { - if (const auto ptrType = as<IRPtrTypeBase>(param->getDataType())) + if (const auto ptrType = as<IROutTypeBase>(param->getDataType())) { params.add(param); } |
