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

Function StackIntoInternal

python/mod_cvcuda/operators/OpStack.cpp:71–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71Tensor StackIntoInternal(Tensor &output, std::vector<Tensor> &tensorList, std::optional<Stream> pstream,
72 int32_t numberOfTensors)
73{
74 if (!pstream)
75 {
76 pstream = Stream::Current();
77 }
78
79 nvcvpy::TensorBatch inTensorBatch = nvcvpy::TensorBatch::Create(numberOfTensors);
80
81 for (auto &tensor : tensorList)
82 {
83 inTensorBatch.pushBack(tensor);
84 }
85
86 auto op = CreateOperator<cvcuda::Stack>();
87
88 ResourceGuard guard(*pstream);
89 guard.add(LockMode::LOCK_MODE_READ, {inTensorBatch});
90 guard.add(LockMode::LOCK_MODE_WRITE, {output});
91 guard.add(LockMode::LOCK_MODE_NONE, {*op});
92 op->submit(pstream->cudaHandle(), inTensorBatch, output);
93 return std::move(output);
94}
95
96Tensor StackInto(Tensor &output, std::vector<Tensor> &tensorList, std::optional<Stream> pstream)
97{

Callers 2

StackIntoFunction · 0.85
StackFunction · 0.85

Calls 4

cudaHandleMethod · 0.80
pushBackMethod · 0.45
addMethod · 0.45
submitMethod · 0.45

Tested by

no test coverage detected