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

Function ReformatInto

python/mod_cvcuda/operators/OpReformat.cpp:29–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28namespace {
29Tensor ReformatInto(Tensor &output, Tensor &input, std::optional<Stream> pstream)
30{
31 if (!pstream)
32 {
33 pstream = Stream::Current();
34 }
35
36 auto reformat = CreateOperator<cvcuda::Reformat>();
37
38 ResourceGuard guard(*pstream);
39 guard.add(LockMode::LOCK_MODE_READ, {input});
40 guard.add(LockMode::LOCK_MODE_WRITE, {output});
41 guard.add(LockMode::LOCK_MODE_NONE, {*reformat});
42
43 reformat->submit(pstream->cudaHandle(), input, output);
44
45 return std::move(output);
46}
47
48Tensor Reformat(Tensor &input, const nvcv::TensorLayout &out_layout, std::optional<Stream> pstream)
49{

Callers 1

ReformatFunction · 0.85

Calls 3

cudaHandleMethod · 0.80
addMethod · 0.45
submitMethod · 0.45

Tested by

no test coverage detected