using gpuMat instead of backend wrappers

This commit is contained in:
Abhishek Gola
2026-07-08 17:17:48 +05:30
parent 7f63fede4c
commit 12fb9a6c24
21 changed files with 319 additions and 153 deletions

View File

@@ -437,6 +437,20 @@ CV__DNN_INLINE_NS_BEGIN
const std::vector<Ptr<BackendWrapper>>& outputs
);
/**
* @brief Returns a CUDA backend node for the new graph engine (wrapper-free).
*
* Inputs and outputs are device tensors (arrays of cuda::GpuMatND) carrying shape and type;
* only that metadata is needed to build the node, the buffers are filled later by
* forwardCUDA(). The default adapts the wrapper-based initCUDA() so classic-engine ops keep
* working. @p context is a void pointer to a CSLContext object.
*/
virtual Ptr<BackendNode> initCUDA(
void *context,
InputArrayOfArrays inputs,
InputArrayOfArrays outputs
);
/**
* @brief Returns a TimVX backend node
*
@@ -479,12 +493,13 @@ CV__DNN_INLINE_NS_BEGIN
/**
* @brief Executes the operation on the CUDA backend (new graph engine).
*
* Called by the engine for nodes assigned to DNN_BACKEND_CUDA. The default
* implementation raises an error. @p workspace is an opaque pointer to a
* cuda4dnn::csl::Workspace (kept void* to avoid leaking internal CUDA types).
* Called by the engine for nodes assigned to DNN_BACKEND_CUDA. Inputs and outputs are
* device-resident tensors passed as arrays of cuda::GpuMatND; no backend wrappers are
* involved. The default implementation raises an error. @p workspace is an opaque pointer
* to a cuda4dnn::csl::Workspace (kept void* to avoid leaking internal CUDA types).
*/
virtual void forwardCUDA(const std::vector<Ptr<BackendWrapper> >& inputs,
const std::vector<Ptr<BackendWrapper> >& outputs,
virtual void forwardCUDA(InputArrayOfArrays inputs,
OutputArrayOfArrays outputs,
void* workspace);
/**