From 65e1a5be6d2c1a470df93eff5dd8cd04589485da Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Thu, 21 Sep 2023 23:31:03 +0800 Subject: fix warnings (#3224) * Remove unused variable * Remove unused variable * Remove unused if bindings --- source/slang/slang-ir-pytorch-cpp-binding.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'source/slang/slang-ir-pytorch-cpp-binding.cpp') 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(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()) + if (func->findDecoration()) 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()) + if (func->findDecoration()) 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()) + if (func->findDecoration()) builder.addCudaKernelDecoration(wrapperFunc); // Add an auto-pybind-cuda decoration to the wrapper function to further generate the -- cgit v1.2.3