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

Function ConvertToInto

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

Source from the content-addressed store, hash-verified

27
28namespace {
29Tensor ConvertToInto(Tensor &output, Tensor &input, float scale, float offset, std::optional<Stream> pstream)
30{
31 if (!pstream)
32 {
33 pstream = Stream::Current();
34 }
35
36 auto cvt = CreateOperator<cvcuda::ConvertTo>();
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, {*cvt});
42
43 cvt->submit(pstream->cudaHandle(), input, output, scale, offset);
44
45 return std::move(output);
46}
47
48Tensor ConvertTo(Tensor &input, nvcv::DataType dtype, float scale, float offset, std::optional<Stream> pstream)
49{

Callers 1

ConvertToFunction · 0.85

Calls 3

cudaHandleMethod · 0.80
addMethod · 0.45
submitMethod · 0.45

Tested by

no test coverage detected