diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-09-21 23:31:03 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-21 11:31:03 -0400 |
| commit | 65e1a5be6d2c1a470df93eff5dd8cd04589485da (patch) | |
| tree | d015c1a7ed84a11df6ec21ed718bf974db4d5f3c /source/slang | |
| parent | c31f456bce65c897e15b1a429e38b34fafff44e6 (diff) | |
fix warnings (#3224)
* Remove unused variable
* Remove unused variable
* Remove unused if bindings
Diffstat (limited to 'source/slang')
| -rw-r--r-- | source/slang/slang-ir-check-differentiability.cpp | 4 | ||||
| -rw-r--r-- | source/slang/slang-ir-constexpr.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-ir-glsl-legalize.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-ir-pytorch-cpp-binding.cpp | 11 | ||||
| -rw-r--r-- | source/slang/slang-ir-validate.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 2 |
6 files changed, 7 insertions, 16 deletions
diff --git a/source/slang/slang-ir-check-differentiability.cpp b/source/slang/slang-ir-check-differentiability.cpp index 8f01a574f..8124f9210 100644 --- a/source/slang/slang-ir-check-differentiability.cpp +++ b/source/slang/slang-ir-check-differentiability.cpp @@ -274,14 +274,11 @@ public: InstHashSet expectDiffSet(funcInst->getModule()); InstHashSet carryNonTrivialDiffSet(funcInst->getModule()); - int differentiableOutputs = 0; bool isDifferentiableReturnType = false; for (auto param : funcInst->getFirstBlock()->getParams()) { if (isDifferentiableType(diffTypeContext, param->getFullType())) { - if (as<IROutTypeBase>(param->getFullType())) - differentiableOutputs++; produceDiffSet.add(param); carryNonTrivialDiffSet.add(param); } @@ -290,7 +287,6 @@ public: { if (isDifferentiableType(diffTypeContext, funcType->getResultType())) { - differentiableOutputs++; isDifferentiableReturnType = true; } } diff --git a/source/slang/slang-ir-constexpr.cpp b/source/slang/slang-ir-constexpr.cpp index 5731238ee..6e56ebd96 100644 --- a/source/slang/slang-ir-constexpr.cpp +++ b/source/slang/slang-ir-constexpr.cpp @@ -272,7 +272,7 @@ bool isUnrollableLoop(IRLoop* loop) if (!isConstExpr(ifElse->getCondition())) return false; } - else if (auto switchInst = as<IRSwitch>(block->getTerminator())) + else if (as<IRSwitch>(block->getTerminator())) { if (!isConstExpr(ifElse->getCondition())) return false; diff --git a/source/slang/slang-ir-glsl-legalize.cpp b/source/slang/slang-ir-glsl-legalize.cpp index b94afe611..590404bf3 100644 --- a/source/slang/slang-ir-glsl-legalize.cpp +++ b/source/slang/slang-ir-glsl-legalize.cpp @@ -1519,7 +1519,7 @@ ScalarizedVal adaptType( val = builder->emitVectorReshape(fromType, val); } } - else if (auto toBasicType = as<IRBasicType>(toType)) + else if (as<IRBasicType>(toType)) { UInt index = 0; val = builder->emitSwizzle(fromVector->getElementType(), val, 1, &index); diff --git a/source/slang/slang-ir-pytorch-cpp-binding.cpp b/source/slang/slang-ir-pytorch-cpp-binding.cpp index c0adef436..c723902de 100644 --- a/source/slang/slang-ir-pytorch-cpp-binding.cpp +++ b/source/slang/slang-ir-pytorch-cpp-binding.cpp @@ -522,11 +522,6 @@ void generateReflectionFunc(IRBuilder* builder, IRFunc* kernelFunc, IRFunc* host IRInst* generateHostParamForCUDAParam(IRBuilder* builder, IRParam* param, DiagnosticSink* sink, IRType** outType = nullptr) { - auto typeMap = [&](IRType* t) -> IRType* { - if (auto tensorViewType = as<IRTensorViewType>(t)) - return builder->getTorchTensorType(tensorViewType->getElementType()); - }; - auto type = translateToHostType(builder, param->getDataType(), sink); if (outType) *outType = type; @@ -749,7 +744,7 @@ IRFunc* generateCUDAWrapperForFunc(IRFunc* func, DiagnosticSink* sink) builder.addExternCppDecoration(hostFunc, externCppHint->getName()); } - if (auto exportInfoHint = func->findDecoration<IRAutoPyBindExportInfoDecoration>()) + if (func->findDecoration<IRAutoPyBindExportInfoDecoration>()) generateReflectionFunc(&builder, func, hostFunc); return hostFunc; @@ -919,7 +914,7 @@ void generateDerivativeWrappers(IRModule* module, DiagnosticSink* sink) builder.emitReturn(fwdDiffCall); // If the original func is a CUDA kernel, mark the wrapper as a CUDA kernel as well. - if (auto kernelHint = func->findDecoration<IRCudaKernelDecoration>()) + if (func->findDecoration<IRCudaKernelDecoration>()) builder.addCudaKernelDecoration(wrapperFunc); // Add an auto-pybind-cuda decoration to the wrapper function to further generate the @@ -975,7 +970,7 @@ void generateDerivativeWrappers(IRModule* module, DiagnosticSink* sink) builder.emitReturn(fwdDiffCall); // If the original func is a CUDA kernel, mark the wrapper as a CUDA kernel as well. - if (auto kernelHint = func->findDecoration<IRCudaKernelDecoration>()) + if (func->findDecoration<IRCudaKernelDecoration>()) builder.addCudaKernelDecoration(wrapperFunc); // Add an auto-pybind-cuda decoration to the wrapper function to further generate the diff --git a/source/slang/slang-ir-validate.cpp b/source/slang/slang-ir-validate.cpp index d0948fbb1..2973e1ee5 100644 --- a/source/slang/slang-ir-validate.cpp +++ b/source/slang/slang-ir-validate.cpp @@ -346,7 +346,7 @@ namespace Slang // validate its children. validateIRInstChildren(context, inst); - if (auto code = as<IRGlobalValueWithCode>(inst)) + if (as<IRGlobalValueWithCode>(inst)) context->domTree = nullptr; } diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 034178dca..b3a309d5a 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -2124,7 +2124,7 @@ void addVarDecorations( { builder->addFormatDecoration(inst, formatAttr->format); } - else if(auto payloadMod = as<HLSLPayloadModifier>(mod)) + else if(as<HLSLPayloadModifier>(mod)) { builder->addSimpleDecoration<IRHLSLMeshPayloadDecoration>(inst); } |
