├── .clang-format ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.md │ └── enhancement.md └── OWNERS ├── .gitignore ├── .travis.yml ├── BUGS ├── CHANGELOG.md ├── CMakeLists.txt ├── CODE_OWNERS.TXT ├── CONTRIBUTING.md ├── LICENSE.TXT ├── Makefile.am ├── Operator.md ├── README.md ├── VERSION ├── autogen.sh ├── cmake ├── FindGlog.cmake ├── FindMKLDNN.cmake ├── FindProtoBuf.cmake ├── FindSkyPat.cmake ├── Findonnx.cmake ├── ONNCConfig.cmake.in ├── check.cmake ├── check_helper.cmake ├── check_stl_hash.cmake ├── config.guess ├── option.cmake ├── proto.cmake └── try_compile.cc.in ├── configure.ac ├── docs ├── ONNC-Backend-Porting-Guide.md ├── ONNC-C-Backend-Guide.md ├── ONNC-IR-Extension-Guide.md ├── ONNC-Pass-Manager-Getting-Started-Guide.md ├── ONNC-Utilities.md ├── The-Code-Emitting-Pass-User-Guide.md ├── api │ └── statistics.md ├── build.md ├── images │ ├── build_up_onnc.svg │ ├── compile_onnx_models.svg │ ├── gcc_compile_generated_c_files.svg │ ├── preface_architecture.png │ └── run_inference.svg └── onnc.dia ├── example └── runtime │ ├── CMakeLists.txt │ ├── bin │ ├── onnc │ └── pb2t │ ├── include │ └── onnc-runtime.h │ └── src │ ├── CMakeLists.txt │ ├── client-app.c │ ├── client-lib.c │ └── onnc-runtime-core.c ├── include ├── .gitignore ├── CMakeLists.txt ├── Makefile.am └── onnc │ ├── .gitignore │ ├── ADT │ ├── Any.h │ ├── ArcIterator.h │ ├── ArrayRef.h │ ├── BinaryTree.h │ ├── Bits │ │ ├── Any.tcc │ │ ├── Digraph.tcc │ │ ├── DigraphArc.h │ │ ├── DigraphNode.h │ │ ├── DigraphSupport.h │ │ ├── HashBase.h │ │ ├── HashBase.tcc │ │ ├── HashIterator.tcc │ │ ├── HashTable.tcc │ │ ├── IList.tcc │ │ ├── PolicyNodeIterator.h │ │ ├── TreeIterator.h │ │ ├── TreeNode.h │ │ └── TreeNodeAllocator.h │ ├── Buffer.h │ ├── Color.h │ ├── ConstBuffer.h │ ├── ConstSwitch.h │ ├── Digraph.h │ ├── EditDistance.h │ ├── Flags.h │ ├── HashIterator.h │ ├── HashTable.h │ ├── IList.h │ ├── IListIterator.h │ ├── IListNode.h │ ├── If.h │ ├── NodeIterator.h │ ├── OwningPtr.h │ ├── Rope.h │ ├── StringHashTable.h │ ├── StringHasher.h │ ├── StringList.h │ ├── StringMap.h │ ├── StringRef.h │ ├── StringSwitch.h │ ├── TopologyIterator.h │ ├── TriState.h │ ├── TriValue.h │ ├── TypeSwitch.h │ ├── TypeTag.h │ ├── TypeTraits.h │ └── Uncopyable.h │ ├── Analysis │ ├── Counter.h │ ├── GlobalStatistics.h │ ├── LivenessAnalysis.h │ ├── MemoryAllocation.h │ ├── NodeIRScheduler.h │ ├── SplitNode.h │ ├── Statistics.h │ └── UpdateGraphOutputSize.h │ ├── CodeGen │ ├── BuildMemOperand.h │ ├── FuseInplaceValue.h │ ├── LinearScanMemAlloc.h │ ├── LiveInterval.h │ ├── LiveIntervals.h │ ├── LiveIntervalsData.h │ ├── LiveValueMatrix.h │ ├── MemAllocData.h │ ├── SetMemOperand.h │ └── SlotIndexes.h │ ├── Config │ ├── AboutData.h │ ├── AboutLicense.h │ ├── Backends.def.in │ ├── Config.h.cmake.in │ ├── Config.h.in │ ├── ONNX.h.in │ └── Platforms.def.in │ ├── Core │ ├── AnalysisResolver.h │ ├── AnalysisUsage.h │ ├── Application.h │ ├── CustomPass.h │ ├── InitializePasses.h │ ├── ModulePass.h │ ├── ObjectWriter.h │ ├── Pass.h │ ├── PassAnalysisSupport.h │ ├── PassInfo.h │ ├── PassManager.h │ ├── PassRegistry.h │ └── PassSupport.h │ ├── Diagnostic │ ├── Bits │ │ ├── Engine.tcc │ │ └── header.h │ ├── DiagCommonKinds.inc │ ├── Diagnostic.h │ ├── DiagnosticInfoMap.h │ ├── Engine.h │ ├── EngineFwd.h │ ├── GeneralOptions.h │ ├── Logger.h │ ├── MsgHandler.h │ ├── MsgHandling.h │ ├── OFStreamLog.h │ ├── Policy.h │ ├── StreamLog.h │ └── SysLog.h │ ├── IR │ ├── Bits │ │ ├── ComputeGraph.tcc │ │ └── IRBuilder.tcc │ ├── CodeEmit.h │ ├── Compute.h │ ├── Compute │ │ ├── ATen.h │ │ ├── Abs.h │ │ ├── Acos.h │ │ ├── Add.h │ │ ├── Affine.h │ │ ├── And.h │ │ ├── ArgMax.h │ │ ├── ArgMin.h │ │ ├── Asin.h │ │ ├── Atan.h │ │ ├── Attributes.h │ │ ├── AveragePool.h │ │ ├── BatchNormalization.h │ │ ├── Cast.h │ │ ├── Ceil.h │ │ ├── Clip.h │ │ ├── Concat.h │ │ ├── Constant.h │ │ ├── ConstantFill.h │ │ ├── Conv.h │ │ ├── ConvTranspose.h │ │ ├── Cos.h │ │ ├── Crop.h │ │ ├── Define.h │ │ ├── DepthToSpace.h │ │ ├── Div.h │ │ ├── Dropout.h │ │ ├── Elu.h │ │ ├── Equal.h │ │ ├── Exp.h │ │ ├── Expand.h │ │ ├── Flatten.h │ │ ├── Floor.h │ │ ├── GRU.h │ │ ├── GRUUnit.h │ │ ├── Gather.h │ │ ├── Gemm.h │ │ ├── GivenTensorFill.h │ │ ├── GlobalAveragePool.h │ │ ├── GlobalLpPool.h │ │ ├── GlobalMaxPool.h │ │ ├── Greater.h │ │ ├── HardSigmoid.h │ │ ├── Hardmax.h │ │ ├── Identity.h │ │ ├── If.h │ │ ├── ImageScaler.h │ │ ├── Initializer.h │ │ ├── InputOperator.h │ │ ├── InstanceNormalization.h │ │ ├── LRN.h │ │ ├── LSTM.h │ │ ├── LeakyRelu.h │ │ ├── Less.h │ │ ├── Log.h │ │ ├── LogSoftmax.h │ │ ├── Loop.h │ │ ├── LpNormalization.h │ │ ├── LpPool.h │ │ ├── MatMul.h │ │ ├── Max.h │ │ ├── MaxPool.h │ │ ├── MaxRoiPool.h │ │ ├── Mean.h │ │ ├── MeanVarianceNormalization.h │ │ ├── Min.h │ │ ├── Mul.h │ │ ├── Multinomial.h │ │ ├── Neg.h │ │ ├── Not.h │ │ ├── Operator.h │ │ ├── Or.h │ │ ├── OutputOperator.h │ │ ├── PRelu.h │ │ ├── Pad.h │ │ ├── ParametricSoftplus.h │ │ ├── Pow.h │ │ ├── RNN.h │ │ ├── RandomNormal.h │ │ ├── RandomNormalLike.h │ │ ├── RandomUniform.h │ │ ├── RandomUniformLike.h │ │ ├── Reciprocal.h │ │ ├── ReduceL1.h │ │ ├── ReduceL2.h │ │ ├── ReduceLogSum.h │ │ ├── ReduceLogSumExp.h │ │ ├── ReduceMax.h │ │ ├── ReduceMean.h │ │ ├── ReduceMin.h │ │ ├── ReduceProd.h │ │ ├── ReduceSum.h │ │ ├── ReduceSumSquare.h │ │ ├── Relu.h │ │ ├── Reshape.h │ │ ├── Scalar.h │ │ ├── Scale.h │ │ ├── ScaledTanh.h │ │ ├── Scan.h │ │ ├── Selu.h │ │ ├── Shape.h │ │ ├── Sigmoid.h │ │ ├── Sin.h │ │ ├── Size.h │ │ ├── Slice.h │ │ ├── Softmax.h │ │ ├── Softplus.h │ │ ├── Softsign.h │ │ ├── SpaceToDepth.h │ │ ├── Split.h │ │ ├── Sqrt.h │ │ ├── Squeeze.h │ │ ├── Sub.h │ │ ├── Sum.h │ │ ├── Tan.h │ │ ├── Tanh.h │ │ ├── Tensor.h │ │ ├── ThresholdedRelu.h │ │ ├── Tile.h │ │ ├── TopK.h │ │ ├── Transpose.h │ │ ├── Unsqueeze.h │ │ ├── Upsample.h │ │ ├── Use.h │ │ ├── Value.h │ │ └── Xor.h │ ├── ComputeGraph.h │ ├── ComputeGraphSupport.h │ ├── ComputeMemOperand.h │ ├── ComputeOperand.h │ ├── ComputeOperator.h │ ├── ComputeRegOperand.h │ ├── ComputeVisitor.h │ ├── ComputeVisitorPass.h │ ├── CustomVisitor.h │ ├── Dump.h │ ├── IRBuilder.h │ ├── InsertionPoint.h │ ├── Module.h │ ├── ONNCModulePrinter.h │ ├── ONNCNodeNameGen.h │ ├── ONNXNodeVisitor.h │ ├── ONNXUtils.h │ ├── Quadruple.h │ └── Tensor │ │ └── InitializerProxy.h │ ├── IRReader │ └── ONNXReader.h │ ├── JSON │ ├── Array.h │ ├── Group.h │ ├── Notation.h │ ├── Object.h │ ├── Reader.h │ ├── Storage.h │ ├── String.h │ ├── Type.h │ └── Value.h │ ├── ONNXWrapper │ └── ONNXWrapper.h │ ├── Option │ ├── Alias.h │ ├── Bits │ │ ├── Apply.h │ │ └── header.h │ ├── CommandLine.h │ ├── OptDefs.h │ ├── OptParser.h │ ├── OptStorage.h │ ├── OptValue.h │ ├── Option.h │ ├── OptionPool.h │ └── OptionPoolReader.h │ ├── Runtime │ ├── Interpreter.h │ ├── onnc-runtime-internal.h │ ├── onnc-runtime.h │ ├── onni-runtime.h │ ├── operator │ │ ├── abs.h │ │ ├── acos.h │ │ ├── add.h │ │ ├── affine.h │ │ ├── and.h │ │ ├── argmax.h │ │ ├── argmin.h │ │ ├── asin.h │ │ ├── atan.h │ │ ├── aten.h │ │ ├── averagepool.h │ │ ├── batchnormalization.h │ │ ├── cast.h │ │ ├── ceil.h │ │ ├── clip.h │ │ ├── concat.h │ │ ├── constant.h │ │ ├── constantfill.h │ │ ├── conv.h │ │ ├── convtranspose.h │ │ ├── cos.h │ │ ├── crop.h │ │ ├── depthtospace.h │ │ ├── div.h │ │ ├── dropout.h │ │ ├── elu.h │ │ ├── equal.h │ │ ├── exp.h │ │ ├── expand.h │ │ ├── flatten.h │ │ ├── floor.h │ │ ├── gather.h │ │ ├── gemm.h │ │ ├── giventensorfill.h │ │ ├── globalaveragepool.h │ │ ├── globallppool.h │ │ ├── globalmaxpool.h │ │ ├── greater.h │ │ ├── gru.h │ │ ├── gruunit.h │ │ ├── hardmax.h │ │ ├── hardsigmoid.h │ │ ├── identity.h │ │ ├── if.h │ │ ├── imagescaler.h │ │ ├── instancenormalization.h │ │ ├── leakyrelu.h │ │ ├── less.h │ │ ├── log.h │ │ ├── logsoftmax.h │ │ ├── loop.h │ │ ├── loopindextensor.h │ │ ├── lpnormalization.h │ │ ├── lppool.h │ │ ├── lrn.h │ │ ├── lstm.h │ │ ├── matmul.h │ │ ├── max.h │ │ ├── maxpool.h │ │ ├── maxroipool.h │ │ ├── mean.h │ │ ├── meanvariancenormalization.h │ │ ├── min.h │ │ ├── mul.h │ │ ├── multinomial.h │ │ ├── neg.h │ │ ├── not.h │ │ ├── or.h │ │ ├── pad.h │ │ ├── parametricsoftplus.h │ │ ├── pow.h │ │ ├── prelu.h │ │ ├── randomnormal.h │ │ ├── randomnormallike.h │ │ ├── randomuniform.h │ │ ├── randomuniformlike.h │ │ ├── reciprocal.h │ │ ├── reducel1.h │ │ ├── reducel2.h │ │ ├── reducelogsum.h │ │ ├── reducelogsumexp.h │ │ ├── reducemax.h │ │ ├── reducemean.h │ │ ├── reducemin.h │ │ ├── reduceprod.h │ │ ├── reducesum.h │ │ ├── reducesumsquare.h │ │ ├── relu.h │ │ ├── reshape.h │ │ ├── rnn.h │ │ ├── scale.h │ │ ├── scaledtanh.h │ │ ├── scan.h │ │ ├── selu.h │ │ ├── shape.h │ │ ├── sigmoid.h │ │ ├── sin.h │ │ ├── size.h │ │ ├── slice.h │ │ ├── softmax.h │ │ ├── softplus.h │ │ ├── softsign.h │ │ ├── spacetodepth.h │ │ ├── split.h │ │ ├── sqrt.h │ │ ├── squeeze.h │ │ ├── sub.h │ │ ├── sum.h │ │ ├── tan.h │ │ ├── tanh.h │ │ ├── thresholdedrelu.h │ │ ├── tile.h │ │ ├── topk.h │ │ ├── transpose.h │ │ ├── unsqueeze.h │ │ ├── upsample.h │ │ └── xor.h │ └── operatorMKLDNN │ │ ├── conv.h │ │ └── gemm.h │ ├── Support │ ├── Algorithm.h │ ├── AsyncPipe.h │ ├── Bits │ │ ├── FileBuf.tcc │ │ ├── IFStream.tcc │ │ ├── IStrStream.tcc │ │ ├── IndentOStreamBuf.tcc │ │ ├── OFStream.tcc │ │ ├── OStrStream.tcc │ │ ├── OStream.tcc │ │ ├── ObjectPool.tcc │ │ ├── StringBuf.tcc │ │ └── header.h │ ├── CArgu.h │ ├── CArguRef.h │ ├── CEnv.h │ ├── Casting.h │ ├── Compress.h │ ├── Contract.h │ ├── DataTypes.h.cmake.in │ ├── DataTypes.h.in │ ├── Debug.h │ ├── DirIterator.h │ ├── Directory.h │ ├── Duration.h │ ├── ELF.h │ ├── EditMatch.h │ ├── Enum.h │ ├── Environ.h │ ├── ErrorCode.h │ ├── Expansion.h │ ├── FileBuf.h │ ├── FileDescriptor.h │ ├── FileHandle.h │ ├── FileInfo.h │ ├── FileLock.h │ ├── FileStatus.h │ ├── FileSystem.h │ ├── GCFactory.h │ ├── Glob.h │ ├── Host.h │ ├── IFStream.h │ ├── IOSFwd.h │ ├── IOStream.h │ ├── IStrStream.h │ ├── IStream.h │ ├── IndentOStream.h │ ├── IndentOStreamBuf.h │ ├── Iterator.h │ ├── LinearAllocator.h │ ├── MallocAllocator.h │ ├── ManagedStatic.h │ ├── MappedFileRegion.h │ ├── Match.h │ ├── Memory.h │ ├── MemoryAllocator.h │ ├── MemoryMap.h │ ├── MemoryPool.h │ ├── OFStream.h │ ├── OStrStream.h │ ├── OStream.h │ ├── ObjectPool.h │ ├── Path.h │ ├── Pipe.h │ ├── Preprocessor.h │ ├── Random.h │ ├── Range.h │ ├── Readline.h │ ├── SelfPipe.h │ ├── SigAction.h │ ├── Signal.h │ ├── Slab.h │ ├── SlabIterator.h │ ├── Span.h │ ├── String.h │ ├── StringBuf.h │ ├── Timer.h │ ├── TypeTraits.h │ ├── UnixPrv.h │ └── View.h │ ├── Target │ ├── DLATargetBackend.h │ ├── NPUTargetBackend.h │ ├── Platform.h │ ├── Target.h │ ├── TargetBackend.h │ ├── TargetMemInfo.h │ ├── TargetOptions.h │ ├── TargetRegistry.h │ ├── TargetSelect.h │ ├── TargetStandardPasses.h │ └── TargetTransformInfo.h │ └── Transforms │ ├── BookONNXGraphs.h │ ├── BuildInitializers.h │ ├── BuildInputOperators.h │ ├── BuildOutputOperators.h │ ├── DeadNodeElimination.h │ ├── EliminateCast.h │ ├── ExtractConstToInitializer.h │ ├── GraphBuildingPass.h │ ├── OnnxOptPass.h │ ├── Optimizations │ ├── DivideGlobalAPIntoAPs.h │ ├── EliminateIdentity.h │ ├── ExpandBatchNormalization.h │ ├── OptimizationOptions.h │ ├── OptimizationsUtils.h │ ├── PropagateConstWithDiffShape.h │ ├── ReplaceGemmByConv.h │ └── SplitConvPass.h │ ├── RemoveTrainingNodes.h │ ├── TensorSel.h │ └── TensorSel │ ├── Lower.h │ ├── LowerRegistry.h │ └── Standards │ ├── ATenLower.h │ ├── AbsLower.h │ ├── AcosLower.h │ ├── AddLower.h │ ├── AffineLower.h │ ├── AndLower.h │ ├── ArgMaxLower.h │ ├── ArgMinLower.h │ ├── AsinLower.h │ ├── AtanLower.h │ ├── AveragePoolLower.h │ ├── BatchNormalizationLower.h │ ├── CastLower.h │ ├── CeilLower.h │ ├── ClipLower.h │ ├── ConcatLower.h │ ├── ConstantFillLower.h │ ├── ConstantLower.h │ ├── ConvLower.h │ ├── ConvTransposeLower.h │ ├── CosLower.h │ ├── CropLower.h │ ├── DefineLower.h │ ├── DepthToSpaceLower.h │ ├── DivLower.h │ ├── DropoutLower.h │ ├── EluLower.h │ ├── EqualLower.h │ ├── ExpLower.h │ ├── ExpandLower.h │ ├── FCLower.h │ ├── FlattenLower.h │ ├── FloorLower.h │ ├── GRULower.h │ ├── GRUUnitLower.h │ ├── GatherLower.h │ ├── GemmLower.h │ ├── GivenTensorFillLower.h │ ├── GlobalAveragePoolLower.h │ ├── GlobalLpPoolLower.h │ ├── GlobalMaxPoolLower.h │ ├── GreaterLower.h │ ├── HardSigmoidLower.h │ ├── HardmaxLower.h │ ├── IdentityLower.h │ ├── IfLower.h │ ├── ImageScalerLower.h │ ├── InstanceNormalizationLower.h │ ├── LRNLower.h │ ├── LSTMLower.h │ ├── LeakyReluLower.h │ ├── LessLower.h │ ├── LogLower.h │ ├── LogSoftmaxLower.h │ ├── LoopIndexTensorLower.h │ ├── LoopLower.h │ ├── LpNormalizationLower.h │ ├── LpPoolLower.h │ ├── MatMulLower.h │ ├── MaxLower.h │ ├── MaxPoolLower.h │ ├── MaxRoiPoolLower.h │ ├── MeanLower.h │ ├── MeanVarianceNormalizationLower.h │ ├── MinLower.h │ ├── MulLower.h │ ├── MultinomialLower.h │ ├── NegLower.h │ ├── NotLower.h │ ├── OperatorLower.h │ ├── OrLower.h │ ├── PReluLower.h │ ├── PadLower.h │ ├── ParametricSoftplusLower.h │ ├── PowLower.h │ ├── RNNLower.h │ ├── RandomNormalLikeLower.h │ ├── RandomNormalLower.h │ ├── RandomUniformLikeLower.h │ ├── RandomUniformLower.h │ ├── ReciprocalLower.h │ ├── ReduceL1Lower.h │ ├── ReduceL2Lower.h │ ├── ReduceLogSumExpLower.h │ ├── ReduceLogSumLower.h │ ├── ReduceMaxLower.h │ ├── ReduceMeanLower.h │ ├── ReduceMinLower.h │ ├── ReduceProdLower.h │ ├── ReduceSumLower.h │ ├── ReduceSumSquareLower.h │ ├── ReluLower.h │ ├── ReshapeLower.h │ ├── ScalarLower.h │ ├── ScaleLower.h │ ├── ScaledTanhLower.h │ ├── ScanLower.h │ ├── SeluLower.h │ ├── ShapeLower.h │ ├── SigmoidLower.h │ ├── SinLower.h │ ├── SizeLower.h │ ├── SliceLower.h │ ├── SoftmaxLower.h │ ├── SoftplusLower.h │ ├── SoftsignLower.h │ ├── SpaceToDepthLower.h │ ├── SplitLower.h │ ├── SqrtLower.h │ ├── SqueezeLower.h │ ├── SubLower.h │ ├── SumLower.h │ ├── TanLower.h │ ├── TanhLower.h │ ├── ThresholdedReluLower.h │ ├── TileLower.h │ ├── TopKLower.h │ ├── TransposeLower.h │ ├── UnsqueezeLower.h │ ├── UpsampleLower.h │ └── XorLower.h ├── lib ├── .gitignore ├── ADT │ ├── Any.cpp │ ├── Buffer.cpp │ ├── CMakeLists.txt │ ├── Color.cpp │ ├── ConstBuffer.cpp │ ├── Digraph.cpp │ ├── IList.cpp │ ├── IListIterator.cpp │ ├── PolicyNodeIterator.cpp │ ├── Rope.cpp │ ├── Serializing.cpp │ ├── StringList.cpp │ ├── StringRef.cpp │ ├── TopologyIterator.cpp │ └── TypeTag.cpp ├── Analysis │ ├── CMakeLists.txt │ ├── Counter.cpp │ ├── GlobalStatistics.cpp │ ├── LivenessAnalysis.cpp │ ├── MemoryAllocation.cpp │ ├── NodeIRScheduler.cpp │ ├── SplitNode.cpp │ ├── Statistics.cpp │ └── UpdateGraphOutputSize.cpp ├── CMakeLists.txt ├── CodeGen │ ├── BuildMemOperand.cpp │ ├── CMakeLists.txt │ ├── FuseInplaceValue.cpp │ ├── LinearScanMemAlloc.cpp │ ├── LiveInterval.cpp │ ├── LiveIntervals.cpp │ ├── LiveIntervalsData.cpp │ ├── LiveValueMatrix.cpp │ ├── MemAllocData.cpp │ ├── SetMemOperand.cpp │ └── SlotIndexes.cpp ├── Config │ ├── AboutData.cpp │ ├── AboutLicense.cpp │ └── CMakeLists.txt ├── Core │ ├── AnalysisResolver.cpp │ ├── AnalysisUsage.cpp │ ├── Application.cpp │ ├── CMakeLists.txt │ ├── InitializePasses.cpp │ ├── ObjectWriter.cpp │ ├── Pass.cpp │ ├── PassInfo.cpp │ ├── PassManager.cpp │ └── PassRegistry.cpp ├── Diagnostic │ ├── CMakeLists.txt │ ├── Diagnostic.cpp │ ├── DiagnosticInfoMap.cpp │ ├── Engine.cpp │ ├── GeneralOptions.cpp │ ├── Logger.cpp │ ├── MsgHandler.cpp │ ├── MsgHandling.cpp │ ├── OFStreamLog.cpp │ ├── Policy.cpp │ ├── StreamLog.cpp │ └── SysLog.cpp ├── IR │ ├── CMakeLists.txt │ ├── CodeEmit.cpp │ ├── Compute │ │ ├── ATen.cpp │ │ ├── Abs.cpp │ │ ├── Acos.cpp │ │ ├── Add.cpp │ │ ├── Affine.cpp │ │ ├── And.cpp │ │ ├── ArgMax.cpp │ │ ├── ArgMin.cpp │ │ ├── Asin.cpp │ │ ├── Atan.cpp │ │ ├── Attributes.cpp │ │ ├── AveragePool.cpp │ │ ├── BatchNormalization.cpp │ │ ├── Cast.cpp │ │ ├── Ceil.cpp │ │ ├── Clip.cpp │ │ ├── Concat.cpp │ │ ├── Constant.cpp │ │ ├── ConstantFill.cpp │ │ ├── Conv.cpp │ │ ├── ConvTranspose.cpp │ │ ├── Cos.cpp │ │ ├── Crop.cpp │ │ ├── DepthToSpace.cpp │ │ ├── Div.cpp │ │ ├── Dropout.cpp │ │ ├── Elu.cpp │ │ ├── Equal.cpp │ │ ├── Exp.cpp │ │ ├── Expand.cpp │ │ ├── Flatten.cpp │ │ ├── Floor.cpp │ │ ├── GRU.cpp │ │ ├── GRUUnit.cpp │ │ ├── Gather.cpp │ │ ├── Gemm.cpp │ │ ├── GivenTensorFill.cpp │ │ ├── GlobalAveragePool.cpp │ │ ├── GlobalLpPool.cpp │ │ ├── GlobalMaxPool.cpp │ │ ├── Greater.cpp │ │ ├── HardSigmoid.cpp │ │ ├── Hardmax.cpp │ │ ├── Identity.cpp │ │ ├── If.cpp │ │ ├── ImageScaler.cpp │ │ ├── Initializer.cpp │ │ ├── InputOperator.cpp │ │ ├── InstanceNormalization.cpp │ │ ├── LRN.cpp │ │ ├── LSTM.cpp │ │ ├── LeakyRelu.cpp │ │ ├── Less.cpp │ │ ├── Log.cpp │ │ ├── LogSoftmax.cpp │ │ ├── Loop.cpp │ │ ├── LpNormalization.cpp │ │ ├── LpPool.cpp │ │ ├── MatMul.cpp │ │ ├── Max.cpp │ │ ├── MaxPool.cpp │ │ ├── MaxRoiPool.cpp │ │ ├── Mean.cpp │ │ ├── MeanVarianceNormalization.cpp │ │ ├── Min.cpp │ │ ├── Mul.cpp │ │ ├── Multinomial.cpp │ │ ├── Neg.cpp │ │ ├── Not.cpp │ │ ├── Or.cpp │ │ ├── OutputOperator.cpp │ │ ├── PRelu.cpp │ │ ├── Pad.cpp │ │ ├── ParametricSoftplus.cpp │ │ ├── Pow.cpp │ │ ├── RNN.cpp │ │ ├── RandomNormal.cpp │ │ ├── RandomNormalLike.cpp │ │ ├── RandomUniform.cpp │ │ ├── RandomUniformLike.cpp │ │ ├── Reciprocal.cpp │ │ ├── ReduceL1.cpp │ │ ├── ReduceL2.cpp │ │ ├── ReduceLogSum.cpp │ │ ├── ReduceLogSumExp.cpp │ │ ├── ReduceMax.cpp │ │ ├── ReduceMean.cpp │ │ ├── ReduceMin.cpp │ │ ├── ReduceProd.cpp │ │ ├── ReduceSum.cpp │ │ ├── ReduceSumSquare.cpp │ │ ├── Relu.cpp │ │ ├── Reshape.cpp │ │ ├── Scalar.cpp │ │ ├── Scale.cpp │ │ ├── ScaledTanh.cpp │ │ ├── Scan.cpp │ │ ├── Selu.cpp │ │ ├── Shape.cpp │ │ ├── Sigmoid.cpp │ │ ├── Sin.cpp │ │ ├── Size.cpp │ │ ├── Slice.cpp │ │ ├── Softmax.cpp │ │ ├── Softplus.cpp │ │ ├── Softsign.cpp │ │ ├── SpaceToDepth.cpp │ │ ├── Split.cpp │ │ ├── Sqrt.cpp │ │ ├── Squeeze.cpp │ │ ├── Sub.cpp │ │ ├── Sum.cpp │ │ ├── Tan.cpp │ │ ├── Tanh.cpp │ │ ├── Tensor.cpp │ │ ├── ThresholdedRelu.cpp │ │ ├── Tile.cpp │ │ ├── TopK.cpp │ │ ├── Transpose.cpp │ │ ├── Unsqueeze.cpp │ │ ├── Upsample.cpp │ │ ├── Use.cpp │ │ ├── Value.cpp │ │ └── Xor.cpp │ ├── ComputeGraph.cpp │ ├── ComputeMemOperand.cpp │ ├── ComputeOperand.cpp │ ├── ComputeOperator.cpp │ ├── ComputeRegOperand.cpp │ ├── Define.cpp │ ├── Dump.cpp │ ├── IRBuilder.cpp │ ├── InsertionPoint.cpp │ ├── Module.cpp │ ├── ONNCModulePrinter.cpp │ ├── ONNCNodeNameGen.cpp │ ├── ONNXNodeVisitor.cpp │ ├── ONNXUtils.cpp │ ├── Quadruple.cpp │ └── Tensor │ │ └── InitializerProxy.cpp ├── IRReader │ ├── CMakeLists.txt │ └── ONNXReader.cpp ├── JSON │ ├── Array.cpp │ ├── CMakeLists.txt │ ├── Group.cpp │ ├── JsonParser.ypp │ ├── JsonScanner.lpp │ ├── Notation.cpp │ ├── Object.cpp │ ├── Storage.cpp │ ├── String.cpp │ └── Value.cpp ├── Makefile.am ├── ONNXWrapper │ ├── CMakeLists.txt │ └── ONNXWrapper.cpp ├── Option │ ├── Alias.cpp │ ├── CMakeLists.txt │ ├── CommandLine.cpp │ ├── OptDefs.cpp │ ├── OptParser.cpp │ ├── Option.cpp │ └── OptionPool.cpp ├── Runtime │ ├── CMakeLists.txt │ ├── Interpreter.cpp │ ├── onnc-runtime.c │ ├── operator │ │ ├── CMakeLists.txt │ │ ├── abs.c │ │ ├── acos.c │ │ ├── add.c │ │ ├── affine.c │ │ ├── and.c │ │ ├── argmax.c │ │ ├── argmin.c │ │ ├── asin.c │ │ ├── atan.c │ │ ├── aten.c │ │ ├── averagepool.c │ │ ├── batchnormalization.c │ │ ├── cast.c │ │ ├── ceil.c │ │ ├── clip.c │ │ ├── concat.c │ │ ├── constant.c │ │ ├── constantfill.c │ │ ├── conv.c │ │ ├── convtranspose.c │ │ ├── cos.c │ │ ├── crop.c │ │ ├── depthtospace.c │ │ ├── div.c │ │ ├── dropout.c │ │ ├── elu.c │ │ ├── equal.c │ │ ├── exp.c │ │ ├── expand.c │ │ ├── flatten.c │ │ ├── floor.c │ │ ├── gather.c │ │ ├── gemm.c │ │ ├── generic │ │ │ ├── assign.h │ │ │ ├── binary.h │ │ │ ├── gemm.h │ │ │ ├── size.h │ │ │ ├── strides.h │ │ │ └── transpose.h │ │ ├── giventensorfill.c │ │ ├── globalaveragepool.c │ │ ├── globallppool.c │ │ ├── globalmaxpool.c │ │ ├── greater.c │ │ ├── gru.c │ │ ├── gruunit.c │ │ ├── hardmax.c │ │ ├── hardsigmoid.c │ │ ├── identity.c │ │ ├── if.c │ │ ├── imagescaler.c │ │ ├── instancenormalization.c │ │ ├── leakyrelu.c │ │ ├── less.c │ │ ├── log.c │ │ ├── logsoftmax.c │ │ ├── loop.c │ │ ├── lpnormalization.c │ │ ├── lppool.c │ │ ├── lrn.c │ │ ├── lstm.c │ │ ├── matmul.c │ │ ├── max.c │ │ ├── maxpool.c │ │ ├── maxroipool.c │ │ ├── mean.c │ │ ├── meanvariancenormalization.c │ │ ├── min.c │ │ ├── mul.c │ │ ├── multinomial.c │ │ ├── neg.c │ │ ├── not.c │ │ ├── or.c │ │ ├── pad.c │ │ ├── parametricsoftplus.c │ │ ├── pow.c │ │ ├── prelu.c │ │ ├── randomnormal.c │ │ ├── randomnormallike.c │ │ ├── randomuniform.c │ │ ├── randomuniformlike.c │ │ ├── reciprocal.c │ │ ├── reducel1.c │ │ ├── reducel2.c │ │ ├── reducelogsum.c │ │ ├── reducelogsumexp.c │ │ ├── reducemax.c │ │ ├── reducemean.c │ │ ├── reducemin.c │ │ ├── reduceprod.c │ │ ├── reducesum.c │ │ ├── reducesumsquare.c │ │ ├── relu.c │ │ ├── reshape.c │ │ ├── rnn.c │ │ ├── scale.c │ │ ├── scaledtanh.c │ │ ├── scan.c │ │ ├── selu.c │ │ ├── shape.c │ │ ├── sigmoid.c │ │ ├── sin.c │ │ ├── size.c │ │ ├── slice.c │ │ ├── softmax.c │ │ ├── softplus.c │ │ ├── softsign.c │ │ ├── spacetodepth.c │ │ ├── split.c │ │ ├── sqrt.c │ │ ├── squeeze.c │ │ ├── sub.c │ │ ├── sum.c │ │ ├── tan.c │ │ ├── tanh.c │ │ ├── thresholdedrelu.c │ │ ├── tile.c │ │ ├── topk.c │ │ ├── transpose.c │ │ ├── unsqueeze.c │ │ ├── upsample.c │ │ └── xor.c │ └── operatorMKLDNN │ │ ├── CMakeLists.txt │ │ ├── conv.c │ │ └── gemm.c ├── Support │ ├── AsyncPipe.cpp │ ├── CArgu.cpp │ ├── CArguRef.cpp │ ├── CEnv.cpp │ ├── CMakeLists.txt │ ├── Compress.cpp │ ├── Debug.cpp │ ├── DirIterator.cpp │ ├── Directory.cpp │ ├── Dragon │ │ ├── Directory.inc │ │ ├── FileStatus.inc │ │ ├── Path.inc │ │ └── header.h │ ├── Duration.cpp │ ├── Environ.cpp │ ├── ErrorCode.cpp │ ├── Expansion.cpp │ ├── FileHandle.cpp │ ├── FileInfo.cpp │ ├── FileLock.cpp │ ├── FileStatus.cpp │ ├── FileSystem.cpp │ ├── Glob.cpp │ ├── Host.cpp │ ├── IOStream.cpp │ ├── IndentOStreamBuf.cpp │ ├── ManagedStatic.cpp │ ├── MappedFileRegion.cpp │ ├── MemoryMap.cpp │ ├── Path.cpp │ ├── Pipe.cpp │ ├── Random.cpp │ ├── Readline.cpp │ ├── SelfPipe.cpp │ ├── Signal.cpp │ ├── Slab.cpp │ ├── Timer.cpp │ ├── Unix │ │ ├── AsyncPipe.inc │ │ ├── Directory.inc │ │ ├── Expansion.inc │ │ ├── FileHandle.inc │ │ ├── FileStatus.inc │ │ ├── FileSystem.inc │ │ ├── Glob.inc │ │ ├── Path.inc │ │ ├── Pipe.inc │ │ ├── Random.inc │ │ ├── SelfPipe.inc │ │ ├── Timer.inc │ │ └── header.h │ ├── Windows │ │ ├── Directory.inc │ │ ├── FileStatus.inc │ │ ├── Path.inc │ │ └── header.h │ ├── linenoise.cpp │ └── linenoise.h ├── Target │ ├── CLang │ │ ├── CLangBackend.cpp │ │ ├── CLangBackend.h │ │ ├── CLangGenServiceLibraryPass.cpp │ │ ├── CLangGenServiceLibraryPass.h │ │ ├── CLangGenWeightFilePass.cpp │ │ ├── CLangGenWeightFilePass.h │ │ ├── CLangGetOperatorListPass.cpp │ │ ├── CLangGetOperatorListPass.h │ │ ├── CLangMemInfoPass.cpp │ │ ├── CLangMemInfoPass.h │ │ ├── CLangMeta.cpp │ │ ├── CLangMeta.h │ │ ├── CLangOperatorInvokeVisitor.cpp │ │ ├── CLangOperatorInvokeVisitor.h │ │ ├── CMakeLists.txt │ │ ├── Indent.h │ │ ├── Makefile.am │ │ ├── TargetInfo │ │ │ ├── CLangTargetInfo.cpp │ │ │ ├── CLangTargetInfo.h │ │ │ ├── CLangTargetMemInfo.cpp │ │ │ └── CLangTargetMemInfo.h │ │ └── internal │ │ │ ├── Indent.h │ │ │ └── Visitors.inc │ ├── CMakeLists.txt │ ├── NPUTargetBackend.cpp │ ├── NvDla │ │ ├── CMakeLists.txt │ │ ├── CodeEmitVisitor.cpp │ │ ├── CodeEmitVisitor.h │ │ ├── CodeEmitVisitor │ │ │ ├── Add.inc │ │ │ ├── AveragePool.inc │ │ │ ├── Concat.inc │ │ │ ├── Conv.inc │ │ │ ├── Initializer.inc │ │ │ ├── InputOperator.inc │ │ │ ├── LRN.inc │ │ │ ├── Max.inc │ │ │ ├── MaxPool.inc │ │ │ ├── Min.inc │ │ │ ├── Mul.inc │ │ │ ├── NvDlaShuffle.inc │ │ │ ├── OutputOperator.inc │ │ │ ├── Relu.inc │ │ │ ├── Reshape.inc │ │ │ ├── Softmax.inc │ │ │ ├── Split.inc │ │ │ ├── Sum.inc │ │ │ └── Transpose.inc │ │ ├── Compute │ │ │ ├── CMakeLists.txt │ │ │ ├── NvDlaShuffle.cpp │ │ │ └── NvDlaShuffle.h │ │ ├── Config │ │ │ ├── CMakeLists.txt │ │ │ └── NvFull.cpp │ │ ├── LegalizeClipToMinMaxPass.cpp │ │ ├── LegalizeClipToMinMaxPass.h │ │ ├── LegalizePadPass.cpp │ │ ├── LegalizePadPass.h │ │ ├── LegalizeReduceMeanPass.cpp │ │ ├── LegalizeReduceMeanPass.h │ │ ├── Loadable.cpp │ │ ├── Makefile.am │ │ ├── NvDlaBackend.cpp │ │ ├── NvDlaBackend.h │ │ ├── NvDlaCalibrateAveragePoolResultPass.cpp │ │ ├── NvDlaCalibrateAveragePoolResultPass.h │ │ ├── NvDlaCollectReshapeInfoPass.cpp │ │ ├── NvDlaCollectReshapeInfoPass.h │ │ ├── NvDlaDefine.cpp │ │ ├── NvDlaDefine.h │ │ ├── NvDlaFileGenPass.cpp │ │ ├── NvDlaFileGenPass.h │ │ ├── NvDlaIdentifyShufflePass.cpp │ │ ├── NvDlaIdentifyShufflePass.h │ │ ├── NvDlaMemInfoPass.cpp │ │ ├── NvDlaMemInfoPass.h │ │ ├── NvDlaMeta.cpp │ │ ├── NvDlaMeta.h │ │ ├── NvDlaTaskSubmitPass.cpp │ │ ├── NvDlaTaskSubmitPass.h │ │ ├── NvDlaUtil.cpp │ │ ├── NvDlaUtil.h │ │ ├── ReplaceFlattenByReshape.cpp │ │ ├── ReplaceFlattenByReshape.h │ │ ├── SplitGroupConvPass.cpp │ │ ├── SplitGroupConvPass.h │ │ ├── TargetInfo │ │ │ ├── CMakeLists.txt │ │ │ ├── NvDlaTargetInfo.cpp │ │ │ ├── NvDlaTargetInfo.h │ │ │ ├── NvDlaTargetMemInfo.cpp │ │ │ └── NvDlaTargetMemInfo.h │ │ ├── Types.h │ │ ├── Version.h │ │ ├── genmem │ │ │ ├── CMakeLists.txt │ │ │ ├── Concat.cpp │ │ │ ├── Copy.cpp │ │ │ ├── Cube.cpp │ │ │ ├── Cube.hpp │ │ │ ├── Memory.cpp │ │ │ ├── Memory.hpp │ │ │ ├── Merge.cpp │ │ │ ├── Merge.hpp │ │ │ ├── Operators.hpp │ │ │ ├── Register.cpp │ │ │ ├── Register.hpp │ │ │ ├── Shuffle.cpp │ │ │ ├── Split.cpp │ │ │ ├── Split.hpp │ │ │ ├── Splitt.cpp │ │ │ ├── genmem.cpp │ │ │ ├── genmem.hpp │ │ │ └── header.hpp │ │ ├── genmemNvdla │ │ │ ├── CMakeLists.txt │ │ │ ├── NvdlaMemory.cpp │ │ │ ├── NvdlaMemory.hpp │ │ │ ├── genmem2Nvdla.cpp │ │ │ ├── genmem2Nvdla.hpp │ │ │ └── genmemNvdla.hpp │ │ └── include │ │ │ ├── ErrorMacros.h │ │ │ ├── dla_interface.h │ │ │ ├── dlaerror.h │ │ │ ├── dlatypes.h │ │ │ ├── emu_interface.h │ │ │ ├── flatbuffers │ │ │ └── flatbuffers.h │ │ │ ├── half.hpp │ │ │ ├── nvdla │ │ │ ├── ILoadable.h │ │ │ ├── IRuntime.h │ │ │ ├── IType.h │ │ │ └── c │ │ │ │ ├── NvDlaLoadable.h │ │ │ │ └── NvDlaType.h │ │ │ └── priv │ │ │ ├── Loadable.h │ │ │ ├── Type.h │ │ │ └── loadable_generated.h │ ├── Platform.cpp │ ├── Sophon │ │ ├── BM168x │ │ │ ├── BM168xBackend.cpp │ │ │ ├── BM168xBackend.h │ │ │ ├── BM168xFuseOptimizer.h │ │ │ ├── CMakeLists.txt │ │ │ └── asm │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── bm168x_asm.proto │ │ │ │ └── bmkernel_api.h.in │ │ ├── BM188x │ │ │ ├── AddDummyWeightPass.cpp │ │ │ ├── AddLutTablePass.cpp │ │ │ ├── AddLutTablePass.h │ │ │ ├── BM188xBackend.cpp │ │ │ ├── BM188xBackend.h │ │ │ ├── BM188xEncodeInstsPass.cpp │ │ │ ├── BM188xEncodeInstsPass.h │ │ │ ├── BM188xFuseOptimizer.cpp │ │ │ ├── BM188xFuseOptimizer.h │ │ │ ├── BM188xTargetMemInfo.cpp │ │ │ ├── BM188xTargetMemInfo.h │ │ │ ├── BM188xTargetTransformInfo.cpp │ │ │ ├── BM188xTargetTransformInfo.h │ │ │ ├── BM188xVisitor.cpp │ │ │ ├── BM188xVisitor.h │ │ │ ├── CMakeLists.txt │ │ │ ├── CodeEmitVisitor.cpp │ │ │ ├── CodeEmitVisitor.h │ │ │ ├── Compute │ │ │ │ ├── AveragePool.cpp │ │ │ │ ├── AveragePool.h │ │ │ │ ├── BMScale.cpp │ │ │ │ ├── BMScale.h │ │ │ │ ├── Concat.cpp │ │ │ │ ├── Concat.h │ │ │ │ ├── Conv.cpp │ │ │ │ ├── Conv.h │ │ │ │ ├── Gemm.cpp │ │ │ │ ├── Gemm.h │ │ │ │ ├── GlobalAveragePool.cpp │ │ │ │ ├── GlobalAveragePool.h │ │ │ │ ├── LRN.cpp │ │ │ │ ├── LRN.h │ │ │ │ ├── LeakyRelu.cpp │ │ │ │ ├── LeakyRelu.h │ │ │ │ ├── Load.cpp │ │ │ │ ├── Load.h │ │ │ │ ├── MaxPool.cpp │ │ │ │ ├── MaxPool.h │ │ │ │ ├── PRelu.cpp │ │ │ │ ├── PRelu.h │ │ │ │ ├── Pool.cpp │ │ │ │ ├── Pool.h │ │ │ │ ├── Relu.cpp │ │ │ │ ├── Relu.h │ │ │ │ ├── Scale.cpp │ │ │ │ ├── Scale.h │ │ │ │ ├── SlicedConv.cpp │ │ │ │ ├── SlicedConv.h │ │ │ │ ├── Store.cpp │ │ │ │ ├── Store.h │ │ │ │ ├── Sum.cpp │ │ │ │ ├── Sum.h │ │ │ │ ├── Transpose.cpp │ │ │ │ ├── Transpose.h │ │ │ │ ├── Upsample.cpp │ │ │ │ └── Upsample.h │ │ │ ├── FillWeightVisitor.cpp │ │ │ ├── FillWeightVisitor.h │ │ │ ├── GenRuntimeInfoPass.cpp │ │ │ ├── GenRuntimeInfoPass.h │ │ │ ├── GenWeightPass.cpp │ │ │ ├── GenWeightPass.h │ │ │ ├── Lowers │ │ │ │ ├── AveragePoolLower.cpp │ │ │ │ ├── AveragePoolLower.h │ │ │ │ ├── BMScaleLower.cpp │ │ │ │ ├── BMScaleLower.h │ │ │ │ ├── ConcatLower.cpp │ │ │ │ ├── ConcatLower.h │ │ │ │ ├── ConvLower.cpp │ │ │ │ ├── ConvLower.h │ │ │ │ ├── GemmLower.cpp │ │ │ │ ├── GemmLower.h │ │ │ │ ├── GlobalAveragePoolLower.cpp │ │ │ │ ├── GlobalAveragePoolLower.h │ │ │ │ ├── LRNLower.cpp │ │ │ │ ├── LRNLower.h │ │ │ │ ├── LeakyReluLower.cpp │ │ │ │ ├── LeakyReluLower.h │ │ │ │ ├── LoadLower.cpp │ │ │ │ ├── LoadLower.h │ │ │ │ ├── MaxPoolLower.cpp │ │ │ │ ├── MaxPoolLower.h │ │ │ │ ├── PReluLower.cpp │ │ │ │ ├── PReluLower.h │ │ │ │ ├── PoolLower.cpp │ │ │ │ ├── PoolLower.h │ │ │ │ ├── ReluLower.cpp │ │ │ │ ├── ReluLower.h │ │ │ │ ├── ScaleLower.cpp │ │ │ │ ├── ScaleLower.h │ │ │ │ ├── SlicedConvLower.cpp │ │ │ │ ├── SlicedConvLower.h │ │ │ │ ├── StoreLower.cpp │ │ │ │ ├── StoreLower.h │ │ │ │ ├── SumLower.cpp │ │ │ │ ├── SumLower.h │ │ │ │ ├── TransposeLower.cpp │ │ │ │ ├── TransposeLower.h │ │ │ │ ├── UpsampleLower.cpp │ │ │ │ └── UpsampleLower.h │ │ │ ├── ONNXDumpOptPass.cpp │ │ │ ├── PrepareCtablePass.cpp │ │ │ ├── TLConv.cpp │ │ │ ├── TLConv.h │ │ │ ├── TLLoad.cpp │ │ │ ├── TLLoad.h │ │ │ ├── TLPool.cpp │ │ │ ├── TLPool.h │ │ │ ├── TLRelu.cpp │ │ │ ├── TLRelu.h │ │ │ ├── TLStore.cpp │ │ │ ├── TLStore.h │ │ │ ├── UpdateCtablePass.cpp │ │ │ ├── UpdateVisitor.cpp │ │ │ ├── UpdateVisitor.h │ │ │ ├── asm │ │ │ │ ├── .gitignore │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── bm188x_asm.proto │ │ │ │ └── bmkernel_api.h.in │ │ │ └── proto │ │ │ │ └── common_calibration2.proto │ │ ├── BuildMemOpndPass.cpp │ │ ├── BuildMemOpndPass.h │ │ ├── CMakeLists.txt │ │ ├── EncodeInstructionsPass.cpp │ │ ├── EncodeInstructionsPass.h │ │ ├── LinearScanAllocPass.cpp │ │ ├── LinearScanAllocPass.h │ │ ├── ObjectFormat.h │ │ ├── PatternMatch.h │ │ ├── TG.h │ │ ├── TGBackend.cpp │ │ ├── TGBackend.h │ │ ├── TGFuseOptimizer.cpp │ │ ├── TGFuseOptimizer.h │ │ ├── TGFuseOptimizerPass.cpp │ │ ├── TargetInfo │ │ │ ├── CMakeLists.txt │ │ │ ├── TGTargetInfo.cpp │ │ │ └── TGTargetInfo.h │ │ ├── bmkernel_api_base.h │ │ ├── include │ │ │ └── onnc │ │ │ │ └── Target │ │ │ │ └── Sophon │ │ │ │ ├── BM168x │ │ │ │ ├── asm │ │ │ │ │ └── .gitignore │ │ │ │ └── bmkernel_api.h │ │ │ │ ├── BM188x │ │ │ │ ├── .gitignore │ │ │ │ ├── asm │ │ │ │ │ └── .gitignore │ │ │ │ └── bmkernel_api.h │ │ │ │ ├── bmkernel_api_base.h │ │ │ │ └── io.hpp │ │ └── io.cpp │ ├── Target.cpp │ ├── TargetRegistry.cpp │ ├── TargetStandardPasses.cpp │ ├── Vanilla │ │ ├── CMakeLists.txt │ │ ├── CodeEmitVisitor.cpp │ │ ├── CodeEmitVisitor.h │ │ ├── Makefile.am │ │ ├── TargetInfo │ │ │ ├── VanillaTargetInfo.cpp │ │ │ ├── VanillaTargetInfo.h │ │ │ ├── VanillaTargetMemInfo.cpp │ │ │ └── VanillaTargetMemInfo.h │ │ ├── VanillaBackend.cpp │ │ └── VanillaBackend.h │ └── X86 │ │ ├── CMakeLists.txt │ │ ├── Compute │ │ ├── X86ComputeVisitor.cpp │ │ ├── X86ComputeVisitor.h │ │ ├── X86ConvRelu.cpp │ │ └── X86ConvRelu.h │ │ ├── Makefile.am │ │ ├── TargetInfo │ │ ├── X86TargetInfo.cpp │ │ ├── X86TargetInfo.h │ │ ├── X86TargetMemInfo.cpp │ │ └── X86TargetMemInfo.h │ │ ├── X86.h │ │ ├── X86Backend.cpp │ │ ├── X86Backend.h │ │ ├── X86FuseConvRelu.cpp │ │ ├── X86FuseConvRelu.h │ │ ├── X86InplaceValueFusible.cpp │ │ ├── X86InplaceValueFusible.h │ │ ├── X86Interpreter.h │ │ ├── X86RemoveWeightFromLiveIntervals.cpp │ │ └── X86RemoveWeightFromLiveIntervals.h └── Transforms │ ├── BookONNXGraphs.cpp │ ├── BuildInitializers.cpp │ ├── BuildInputOperators.cpp │ ├── BuildOutputOperators.cpp │ ├── CMakeLists.txt │ ├── DeadNodeElimination.cpp │ ├── EliminateCast.cpp │ ├── ExtractConstToInitializer.cpp │ ├── GraphBuildingPass.cpp │ ├── OnnxOptPass.cpp │ ├── Optimizations │ ├── CMakeLists.txt │ ├── DivideGlobalAPIntoAPs.cpp │ ├── EliminateIdentity.cpp │ ├── ExpandBatchNormalization.cpp │ ├── OptimizationsUtils.cpp │ ├── PropagateConstWithDiffShape.cpp │ ├── ReplaceGemmByConv.cpp │ └── SplitConvPass.cpp │ ├── RemoveTrainingNodes.cpp │ ├── TensorSel.cpp │ └── TensorSel │ ├── ATenLower.cpp │ ├── AbsLower.cpp │ ├── AcosLower.cpp │ ├── AddLower.cpp │ ├── AffineLower.cpp │ ├── AndLower.cpp │ ├── ArgMaxLower.cpp │ ├── ArgMinLower.cpp │ ├── AsinLower.cpp │ ├── AtanLower.cpp │ ├── AveragePoolLower.cpp │ ├── BatchNormalizationLower.cpp │ ├── CMakeLists.txt │ ├── CastLower.cpp │ ├── CeilLower.cpp │ ├── ClipLower.cpp │ ├── ConcatLower.cpp │ ├── ConstantFillLower.cpp │ ├── ConstantLower.cpp │ ├── ConvLower.cpp │ ├── ConvTransposeLower.cpp │ ├── CosLower.cpp │ ├── CropLower.cpp │ ├── DefaultAttributes.cpp │ ├── DefaultAttributes.h │ ├── DepthToSpaceLower.cpp │ ├── DivLower.cpp │ ├── DropoutLower.cpp │ ├── EluLower.cpp │ ├── EqualLower.cpp │ ├── ExpLower.cpp │ ├── ExpandLower.cpp │ ├── FlattenLower.cpp │ ├── FloorLower.cpp │ ├── GRULower.cpp │ ├── GRUUnitLower.cpp │ ├── GatherLower.cpp │ ├── GemmLower.cpp │ ├── GivenTensorFillLower.cpp │ ├── GlobalAveragePoolLower.cpp │ ├── GlobalLpPoolLower.cpp │ ├── GlobalMaxPoolLower.cpp │ ├── GreaterLower.cpp │ ├── HardSigmoidLower.cpp │ ├── HardmaxLower.cpp │ ├── IdentityLower.cpp │ ├── IfLower.cpp │ ├── ImageScalerLower.cpp │ ├── InstanceNormalizationLower.cpp │ ├── LRNLower.cpp │ ├── LSTMLower.cpp │ ├── LeakyReluLower.cpp │ ├── LessLower.cpp │ ├── LogLower.cpp │ ├── LogSoftmaxLower.cpp │ ├── LoopLower.cpp │ ├── Lower.cpp │ ├── LowerRegistry.cpp │ ├── LpNormalizationLower.cpp │ ├── LpPoolLower.cpp │ ├── MatMulLower.cpp │ ├── MaxLower.cpp │ ├── MaxPoolLower.cpp │ ├── MaxRoiPoolLower.cpp │ ├── MeanLower.cpp │ ├── MeanVarianceNormalizationLower.cpp │ ├── MinLower.cpp │ ├── MulLower.cpp │ ├── MultinomialLower.cpp │ ├── NegLower.cpp │ ├── NotLower.cpp │ ├── OrLower.cpp │ ├── PReluLower.cpp │ ├── PadLower.cpp │ ├── ParametricSoftplusLower.cpp │ ├── PowLower.cpp │ ├── RNNLower.cpp │ ├── RandomNormalLikeLower.cpp │ ├── RandomNormalLower.cpp │ ├── RandomUniformLikeLower.cpp │ ├── RandomUniformLower.cpp │ ├── ReciprocalLower.cpp │ ├── ReduceL1Lower.cpp │ ├── ReduceL2Lower.cpp │ ├── ReduceLogSumExpLower.cpp │ ├── ReduceLogSumLower.cpp │ ├── ReduceMaxLower.cpp │ ├── ReduceMeanLower.cpp │ ├── ReduceMinLower.cpp │ ├── ReduceProdLower.cpp │ ├── ReduceSumLower.cpp │ ├── ReduceSumSquareLower.cpp │ ├── ReluLower.cpp │ ├── ReshapeLower.cpp │ ├── ScaleLower.cpp │ ├── ScaledTanhLower.cpp │ ├── ScanLower.cpp │ ├── SeluLower.cpp │ ├── ShapeLower.cpp │ ├── SigmoidLower.cpp │ ├── SinLower.cpp │ ├── SizeLower.cpp │ ├── SliceLower.cpp │ ├── SoftmaxLower.cpp │ ├── SoftplusLower.cpp │ ├── SoftsignLower.cpp │ ├── SpaceToDepthLower.cpp │ ├── SplitLower.cpp │ ├── SqrtLower.cpp │ ├── SqueezeLower.cpp │ ├── SubLower.cpp │ ├── SumLower.cpp │ ├── TanLower.cpp │ ├── TanhLower.cpp │ ├── ThresholdedReluLower.cpp │ ├── TileLower.cpp │ ├── TopKLower.cpp │ ├── TransposeLower.cpp │ ├── UnsqueezeLower.cpp │ ├── UpsampleLower.cpp │ └── XorLower.cpp ├── m4 ├── .gitignore ├── README ├── acx_pthread.m4 ├── ax_cxx_compile_stdcxx.m4 ├── ax_cxx_compile_stdcxx_11.m4 ├── ax_cxx_compile_stdcxx_14.m4 ├── ax_prog_doxygen.m4 ├── canoncial_system.m4 ├── cond_config.m4 ├── config.m4 ├── cxx_flag_check.m4 ├── dl.m4 ├── enable_option.m4 ├── llvm_check.m4 ├── onnc-target.m4 ├── onnx_check.m4 ├── optimizer.m4 ├── proto_config.m4 ├── pthread_check.m4 ├── setup_onnc_flags.m4 ├── skypat_check.m4 ├── stl_hash.m4 ├── targets │ └── x86.m4 ├── werror-flags.m4 └── zlib_check.m4 ├── nvdla └── sw.diff ├── scripts ├── .gitignore ├── ComputeIRTemplate.cpp ├── ComputeIRTemplate.h ├── ComputeVisitorTemplate.h ├── LowerTemplate.cpp ├── LowerTemplate.h ├── convert-jpeg-to-tensor.py ├── convert-tensor-to-jpeg.py ├── create-new-backend.sh ├── format-source-files.sh ├── generate_compute_ir.py ├── runtime │ ├── .gitignore │ ├── Interpreter.template.cpp │ ├── Interpreter.visitor.template.cpp │ ├── code_generator.py │ ├── onnc-runtime.template.h │ ├── operator.template.c │ └── operator.template.h └── test-driver ├── single_layer_test ├── Add │ ├── 4983_Add.dimg │ ├── 4983_Add.onnx │ ├── 4983_Add.pgm │ ├── 4984_Add.dimg │ ├── 4984_Add.onnx │ ├── 4984_Add.pgm │ ├── 4991_Add.dimg │ ├── 4991_Add.onnx │ └── 4991_Add.pgm ├── AveragePool │ ├── 5116_AveragePool.dimg │ ├── 5116_AveragePool.onnx │ ├── 5116_AveragePool.pgm │ ├── 5120_AveragePool.dimg │ ├── 5120_AveragePool.onnx │ ├── 5120_AveragePool.pgm │ ├── 5128_AveragePool.dimg │ ├── 5128_AveragePool.onnx │ └── 5128_AveragePool.pgm ├── BatchNormalization │ ├── 5226_BatchNormalization.dimg │ ├── 5226_BatchNormalization.onnx │ ├── 5226_BatchNormalization.pgm │ ├── 5236_BatchNormalization.dimg │ ├── 5236_BatchNormalization.onnx │ ├── 5236_BatchNormalization.pgm │ ├── 5247_BatchNormalization.dimg │ ├── 5247_BatchNormalization.onnx │ └── 5247_BatchNormalization.pgm ├── Concat │ ├── 5328_Concat.dimg │ ├── 5328_Concat.onnx │ ├── 5328_Concat.pgm │ ├── 5330_Concat.dimg │ ├── 5330_Concat.onnx │ ├── 5330_Concat.pgm │ ├── 5436_Concat.dimg │ ├── 5436_Concat.onnx │ └── 5436_Concat.pgm ├── Conv │ ├── 4781_Conv.dimg │ ├── 4781_Conv.onnx │ ├── 4781_Conv.pgm │ ├── 4783_Conv.dimg │ ├── 4783_Conv.onnx │ ├── 4783_Conv.pgm │ ├── 4791_Conv.dimg │ ├── 4791_Conv.onnx │ └── 4791_Conv.pgm ├── Gemm │ ├── 5384_Gemm.dimg │ ├── 5384_Gemm.onnx │ ├── 5384_Gemm.pgm │ ├── 5385_Gemm.dimg │ ├── 5385_Gemm.onnx │ ├── 5385_Gemm.pgm │ ├── 5386_Gemm.dimg │ ├── 5386_Gemm.onnx │ └── 5386_Gemm.pgm ├── GlobalAveragePool │ ├── 5415_GlobalAveragePool.dimg │ ├── 5415_GlobalAveragePool.onnx │ ├── 5415_GlobalAveragePool.pgm │ ├── 5420_GlobalAveragePool.dimg │ ├── 5420_GlobalAveragePool.onnx │ ├── 5420_GlobalAveragePool.pgm │ ├── 5423_GlobalAveragePool.dimg │ ├── 5423_GlobalAveragePool.onnx │ └── 5423_GlobalAveragePool.pgm ├── LRN │ ├── 5439_LRN.dimg │ ├── 5439_LRN.onnx │ ├── 5439_LRN.pgm │ ├── 5442_LRN.dimg │ ├── 5442_LRN.onnx │ ├── 5442_LRN.pgm │ ├── 5452_LRN.dimg │ ├── 5452_LRN.onnx │ └── 5452_LRN.pgm ├── MaxPool │ ├── 5488_MaxPool.dimg │ ├── 5488_MaxPool.onnx │ ├── 5488_MaxPool.pgm │ ├── 5492_MaxPool.dimg │ ├── 5492_MaxPool.onnx │ ├── 5492_MaxPool.pgm │ ├── 5500_MaxPool.dimg │ ├── 5500_MaxPool.onnx │ └── 5500_MaxPool.pgm ├── Mul │ ├── 5599_Mul.dimg │ ├── 5599_Mul.onnx │ ├── 5599_Mul.pgm │ ├── 5600_Mul.dimg │ ├── 5600_Mul.onnx │ ├── 5600_Mul.pgm │ ├── 5606_Mul.dimg │ ├── 5606_Mul.onnx │ └── 5606_Mul.pgm ├── Relu │ ├── 5731_Relu.dimg │ ├── 5731_Relu.onnx │ ├── 5731_Relu.pgm │ ├── 5737_Relu.dimg │ ├── 5737_Relu.onnx │ ├── 5737_Relu.pgm │ ├── 5742_Relu.dimg │ ├── 5742_Relu.onnx │ └── 5742_Relu.pgm ├── Reshape │ ├── 5805_Reshape.dimg │ ├── 5805_Reshape.onnx │ ├── 5805_Reshape.pgm │ ├── 5811_Reshape.dimg │ ├── 5811_Reshape.onnx │ ├── 5811_Reshape.pgm │ ├── 5816_Reshape.dimg │ ├── 5816_Reshape.onnx │ └── 5816_Reshape.pgm ├── Softmax │ ├── 5834_Softmax.dimg │ ├── 5834_Softmax.onnx │ ├── 5834_Softmax.pgm │ ├── 5835_Softmax.dimg │ ├── 5835_Softmax.onnx │ ├── 5835_Softmax.pgm │ ├── 5841_Softmax.dimg │ ├── 5841_Softmax.onnx │ └── 5841_Softmax.pgm ├── Transpose │ ├── 5917_Transpose.dimg │ ├── 5917_Transpose.onnx │ ├── 5917_Transpose.pgm │ ├── 5922_Transpose.dimg │ ├── 5922_Transpose.onnx │ ├── 5922_Transpose.pgm │ ├── 5952_Transpose.dimg │ ├── 5952_Transpose.onnx │ └── 5952_Transpose.pgm ├── Unsqueeze │ ├── 5967_Unsqueeze.dimg │ ├── 5967_Unsqueeze.onnx │ ├── 5967_Unsqueeze.pgm │ ├── 5970_Unsqueeze.dimg │ ├── 5970_Unsqueeze.onnx │ └── 5970_Unsqueeze.pgm └── compile-models.sh └── tools ├── .gitignore ├── CMakeLists.txt ├── Makefile.am ├── onnc-jit ├── CMakeLists.txt ├── Makefile.am ├── ONNCJITApp.cpp ├── ONNCJITApp.h ├── ONNCJITConfig.cpp ├── ONNCJITConfig.h └── main.cpp ├── onnc ├── CMakeLists.txt ├── Makefile.am ├── ONNCApp.cpp ├── ONNCApp.h ├── ONNCConfig.cpp ├── ONNCConfig.h └── main.cpp ├── onni ├── CMakeLists.txt ├── CountOperatorsPass.cpp ├── CountOperatorsPass.h ├── InterpreterPass.cpp ├── InterpreterPass.h ├── Makefile.am ├── ONNIApp.cpp ├── ONNIApp.h ├── ONNIConfig.cpp ├── ONNIConfig.h ├── Statistics.h └── main.cpp ├── onnx2tg ├── CMakeLists.txt ├── Config.cpp ├── Config.h ├── Makefile.am ├── ONNX2TGApp.cpp ├── ONNX2TGApp.h └── main.cpp ├── pb2t ├── CMakeLists.txt └── main.cpp ├── readonnx ├── CMakeLists.txt ├── Makefile.am ├── ReadONNXApp.cpp ├── ReadONNXApp.h ├── ReadONNXConfig.cpp ├── ReadONNXConfig.h └── main.cpp └── unittests ├── .gitignore ├── AnyTest.cpp ├── BinaryTreeTest.cpp ├── CMakeLists.txt ├── ComputeGraphTest.cpp ├── ComputeIRTest.cpp ├── CounterTest.cpp ├── DigraphTest.cpp ├── FileHandleTest.cpp ├── GroupTest.cpp ├── JsonObjectTest.cpp ├── JsonValueTest.cpp ├── LivenessAnalysisTest.cpp ├── Makefile.am ├── MemAllocTest.cpp ├── ONNXReaderTest.cpp ├── Optimizations ├── CMakeLists.txt ├── DivideGlobalAPIntoAPsTest.cpp ├── EliminateIdentityTest.cpp ├── GraphUtils.h ├── PropagateConstWithDiffShapeTest.cpp ├── ReplaceGemmByConvTest.cpp ├── SplitConvTest.cpp └── TestUtils.h ├── PassManagerTest.cpp ├── QuadrupleTest.cpp ├── Runtime ├── AbsTest.cpp ├── CMakeLists.txt ├── TransposeTest.cpp └── valarray.hpp ├── StatisticsTest.cpp ├── StorageTest.cpp ├── StringMapTest.cpp ├── StringRefTest.cpp ├── StringSwitchTest.cpp ├── TensorSelTest.cpp ├── data ├── empty.json ├── squeezenet │ └── model.onnx ├── statistics.json ├── target.json └── test.txt └── main.cpp /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Report a bug while building, patching or running ONNC 4 | 5 | --- 6 | 7 | **Expected Result**: 8 | 9 | **Actual Result**: 10 | 11 | **Steps to reproduce**: 12 | 13 | **Environment**: 14 | 15 | - ONNC version: 16 | - OS (e.g. from `python -c "import platform as p; print(p.platform());print(p.processor())"`): 17 | - Others: 18 | 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement Request 3 | about: Suggest an enhancement to the ONNC project 4 | 5 | --- 6 | 7 | **What to add**: 8 | 9 | **Why it is necessary**: 10 | 11 | **How to achieve it**: 12 | 13 | -------------------------------------------------------------------------------- /.github/OWNERS: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | Makefile.in 3 | aclocal.m4 4 | config.log 5 | configure 6 | autom4te.cache 7 | build* 8 | .vscode 9 | *.swp 10 | *.nvdla 11 | -------------------------------------------------------------------------------- /BUGS: -------------------------------------------------------------------------------- 1 | 0.9.0 Known Bugs 2 | - Compute operators don't have internval onnc::Value. 3 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS=-I m4 2 | 3 | AUTOMAKE_OPTIONS = foreign 4 | 5 | SUBDIRS = include lib tools 6 | 7 | dist_pkgdata_DATA = README.md LICENSE.TXT 8 | 9 | EXTRA_DIST = ./autogen.sh 10 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.3.0 2 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # The ONNC Project 3 | # 4 | 5 | call() 6 | { 7 | local PROGRAM=`which $1` 8 | if [ ! -z "${PROGRAM}" ]; then 9 | $* 10 | else 11 | echo "error: $1: command not found" 12 | exit 1 13 | fi 14 | } 15 | 16 | LIBTOOLIZE=libtoolize 17 | my_uname=`uname` 18 | 19 | if [ ${my_uname} = "Darwin" ]; then 20 | LIBTOOLIZE=glibtoolize 21 | fi 22 | root=`dirname $0` 23 | cd $root 24 | 25 | call aclocal -I ./m4 26 | call autoheader 27 | call ${LIBTOOLIZE} --force 28 | call automake --add-missing 29 | call autoconf 30 | -------------------------------------------------------------------------------- /cmake/FindGlog.cmake: -------------------------------------------------------------------------------- 1 | find_library(GLOG_LIBRARIES 2 | NAMES glog 3 | HINTS ${GLOG_ROOT}/lib 4 | ) 5 | 6 | get_filename_component(GLOG_LIBRARY_DIR ${GLOG_LIBRARIES} DIRECTORY) 7 | find_path(GLOG_INCLUDE_DIR 8 | NAMES glog/logging.h 9 | HINTS ${GLOG_ROOT}/include 10 | ) 11 | include(FindPackageHandleStandardArgs) 12 | find_package_handle_standard_args(GLOG REQUIRED_VARS GLOG_INCLUDE_DIR GLOG_LIBRARY_DIR) 13 | -------------------------------------------------------------------------------- /cmake/FindMKLDNN.cmake: -------------------------------------------------------------------------------- 1 | find_library(MKLDNN_LIBRARIES 2 | NAMES mkldnn 3 | HINTS ${MKLDNN_ROOT}/lib 4 | ) 5 | get_filename_component(MKLDNN_LIBRARY_DIR ${MKLDNN_LIBRARIES} DIRECTORY) 6 | find_path(MKLDNN_INCLUDE_DIR 7 | NAMES mkldnn.h 8 | HINTS ${MKLDNN_ROOT}/include 9 | ) 10 | include(FindPackageHandleStandardArgs) 11 | find_package_handle_standard_args(MKLDNN REQUIRED_VARS MKLDNN_INCLUDE_DIR MKLDNN_LIBRARY_DIR) 12 | -------------------------------------------------------------------------------- /cmake/FindProtoBuf.cmake: -------------------------------------------------------------------------------- 1 | find_library(PROTOBUF_LIBRARIES 2 | NAMES protobuf 3 | HINTS ${PROTOBUF_ROOT}/lib 4 | ) 5 | 6 | get_filename_component(PROTOBUF_LIBRARY_DIR ${PROTOBUF_LIBRARIES} DIRECTORY) 7 | find_path(PROTOBUF_INCLUDE_DIR 8 | NAMES google/protobuf/api.pb.h 9 | HINTS ${PROTOBUF_ROOT}/include 10 | ) 11 | include(FindPackageHandleStandardArgs) 12 | find_package_handle_standard_args(PROTOBUF REQUIRED_VARS PROTOBUF_INCLUDE_DIR PROTOBUF_LIBRARY_DIR) 13 | -------------------------------------------------------------------------------- /cmake/FindSkyPat.cmake: -------------------------------------------------------------------------------- 1 | find_library(SKYPAT_LIBRARIES 2 | NAMES skypat 3 | HINTS ${SKYPAT_ROOT}/lib 4 | ) 5 | get_filename_component(SKYPAT_LIBRARY_DIR ${SKYPAT_LIBRARIES} DIRECTORY) 6 | find_path(SKYPAT_INCLUDE_DIR 7 | NAMES skypat/skypat.h 8 | HINTS ${SKYPAT_ROOT}/include 9 | ) 10 | include(FindPackageHandleStandardArgs) 11 | find_package_handle_standard_args(SKYPAT REQUIRED_VARS SKYPAT_INCLUDE_DIR SKYPAT_LIBRARY_DIR) 12 | -------------------------------------------------------------------------------- /cmake/ONNCConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # This file provides information and services to the final user. 2 | 3 | set(ONNC_INCLUDE_DIRS "@LIBONNC_INCLUDES@") 4 | set(ONNC_LDFLAGS "@LIBONNC_LIBS@") 5 | set(ONNC_LIBRARY_DIR "@LIBONNC_LIBS@") 6 | -------------------------------------------------------------------------------- /cmake/option.cmake: -------------------------------------------------------------------------------- 1 | function(option_bool) 2 | cmake_parse_arguments(OPT "" "NAME;HELP;CHECK;DEFAULT" "" ${ARGN}) 3 | set(${OPT_NAME} ${OPT_DEFAULT} CACHE BOOL ${OPT_HELP}) 4 | if (OPT_CHECK AND NOT ${OPT_CHECK}) 5 | unset(${OPT_NAME} CACHE) 6 | endif() 7 | endfunction() 8 | 9 | function(option_enum) 10 | cmake_parse_arguments(OPT "" "NAME;HELP;CHECK" "VALUE" ${ARGN}) 11 | list(GET OPT_VALUE 0 DEFAULT) 12 | string(REPLACE ";" " " VALUE_HELP "${OPT_VALUE}") 13 | set(${OPT_NAME} ${DEFAULT} CACHE STRING "${OPT_HELP}, options are: ${VALUE_HELP}") 14 | set_property(CACHE ${OPT_NAME} PROPERTY STRINGS ${OPT_VALUE}) 15 | if (OPT_CHECK AND NOT ${OPT_CHECK}) 16 | unset(${OPT_NAME} CACHE) 17 | endif() 18 | endfunction() 19 | -------------------------------------------------------------------------------- /cmake/try_compile.cc.in: -------------------------------------------------------------------------------- 1 | @OPT_HEAD@ 2 | int main () 3 | { 4 | @OPT_CODE@; 5 | return 0; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /docs/images/preface_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/docs/images/preface_architecture.png -------------------------------------------------------------------------------- /docs/onnc.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/docs/onnc.dia -------------------------------------------------------------------------------- /example/runtime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.9) 2 | 3 | set(PROJECT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) 4 | 5 | add_subdirectory(src) 6 | -------------------------------------------------------------------------------- /example/runtime/bin/onnc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/example/runtime/bin/onnc -------------------------------------------------------------------------------- /example/runtime/bin/pb2t: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/example/runtime/bin/pb2t -------------------------------------------------------------------------------- /example/runtime/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(inference LANGUAGES C) 2 | set(CMAKE_C_STANDARD 99) 3 | set(CMAKE_C_STANDARD_REQUIRED ON) 4 | set(CMAKE_C_EXTENSIONS OFF) 5 | 6 | include_directories(${PROJECT_INCLUDE_DIR}) 7 | 8 | add_executable(inference 9 | client-app.c 10 | client-lib.c 11 | onnc-runtime-service.c 12 | onnc-runtime-core.c 13 | ) 14 | 15 | target_link_libraries(inference 16 | onnc-rt 17 | m 18 | ) 19 | 20 | OPTION(USE_MKLDNN "Use mkldnn" ON) 21 | if(USE_MKLDNN) 22 | target_link_libraries(inference 23 | dnnl 24 | ) 25 | endif() 26 | -------------------------------------------------------------------------------- /example/runtime/src/onnc-runtime-core.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | bool ONNC_RUNTIME_has_tensor(const struct ONNC_RUNTIME_tensor_offset_table* table, uint64_t tensor) 6 | { 7 | if (table == NULL) { 8 | return false; 9 | } 10 | 11 | return tensor < table->number_of_tensors; 12 | } 13 | 14 | struct ONNC_RUNTIME_tensor_offset ONNC_RUNTIME_get_tensor_offset(const struct ONNC_RUNTIME_tensor_offset_table* table, 15 | uint64_t tensor) 16 | { 17 | assert(ONNC_RUNTIME_has_tensor(table, tensor)); 18 | 19 | return table->tensor_offsets[tensor]; 20 | } 21 | -------------------------------------------------------------------------------- /include/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | -------------------------------------------------------------------------------- /include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | install(DIRECTORY onnc DESTINATION include 3 | FILES_MATCHING 4 | PATTERN "*" 5 | PATTERN "*.in" EXCLUDE 6 | PATTERN "Makefile.am" EXCLUDE) 7 | 8 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/onnc DESTINATION include 9 | FILES_MATCHING 10 | PATTERN "*.h" 11 | PATTERN "*.def") 12 | -------------------------------------------------------------------------------- /include/onnc/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | .*.swp 3 | -------------------------------------------------------------------------------- /include/onnc/ADT/If.h: -------------------------------------------------------------------------------- 1 | //===- If.h ---------------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_ADT_IF_H 9 | #define ONNC_ADT_IF_H 10 | 11 | namespace onnc { 12 | 13 | template 14 | struct if_c { 15 | typedef T1 type; 16 | }; 17 | 18 | template 19 | struct if_c 20 | { 21 | typedef T2 type; 22 | }; 23 | 24 | } // namespace of onnc 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /include/onnc/ADT/StringMap.h: -------------------------------------------------------------------------------- 1 | //===- StringMap.h --------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_ADT_STRING_MAP_H 9 | #define ONNC_ADT_STRING_MAP_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | template 15 | using StringMap = StringHashTable >; 17 | 18 | } // namespace of onnc 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /include/onnc/ADT/TriState.h: -------------------------------------------------------------------------------- 1 | //===- TriState.h ---------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_ADT_TRISTATE_H 9 | #define ONNC_ADT_TRISTATE_H 10 | 11 | namespace onnc { 12 | 13 | // Other safe-to-copy-by-value common option types. 14 | enum TriState { 15 | TriTrue, 16 | TriFalse, 17 | TriUnset 18 | }; 19 | 20 | } // namespace of onnc 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /include/onnc/Analysis/GlobalStatistics.h: -------------------------------------------------------------------------------- 1 | //===- SkyGlobal.h --------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_ANALYSIS_GLOBALSTATISTICS_H 9 | #define ONNC_ANALYSIS_GLOBALSTATISTICS_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | namespace global { 15 | 16 | Statistics& stats(); 17 | 18 | 19 | } // namespace of global 20 | 21 | 22 | /// Clear global::config() 23 | void ClearStats(); 24 | 25 | 26 | } // namespace of skymizer 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /include/onnc/Diagnostic/Bits/header.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/include/onnc/Diagnostic/Bits/header.h -------------------------------------------------------------------------------- /include/onnc/IR/ONNCModulePrinter.h: -------------------------------------------------------------------------------- 1 | //===- ONNC_MODULE_PRINTER.h -----------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_MODULE_PRINTER_H 9 | #define ONNC_MODULE_PRINTER_H 10 | 11 | #include 12 | 13 | namespace onnc { 14 | ModulePass *createONNCModulePrinterPass(); 15 | } 16 | 17 | 18 | #endif // ONNC_MODULE_PRINTER_H 19 | -------------------------------------------------------------------------------- /include/onnc/IR/ONNCNodeNameGen.h: -------------------------------------------------------------------------------- 1 | //===- ONNCNodeNameGen.h --------------------------------------------------===// 2 | 3 | // 4 | // The ONNC Project 5 | // 6 | // See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | #ifndef ONNC_NODE_NAME_GEN_H 10 | #define ONNC_NODE_NAME_GEN_H 11 | 12 | #include 13 | 14 | namespace onnc { 15 | ModulePass *createONNCNodeNameGenPass(); 16 | } 17 | 18 | #endif // ONNC_NODE_NAME_GEN_H 19 | -------------------------------------------------------------------------------- /include/onnc/Option/Bits/header.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/include/onnc/Option/Bits/header.h -------------------------------------------------------------------------------- /include/onnc/Runtime/onnc-runtime-internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "onnc-runtime.h" 4 | 5 | #include 6 | 7 | typedef struct ONNC_RUNTIME_Context { 8 | void *input_context; 9 | void *weight_context; 10 | void *output_context; 11 | void **mem; /* Deprecated */ 12 | size_t mem_i; /* Deprecated */ 13 | } Context; 14 | 15 | 16 | //void *ONNC_RUNTIME_internal_allocate_memory(void *onnc_runtime_context, size_t num, size_t size); 17 | 18 | //void *ONNC_RUNTIME_initial_temporary_tensor_memory(void *onnc_runtime_context); 19 | 20 | typedef struct ONNC_RUNTIME_Tensor_offset TensorOffset; 21 | typedef struct ONNC_RUNTIME_Tensor_offset_table TensorOffsetTable; 22 | 23 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/abs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_abs_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/acos.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_acos_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/add.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_add_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/affine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_affine_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ,float beta 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/and.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_and_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/argmax.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_argmax_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t axis 13 | ,int32_t keepdims 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/argmin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_argmin_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t axis 13 | ,int32_t keepdims 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/asin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_asin_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/atan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_atan_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/aten.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_aten_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * const * restrict input_input 9 | ,int32_t input_input_ntensor 10 | ,const int32_t * input_input_ndim, const int32_t * const * restrict input_input_dims 11 | ,float * const * restrict output_output 12 | ,int32_t output_output_ntensor 13 | ,const int32_t * output_output_ndim, const int32_t * const * restrict output_output_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/averagepool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_averagepool_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,const char * restrict auto_pad 13 | ,int32_t count_include_pad 14 | ,int32_t * restrict kernel_shape 15 | ,int32_t number_of_kernel_shape 16 | ,int32_t * restrict pads 17 | ,int32_t number_of_pads 18 | ,int32_t * restrict strides 19 | ,int32_t number_of_strides 20 | ); 21 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/cast.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_cast_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t to 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/ceil.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_ceil_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/clip.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_clip_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,float max 13 | ,float min 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/concat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_concat_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * const * restrict input_inputs 9 | ,int32_t input_inputs_ntensor 10 | ,const int32_t * input_inputs_ndim, const int32_t * const * restrict input_inputs_dims 11 | ,float * restrict output_concat_result 12 | ,int32_t output_concat_result_ndim, const int32_t * restrict output_concat_result_dims 13 | ,int32_t axis 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/constant.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_constant_float( 7 | void * restrict onnc_runtime_context 8 | 9 | ,float * restrict output_output 10 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 11 | ,const void * restrict value 12 | ); 13 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/constantfill.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_constantfill_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t dtype 13 | ,int32_t * restrict extra_shape 14 | ,int32_t number_of_extra_shape 15 | ,int32_t input_as_shape 16 | ,int32_t * restrict shape 17 | ,int32_t number_of_shape 18 | ,float value 19 | ); 20 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/cos.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_cos_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/crop.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_crop_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t * restrict border 13 | ,int32_t number_of_border 14 | ,int32_t * restrict scale 15 | ,int32_t number_of_scale 16 | ); 17 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/depthtospace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_depthtospace_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t blocksize 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/div.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_div_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/dropout.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_dropout_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,float * restrict output_mask 13 | ,int32_t output_mask_ndim, const int32_t * restrict output_mask_dims 14 | ,float ratio 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/elu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_elu_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/equal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_equal_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/exp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_exp_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/expand.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_expand_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,const float * restrict input_shape 11 | ,int32_t input_shape_ndim, const int32_t * restrict input_shape_dims 12 | ,float * restrict output_output 13 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/flatten.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_flatten_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t axis 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/floor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_floor_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/gather.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_gather_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,const float * restrict input_indices 11 | ,int32_t input_indices_ndim, const int32_t * restrict input_indices_dims 12 | ,float * restrict output_output 13 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 14 | ,int32_t axis 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/gemm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_gemm_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,const float * restrict input_C 13 | ,int32_t input_C_ndim, const int32_t * restrict input_C_dims 14 | ,float * restrict output_Y 15 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 16 | ,float alpha 17 | ,float beta 18 | ,int32_t transA 19 | ,int32_t transB 20 | ); 21 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/giventensorfill.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_giventensorfill_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_shape 9 | ,int32_t input_shape_ndim, const int32_t * restrict input_shape_dims 10 | ,float * restrict output_X 11 | ,int32_t output_X_ndim, const int32_t * restrict output_X_dims 12 | ,int32_t * restrict extra_shape 13 | ,int32_t number_of_extra_shape 14 | ,int32_t input_as_shape 15 | ,int32_t * restrict shape 16 | ,int32_t number_of_shape 17 | ,float * restrict values 18 | ,int32_t number_of_values 19 | ); 20 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/globalaveragepool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_globalaveragepool_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/globallppool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_globallppool_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,int32_t p 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/globalmaxpool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_globalmaxpool_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/greater.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_greater_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/hardmax.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_hardmax_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t axis 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/hardsigmoid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_hardsigmoid_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ,float beta 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/identity.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_identity_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/if.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_if_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_cond 9 | ,int32_t input_cond_ndim, const int32_t * restrict input_cond_dims 10 | ,float * const * restrict output_outputs 11 | ,int32_t output_outputs_ntensor 12 | ,const int32_t * output_outputs_ndim, const int32_t * const * restrict output_outputs_dims 13 | ,const void * restrict else_branch 14 | ,const void * restrict then_branch 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/imagescaler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_imagescaler_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,float * restrict bias 13 | ,int32_t number_of_bias 14 | ,float scale 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/instancenormalization.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_instancenormalization_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,const float * restrict input_scale 11 | ,int32_t input_scale_ndim, const int32_t * restrict input_scale_dims 12 | ,const float * restrict input_B 13 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 14 | ,float * restrict output_output 15 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 16 | ,float epsilon 17 | ); 18 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/leakyrelu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_leakyrelu_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/less.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_less_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_log_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/logsoftmax.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_logsoftmax_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t axis 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/loopindextensor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_loopindextensor_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_T 9 | ,int32_t input_T_ndim, const int32_t * restrict input_T_dims 10 | ,const float * restrict input_loop_idx 11 | ,int32_t input_loop_idx_ndim, const int32_t * restrict input_loop_idx_dims 12 | ,float * restrict output_O 13 | ,int32_t output_O_ndim, const int32_t * restrict output_O_dims 14 | ,int32_t axis 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/lpnormalization.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_lpnormalization_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t axis 13 | ,int32_t p 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/lppool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_lppool_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,const char * restrict auto_pad 13 | ,int32_t * restrict kernel_shape 14 | ,int32_t number_of_kernel_shape 15 | ,int32_t p 16 | ,int32_t * restrict pads 17 | ,int32_t number_of_pads 18 | ,int32_t * restrict strides 19 | ,int32_t number_of_strides 20 | ); 21 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/lrn.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_lrn_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ,float beta 14 | ,float bias 15 | ,int32_t size 16 | ); 17 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/matmul.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_matmul_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_Y 13 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/max.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_max_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * const * restrict input_data_0 9 | ,int32_t input_data_0_ntensor 10 | ,const int32_t * input_data_0_ndim, const int32_t * const * restrict input_data_0_dims 11 | ,float * restrict output_max 12 | ,int32_t output_max_ndim, const int32_t * restrict output_max_dims 13 | 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/maxroipool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_maxroipool_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,const float * restrict input_rois 11 | ,int32_t input_rois_ndim, const int32_t * restrict input_rois_dims 12 | ,float * restrict output_Y 13 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 14 | ,int32_t * restrict pooled_shape 15 | ,int32_t number_of_pooled_shape 16 | ,float spatial_scale 17 | ); 18 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/mean.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_mean_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * const * restrict input_data_0 9 | ,int32_t input_data_0_ntensor 10 | ,const int32_t * input_data_0_ndim, const int32_t * const * restrict input_data_0_dims 11 | ,float * restrict output_mean 12 | ,int32_t output_mean_ndim, const int32_t * restrict output_mean_dims 13 | 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/meanvariancenormalization.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_meanvariancenormalization_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t across_channels 13 | ,int32_t normalize_variance 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/min.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_min_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * const * restrict input_data_0 9 | ,int32_t input_data_0_ntensor 10 | ,const int32_t * input_data_0_ndim, const int32_t * const * restrict input_data_0_dims 11 | ,float * restrict output_min 12 | ,int32_t output_min_ndim, const int32_t * restrict output_min_dims 13 | 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/mul.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_mul_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/multinomial.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_multinomial_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t dtype 13 | ,int32_t sample_size 14 | ,float seed 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/neg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_neg_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/not.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_not_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/or.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_or_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/pad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_pad_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,const char * restrict mode 13 | ,int32_t * restrict pads 14 | ,int32_t number_of_pads 15 | ,float value 16 | ); 17 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/parametricsoftplus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_parametricsoftplus_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ,float beta 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/pow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_pow_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,const float * restrict input_Y 11 | ,int32_t input_Y_ndim, const int32_t * restrict input_Y_dims 12 | ,float * restrict output_Z 13 | ,int32_t output_Z_ndim, const int32_t * restrict output_Z_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/prelu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_prelu_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,const float * restrict input_slope 11 | ,int32_t input_slope_ndim, const int32_t * restrict input_slope_dims 12 | ,float * restrict output_Y 13 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/randomnormal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_randomnormal_float( 7 | void * restrict onnc_runtime_context 8 | 9 | ,float * restrict output_output 10 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 11 | ,int32_t dtype 12 | ,float mean 13 | ,float scale 14 | ,float seed 15 | ,int32_t * restrict shape 16 | ,int32_t number_of_shape 17 | ); 18 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/randomnormallike.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_randomnormallike_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t dtype 13 | ,float mean 14 | ,float scale 15 | ,float seed 16 | ); 17 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/randomuniform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_randomuniform_float( 7 | void * restrict onnc_runtime_context 8 | 9 | ,float * restrict output_output 10 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 11 | ,int32_t dtype 12 | ,float high 13 | ,float low 14 | ,float seed 15 | ,int32_t * restrict shape 16 | ,int32_t number_of_shape 17 | ); 18 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/randomuniformlike.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_randomuniformlike_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t dtype 13 | ,float high 14 | ,float low 15 | ,float seed 16 | ); 17 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reciprocal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reciprocal_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reducel1.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reducel1_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ,int32_t keepdims 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reducel2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reducel2_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ,int32_t keepdims 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reducelogsum.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reducelogsum_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ,int32_t keepdims 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reducelogsumexp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reducelogsumexp_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ,int32_t keepdims 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reducemax.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reducemax_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ,int32_t keepdims 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reducemean.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reducemean_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ,int32_t keepdims 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reducemin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reducemin_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ,int32_t keepdims 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reduceprod.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reduceprod_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ,int32_t keepdims 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reducesum.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reducesum_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ,int32_t keepdims 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reducesumsquare.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reducesumsquare_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_reduced 11 | ,int32_t output_reduced_ndim, const int32_t * restrict output_reduced_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ,int32_t keepdims 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/relu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_relu_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/reshape.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_reshape_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,const float * restrict input_shape 11 | ,int32_t input_shape_ndim, const int32_t * restrict input_shape_dims 12 | ,float * restrict output_reshaped 13 | ,int32_t output_reshaped_ndim, const int32_t * restrict output_reshaped_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/scale.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_scale_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,float scale 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/scaledtanh.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_scaledtanh_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,float alpha 13 | ,float beta 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/selu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_selu_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ,float gamma 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/shape.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_shape_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_shape 11 | ,int32_t output_shape_ndim, const int32_t * restrict output_shape_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/sigmoid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_sigmoid_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/sin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_sin_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/size.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_size_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_size 11 | ,int32_t output_size_ndim, const int32_t * restrict output_size_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/slice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_slice_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ,int32_t * restrict ends 15 | ,int32_t number_of_ends 16 | ,int32_t * restrict starts 17 | ,int32_t number_of_starts 18 | ); 19 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/softmax.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_softmax_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t axis 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/softplus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_softplus_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/softsign.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_softsign_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/spacetodepth.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_spacetodepth_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t blocksize 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/split.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_split_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * const * restrict output_outputs 11 | ,int32_t output_outputs_ntensor 12 | ,const int32_t * output_outputs_ndim, const int32_t * const * restrict output_outputs_dims 13 | ,int32_t axis 14 | ,int32_t * restrict split 15 | ,int32_t number_of_split 16 | ); 17 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/sqrt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_sqrt_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/squeeze.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_squeeze_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_squeezed 11 | ,int32_t output_squeezed_ndim, const int32_t * restrict output_squeezed_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/sub.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_sub_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/sum.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_sum_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * const * restrict input_data_0 9 | ,int32_t input_data_0_ntensor 10 | ,const int32_t * input_data_0_ndim, const int32_t * const * restrict input_data_0_dims 11 | ,float * restrict output_sum 12 | ,int32_t output_sum_ndim, const int32_t * restrict output_sum_dims 13 | 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/tan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_tan_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/tanh.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_tanh_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/thresholdedrelu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_thresholdedrelu_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ); 14 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/tile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_tile_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,const float * restrict input_repeats 11 | ,int32_t input_repeats_ndim, const int32_t * restrict input_repeats_dims 12 | ,float * restrict output_output 13 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/topk.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_topk_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Values 11 | ,int32_t output_Values_ndim, const int32_t * restrict output_Values_dims 12 | ,float * restrict output_Indices 13 | ,int32_t output_Indices_ndim, const int32_t * restrict output_Indices_dims 14 | ,int32_t axis 15 | ,int32_t k 16 | ); 17 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/transpose.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_transpose_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_transposed 11 | ,int32_t output_transposed_ndim, const int32_t * restrict output_transposed_dims 12 | ,int32_t * restrict perm 13 | ,int32_t number_of_perm 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/unsqueeze.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_unsqueeze_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_expanded 11 | ,int32_t output_expanded_ndim, const int32_t * restrict output_expanded_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ); 15 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/upsample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_upsample_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,const char * restrict mode 13 | ,float * restrict scales 14 | ,int32_t number_of_scales 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Runtime/operator/xor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_xor_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /include/onnc/Support/Bits/IStrStream.tcc: -------------------------------------------------------------------------------- 1 | //===- IStrStream.tcc -----------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_SUPPORT_INTPUT_STRING_STREAM_TCC 9 | #define ONNC_SUPPORT_INTPUT_STRING_STREAM_TCC 10 | 11 | namespace onnc { 12 | 13 | template 14 | BasicIStrStream::BasicIStrStream(string_type& pStr) 15 | : istream_type(&m_StringBuf), m_StringBuf(pStr, std::ios_base::in) { 16 | this->init(&m_StringBuf); 17 | } 18 | 19 | } // namespace of onnc 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /include/onnc/Support/Bits/header.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/include/onnc/Support/Bits/header.h -------------------------------------------------------------------------------- /include/onnc/Support/SigAction.h: -------------------------------------------------------------------------------- 1 | //===- SigAction.h --------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_SUPPORT_SIGNAL_ACTION_H 9 | #define ONNC_SUPPORT_SIGNAL_ACTION_H 10 | 11 | namespace onnc { 12 | 13 | /** \class SigAction 14 | * \brief provides software signal facilities. 15 | */ 16 | class SigAction 17 | { 18 | public: 19 | void install(); 20 | }; 21 | 22 | } // namespace of onnc 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /include/onnc/Support/TypeTraits.h: -------------------------------------------------------------------------------- 1 | //===- TypeTraits.h -------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_SUPPORT_TYPE_TRAITS_H_INCLUDED 9 | #define ONNC_SUPPORT_TYPE_TRAITS_H_INCLUDED 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace onnc { 16 | 17 | template 18 | using void_t = void; 19 | 20 | } // namespace onnc 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /include/onnc/Target/NPUTargetBackend.h: -------------------------------------------------------------------------------- 1 | //===- NPUTargetBackend.h -------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_TARGET_NETWORK_PROCESSING_UNIT_TARGET_BACKEND_H 9 | #define ONNC_TARGET_NETWORK_PROCESSING_UNIT_TARGET_BACKEND_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | class TargetOptions; 15 | 16 | class NPUTargetBackend : public TargetBackend 17 | { 18 | public: 19 | NPUTargetBackend(const TargetOptions& pOptions); 20 | 21 | virtual ~NPUTargetBackend(); 22 | }; 23 | 24 | } // namespace of onnc 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | -------------------------------------------------------------------------------- /lib/ADT/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | PolicyNodeIterator.cpp 4 | Digraph.cpp 5 | Buffer.cpp 6 | ConstBuffer.cpp 7 | Any.cpp 8 | Color.cpp 9 | TypeTag.cpp 10 | IList.cpp 11 | IListIterator.cpp 12 | Rope.cpp 13 | StringList.cpp 14 | StringRef.cpp 15 | TopologyIterator.cpp) 16 | -------------------------------------------------------------------------------- /lib/Analysis/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | Counter.cpp 4 | GlobalStatistics.cpp 5 | Statistics.cpp 6 | LivenessAnalysis.cpp 7 | MemoryAllocation.cpp 8 | NodeIRScheduler.cpp 9 | SplitNode.cpp 10 | UpdateGraphOutputSize.cpp) 11 | -------------------------------------------------------------------------------- /lib/CodeGen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_libonnc_src( 2 | BuildMemOperand.cpp 3 | FuseInplaceValue.cpp 4 | LinearScanMemAlloc.cpp 5 | LiveInterval.cpp 6 | LiveIntervals.cpp 7 | LiveIntervalsData.cpp 8 | LiveValueMatrix.cpp 9 | MemAllocData.cpp 10 | SetMemOperand.cpp 11 | SlotIndexes.cpp) -------------------------------------------------------------------------------- /lib/Config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | AboutLicense.cpp 4 | AboutData.cpp) 5 | -------------------------------------------------------------------------------- /lib/Core/AnalysisUsage.cpp: -------------------------------------------------------------------------------- 1 | //===- AnalysisUsage.cpp --------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | 10 | using namespace onnc; 11 | 12 | //===----------------------------------------------------------------------===// 13 | // AnalysisUsage 14 | //===----------------------------------------------------------------------===// 15 | AnalysisUsage& AnalysisUsage::addRequiredID(Pass::AnalysisID pID) 16 | { 17 | m_Required.push_back(pID); 18 | return *this; 19 | } 20 | -------------------------------------------------------------------------------- /lib/Core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | PassRegistry.cpp 4 | PassManager.cpp 5 | PassInfo.cpp 6 | AnalysisUsage.cpp 7 | AnalysisResolver.cpp 8 | Pass.cpp 9 | ObjectWriter.cpp 10 | Application.cpp 11 | InitializePasses.cpp) 12 | -------------------------------------------------------------------------------- /lib/Core/ObjectWriter.cpp: -------------------------------------------------------------------------------- 1 | //===- ObjectWriter.cpp ---------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | 10 | using namespace onnc; 11 | 12 | //===----------------------------------------------------------------------===// 13 | // ObjectWriter 14 | //===----------------------------------------------------------------------===// 15 | ObjectWriter::ObjectWriter(OStream& pOS) 16 | : m_pOS(&pOS) { 17 | } 18 | 19 | ObjectWriter::~ObjectWriter() 20 | { 21 | /* To date, do nothing */ 22 | } 23 | -------------------------------------------------------------------------------- /lib/Diagnostic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | Diagnostic.cpp 4 | DiagnosticInfoMap.cpp 5 | Engine.cpp 6 | GeneralOptions.cpp 7 | MsgHandler.cpp 8 | MsgHandling.cpp 9 | Policy.cpp 10 | Logger.cpp 11 | SysLog.cpp 12 | StreamLog.cpp) 13 | -------------------------------------------------------------------------------- /lib/Diagnostic/GeneralOptions.cpp: -------------------------------------------------------------------------------- 1 | //===- GeneralOptions.cpp -------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | 10 | using namespace onnc; 11 | using namespace onnc::diagnostic; 12 | 13 | //===----------------------------------------------------------------------===// 14 | // GeneralOptions 15 | //===----------------------------------------------------------------------===// 16 | GeneralOptions::GeneralOptions() 17 | : m_bIsFatalWarnings(false), m_Verbose(0), 18 | m_MaxErrorNum(10), m_MaxWarnNum(10) { 19 | } 20 | -------------------------------------------------------------------------------- /lib/IR/ComputeRegOperand.cpp: -------------------------------------------------------------------------------- 1 | //===- ComputeRegOperand.cpp -----------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | 10 | using namespace onnc; 11 | 12 | //===----------------------------------------------------------------------===// 13 | // ComputeRegOperand 14 | //===----------------------------------------------------------------------===// 15 | ComputeRegOperand::ComputeRegOperand() 16 | : ComputeOperand(kRegOperand) { 17 | } 18 | 19 | ComputeRegOperand::~ComputeRegOperand() 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /lib/IR/Define.cpp: -------------------------------------------------------------------------------- 1 | //===- Define.cpp ----------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | 10 | using namespace onnc; 11 | 12 | //===----------------------------------------------------------------------===// 13 | // Define 14 | //===----------------------------------------------------------------------===// 15 | Define::Define(StringRef pName) 16 | : m_Name(pName) { 17 | } 18 | 19 | Define::Define(const Define& pCopy) 20 | : m_Name(pCopy.name()) { 21 | } 22 | -------------------------------------------------------------------------------- /lib/IR/ONNCModulePrinter.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace onnc; 8 | 9 | namespace { 10 | 11 | class ONNCModulePrinter : public CustomPass 12 | { 13 | public: 14 | ONNCModulePrinter() = default; 15 | 16 | StringRef getPassName() const override { return "ONNCModulePrinter"; } 17 | 18 | Pass::ReturnType runOnModule(Module &pModule) override 19 | { 20 | ::onnc::DumpModule(pModule); 21 | return Pass::kModuleNoChanged; 22 | } 23 | }; 24 | 25 | } // anonymous namespace 26 | 27 | ModulePass *onnc::createONNCModulePrinterPass() 28 | { 29 | return new ONNCModulePrinter(); 30 | } 31 | -------------------------------------------------------------------------------- /lib/IRReader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | ONNXReader.cpp) 4 | -------------------------------------------------------------------------------- /lib/ONNXWrapper/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # FIXME: Get rid of this one day if onnx can turn off c++ exceptions. 2 | if(CMAKE_COMPILER_IS_GNUCXX OR 3 | "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR 4 | "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel") 5 | add_compile_options(-fexceptions) 6 | endif() 7 | 8 | add_libonnc_src( 9 | ONNXWrapper.cpp) 10 | -------------------------------------------------------------------------------- /lib/Option/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | Alias.cpp 4 | CommandLine.cpp 5 | OptDefs.cpp 6 | Option.cpp 7 | OptionPool.cpp 8 | OptParser.cpp) 9 | -------------------------------------------------------------------------------- /lib/Runtime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_libonnc_src( 2 | Interpreter.cpp 3 | ) 4 | 5 | add_library(${ONNC_RUNTIME_LIB_NAME} 6 | onnc-runtime.c 7 | ) 8 | 9 | OPTION(USE_MKLDNN "Use mkldnn" ON) 10 | if(USE_MKLDNN) 11 | find_package(MKLDNN REQUIRED) 12 | message(STATUS "[${PACKAGE}] Using MKLDNN include at ${MKLDNN_INCLUDE_DIR}") 13 | include_directories(${MKLDNN_INCLUDE_DIR}) 14 | link_directories(${MKLDNN_LIBRARY_DIR}) 15 | add_subdirectory(operatorMKLDNN) 16 | target_link_libraries(onnc-rt dnnl) 17 | else() 18 | add_subdirectory(operator) 19 | endif(USE_MKLDNN) 20 | 21 | install(TARGETS ${ONNC_RUNTIME_LIB_NAME} 22 | ARCHIVE DESTINATION lib/Runtime 23 | ) 24 | -------------------------------------------------------------------------------- /lib/Runtime/operator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB_RECURSE OPERATOR_C_FILES *.c) 2 | 3 | target_sources( 4 | ${ONNC_RUNTIME_LIB_NAME} 5 | PRIVATE ${OPERATOR_C_FILES} 6 | ) 7 | -------------------------------------------------------------------------------- /lib/Runtime/operator/abs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_abs_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_X 10 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 11 | ,float * restrict output_Y 12 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 13 | ) { 14 | int32_t size = 1; 15 | for(int32_t i = 0 ; i < input_X_ndim ; ++i){ 16 | size *= input_X_dims[i]; 17 | } 18 | for(int32_t i = 0 ; i < size ; ++i){ 19 | output_Y[i] = fabs(input_X[i]); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/Runtime/operator/acos.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_acos_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_input 10 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 11 | ,float * restrict output_output 12 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 13 | ) { 14 | int32_t size = 1; 15 | for(int32_t i = 0 ; i < input_input_ndim ; ++i){ 16 | size *= input_input_dims[i]; 17 | } 18 | for(int32_t i = 0 ; i < size ; ++i){ 19 | output_output[i] = acosf(input_input[i]); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/Runtime/operator/add.c: -------------------------------------------------------------------------------- 1 | #include 2 | typedef int32_t ONNC_INDEX_TYPE; 3 | 4 | #include "generic/assign.h" 5 | #include "generic/binary.h" 6 | 7 | static float add_(float a, float b) 8 | { 9 | return a + b; 10 | } 11 | 12 | void ONNC_RUNTIME_add_float(void* restrict context, 13 | const float* restrict A, int32_t Adim, const int32_t* restrict Ashape, 14 | const float* restrict B, int32_t Bdim, const int32_t* restrict Bshape, 15 | float* restrict C, int32_t Cdim, const int32_t* restrict Cshape) 16 | { 17 | ONNC_ASSIGN(float, C, Cshape, Cdim, A, Ashape, Adim); 18 | ONNC_BINARY(float, C, Cshape, Cdim, B, Bshape, Bdim, add_); 19 | } 20 | -------------------------------------------------------------------------------- /lib/Runtime/operator/affine.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_affine_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ,float beta 14 | ) { 15 | int32_t size = 1; 16 | for(int32_t i = 0 ; i < input_X_ndim ; ++i){ 17 | size *= input_X_dims[i]; 18 | } 19 | // y = alpha * x + beta 20 | for(int32_t i = 0 ; i < size ; ++i){ 21 | output_Y[i] = alpha * input_X[i] + beta; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/Runtime/operator/and.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_and_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | ) { 15 | int32_t size = 1; 16 | for(int32_t dim = 0 ; dim < input_A_ndim ; dim++){ 17 | size *= input_A_dims[dim]; 18 | } 19 | for(int32_t index = 0 ; index < size ; index++){ 20 | output_C[index] = (int32_t)input_A[index] & (int32_t)input_B[index]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/asin.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_asin_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_input 10 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 11 | ,float * restrict output_output 12 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 13 | ) { 14 | int32_t size = 1; 15 | for(int32_t i = 0 ; i < input_input_ndim ; ++i){ 16 | size *= input_input_dims[i]; 17 | } 18 | for(int32_t i = 0 ; i < size ; ++i){ 19 | output_output[i] = asinf(input_input[i]); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/Runtime/operator/atan.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_atan_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_input 10 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 11 | ,float * restrict output_output 12 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 13 | ) { 14 | int32_t size = 1; 15 | for(int32_t i = 0 ; i < input_input_ndim ; ++i){ 16 | size *= input_input_dims[i]; 17 | } 18 | for(int32_t i = 0 ; i < size ; ++i){ 19 | output_output[i] = atanf(input_input[i]); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/Runtime/operator/aten.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_aten_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * const * restrict input_input 9 | ,int32_t input_input_ntensor 10 | ,const int32_t * input_input_ndim, const int32_t * const * restrict input_input_dims 11 | ,float * const * restrict output_output 12 | ,int32_t output_output_ntensor 13 | ,const int32_t * output_output_ndim, const int32_t * const * restrict output_output_dims 14 | 15 | ) { 16 | } 17 | -------------------------------------------------------------------------------- /lib/Runtime/operator/cast.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_cast_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t to 13 | ) { 14 | } 15 | -------------------------------------------------------------------------------- /lib/Runtime/operator/ceil.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_ceil_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_X 10 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 11 | ,float * restrict output_Y 12 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 13 | 14 | ) { 15 | int32_t size = 1; 16 | for(int32_t i = 0; i < input_X_ndim; ++i){ 17 | size *= input_X_dims[i]; 18 | } 19 | for(int32_t i = 0; i < size; ++i){ 20 | output_Y[i] = ceil(input_X[i]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/constant.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_constant_float( 7 | void * restrict onnc_runtime_context 8 | 9 | ,float * restrict output_output 10 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 11 | ,const void * restrict value 12 | ) { 13 | int32_t size = 1; 14 | for(int32_t dim = 0 ; dim < output_output_ndim ; dim++){ 15 | size *= output_output_dims[dim]; 16 | } 17 | 18 | float fill = *((float*)value); 19 | for(int32_t index = 0 ; index < size ; index++){ 20 | output_output[index] = fill; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/constantfill.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_constantfill_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t dtype 13 | ,int32_t * restrict extra_shape 14 | ,int32_t number_of_extra_shape 15 | ,int32_t input_as_shape 16 | ,int32_t * restrict shape 17 | ,int32_t number_of_shape 18 | ,float value 19 | ) { 20 | } 21 | -------------------------------------------------------------------------------- /lib/Runtime/operator/cos.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_cos_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_input 10 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 11 | ,float * restrict output_output 12 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 13 | 14 | ) { 15 | int size = 1; 16 | for(int32_t i = 0 ; i < input_input_ndim ;++i){ 17 | size *= input_input_dims[i]; 18 | } 19 | for(int32_t i = 0 ; i < size ; ++i){ 20 | output_output[i] = cosf(input_input[i]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/crop.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_crop_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t * restrict border 13 | ,int32_t number_of_border 14 | ,int32_t * restrict scale 15 | ,int32_t number_of_scale 16 | ) { 17 | } 18 | -------------------------------------------------------------------------------- /lib/Runtime/operator/depthtospace.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_depthtospace_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t blocksize 13 | ) { 14 | } 15 | -------------------------------------------------------------------------------- /lib/Runtime/operator/div.c: -------------------------------------------------------------------------------- 1 | #include 2 | typedef int32_t ONNC_INDEX_TYPE; 3 | 4 | #include "generic/assign.h" 5 | #include "generic/binary.h" 6 | 7 | static float div_(float a, float b) 8 | { 9 | return a / b; 10 | } 11 | 12 | void ONNC_RUNTIME_div_float(void* restrict context, 13 | const float* restrict A, int32_t Adim, const int32_t* restrict Ashape, 14 | const float* restrict B, int32_t Bdim, const int32_t* restrict Bshape, 15 | float* restrict C, int32_t Cdim, const int32_t* restrict Cshape) 16 | { 17 | ONNC_ASSIGN(float, C, Cshape, Cdim, A, Ashape, Adim); 18 | ONNC_BINARY(float, C, Cshape, Cdim, B, Bshape, Bdim, div_); 19 | } 20 | -------------------------------------------------------------------------------- /lib/Runtime/operator/dropout.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_dropout_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,float * restrict output_mask 13 | ,int32_t output_mask_ndim, const int32_t * restrict output_mask_dims 14 | ,float ratio 15 | ) { 16 | } 17 | -------------------------------------------------------------------------------- /lib/Runtime/operator/elu.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_elu_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ) { 14 | } 15 | -------------------------------------------------------------------------------- /lib/Runtime/operator/equal.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_equal_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ) { 16 | int32_t size = 1; 17 | for(int32_t i = 0 ; i < input_A_ndim ; ++i){ 18 | size *= input_A_dims[i]; 19 | } 20 | for(int32_t i = 0 ; i < size ; ++i){ 21 | output_C[i] = (input_A[i] == input_B[i]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/Runtime/operator/exp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_exp_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_input 10 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 11 | ,float * restrict output_output 12 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 13 | 14 | ) { 15 | int32_t size = 1; 16 | for(int32_t dim = 0 ; dim < input_input_ndim ; dim++){ 17 | size *= input_input_dims[dim]; 18 | } 19 | 20 | for(int32_t index = 0 ; index < size ; index++){ 21 | output_output[index] = expf(input_input[index]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/Runtime/operator/expand.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_expand_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,const float * restrict input_shape 11 | ,int32_t input_shape_ndim, const int32_t * restrict input_shape_dims 12 | ,float * restrict output_output 13 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 14 | 15 | ) { 16 | } 17 | -------------------------------------------------------------------------------- /lib/Runtime/operator/flatten.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_flatten_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t axis 13 | ) { 14 | int32_t size = 1; 15 | for(int32_t dim = 0 ; dim < input_input_ndim ; dim++){ 16 | size *= input_input_dims[dim]; 17 | } 18 | 19 | for(int32_t index = 0 ; index < size ; index++){ 20 | output_output[index] = input_input[index]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/floor.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | void ONNC_RUNTIME_floor_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ) { 14 | int32_t size = 1; 15 | for(int32_t i = 0 ; i < input_X_ndim ; ++i){ 16 | size *= input_X_dims[i]; 17 | } 18 | for(int32_t i = 0 ; i < size ; ++i){ 19 | output_Y[i] = floorf(input_X[i]); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/Runtime/operator/gather.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_gather_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,const float * restrict input_indices 11 | ,int32_t input_indices_ndim, const int32_t * restrict input_indices_dims 12 | ,float * restrict output_output 13 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 14 | ,int32_t axis 15 | ) { 16 | } 17 | -------------------------------------------------------------------------------- /lib/Runtime/operator/generic/size.h: -------------------------------------------------------------------------------- 1 | #ifndef ONNC_RUNTIME_SIZE_H 2 | #define ONNC_RUNTIME_SIZE_H 3 | /*! 4 | * \brief Count elements in a tensor 5 | * 6 | * This function returns count of elements given shape of a tensor. 7 | */ 8 | static ONNC_INDEX_TYPE onnc_size(const ONNC_INDEX_TYPE* shape, ONNC_INDEX_TYPE order) 9 | { 10 | ONNC_INDEX_TYPE result = 1; 11 | 12 | for (ONNC_INDEX_TYPE i = 0; i < order; ++i) 13 | result *= shape[i]; 14 | 15 | return result; 16 | } 17 | 18 | #endif 19 | // vim: ft=c 20 | -------------------------------------------------------------------------------- /lib/Runtime/operator/giventensorfill.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_giventensorfill_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_shape 9 | ,int32_t input_shape_ndim, const int32_t * restrict input_shape_dims 10 | ,float * restrict output_X 11 | ,int32_t output_X_ndim, const int32_t * restrict output_X_dims 12 | ,int32_t * restrict extra_shape 13 | ,int32_t number_of_extra_shape 14 | ,int32_t input_as_shape 15 | ,int32_t * restrict shape 16 | ,int32_t number_of_shape 17 | ,float * restrict values 18 | ,int32_t number_of_values 19 | ) { 20 | } 21 | -------------------------------------------------------------------------------- /lib/Runtime/operator/greater.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_greater_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ) { 16 | int32_t size = 1 ; 17 | for(int32_t i = 0 ; i < input_A_ndim ; ++i){ 18 | size *= input_A_dims[i] ; 19 | } 20 | for(int32_t i = 0 ; i < size ; ++i){ 21 | output_C[i] = (input_A[i] > input_B[i]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/Runtime/operator/identity.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_identity_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | 13 | ) { 14 | int32_t size = 1; 15 | for(int32_t i = 0 ; i < input_input_ndim ; ++i){ 16 | size *= input_input_dims[i]; 17 | } 18 | for(int32_t i = 0 ; i < size ; ++i){ 19 | output_output[i] = input_input[i]; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/Runtime/operator/if.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_if_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_cond 9 | ,int32_t input_cond_ndim, const int32_t * restrict input_cond_dims 10 | ,float * const * restrict output_outputs 11 | ,int32_t output_outputs_ntensor 12 | ,const int32_t * output_outputs_ndim, const int32_t * const * restrict output_outputs_dims 13 | ,const void * restrict else_branch 14 | ,const void * restrict then_branch 15 | ) { 16 | } 17 | -------------------------------------------------------------------------------- /lib/Runtime/operator/leakyrelu.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_leakyrelu_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ) { 14 | int32_t size = 1; 15 | for(int32_t i = 0 ; i < input_X_ndim ; ++i){ 16 | size *= input_X_dims[i]; 17 | } 18 | for(int32_t i = 0 ; i < size ; ++i){ 19 | float tmp_val = input_X[i]; 20 | output_Y[i] = (tmp_val >= 0.0f) ? tmp_val : tmp_val * alpha; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/less.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_less_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_A 9 | ,int32_t input_A_ndim, const int32_t * restrict input_A_dims 10 | ,const float * restrict input_B 11 | ,int32_t input_B_ndim, const int32_t * restrict input_B_dims 12 | ,float * restrict output_C 13 | ,int32_t output_C_ndim, const int32_t * restrict output_C_dims 14 | 15 | ) { 16 | int32_t size = 1 ; 17 | for(int32_t i = 0 ; i < input_A_ndim ; ++i){ 18 | size *= input_A_dims[i] ; 19 | } 20 | for(int32_t i = 0 ; i < size ; ++i){ 21 | output_C[i] = (input_A[i] < input_B[i]) ; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/Runtime/operator/log.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_log_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_input 10 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 11 | ,float * restrict output_output 12 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 13 | 14 | ) { 15 | int32_t size = 1; 16 | for(int32_t i = 0 ; i < input_input_ndim ; ++i){ 17 | size *= input_input_dims[i]; 18 | } 19 | for(int32_t i = 0 ; i < size ; ++i){ 20 | output_output[i] = logf(input_input[i]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/maxroipool.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_maxroipool_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,const float * restrict input_rois 11 | ,int32_t input_rois_ndim, const int32_t * restrict input_rois_dims 12 | ,float * restrict output_Y 13 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 14 | ,int32_t * restrict pooled_shape 15 | ,int32_t number_of_pooled_shape 16 | ,float spatial_scale 17 | ) { 18 | } 19 | -------------------------------------------------------------------------------- /lib/Runtime/operator/meanvariancenormalization.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_meanvariancenormalization_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,int32_t across_channels 13 | ,int32_t normalize_variance 14 | ) { 15 | } 16 | -------------------------------------------------------------------------------- /lib/Runtime/operator/mul.c: -------------------------------------------------------------------------------- 1 | #include 2 | typedef int32_t ONNC_INDEX_TYPE; 3 | 4 | #include "generic/assign.h" 5 | #include "generic/binary.h" 6 | 7 | static float mul_(float a, float b) 8 | { 9 | return a * b; 10 | } 11 | 12 | void ONNC_RUNTIME_mul_float(void* restrict context, 13 | const float* restrict A, int32_t Adim, const int32_t* restrict Ashape, 14 | const float* restrict B, int32_t Bdim, const int32_t* restrict Bshape, 15 | float* restrict C, int32_t Cdim, const int32_t* restrict Cshape) 16 | { 17 | ONNC_ASSIGN(float, C, Cshape, Cdim, A, Ashape, Adim); 18 | ONNC_BINARY(float, C, Cshape, Cdim, B, Bshape, Bdim, mul_); 19 | } 20 | -------------------------------------------------------------------------------- /lib/Runtime/operator/neg.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_neg_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ) { 14 | int32_t dataSize = 1; 15 | for (int32_t i = 0; i < input_X_ndim; i++){ 16 | dataSize *= input_X_dims[i]; 17 | } 18 | for(int32_t i = 0; i < dataSize; i++){ 19 | output_Y[i] = -input_X[i]; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/Runtime/operator/not.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_not_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ) { 14 | int32_t size = 1; 15 | for(int32_t i = 0 ; i < input_X_ndim ; ++i){ 16 | size *= input_X_dims[i]; 17 | } 18 | for(int32_t i = 0 ; i < size ; ++i){ 19 | output_Y[i] = !(input_X[i]); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/Runtime/operator/reciprocal.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_reciprocal_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_X 10 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 11 | ,float * restrict output_Y 12 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 13 | 14 | ) { 15 | int32_t size = 1; 16 | for(int32_t i = 0 ; i < input_X_ndim ; ++i){ 17 | size *= input_X_dims[i]; 18 | } 19 | for(int32_t i = 0 ; i < size ; ++i){ 20 | output_Y[i] = (input_X[i] == 0.0f) ? INFINITY : (1.0f / input_X[i]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/relu.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_relu_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ) { 14 | int32_t size = 1; 15 | 16 | for(int32_t i = 0 ; i < input_X_ndim ; ++i){ 17 | size *= input_X_dims[i]; 18 | } 19 | 20 | for(int32_t i = 0 ; i < size ; ++i){ 21 | float tmp_val = input_X[i]; 22 | output_Y[i] = (tmp_val >= 0.0f) ? tmp_val : 0.0f; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/Runtime/operator/scale.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_scale_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_input 9 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 10 | ,float * restrict output_output 11 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 12 | ,float scale 13 | ) { 14 | int32_t size = 1; 15 | 16 | for(int32_t i = 0 ; i < input_input_ndim ; ++i){ 17 | size *= input_input_dims[i]; 18 | } 19 | 20 | for(int32_t i = 0 ; i < size ; ++i){ 21 | output_output[i] = scale * input_input[i]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/Runtime/operator/scaledtanh.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_scaledtanh_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_input 10 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 11 | ,float * restrict output_output 12 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 13 | ,float alpha 14 | ,float beta 15 | ) { 16 | int32_t size = 1; 17 | 18 | for(int32_t i = 0 ; i < input_input_ndim ; ++i){ 19 | size *= input_input_dims[i]; 20 | } 21 | 22 | for(int32_t i = 0 ; i < size ; ++i){ 23 | output_output[i] = alpha * tanhf(beta * input_input[i]); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/Runtime/operator/selu.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_selu_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_X 10 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 11 | ,float * restrict output_Y 12 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 13 | ,float alpha 14 | ,float gamma 15 | ) { 16 | int32_t size = 1; 17 | 18 | for(int32_t i = 0 ; i < input_X_ndim ; ++i){ 19 | size *= input_X_dims[i]; 20 | } 21 | 22 | for(int32_t i = 0 ; i < size ; ++i){ 23 | output_Y[i] = gamma * ((input_X[i] <= 0.0f) ? alpha * (expf(input_X[i]) - 1.0f) : input_X[i]); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/Runtime/operator/shape.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_shape_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_shape 11 | ,int32_t output_shape_ndim, const int32_t * restrict output_shape_dims 12 | 13 | ) { 14 | for(int32_t dim = 0 ; dim < input_data_ndim ; dim++){ 15 | output_shape[dim] = input_data_dims[dim]; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/Runtime/operator/sigmoid.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_sigmoid_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_X 10 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 11 | ,float * restrict output_Y 12 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 13 | 14 | ) { 15 | int32_t size = 1; 16 | 17 | for(int32_t i = 0 ; i < input_X_ndim ; ++i){ 18 | size *= input_X_dims[i]; 19 | } 20 | 21 | for(int32_t i = 0 ; i < size ; ++i){ 22 | output_Y[i] = 1.0f / (1.0f + expf(input_X[i] * -1.0f)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/Runtime/operator/sin.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_sin_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_input 10 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 11 | ,float * restrict output_output 12 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 13 | 14 | ) { 15 | int32_t size = 1; 16 | for(int32_t i = 0 ; i < input_input_ndim ; ++i){ 17 | size *= input_input_dims[i]; 18 | } 19 | for(int32_t i = 0 ; i < size ; ++i){ 20 | output_output[i] = sinf(input_input[i]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/size.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_size_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_size 11 | ,int32_t output_size_ndim, const int32_t * restrict output_size_dims 12 | 13 | ) { 14 | int32_t size = 1; 15 | for(int32_t dim = 0 ; dim < input_data_ndim ; dim++){ 16 | size *= input_data_dims[dim]; 17 | } 18 | *output_size = size; 19 | } 20 | -------------------------------------------------------------------------------- /lib/Runtime/operator/softplus.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_softplus_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | 13 | ) { 14 | } 15 | -------------------------------------------------------------------------------- /lib/Runtime/operator/softsign.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_softsign_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_input 10 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 11 | ,float * restrict output_output 12 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 13 | 14 | ) { 15 | int32_t size = 1; 16 | 17 | for(int32_t i = 0 ; i < input_input_ndim ; ++i){ 18 | size *= input_input_dims[i]; 19 | } 20 | for(int32_t i = 0 ; i < size ; ++i){ 21 | output_output[i] = input_input[i] / (fabsf(input_input[i]) + 1.0f); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/Runtime/operator/sqrt.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_sqrt_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_X 10 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 11 | ,float * restrict output_Y 12 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 13 | 14 | ) { 15 | int32_t size = 1; 16 | for(int32_t i = 0 ; i < input_X_ndim ; ++i){ 17 | size *= input_X_dims[i]; 18 | } 19 | for(int32_t i = 0 ; i < size ; ++i){ 20 | output_Y[i] = sqrtf(input_X[i]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/squeeze.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_squeeze_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_squeezed 11 | ,int32_t output_squeezed_ndim, const int32_t * restrict output_squeezed_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ) { 15 | int32_t size_N = 1; 16 | 17 | // total counts of elements 18 | for(int32_t i = 0; i < input_data_ndim; ++i) { 19 | size_N *= input_data_dims[i]; 20 | } 21 | 22 | for(int32_t i = 0; i < size_N; ++i) { 23 | output_squeezed[i] = input_data[i]; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/Runtime/operator/sub.c: -------------------------------------------------------------------------------- 1 | #include 2 | typedef int32_t ONNC_INDEX_TYPE; 3 | 4 | #include "generic/assign.h" 5 | #include "generic/binary.h" 6 | 7 | static float sub_(float a, float b) 8 | { 9 | return a - b; 10 | } 11 | 12 | void ONNC_RUNTIME_sub_float(void* restrict context, 13 | const float* restrict A, int32_t Adim, const int32_t* restrict Ashape, 14 | const float* restrict B, int32_t Bdim, const int32_t* restrict Bshape, 15 | float* restrict C, int32_t Cdim, const int32_t* restrict Cshape) 16 | { 17 | ONNC_ASSIGN(float, C, Cshape, Cdim, A, Ashape, Adim); 18 | ONNC_BINARY(float, C, Cshape, Cdim, B, Bshape, Bdim, sub_); 19 | } 20 | -------------------------------------------------------------------------------- /lib/Runtime/operator/tan.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_tan_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_input 10 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 11 | ,float * restrict output_output 12 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 13 | 14 | ) { 15 | int32_t size = 1; 16 | for(int32_t i = 0 ; i < input_input_ndim ; ++i){ 17 | size *= input_input_dims[i]; 18 | } 19 | for(int32_t i = 0 ; i < size ; ++i){ 20 | output_output[i] = tanf(input_input[i]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/tanh.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void ONNC_RUNTIME_tanh_float( 8 | void * restrict onnc_runtime_context 9 | ,const float * restrict input_input 10 | ,int32_t input_input_ndim, const int32_t * restrict input_input_dims 11 | ,float * restrict output_output 12 | ,int32_t output_output_ndim, const int32_t * restrict output_output_dims 13 | 14 | ) { 15 | int32_t dataSize = 1; 16 | for (int32_t i = 0; i < input_input_ndim; i++){ 17 | dataSize *= input_input_dims[i]; 18 | } 19 | 20 | for(int32_t j = 0; j < dataSize; j++){ 21 | output_output[j] = tanhf(input_input[j]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/Runtime/operator/thresholdedrelu.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_thresholdedrelu_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_X 9 | ,int32_t input_X_ndim, const int32_t * restrict input_X_dims 10 | ,float * restrict output_Y 11 | ,int32_t output_Y_ndim, const int32_t * restrict output_Y_dims 12 | ,float alpha 13 | ) { 14 | int32_t size = 1; 15 | for(int32_t i = 0 ; i < input_X_ndim ; ++i){ 16 | size *= input_X_dims[i]; 17 | } 18 | 19 | for(int32_t i = 0 ; i < size ; ++i){ 20 | output_Y[i] = (input_X[i] > alpha) ? input_X[i] : 0.0f; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operator/transpose.c: -------------------------------------------------------------------------------- 1 | #include 2 | typedef int32_t ONNC_INDEX_TYPE; 3 | 4 | #include "generic/transpose.h" 5 | 6 | void ONNC_RUNTIME_transpose_float(void* restrict context, 7 | const float* restrict X, int32_t Xdim, const int32_t* restrict Xshape, 8 | float* restrict Y, int32_t Ydim, const int32_t* restrict Yshape, 9 | const int32_t* restrict permute, int32_t dim) 10 | { 11 | ONNC_TRANSPOSE(float, Y, X, permute, Xshape, Xdim); 12 | } 13 | -------------------------------------------------------------------------------- /lib/Runtime/operator/unsqueeze.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_unsqueeze_float( 7 | void * restrict onnc_runtime_context 8 | ,const float * restrict input_data 9 | ,int32_t input_data_ndim, const int32_t * restrict input_data_dims 10 | ,float * restrict output_expanded 11 | ,int32_t output_expanded_ndim, const int32_t * restrict output_expanded_dims 12 | ,int32_t * restrict axes 13 | ,int32_t number_of_axes 14 | ) { 15 | int32_t size_N = 1; 16 | for(int32_t i = 0; i < input_data_ndim; ++i) { 17 | size_N *= input_data_dims[i]; 18 | } 19 | for(int32_t i = 0; i < size_N; ++i) { 20 | output_expanded[i] = input_data[i]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/Runtime/operatorMKLDNN/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB_RECURSE OPERATOR_C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.c) 2 | file(GLOB_RECURSE OPERATOR_C_FILES_ORI ${CMAKE_CURRENT_SOURCE_DIR}/../operator/*.c) 3 | 4 | list(REMOVE_ITEM OPERATOR_C_FILES_ORI "${CMAKE_CURRENT_SOURCE_DIR}/../operator/conv.c") 5 | list(REMOVE_ITEM OPERATOR_C_FILES_ORI "${CMAKE_CURRENT_SOURCE_DIR}/../operator/gemm.c") 6 | 7 | target_sources( 8 | ${ONNC_RUNTIME_LIB_NAME} 9 | PRIVATE ${OPERATOR_C_FILES} ${OPERATOR_C_FILES_ORI} 10 | ) 11 | -------------------------------------------------------------------------------- /lib/Support/AsyncPipe.cpp: -------------------------------------------------------------------------------- 1 | //===- AsyncPipe.cpp ------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | #include 10 | 11 | // Include the truly platform-specific parts. 12 | #if defined(ONNC_ON_UNIX) 13 | #include "Unix/AsyncPipe.inc" 14 | #endif 15 | #if defined(ONNC_ON_WIN32) 16 | #include "Windows/AsyncPipe.inc" 17 | #endif 18 | #if defined(ONNC_ON_DRAGON) 19 | #include "Dragon/AsyncPipe.inc" 20 | #endif 21 | -------------------------------------------------------------------------------- /lib/Support/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | AsyncPipe.cpp 4 | CArgu.cpp 5 | CArguRef.cpp 6 | CEnv.cpp 7 | Debug.cpp 8 | Directory.cpp 9 | DirIterator.cpp 10 | ErrorCode.cpp 11 | Environ.cpp 12 | Expansion.cpp 13 | Glob.cpp 14 | Host.cpp 15 | IOStream.cpp 16 | IndentOStreamBuf.cpp 17 | ManagedStatic.cpp 18 | MappedFileRegion.cpp 19 | MemoryMap.cpp 20 | Path.cpp 21 | Pipe.cpp 22 | FileHandle.cpp 23 | FileLock.cpp 24 | FileInfo.cpp 25 | FileStatus.cpp 26 | FileSystem.cpp 27 | Timer.cpp 28 | Random.cpp 29 | Readline.cpp 30 | linenoise.cpp 31 | SelfPipe.cpp 32 | Signal.cpp) 33 | -------------------------------------------------------------------------------- /lib/Support/Dragon/Directory.inc: -------------------------------------------------------------------------------- 1 | //===- Path.inc -----------------------------------------------------------===// 2 | // 3 | // Skymizer 4 | // 5 | // Copyright (C) 2013, 2014, Skymizer Inc.. All rights reserved. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | namespace skymizer { 10 | 11 | } // namespace skymizer 12 | -------------------------------------------------------------------------------- /lib/Support/Dragon/header.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/lib/Support/Dragon/header.h -------------------------------------------------------------------------------- /lib/Support/Pipe.cpp: -------------------------------------------------------------------------------- 1 | //===- Pipe.cpp -----------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | #include 10 | 11 | // Include the truly platform-specific parts. 12 | #if defined(ONNC_ON_UNIX) 13 | #include "Unix/Pipe.inc" 14 | #endif 15 | #if defined(ONNC_ON_WIN32) 16 | #include "Windows/Pipe.inc" 17 | #endif 18 | #if defined(ONNC_ON_DRAGON) 19 | #include "Dragon/Pipe.inc" 20 | #endif 21 | -------------------------------------------------------------------------------- /lib/Support/Random.cpp: -------------------------------------------------------------------------------- 1 | //===- Random.cpp ---------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | #include 10 | 11 | // Include the truly platform-specific parts. 12 | #if defined(ONNC_ON_UNIX) 13 | #include "Unix/Random.inc" 14 | #endif 15 | #if defined(ONNC_ON_WIN32) 16 | #include "Windows/Random.inc" 17 | #endif 18 | #if defined(ONNC_ON_DRAGON) 19 | #include "Dragon/Random.inc" 20 | #endif 21 | -------------------------------------------------------------------------------- /lib/Support/SelfPipe.cpp: -------------------------------------------------------------------------------- 1 | //===- SelfPipe.cpp -------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | #include 10 | 11 | // Include the truly platform-specific parts. 12 | #if defined(ONNC_ON_UNIX) 13 | #include "Unix/SelfPipe.inc" 14 | #endif 15 | #if defined(ONNC_ON_WIN32) 16 | #include "Windows/SelfPipe.inc" 17 | #endif 18 | #if defined(ONNC_ON_DRAGON) 19 | #include "Dragon/SelfPipe.inc" 20 | #endif 21 | -------------------------------------------------------------------------------- /lib/Support/Unix/Path.inc: -------------------------------------------------------------------------------- 1 | //===- Path.inc -----------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | #include 10 | 11 | namespace onnc { 12 | 13 | } // namespace of onnc 14 | -------------------------------------------------------------------------------- /lib/Support/Unix/header.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/lib/Support/Unix/header.h -------------------------------------------------------------------------------- /lib/Support/Windows/Directory.inc: -------------------------------------------------------------------------------- 1 | //===- Path.inc -----------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | namespace onnc { 10 | 11 | } // namespace onnc 12 | -------------------------------------------------------------------------------- /lib/Support/Windows/header.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/lib/Support/Windows/header.h -------------------------------------------------------------------------------- /lib/Target/CLang/CLangMeta.cpp: -------------------------------------------------------------------------------- 1 | //===- NVDLAMeta.cpp ------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include "CLangMeta.h" 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | namespace onnc { 19 | 20 | const std::string CLangMeta::weightFileExt{".weight"}; 21 | const std::string CLangMeta::serviceLibraryFileExt{".c"}; 22 | 23 | } // namespace onnc 24 | -------------------------------------------------------------------------------- /lib/Target/CLang/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_libonnc_src( 2 | CLangBackend.cpp 3 | CLangGenServiceLibraryPass.cpp 4 | CLangGenWeightFilePass.cpp 5 | CLangGetOperatorListPass.cpp 6 | CLangMemInfoPass.cpp 7 | CLangMeta.cpp 8 | CLangOperatorInvokeVisitor.cpp 9 | TargetInfo/CLangTargetInfo.cpp 10 | TargetInfo/CLangTargetMemInfo.cpp 11 | ) 12 | -------------------------------------------------------------------------------- /lib/Target/CLang/Makefile.am: -------------------------------------------------------------------------------- 1 | ONNC_TARGET_SOURCES += \ 2 | Target/CLang/CLangBackend.cpp \ 3 | Target/CLang/CodeEmitVisitor.cpp \ 4 | Target/CLang/TargetInfo/CLangTargetInfo.cpp \ 5 | Target/CLang/TargetInfo/CLangTargetMemInfo.cpp \ 6 | Target/CLang/CLanMemInfoPass.cpp \ 7 | Targer/CLang/CLangMeta.cpp \ 8 | -------------------------------------------------------------------------------- /lib/Target/CLang/TargetInfo/CLangTargetInfo.h: -------------------------------------------------------------------------------- 1 | //===- CLangTargetInfo.h ----------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_TARGET_CLANG_TARGET_INFO_H 9 | #define ONNC_TARGET_CLANG_TARGET_INFO_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | Target& getTheCLangTarget(); 15 | 16 | } // namespace onnc 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /lib/Target/CLang/TargetInfo/CLangTargetMemInfo.h: -------------------------------------------------------------------------------- 1 | //===- CLangTargetMemInfo.h --------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_TARGET_CLANG_MEM_INFO_H 9 | #define ONNC_TARGET_CLANG_MEM_INFO_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | class CLangTargetMemInfo : public TargetMemInfo 15 | { 16 | public: 17 | MemSize getTensorMemorySize(const Tensor& pVal) override; 18 | }; 19 | 20 | } // namespace onnc 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /lib/Target/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_libonnc_src( 2 | Platform.cpp 3 | Target.cpp 4 | TargetRegistry.cpp 5 | TargetStandardPasses.cpp 6 | NPUTargetBackend.cpp) 7 | 8 | foreach(TARGET_DIR IN LISTS ONNC_TARGETS) 9 | list(FIND ONNC_TARGETS ${TARGET_DIR} target_index) 10 | list(GET ONNC_TARGET_ENTRIES ${target_index} target_entry) 11 | if(${target_entry}) 12 | add_subdirectory(${TARGET_DIR}) 13 | endif(${target_entry}) 14 | endforeach(TARGET_DIR IN LISTS ONNC_TARGETS) 15 | 16 | -------------------------------------------------------------------------------- /lib/Target/NPUTargetBackend.cpp: -------------------------------------------------------------------------------- 1 | //===-- NPUTargetBackend.cpp ----------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | 10 | using namespace onnc; 11 | 12 | //===----------------------------------------------------------------------===// 13 | // NPUTargetBackend 14 | //===----------------------------------------------------------------------===// 15 | NPUTargetBackend::NPUTargetBackend(const TargetOptions& pOptions) 16 | : TargetBackend(pOptions) { 17 | } 18 | 19 | NPUTargetBackend::~NPUTargetBackend() 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /lib/Target/NvDla/CodeEmitVisitor/Add.inc: -------------------------------------------------------------------------------- 1 | PP_DEFINE_VISIT(Add, pAdd) { emitSdp(pAdd, *pAdd.getA(), *pAdd.getB(), *pAdd.getOutput(0)); } 2 | -------------------------------------------------------------------------------- /lib/Target/NvDla/CodeEmitVisitor/Initializer.inc: -------------------------------------------------------------------------------- 1 | PP_DEFINE_VISIT(Initializer, pInitializer) {} 2 | -------------------------------------------------------------------------------- /lib/Target/NvDla/CodeEmitVisitor/InputOperator.inc: -------------------------------------------------------------------------------- 1 | PP_DEFINE_VISIT(InputOperator, pInputOperator) {} 2 | -------------------------------------------------------------------------------- /lib/Target/NvDla/CodeEmitVisitor/Max.inc: -------------------------------------------------------------------------------- 1 | PP_DEFINE_VISIT(Max, pMax) { emitSdp(pMax, *pMax.getInput(0), *pMax.getInput(1), *pMax.getOutput(0)); } 2 | -------------------------------------------------------------------------------- /lib/Target/NvDla/CodeEmitVisitor/Min.inc: -------------------------------------------------------------------------------- 1 | PP_DEFINE_VISIT(Min, pMin) { emitSdp(pMin, *pMin.getInput(0), *pMin.getInput(1), *pMin.getOutput(0)); } 2 | -------------------------------------------------------------------------------- /lib/Target/NvDla/CodeEmitVisitor/Mul.inc: -------------------------------------------------------------------------------- 1 | PP_DEFINE_VISIT(Mul, pMul) { emitSdp(pMul, *pMul.getA(), *pMul.getB(), *pMul.getOutput(0)); } 2 | -------------------------------------------------------------------------------- /lib/Target/NvDla/CodeEmitVisitor/OutputOperator.inc: -------------------------------------------------------------------------------- 1 | PP_DEFINE_VISIT(OutputOperator, pOutputOperator) {} 2 | -------------------------------------------------------------------------------- /lib/Target/NvDla/CodeEmitVisitor/Reshape.inc: -------------------------------------------------------------------------------- 1 | PP_DEFINE_VISIT(Reshape, pOp) {} 2 | -------------------------------------------------------------------------------- /lib/Target/NvDla/CodeEmitVisitor/Transpose.inc: -------------------------------------------------------------------------------- 1 | PP_DEFINE_VISIT(Transpose, pTranspose) {} 2 | -------------------------------------------------------------------------------- /lib/Target/NvDla/Compute/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_libonnc_src( 2 | NvDlaShuffle.cpp 3 | ) 4 | -------------------------------------------------------------------------------- /lib/Target/NvDla/Config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_libonnc_src( 2 | NvFull.cpp 3 | ) 4 | -------------------------------------------------------------------------------- /lib/Target/NvDla/TargetInfo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_libonnc_src( 2 | NvDlaTargetInfo.cpp 3 | NvDlaTargetMemInfo.cpp 4 | ) 5 | -------------------------------------------------------------------------------- /lib/Target/NvDla/TargetInfo/NvDlaTargetInfo.h: -------------------------------------------------------------------------------- 1 | //===- NvDlaTargetInfo.h ----------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_TARGET_NVDLA_TARGET_INFO_H 9 | #define ONNC_TARGET_NVDLA_TARGET_INFO_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | Target& getTheNvDlaTarget(); 15 | 16 | } // namespace onnc 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /lib/Target/NvDla/TargetInfo/NvDlaTargetMemInfo.h: -------------------------------------------------------------------------------- 1 | //===- NvDlaTargetMemInfo.h --------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_TARGET_NVDLA_MEM_INFO_H 9 | #define ONNC_TARGET_NVDLA_MEM_INFO_H 10 | #include 11 | 12 | namespace onnc { 13 | class NvDlaTargetMemInfo : public TargetMemInfo 14 | { 15 | public: 16 | MemSize getTensorMemorySize(const Tensor& pVal) override; 17 | }; 18 | 19 | } // namespace onnc 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /lib/Target/NvDla/genmem/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_libonnc_src( 2 | genmem.cpp 3 | Concat.cpp 4 | Copy.cpp 5 | Cube.cpp 6 | Memory.cpp 7 | Merge.cpp 8 | Register.cpp 9 | Shuffle.cpp 10 | Split.cpp 11 | Splitt.cpp 12 | ) 13 | -------------------------------------------------------------------------------- /lib/Target/NvDla/genmem/Memory.cpp: -------------------------------------------------------------------------------- 1 | #include "Memory.hpp" 2 | 3 | using namespace genmem; 4 | 5 | Memory::Memory(int memWidth) 6 | : memWidth(memWidth) 7 | { 8 | used_entry = 0; 9 | } 10 | 11 | int Memory::request_memory(int total_entry) 12 | { 13 | int given_entry = used_entry; 14 | used_entry += total_entry; 15 | return given_entry; 16 | } 17 | -------------------------------------------------------------------------------- /lib/Target/NvDla/genmem/Memory.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GENMEM_MEMORY_H 2 | #define GENMEM_MEMORY_H 3 | 4 | #include "header.hpp" 5 | 6 | namespace genmem { 7 | 8 | class Memory 9 | { 10 | using BYTE = int; 11 | 12 | public: 13 | Memory(int memWidth); 14 | 15 | virtual int request_memory(int total_entry); 16 | 17 | protected: 18 | int memWidth; 19 | int used_entry; 20 | }; 21 | 22 | } // namespace genmem 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /lib/Target/NvDla/genmem/Merge.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GENMEM_MERGE_H 2 | #define GENMEM_MERGE_H 3 | 4 | #include "Cube.hpp" 5 | #include "Register.hpp" 6 | #include "header.hpp" 7 | 8 | namespace genmem { 9 | 10 | class Merge 11 | { 12 | public: 13 | static void init_stride(int W, int H, int C, int line_stride[2], int surf_stride[2], int planar_stride[2]); 14 | static void merge(Cube& in_cube, Cube& out_cube, Memory& mem, Register& reg); 15 | }; 16 | 17 | } // namespace genmem 18 | #endif 19 | -------------------------------------------------------------------------------- /lib/Target/NvDla/genmem/Split.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GENMEM_SPLIT_H 2 | #define GENMEM_SPLIT_H 3 | 4 | #include "Cube.hpp" 5 | #include "Register.hpp" 6 | #include "header.hpp" 7 | 8 | namespace genmem { 9 | 10 | class Split 11 | { 12 | public: 13 | static void init_stride(int W, int H, int C, int line_stride[2], int surf_stride[2], int planar_stride[2]); 14 | 15 | static void split(Cube& in_cube, Cube& out_cube, Memory& mem, Register& reg); 16 | }; 17 | 18 | } // namespace genmem 19 | #endif 20 | -------------------------------------------------------------------------------- /lib/Target/NvDla/genmem/genmem.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "genmem.hpp" 3 | 4 | namespace genmem { 5 | 6 | unsigned long long start_address = 0xc0000000; 7 | int ATOMIC_K = 16; 8 | int elementSize = 2; 9 | int memWidth = 32; 10 | int NUM_MAX_BDMA_TRANSFER = 20; 11 | 12 | void init_genmem(int eleSize, int start_addr) 13 | { 14 | elementSize = eleSize; 15 | ATOMIC_K = elementSize == 1 ? 32 : 16; 16 | 17 | start_address = start_addr; 18 | } 19 | 20 | } // namespace genmem 21 | -------------------------------------------------------------------------------- /lib/Target/NvDla/genmem/genmem.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GENMEM_GENMEM_H 2 | #define GENMEM_GENMEM_H 3 | 4 | #include "Cube.hpp" 5 | #include "Memory.hpp" 6 | #include "Operators.hpp" 7 | #include "Register.hpp" 8 | #include "header.hpp" 9 | 10 | namespace genmem { 11 | 12 | void init_genmem(int eleSize, int start_addr); 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /lib/Target/NvDla/genmemNvdla/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_libonnc_src( 2 | genmem2Nvdla.cpp 3 | NvdlaMemory.cpp 4 | ) 5 | -------------------------------------------------------------------------------- /lib/Target/NvDla/genmemNvdla/genmemNvdla.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GENMEM_GENMEM_NVDLA_H 2 | #define GENMEM_GENMEM_NVDLA_H 3 | 4 | #include "NvdlaMemory.hpp" 5 | #include "genmem/genmem.hpp" 6 | #include "genmem2Nvdla.hpp" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lib/Target/Platform.cpp: -------------------------------------------------------------------------------- 1 | //===-- Platform.cpp ------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | 10 | using namespace onnc; 11 | 12 | //===----------------------------------------------------------------------===// 13 | // Platform 14 | //===----------------------------------------------------------------------===// 15 | onnc::Platform::Platform(const std::string& pName) 16 | : m_Name(pName), 17 | m_ShortDesc(), 18 | m_TargetBackends() { 19 | } 20 | -------------------------------------------------------------------------------- /lib/Target/Sophon/BM168x/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | BM168xBackend.cpp 4 | ) 5 | 6 | add_subdirectory(asm) 7 | -------------------------------------------------------------------------------- /lib/Target/Sophon/BM188x/BM188xVisitor.cpp: -------------------------------------------------------------------------------- 1 | //===- BM188xVisitor.cpp --------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include "BM188xVisitor.h" 9 | 10 | using namespace onnc; 11 | using namespace onnc::BM188X; 12 | 13 | //===----------------------------------------------------------------------===// 14 | // BM188xVisitor 15 | //===----------------------------------------------------------------------===// 16 | bool BM188xVisitor::classof(const ComputeVisitor* pVisitor) 17 | { 18 | if (nullptr != pVisitor) 19 | return (pVisitor->getVisitorID() == id()); 20 | return false; 21 | } 22 | -------------------------------------------------------------------------------- /lib/Target/Sophon/BM188x/asm/.gitignore: -------------------------------------------------------------------------------- 1 | bm188x_asm.pb.h 2 | bm188x_asm.pb.cc 3 | -------------------------------------------------------------------------------- /lib/Target/Sophon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | option(TG_GEN_ASM_PROTO "generate asm.proto by bmtarget" OFF) 3 | 4 | set(tg_root ${CMAKE_CURRENT_SOURCE_DIR}) 5 | 6 | if (BMONNC_EXIST) 7 | add_definitions(-DBMONNC_EXIST) 8 | include_directories(${BMONNC_SOURCE_DIR}/src/include) 9 | endif() 10 | 11 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 12 | include_directories(SYSTEM ${tg_root}/include) 13 | install(DIRECTORY include/ DESTINATION include) 14 | 15 | add_libonnc_src( 16 | io.cpp 17 | TGBackend.cpp 18 | TGFuseOptimizer.cpp 19 | TGFuseOptimizerPass.cpp 20 | BuildMemOpndPass.cpp 21 | EncodeInstructionsPass.cpp 22 | LinearScanAllocPass.cpp) 23 | 24 | add_subdirectory(BM168x) 25 | add_subdirectory(BM188x) 26 | add_subdirectory(TargetInfo) 27 | 28 | -------------------------------------------------------------------------------- /lib/Target/Sophon/TargetInfo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | TGTargetInfo.cpp) 4 | -------------------------------------------------------------------------------- /lib/Target/Sophon/include/onnc/Target/Sophon/BM168x/asm/.gitignore: -------------------------------------------------------------------------------- 1 | bm168x_asm.pb.h 2 | asm.pb.cc 3 | -------------------------------------------------------------------------------- /lib/Target/Sophon/include/onnc/Target/Sophon/BM188x/.gitignore: -------------------------------------------------------------------------------- 1 | common_calibration2.pb.h 2 | common_calibration2.pb.cc 3 | -------------------------------------------------------------------------------- /lib/Target/Sophon/include/onnc/Target/Sophon/BM188x/asm/.gitignore: -------------------------------------------------------------------------------- 1 | bm188x_asm.pb.h 2 | asm.pb.cc 3 | -------------------------------------------------------------------------------- /lib/Target/Vanilla/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | VanillaBackend.cpp 4 | CodeEmitVisitor.cpp 5 | TargetInfo/VanillaTargetInfo.cpp 6 | TargetInfo/VanillaTargetMemInfo.cpp) 7 | -------------------------------------------------------------------------------- /lib/Target/Vanilla/Makefile.am: -------------------------------------------------------------------------------- 1 | ONNC_TARGET_SOURCES += \ 2 | Target/Vanilla/VanillaBackend.cpp \ 3 | Target/Vanilla/CodeEmitVisitor.cpp \ 4 | Target/Vanilla/TargetInfo/VanillaTargetInfo.cpp \ 5 | Target/Vanilla/TargetInfo/VanillaTargetMemInfo.cpp 6 | 7 | -------------------------------------------------------------------------------- /lib/Target/Vanilla/TargetInfo/VanillaTargetInfo.h: -------------------------------------------------------------------------------- 1 | //===- VanillaTargetInfo.h ----------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_TARGET_VANILLA_TARGET_INFO_H 9 | #define ONNC_TARGET_VANILLA_TARGET_INFO_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | Target& getTheVanillaTarget(); 15 | 16 | } // namespace of onnc 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /lib/Target/Vanilla/TargetInfo/VanillaTargetMemInfo.h: -------------------------------------------------------------------------------- 1 | //===- VanillaTargetMemInfo.h --------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_TARGET_VANILLA_MEM_INFO_H 9 | #define ONNC_TARGET_VANILLA_MEM_INFO_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | class VanillaTargetMemInfo : public TargetMemInfo 15 | { 16 | public: 17 | MemSize getTensorMemorySize(const Tensor& pVal) override; 18 | }; 19 | 20 | } // namespace onnc 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /lib/Target/X86/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_libonnc_src( 3 | Compute/X86ConvRelu.cpp 4 | Compute/X86ComputeVisitor.cpp 5 | X86Backend.cpp 6 | X86FuseConvRelu.cpp 7 | X86InplaceValueFusible.cpp 8 | X86RemoveWeightFromLiveIntervals.cpp 9 | TargetInfo/X86TargetInfo.cpp 10 | TargetInfo/X86TargetMemInfo.cpp) 11 | -------------------------------------------------------------------------------- /lib/Target/X86/Compute/X86ComputeVisitor.cpp: -------------------------------------------------------------------------------- 1 | //===- X86ComputeVisitor.cpp ----------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include "X86ComputeVisitor.h" 9 | 10 | using namespace onnc; 11 | 12 | class X86ConvRelu; 13 | 14 | bool X86ComputeVisitor::classof(const ComputeVisitor* pOp) { 15 | if (nullptr == pOp) 16 | return false; 17 | return (pOp->getVisitorID() == id()); 18 | } 19 | -------------------------------------------------------------------------------- /lib/Target/X86/Makefile.am: -------------------------------------------------------------------------------- 1 | ONNC_TARGET_SOURCES += \ 2 | Target/X86/Compute/X86ConvRelu.cpp \ 3 | Target/X86/Compute/X86ComputeVisitor.cpp \ 4 | Target/X86/X86Backend.cpp \ 5 | Target/X86/X86InplaceValueFusible.cpp \ 6 | Target/X86/X86FuseConvRelu.cpp \ 7 | Target/X86/X86RemoveWeightFromLiveIntervals.cpp \ 8 | Target/X86/TargetInfo/X86TargetInfo.cpp \ 9 | Target/X86/TargetInfo/X86TargetMemInfo.cpp 10 | -------------------------------------------------------------------------------- /lib/Target/X86/TargetInfo/X86TargetInfo.h: -------------------------------------------------------------------------------- 1 | //===- X86TargetInfo.h ----------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_TARGET_X86_TARGET_INFO_H 9 | #define ONNC_TARGET_X86_TARGET_INFO_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | onnc::Target& getTheX86_32Target(); 15 | 16 | onnc::Target& getTheX86_64Target(); 17 | 18 | } // namespace of onnc 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /lib/Target/X86/TargetInfo/X86TargetMemInfo.h: -------------------------------------------------------------------------------- 1 | //===- X86TargetMemInfo.h -------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_TARGET_X86_MEM_INFO_H 9 | #define ONNC_TARGET_X86_MEM_INFO_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | class X86TargetMemInfo : public TargetMemInfo 15 | { 16 | public: 17 | MemSize getTensorMemorySize(const Tensor& pVal) override; 18 | }; 19 | 20 | } // namespace onnc 21 | 22 | #endif -------------------------------------------------------------------------------- /lib/Target/X86/X86.h: -------------------------------------------------------------------------------- 1 | //===- X86.h --------------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef TARGET_X86_X86_H 9 | #define TARGET_X86_X86_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | class Target; 15 | class TargetLDBackend; 16 | 17 | TargetBackend* CreateX86Backend(const TargetOptions& pOptions); 18 | 19 | } // namespace onnc 20 | 21 | #endif // TARGET_X86_X86_H_ 22 | -------------------------------------------------------------------------------- /lib/Target/X86/X86InplaceValueFusible.h: -------------------------------------------------------------------------------- 1 | //===- X86InplaceValueFusible.h -------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef TARGET_X86_X86_INPLACE_VALUE_FUSIBLE_H_H 9 | #define TARGET_X86_X86_INPLACE_VALUE_FUSIBLE_H_H 10 | #include 11 | 12 | namespace onnc { 13 | namespace x86 { 14 | 15 | bool IsInplaceValueFusible(const ComputeOperator& pOp); 16 | 17 | } // namespace x86 18 | } // namespace onnc 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /lib/Transforms/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Optimizations) 2 | add_subdirectory(TensorSel) 3 | 4 | add_libonnc_src( 5 | BookONNXGraphs.cpp 6 | BuildInitializers.cpp 7 | BuildInputOperators.cpp 8 | BuildOutputOperators.cpp 9 | DeadNodeElimination.cpp 10 | EliminateCast.cpp 11 | ExtractConstToInitializer.cpp 12 | GraphBuildingPass.cpp 13 | OnnxOptPass.cpp 14 | RemoveTrainingNodes.cpp 15 | TensorSel.cpp 16 | ) 17 | -------------------------------------------------------------------------------- /lib/Transforms/Optimizations/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_libonnc_src( 2 | DivideGlobalAPIntoAPs.cpp 3 | EliminateIdentity.cpp 4 | ExpandBatchNormalization.cpp 5 | OptimizationsUtils.cpp 6 | PropagateConstWithDiffShape.cpp 7 | ReplaceGemmByConv.cpp 8 | SplitConvPass.cpp 9 | ) 10 | -------------------------------------------------------------------------------- /lib/Transforms/Optimizations/OptimizationsUtils.cpp: -------------------------------------------------------------------------------- 1 | //===- OptimizationsUtils.cpp ---------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include 10 | 11 | namespace onnc { 12 | namespace internal { 13 | 14 | Tensor::Size getTotalSizeOfDimensions(const Tensor::Dimensions& dims) 15 | { 16 | Tensor::Size totalSize = 1; 17 | for (Tensor::Size idx = 0; idx < dims.size(); ++idx) { 18 | totalSize *= dims[idx]; 19 | } 20 | return totalSize; 21 | } 22 | 23 | } // namespace of internal 24 | } // namespace of onnc 25 | -------------------------------------------------------------------------------- /lib/Transforms/TensorSel/DefaultAttributes.h: -------------------------------------------------------------------------------- 1 | //===- DefaultAttributes.h --------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_TRANSFORMS_TENSORSEL_DEFAULTATTRIBUTES_H 9 | #define ONNC_TRANSFORMS_TENSORSEL_DEFAULTATTRIBUTES_H 10 | #include 11 | 12 | namespace onnc { 13 | 14 | class ComputeOperator; 15 | 16 | void SetDefaultAttributes(xNode &pNode, ComputeOperator& pOp); 17 | 18 | } // namespace of onnc 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /lib/Transforms/TensorSel/Lower.cpp: -------------------------------------------------------------------------------- 1 | //===- Lower.cpp ----------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | 10 | using namespace onnc; 11 | 12 | //===----------------------------------------------------------------------===// 13 | // Lower 14 | //===----------------------------------------------------------------------===// 15 | Lower::~Lower() 16 | { 17 | // do nothing. 18 | } 19 | -------------------------------------------------------------------------------- /m4/.gitignore: -------------------------------------------------------------------------------- 1 | libtool.m4 2 | ltoptions.m4 3 | ltsugar.m4 4 | ltversion.m4 5 | lt~obsolete.m4 6 | -------------------------------------------------------------------------------- /m4/README: -------------------------------------------------------------------------------- 1 | Scripts under m4 folder are functions for autoconf. 2 | Scripts under m4/targets are used to make function calls for different target 3 | backends. 4 | -------------------------------------------------------------------------------- /m4/config.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl @synopsis SETUP_CONFIG_HEADER 3 | dnl 4 | dnl @summary set up Config/Config.h 5 | dnl 6 | dnl Luba Tang 7 | 8 | AC_DEFUN([SETUP_CONFIG_HEADER], 9 | [dnl 10 | 11 | AH_TOP([ 12 | //===- Config.h.in --------------------------------------------------------===// 13 | // 14 | // The ONNC Project 15 | // 16 | // See LICENSE.TXT for details. 17 | // 18 | //===----------------------------------------------------------------------===// 19 | #ifndef ONNC_CONFIG_CONFIG_H 20 | #define ONNC_CONFIG_CONFIG_H 21 | ]) 22 | 23 | AH_BOTTOM([ 24 | #endif 25 | ]) 26 | 27 | ]) 28 | -------------------------------------------------------------------------------- /m4/cxx_flag_check.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl @synopsis CXX_FLAGS_CHECK [compiler flags] 3 | dnl 4 | dnl @summary check whether compiler supports given C++ flags or not 5 | dnl 6 | dnl Luba Tang 7 | AC_DEFUN([CXX_FLAG_CHECK], 8 | [dnl 9 | AC_MSG_CHECKING([if $CXX supports $1]) 10 | AC_LANG_PUSH([C++]) 11 | ac_saved_cxxflags="$CXXFLAGS" 12 | CXXFLAGS="-Werror $1" 13 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], 14 | [AC_MSG_RESULT([yes])], 15 | [AC_MSG_ERROR([no])] 16 | ) 17 | CXXFLAGS="$ac_saved_cxxflags" 18 | AC_LANG_POP([C++]) 19 | ]) 20 | -------------------------------------------------------------------------------- /m4/dl.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl @synopsis CHECK_DL 3 | dnl 4 | dnl @summary check libdl library and setup variables: 5 | dnl HAVE_DL 6 | dnl 7 | dnl Luba Tang 8 | dnl 9 | 10 | AC_DEFUN([CHECK_DL], 11 | [dnl 12 | AC_SEARCH_LIBS([dlopen], [dl dld], 13 | [dnl found 14 | HAVE_DL=1 15 | ], 16 | [AC_MSG_RESULT([unable to find the dlopen() function])] 17 | ) 18 | ]) 19 | -------------------------------------------------------------------------------- /m4/enable_option.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl @synposis CHECK_ENABLE_OPTION[option, value, if yes] 3 | dnl 4 | dnl $1: option name 5 | dnl $2: default value ("yes" or "no") 6 | dnl $3: define $3 if yes 7 | dnl 8 | dnl @summary check --enable-`option`=[yes or no] 9 | dnl 10 | AC_DEFUN([CHECK_ENABLE_OPTION], 11 | [ 12 | AC_ARG_ENABLE($1, 13 | [AS_HELP_STRING([--enable-$1], 14 | [turn on $1 (default is $2)])], 15 | [], 16 | [enable_$1=$2]) 17 | AM_CONDITIONAL([$3],[test "x${enable_$1}" == "xyes" ]) 18 | AS_IF([test "x${enable_$1}" = "xyes"], 19 | [AC_DEFINE($3, 1, [Enable $1])] 20 | ) 21 | ]) 22 | -------------------------------------------------------------------------------- /m4/proto_config.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl @synopsis PROTO_CONFIG_FILES([source],[target header], [target implement]) 3 | dnl 4 | AC_DEFUN([PROTO_CONFIG_FILES], 5 | [dnl 6 | SEARCHPATH=$(dirname "$srcdir/$1") 7 | FILENAME=$(basename "$srcdir/$1" .proto) 8 | protoc --proto_path=$SEARCHPATH \ 9 | --cpp_out=$SEARCHPATH \ 10 | $srcdir/$1 11 | if test -f "$SEARCHPATH/$FILENAME.pb.h" && test "$SEARCHPATH/$FILENAME.pb.h" != "$2"; then 12 | mv "$SEARCHPATH/$FILENAME.pb.h" $srcdir/$2 13 | fi 14 | if test -f "$SEARCHPATH/$FILENAME.pb.cc" && test "$SEARCHPATH/$FILENAME.pb.cc" != "$3"; then 15 | mv "$SEARCHPATH/$FILENAME.pb.cc" $srcdir/$3 16 | fi 17 | ]) 18 | -------------------------------------------------------------------------------- /m4/targets/x86.m4: -------------------------------------------------------------------------------- 1 | CHECK_LLVM 2 | -------------------------------------------------------------------------------- /m4/werror-flags.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl @synopsis CHECK_WERROR_FLAGS 3 | dnl 4 | dnl @summary check compiler's warning flags. 5 | dnl 6 | dnl Luba Tang 7 | dnl From Kito Cheng 8 | AC_DEFUN([CHECK_WERROR_FLAGS], 9 | [dnl 10 | AC_ARG_ENABLE(werror, 11 | AS_HELP_STRING([--enable-werror], 12 | [Compile with -Werror enabled (default is NO)]), 13 | [case "${enableval}" in 14 | yes) enable_werror=true ;; 15 | no) enable_werror=false ;; 16 | *) AC_MSG_ERROR([Invalid setting for --enable-werror. Use "yes" or "no"]) ;; 17 | esac], 18 | [enable_werror="no"]) 19 | 20 | AM_CONDITIONAL([ENABLE_WERROR], [test x${enable_werror} = xtrue]) 21 | 22 | ]) 23 | -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | ylwrap 2 | compile 3 | config.guess 4 | config.sub 5 | depcomp 6 | install-sh 7 | ltmain.sh 8 | missing 9 | ComputeIR.cpp/ 10 | ComputeIR.h/ 11 | ComputeVisitor.h 12 | Lower.cpp/ 13 | Lower.h/ 14 | -------------------------------------------------------------------------------- /scripts/runtime/.gitignore: -------------------------------------------------------------------------------- 1 | out/ 2 | -------------------------------------------------------------------------------- /scripts/runtime/Interpreter.template.cpp: -------------------------------------------------------------------------------- 1 | //===- Interpreter.cpp ----------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include "Interpreter.h" 9 | #include 10 | 11 | ${ComputeIR_includes} 12 | 13 | #define restrict __restrict__ 14 | extern "C" { 15 | #include 16 | } 17 | #undef restrict 18 | 19 | using namespace onnc; 20 | 21 | //===----------------------------------------------------------------------===// 22 | // Interpreter 23 | //===----------------------------------------------------------------------===// 24 | ${interpreter_visitors} 25 | -------------------------------------------------------------------------------- /scripts/runtime/Interpreter.visitor.template.cpp: -------------------------------------------------------------------------------- 1 | void Interpreter::visit(${OperatorName}& pOp) { 2 | // Prepare input 3 | ${visitor_prepare_input} 4 | // Prepare output 5 | ${visitor_prepare_output} 6 | // Prepare attributes 7 | ${visitor_prepare_attribute} 8 | 9 | // Call to Runtime 10 | ONNC_RUNTIME_${operator_name}_float( 11 | m_pContext 12 | ${visitor_pass_input} 13 | ${visitor_pass_output} 14 | ${visitor_pass_attribute} 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /scripts/runtime/operator.template.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_${operator_name}_float( 7 | void * restrict onnc_runtime_context 8 | ${input_parameters_float} 9 | ${output_parameters_float} 10 | ${attribute_paprameters_float} 11 | ) { 12 | } 13 | -------------------------------------------------------------------------------- /scripts/runtime/operator.template.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void ONNC_RUNTIME_${operator_name}_float( 7 | void * restrict onnc_runtime_context 8 | ${input_parameters_float} 9 | ${output_parameters_float} 10 | ${attribute_paprameters_float} 11 | ); 12 | -------------------------------------------------------------------------------- /single_layer_test/Add/4983_Add.dimg: -------------------------------------------------------------------------------- 1 | 3 3 3 3 3 3 3 3 3 7 7 7 7 7 7 7 7 7 -------------------------------------------------------------------------------- /single_layer_test/Add/4983_Add.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Add/4983_Add.onnx -------------------------------------------------------------------------------- /single_layer_test/Add/4983_Add.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 3 3 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Add/4984_Add.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Add/4984_Add.onnx -------------------------------------------------------------------------------- /single_layer_test/Add/4991_Add.dimg: -------------------------------------------------------------------------------- 1 | 5 5 5 5 5 5 5 5 -------------------------------------------------------------------------------- /single_layer_test/Add/4991_Add.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Add/4991_Add.onnx -------------------------------------------------------------------------------- /single_layer_test/Add/4991_Add.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 4 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/AveragePool/5116_AveragePool.dimg: -------------------------------------------------------------------------------- 1 | 3 3 3 3 -------------------------------------------------------------------------------- /single_layer_test/AveragePool/5116_AveragePool.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/AveragePool/5116_AveragePool.onnx -------------------------------------------------------------------------------- /single_layer_test/AveragePool/5116_AveragePool.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 4 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/AveragePool/5120_AveragePool.dimg: -------------------------------------------------------------------------------- 1 | 1 1 1 1 1 1 -------------------------------------------------------------------------------- /single_layer_test/AveragePool/5120_AveragePool.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/AveragePool/5120_AveragePool.onnx -------------------------------------------------------------------------------- /single_layer_test/AveragePool/5120_AveragePool.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 3 2 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/AveragePool/5128_AveragePool.dimg: -------------------------------------------------------------------------------- 1 | 2 2 2 2 2 2 2 2 -------------------------------------------------------------------------------- /single_layer_test/AveragePool/5128_AveragePool.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/AveragePool/5128_AveragePool.onnx -------------------------------------------------------------------------------- /single_layer_test/AveragePool/5128_AveragePool.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 4 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/BatchNormalization/5226_BatchNormalization.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/BatchNormalization/5226_BatchNormalization.onnx -------------------------------------------------------------------------------- /single_layer_test/BatchNormalization/5226_BatchNormalization.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 16 13 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/BatchNormalization/5236_BatchNormalization.dimg: -------------------------------------------------------------------------------- 1 | 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 0.999512 -------------------------------------------------------------------------------- /single_layer_test/BatchNormalization/5236_BatchNormalization.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/BatchNormalization/5236_BatchNormalization.onnx -------------------------------------------------------------------------------- /single_layer_test/BatchNormalization/5236_BatchNormalization.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 12 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/BatchNormalization/5247_BatchNormalization.dimg: -------------------------------------------------------------------------------- 1 | 1.99902 1.99902 2.99805 2.99805 0.999512 0.999512 2.99805 2.99805 3.99805 3.99805 0.999512 0.999512 2.99805 2.99805 3.99805 3.99805 0.999512 0.999512 0.999512 0.999512 2.99805 2.99805 0.999512 0.999512 0.999512 0.999512 2.99805 2.99805 1.99902 1.99902 1.99902 1.99902 1.99902 1.99902 1.99902 1.99902 -------------------------------------------------------------------------------- /single_layer_test/BatchNormalization/5247_BatchNormalization.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/BatchNormalization/5247_BatchNormalization.onnx -------------------------------------------------------------------------------- /single_layer_test/BatchNormalization/5247_BatchNormalization.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 1 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Concat/5328_Concat.dimg: -------------------------------------------------------------------------------- 1 | 3 3 3 3 2 2 2 2 3 3 3 3 2 2 2 2 4 4 4 4 4 4 4 4 1 1 1 1 3 3 3 3 2 2 2 2 3 3 3 3 1 1 1 1 2 2 2 2 4 4 4 4 4 4 4 4 2 2 2 2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 1 1 1 1 2 2 2 2 3 3 3 3 2 2 2 2 3 3 3 3 4 4 4 4 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 3 3 3 3 3 3 3 3 2 2 2 2 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 1 1 1 1 3 3 3 3 2 2 2 2 3 3 3 3 2 2 2 2 2 2 2 2 4 4 4 4 2 2 2 2 3 3 3 3 2 2 2 2 3 3 3 3 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 3 3 3 3 2 2 2 2 -------------------------------------------------------------------------------- /single_layer_test/Concat/5328_Concat.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Concat/5328_Concat.onnx -------------------------------------------------------------------------------- /single_layer_test/Concat/5328_Concat.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 1 4 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Concat/5330_Concat.dimg: -------------------------------------------------------------------------------- 1 | 23 23 23 23 23 16 16 16 16 16 26 26 26 26 26 9 9 9 9 9 14 14 14 14 14 23 23 23 23 23 32 32 32 32 32 17 17 17 17 17 17 17 17 17 17 22 22 22 22 22 32 32 32 32 32 23 23 23 23 23 4 4 4 4 4 2 2 2 2 2 3 3 3 3 3 775 775 775 775 775 719 719 719 719 719 619 619 619 619 619 632 632 632 632 632 855 855 855 855 855 603 603 603 603 603 632 632 632 632 632 668 668 668 668 668 -------------------------------------------------------------------------------- /single_layer_test/Concat/5330_Concat.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Concat/5330_Concat.onnx -------------------------------------------------------------------------------- /single_layer_test/Concat/5330_Concat.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 5 1 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Concat/5436_Concat.dimg: -------------------------------------------------------------------------------- 1 | 3 1 3 -------------------------------------------------------------------------------- /single_layer_test/Concat/5436_Concat.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Concat/5436_Concat.onnx -------------------------------------------------------------------------------- /single_layer_test/Concat/5436_Concat.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 6 4 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Conv/4781_Conv.dimg: -------------------------------------------------------------------------------- 1 | 1127 1127 1127 1127 1127 1127 1127 1127 1127 1127 1127 1124 1124 1124 1124 1124 1124 1124 1124 1124 1124 1124 1076 1076 1076 1076 1076 1076 1076 1076 1076 1076 1076 1052 1052 1052 1052 1052 1052 1052 1052 1052 1052 1052 1069 1069 1069 1069 1069 1069 1069 1069 1069 1069 1069 1131 1131 1131 1131 1131 1131 1131 1131 1131 1131 1131 1158 1158 1158 1158 1158 1158 1158 1158 1158 1158 1158 1055 1055 1055 1055 1055 1055 1055 1055 1055 1055 1055 -------------------------------------------------------------------------------- /single_layer_test/Conv/4781_Conv.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Conv/4781_Conv.onnx -------------------------------------------------------------------------------- /single_layer_test/Conv/4781_Conv.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 8 12 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Conv/4783_Conv.dimg: -------------------------------------------------------------------------------- 1 | 40 40 40 40 40 40 40 40 44 44 44 44 44 44 44 44 40 40 40 40 40 40 40 40 42 42 42 42 42 42 42 42 43 43 43 43 43 43 43 43 42 42 42 42 42 42 42 42 46 46 46 46 46 46 46 46 50 50 50 50 50 50 50 50 -------------------------------------------------------------------------------- /single_layer_test/Conv/4783_Conv.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Conv/4783_Conv.onnx -------------------------------------------------------------------------------- /single_layer_test/Conv/4783_Conv.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 9 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Conv/4791_Conv.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Conv/4791_Conv.onnx -------------------------------------------------------------------------------- /single_layer_test/Gemm/5384_Gemm.dimg: -------------------------------------------------------------------------------- 1 | 99 85 77 95 -------------------------------------------------------------------------------- /single_layer_test/Gemm/5384_Gemm.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Gemm/5384_Gemm.onnx -------------------------------------------------------------------------------- /single_layer_test/Gemm/5384_Gemm.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 7 5 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Gemm/5385_Gemm.dimg: -------------------------------------------------------------------------------- 1 | 346 257 374 334 320 361 298 310 -------------------------------------------------------------------------------- /single_layer_test/Gemm/5385_Gemm.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Gemm/5385_Gemm.onnx -------------------------------------------------------------------------------- /single_layer_test/Gemm/5385_Gemm.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 1 2 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Gemm/5386_Gemm.dimg: -------------------------------------------------------------------------------- 1 | 1663 -------------------------------------------------------------------------------- /single_layer_test/Gemm/5386_Gemm.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Gemm/5386_Gemm.onnx -------------------------------------------------------------------------------- /single_layer_test/Gemm/5386_Gemm.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 3 6 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/GlobalAveragePool/5415_GlobalAveragePool.dimg: -------------------------------------------------------------------------------- 1 | 1 2 1 2 -------------------------------------------------------------------------------- /single_layer_test/GlobalAveragePool/5415_GlobalAveragePool.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/GlobalAveragePool/5415_GlobalAveragePool.onnx -------------------------------------------------------------------------------- /single_layer_test/GlobalAveragePool/5415_GlobalAveragePool.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 1 1 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/GlobalAveragePool/5420_GlobalAveragePool.dimg: -------------------------------------------------------------------------------- 1 | 3 -------------------------------------------------------------------------------- /single_layer_test/GlobalAveragePool/5420_GlobalAveragePool.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/GlobalAveragePool/5420_GlobalAveragePool.onnx -------------------------------------------------------------------------------- /single_layer_test/GlobalAveragePool/5420_GlobalAveragePool.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 3 3 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/GlobalAveragePool/5423_GlobalAveragePool.dimg: -------------------------------------------------------------------------------- 1 | 1 1 1 2 4 4 1 1 4 -------------------------------------------------------------------------------- /single_layer_test/GlobalAveragePool/5423_GlobalAveragePool.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/GlobalAveragePool/5423_GlobalAveragePool.onnx -------------------------------------------------------------------------------- /single_layer_test/GlobalAveragePool/5423_GlobalAveragePool.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 1 1 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/LRN/5439_LRN.dimg: -------------------------------------------------------------------------------- 1 | 0.999512 0.999512 0.999512 0.999512 2.99805 2.99805 2.99805 2.99805 -------------------------------------------------------------------------------- /single_layer_test/LRN/5439_LRN.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/LRN/5439_LRN.onnx -------------------------------------------------------------------------------- /single_layer_test/LRN/5439_LRN.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 2 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/LRN/5442_LRN.dimg: -------------------------------------------------------------------------------- 1 | 2.99609 2.99609 3.99609 3.99609 2.99609 2.99609 -------------------------------------------------------------------------------- /single_layer_test/LRN/5442_LRN.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/LRN/5442_LRN.onnx -------------------------------------------------------------------------------- /single_layer_test/LRN/5442_LRN.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 1 2 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/LRN/5452_LRN.dimg: -------------------------------------------------------------------------------- 1 | 1.99902 1.99902 1.99902 1.99902 1.99902 1.99902 -------------------------------------------------------------------------------- /single_layer_test/LRN/5452_LRN.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/LRN/5452_LRN.onnx -------------------------------------------------------------------------------- /single_layer_test/LRN/5452_LRN.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 3 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/MaxPool/5488_MaxPool.dimg: -------------------------------------------------------------------------------- 1 | 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 -------------------------------------------------------------------------------- /single_layer_test/MaxPool/5488_MaxPool.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/MaxPool/5488_MaxPool.onnx -------------------------------------------------------------------------------- /single_layer_test/MaxPool/5488_MaxPool.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 3 4 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/MaxPool/5492_MaxPool.dimg: -------------------------------------------------------------------------------- 1 | 3 3 3 3 3 3 -------------------------------------------------------------------------------- /single_layer_test/MaxPool/5492_MaxPool.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/MaxPool/5492_MaxPool.onnx -------------------------------------------------------------------------------- /single_layer_test/MaxPool/5492_MaxPool.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 3 2 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/MaxPool/5500_MaxPool.dimg: -------------------------------------------------------------------------------- 1 | 2 2 2 2 2 2 -------------------------------------------------------------------------------- /single_layer_test/MaxPool/5500_MaxPool.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/MaxPool/5500_MaxPool.onnx -------------------------------------------------------------------------------- /single_layer_test/MaxPool/5500_MaxPool.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 3 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Mul/5599_Mul.dimg: -------------------------------------------------------------------------------- 1 | 4 4 4 4 6 6 6 6 12 12 12 12 -------------------------------------------------------------------------------- /single_layer_test/Mul/5599_Mul.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Mul/5599_Mul.onnx -------------------------------------------------------------------------------- /single_layer_test/Mul/5599_Mul.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 2 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Mul/5600_Mul.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Mul/5600_Mul.onnx -------------------------------------------------------------------------------- /single_layer_test/Mul/5606_Mul.dimg: -------------------------------------------------------------------------------- 1 | 12 12 12 12 12 12 12 12 12 12 12 12 -------------------------------------------------------------------------------- /single_layer_test/Mul/5606_Mul.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Mul/5606_Mul.onnx -------------------------------------------------------------------------------- /single_layer_test/Mul/5606_Mul.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 3 4 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Relu/5731_Relu.dimg: -------------------------------------------------------------------------------- 1 | 3 3 3 3 3 3 3 3 3 -------------------------------------------------------------------------------- /single_layer_test/Relu/5731_Relu.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Relu/5731_Relu.onnx -------------------------------------------------------------------------------- /single_layer_test/Relu/5731_Relu.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 3 3 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Relu/5737_Relu.dimg: -------------------------------------------------------------------------------- 1 | 4 4 4 4 4 4 4 4 4 4 4 4 1 1 1 1 1 1 1 1 1 1 1 1 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 -------------------------------------------------------------------------------- /single_layer_test/Relu/5737_Relu.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Relu/5737_Relu.onnx -------------------------------------------------------------------------------- /single_layer_test/Relu/5737_Relu.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 4 3 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Relu/5742_Relu.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Relu/5742_Relu.onnx -------------------------------------------------------------------------------- /single_layer_test/Relu/5742_Relu.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 1 2 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Reshape/5805_Reshape.dimg: -------------------------------------------------------------------------------- 1 | 7 7 7 5 6 5 7 4 6 4 5 4 4 6 7 4 7 7 4 4 5 6 4 6 6 6 7 4 5 7 7 4 7 7 4 6 4 5 4 6 6 7 5 5 6 4 4 5 6 4 6 7 5 4 5 6 4 7 7 7 4 6 5 5 7 6 5 4 7 6 5 7 4 6 4 5 7 7 6 4 7 6 5 5 7 7 5 7 4 7 7 4 4 7 5 6 5 6 6 6 5 4 5 5 5 5 4 4 5 4 5 5 7 4 7 6 4 5 5 7 7 4 4 4 6 7 7 4 4 6 5 7 7 4 4 4 4 7 7 5 4 5 5 7 4 5 4 4 5 6 7 5 4 7 6 6 7 4 4 4 4 6 7 5 6 6 5 4 4 4 4 5 7 6 4 7 5 7 7 4 7 7 6 4 7 7 7 6 4 4 5 6 7 7 4 6 4 5 4 7 4 5 5 6 7 5 4 7 4 4 4 6 6 7 7 6 4 4 4 7 5 4 5 6 4 4 5 4 6 5 6 4 6 4 7 5 7 4 6 4 6 7 4 4 7 5 6 4 4 6 7 7 5 7 7 4 -------------------------------------------------------------------------------- /single_layer_test/Reshape/5805_Reshape.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Reshape/5805_Reshape.onnx -------------------------------------------------------------------------------- /single_layer_test/Reshape/5805_Reshape.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 16 16 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Reshape/5811_Reshape.dimg: -------------------------------------------------------------------------------- 1 | 6 6 -------------------------------------------------------------------------------- /single_layer_test/Reshape/5811_Reshape.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Reshape/5811_Reshape.onnx -------------------------------------------------------------------------------- /single_layer_test/Reshape/5811_Reshape.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 1 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Reshape/5816_Reshape.dimg: -------------------------------------------------------------------------------- 1 | 6 7 -------------------------------------------------------------------------------- /single_layer_test/Reshape/5816_Reshape.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Reshape/5816_Reshape.onnx -------------------------------------------------------------------------------- /single_layer_test/Reshape/5816_Reshape.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 2 1 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Softmax/5834_Softmax.dimg: -------------------------------------------------------------------------------- 1 | 0.0131149 0.0969238 0.0356445 0.263428 0.0131149 0.0356445 0.0356445 0.0131149 0.0131149 0.0969238 0.263428 0.0131149 0.0356445 0.0356445 0.0356445 -------------------------------------------------------------------------------- /single_layer_test/Softmax/5834_Softmax.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Softmax/5834_Softmax.onnx -------------------------------------------------------------------------------- /single_layer_test/Softmax/5834_Softmax.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 1 1 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Softmax/5835_Softmax.dimg: -------------------------------------------------------------------------------- 1 | 0.0795288 0.0292511 0.0292511 0.0107651 0.0292511 0.216187 0.0292511 0.0107651 0.0107651 0.0107651 0.216187 0.0795288 0.0107651 0.216187 0.0107651 0.0107651 -------------------------------------------------------------------------------- /single_layer_test/Softmax/5835_Softmax.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Softmax/5835_Softmax.onnx -------------------------------------------------------------------------------- /single_layer_test/Softmax/5835_Softmax.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 1 1 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Softmax/5841_Softmax.dimg: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /single_layer_test/Softmax/5841_Softmax.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Softmax/5841_Softmax.onnx -------------------------------------------------------------------------------- /single_layer_test/Softmax/5841_Softmax.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 1 1 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Transpose/5917_Transpose.dimg: -------------------------------------------------------------------------------- 1 | 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 -------------------------------------------------------------------------------- /single_layer_test/Transpose/5917_Transpose.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Transpose/5917_Transpose.onnx -------------------------------------------------------------------------------- /single_layer_test/Transpose/5917_Transpose.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 5 5 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Transpose/5922_Transpose.dimg: -------------------------------------------------------------------------------- 1 | 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1940 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1934 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1917 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 1887 -------------------------------------------------------------------------------- /single_layer_test/Transpose/5922_Transpose.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Transpose/5922_Transpose.onnx -------------------------------------------------------------------------------- /single_layer_test/Transpose/5922_Transpose.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 5 5 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Transpose/5952_Transpose.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Transpose/5952_Transpose.onnx -------------------------------------------------------------------------------- /single_layer_test/Transpose/5952_Transpose.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 5 33 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Unsqueeze/5967_Unsqueeze.dimg: -------------------------------------------------------------------------------- 1 | 5 3 4 4 3 2 3 5 4 2 4 3 3 5 3 2 4 6 6 4 4 3 6 3 4 5 5 4 5 6 3 6 7 7 4 7 6 4 7 4 7 7 6 5 5 4 5 5 5 4 5 4 3 5 4 3 5 4 4 6 6 5 6 3 -------------------------------------------------------------------------------- /single_layer_test/Unsqueeze/5967_Unsqueeze.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Unsqueeze/5967_Unsqueeze.onnx -------------------------------------------------------------------------------- /single_layer_test/Unsqueeze/5967_Unsqueeze.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 4 4 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/Unsqueeze/5970_Unsqueeze.dimg: -------------------------------------------------------------------------------- 1 | 6 4 3 3 4 3 4 4 4 4 5 4 4 3 5 2 6 4 3 6 4 3 6 3 -------------------------------------------------------------------------------- /single_layer_test/Unsqueeze/5970_Unsqueeze.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/single_layer_test/Unsqueeze/5970_Unsqueeze.onnx -------------------------------------------------------------------------------- /single_layer_test/Unsqueeze/5970_Unsqueeze.pgm: -------------------------------------------------------------------------------- 1 | P5 2 | 4 2 3 | 255 4 |  -------------------------------------------------------------------------------- /single_layer_test/compile-models.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" 5 | MODELS=($(find $SCRIPT_DIR -iname "*.onnx")) 6 | 7 | ONNC=onnc 8 | 9 | for model in "${MODELS[@]}"; do 10 | model_dir="$(dirname $model)" 11 | model_basename="$(basename $model .onnx)" 12 | $ONNC -mquadruple nvdla $model 13 | cp out.nvdla $model_dir/$model_basename.nvdla 14 | done 15 | -------------------------------------------------------------------------------- /tools/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | -------------------------------------------------------------------------------- /tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(unittests) 2 | add_subdirectory(onnc) 3 | add_subdirectory(onni) 4 | add_subdirectory(pb2t) 5 | add_subdirectory(readonnx) 6 | 7 | if (ENABLE_SOPHON_TARGET) 8 | add_subdirectory(onnx2tg) 9 | endif() 10 | if (ENABLE_X86_TARGET) 11 | add_subdirectory(onnc-jit) 12 | endif() 13 | -------------------------------------------------------------------------------- /tools/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign 2 | 3 | SUBDIRS = unittests onnc readonnx onnc-jit onni 4 | -------------------------------------------------------------------------------- /tools/onnc-jit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | include_directories(${ONNC_INCLUDE_DIRS}) 3 | add_executable(onnc-jit main.cpp ONNCJITApp.cpp ONNCJITConfig.cpp) 4 | target_link_libraries(onnc-jit libonnc onnc-rt) 5 | 6 | install(TARGETS onnc-jit 7 | RUNTIME DESTINATION bin) 8 | -------------------------------------------------------------------------------- /tools/onnc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | include_directories(${ONNC_INCLUDE_DIRS}) 3 | add_executable(onnc main.cpp ONNCApp.cpp ONNCConfig.cpp) 4 | target_link_libraries(onnc libonnc onnc-rt) 5 | 6 | install(TARGETS onnc 7 | RUNTIME DESTINATION bin) 8 | -------------------------------------------------------------------------------- /tools/onni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | include_directories(${ONNC_INCLUDE_DIRS}) 3 | 4 | add_executable(onni main.cpp ONNIApp.cpp ONNIConfig.cpp 5 | InterpreterPass.cpp CountOperatorsPass.cpp) 6 | target_link_libraries(onni libonnc onnc-rt) 7 | 8 | install(TARGETS onni 9 | RUNTIME DESTINATION bin) 10 | -------------------------------------------------------------------------------- /tools/onni/ONNIApp.h: -------------------------------------------------------------------------------- 1 | //===- ONNIApp.h ----------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef ONNC_INTERPRETER_APPLICATION_H 9 | #define ONNC_INTERPRETER_APPLICATION_H 10 | #include 11 | #include "ONNIConfig.h" 12 | 13 | class ONNIApp : public onnc::CoreApplication 14 | { 15 | public: 16 | ONNIApp(int pArgc, char* pArgv[]); 17 | 18 | ONNIConfig& options() { return m_Options; } 19 | 20 | const ONNIConfig& options() const { return m_Options; } 21 | 22 | int run(); 23 | 24 | private: 25 | ONNIConfig m_Options; 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /tools/onnx2tg/Config.cpp: -------------------------------------------------------------------------------- 1 | //===- Config.cpp --------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include "Config.h" 9 | 10 | //===----------------------------------------------------------------------===// 11 | // Config 12 | //===----------------------------------------------------------------------===// 13 | Config::Config() 14 | : m_Input(), m_Output() { 15 | } 16 | 17 | onnc::TargetOptions &Config::target() 18 | { 19 | return m_Options; 20 | } 21 | 22 | const onnc::TargetOptions &Config::target() const 23 | { 24 | return m_Options; 25 | } 26 | -------------------------------------------------------------------------------- /tools/pb2t/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${ONNC_INCLUDE_DIRS}) 2 | add_executable(pb2t main.cpp) 3 | target_link_libraries(pb2t libonnc) 4 | 5 | install(TARGETS pb2t 6 | RUNTIME DESTINATION bin) 7 | -------------------------------------------------------------------------------- /tools/readonnx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | include_directories(${ONNC_INCLUDE_DIRS}) 3 | add_executable(readonnx main.cpp ReadONNXApp.cpp ReadONNXConfig.cpp) 4 | target_link_libraries(readonnx libonnc) 5 | 6 | install(TARGETS readonnx 7 | RUNTIME DESTINATION bin) 8 | -------------------------------------------------------------------------------- /tools/unittests/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | -------------------------------------------------------------------------------- /tools/unittests/Optimizations/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_onnc_test(DivideGlobalAPIntoAPs DivideGlobalAPIntoAPsTest.cpp) 2 | add_onnc_test(EliminateIdentityTest EliminateIdentityTest.cpp) 3 | add_onnc_test(PropagateConstWithDiffShape PropagateConstWithDiffShapeTest.cpp) 4 | add_onnc_test(ReplaceGemmByConv ReplaceGemmByConvTest.cpp) 5 | add_onnc_test(SplitConv SplitConvTest.cpp) 6 | -------------------------------------------------------------------------------- /tools/unittests/Runtime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${ONNC_INCLUDE_DIRS}) 2 | include_directories(${SKYPAT_INCLUDE_DIRS}) 3 | 4 | function(add_onnc_runtime_test name) 5 | add_onnc_test(Runtime_${name} ${ARGN}) 6 | endfunction() 7 | 8 | add_onnc_runtime_test(Abs AbsTest.cpp) 9 | add_onnc_runtime_test(Transpose TransposeTest.cpp) -------------------------------------------------------------------------------- /tools/unittests/data/empty.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/tools/unittests/data/empty.json -------------------------------------------------------------------------------- /tools/unittests/data/squeezenet/model.onnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/tools/unittests/data/squeezenet/model.onnx -------------------------------------------------------------------------------- /tools/unittests/data/statistics.json: -------------------------------------------------------------------------------- 1 | { 2 | "group1" : { 3 | "gkey1" : 10, 4 | "gkey2" : 1.1, 5 | "gkey3" : "value13", 6 | "gkey4" : [ "1", "2", "3" ] 7 | }, 8 | "group2" : { 9 | "g2key1" : 22, 10 | "g2key2" : 2.2, 11 | "g2key3" : "value23" 12 | }, 13 | "group3" : { 14 | "int_list" : [ 1, 2, 3] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tools/unittests/data/target.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ONNC/onnc/6628eb7eafa2fd9820a7e1191feff441ac03811e/tools/unittests/data/target.json -------------------------------------------------------------------------------- /tools/unittests/data/test.txt: -------------------------------------------------------------------------------- 1 | This is a text for testing 2 | -------------------------------------------------------------------------------- /tools/unittests/main.cpp: -------------------------------------------------------------------------------- 1 | //===- main.cpp -----------------------------------------------------------===// 2 | // 3 | // The ONNC Project 4 | // 5 | // See LICENSE.TXT for details. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #include 9 | #include 10 | 11 | int main(int argc, char* argv[]) 12 | { 13 | skypat::Test::Initialize(argc, argv); 14 | skypat::Test::RunAll(); 15 | 16 | return (skypat::testing::UnitTest::self()->getNumOfFails() == 0 ? EXIT_SUCCESS : EXIT_FAILURE); 17 | } 18 | --------------------------------------------------------------------------------