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

Function __OPNAME__Into

tools/mkop/PythonWrap.cpp:29–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28namespace {
29Tensor __OPNAME__Into(Tensor &output, Tensor &input, std::optional<Stream> pstream)
30{
31 if (!pstream)
32 {
33 pstream = Stream::Current();
34 }
35
36 auto op = CreateOperator<cvcuda::__OPNAME__>();
37
38 ResourceGuard guard(*pstream);
39 guard.add(LockMode::LOCK_MODE_READ, {input});
40 guard.add(LockMode::LOCK_MODE_WRITE, {output});
41 // TODO if op kernel allocates resources that are accessed by the device change to READWRITE
42 // is set to none it is possible for the operator to be destroyed before the kernel is executed.
43 guard.add(LockMode::LOCK_MODE_NONE, {*op});
44
45 op->submit(pstream->cudaHandle(), input, output);
46
47 return std::move(output);
48}
49
50Tensor __OPNAME__(Tensor &input, nvcv::DataType dtype, std::optional<Stream> pstream)
51{

Callers 1

__OPNAME__Function · 0.85

Calls 3

cudaHandleMethod · 0.80
addMethod · 0.45
submitMethod · 0.45

Tested by

no test coverage detected