MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / MorphologyVarShapeInto

Function MorphologyVarShapeInto

python/mod_cvcuda/operators/OpMorphology.cpp:80–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80ImageBatchVarShape MorphologyVarShapeInto(ImageBatchVarShape &output, ImageBatchVarShape &input,
81 NVCVMorphologyType morph_type, Tensor &masks, Tensor &anchors,
82 std::optional<ImageBatchVarShape> workspace, const int32_t iteration,
83 const NVCVBorderType borderMode, std::optional<Stream> pstream)
84{
85 if (!pstream)
86 {
87 pstream = Stream::Current();
88 }
89
90 auto morphology = CreateOperator<cvcuda::Morphology>();
91
92 ResourceGuard guard(*pstream);
93 guard.add(LockMode::LOCK_MODE_READ, {input});
94 guard.add(LockMode::LOCK_MODE_READWRITE, {output, masks, anchors});
95 guard.add(LockMode::LOCK_MODE_READWRITE, {*morphology});
96
97 if (workspace)
98 {
99 guard.add(LockMode::LOCK_MODE_READ, {*workspace});
100 morphology->submit(pstream->cudaHandle(), input, output, *workspace, morph_type, masks, anchors, iteration,
101 borderMode);
102 }
103 else
104 {
105 morphology->submit(pstream->cudaHandle(), input, output, nvcv::NullOpt, morph_type, masks, anchors, iteration,
106 borderMode);
107 }
108
109 return output;
110}
111
112ImageBatchVarShape MorphologyVarShape(ImageBatchVarShape &input, NVCVMorphologyType morph_type, Tensor &masks,
113 Tensor &anchors, std::optional<ImageBatchVarShape> workspace,

Callers 1

MorphologyVarShapeFunction · 0.85

Calls 3

cudaHandleMethod · 0.80
addMethod · 0.45
submitMethod · 0.45

Tested by

no test coverage detected