Compute Graph Framework SDK Reference  5.8
dwPyramidNode.hpp
Go to the documentation of this file.
1
2//
3// Notice
4// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8//
9// NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10// information or for any infringement of patents or other rights of third parties that may
11// result from its use. No license is granted by implication or otherwise under any patent
12// or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13// expressly authorized by NVIDIA. Details are subject to change without notice.
14// This code supersedes and replaces all information previously supplied.
15// NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16// components in life support devices or systems without express written approval of
17// NVIDIA CORPORATION & AFFILIATES.
18//
19// SPDX-FileCopyrightText: Copyright (c) 2018-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21//
22// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23// property and proprietary rights in and to this material, related
24// documentation and any modifications thereto. Any use, reproduction,
25// disclosure or distribution of this material and related documentation
26// without an express license agreement from NVIDIA CORPORATION or
27// its affiliates is strictly prohibited.
28//
30
31#ifndef DW_FRAMEWORK_PYRAMID_NODE_HPP_
32#define DW_FRAMEWORK_PYRAMID_NODE_HPP_
33
34#include <dwcgf/node/Node.hpp>
38#include <dwcgf/port/Port.hpp>
40#include <dw/imageprocessing/filtering/Pyramid.h>
41#include <dw/core/system/PVA.h>
42
43#ifdef DW_SDK_BUILD_PVA
44#include <dw/imageprocessing/filtering/PyramidPVA_processpipeline.h>
45#endif
46/* Need to include the appropriate ChannelPacketTypes.hpp since port initialization requires
47 the parameter_trait overrides. Otherwise, it will be considered as a packet of generic type. */
49
50namespace dw
51{
52namespace framework
53{
54
56{
57 uint32_t width;
58 uint32_t height;
59 uint32_t levelCount;
60 dwTrivialDataType dataType = dwTrivialDataType::DW_TYPE_FLOAT32;
61 cupvaStream_t cupvastream;
62 cudaStream_t stream;
63};
64
66{
67public:
68 static constexpr auto describeInputPorts()
69 {
71 DW_DESCRIBE_PORT(dwImageHandle_t, "IMAGE"_sv, PortBinding::REQUIRED));
72 };
73 static constexpr auto describeOutputPorts()
74 {
76 DW_DESCRIBE_PORT(dwPyramidImage, "LEVEL_IMAGES"_sv, PortBinding::REQUIRED));
77 };
78
80};
81
83{
84public:
85 static constexpr char LOG_TAG[] = "dwPyramidNode";
86
87 static constexpr auto describePasses()
88 {
90 describePass("SETUP"_sv, DW_PROCESSOR_TYPE_CPU),
91 describePass("BUILD_PYRAMID"_sv, DW_PROCESSOR_TYPE_GPU),
92 describePass("TEARDOWN"_sv, DW_PROCESSOR_TYPE_CPU));
93 };
94
95 static std::unique_ptr<dwPyramidNode> create(ParameterProvider& provider);
96
97 static constexpr auto describeParameters()
98 {
99 return describeConstructorArguments<dwPyramidNodeParams, dwContextHandle_t>(
102 uint32_t,
104 "cameraIndex"_sv,
105 &dwPyramidNodeParams::width),
107 uint32_t,
109 "cameraIndex"_sv,
112 uint32_t,
113 "pyramidLevelCount"_sv,
116 cudaStream_t,
117 "streamIndex"_sv,
121 dwContextHandle_t)));
122 }
123
125 const dwContextHandle_t ctx);
126};
127} // namespace framework
128} // namespace dw
129
130#endif //DW_FRAMEWORK_PYRAMID_NODE_HPP_
#define DW_DESCRIBE_INDEX_PARAMETER_WITH_SEMANTIC(TYPE_NAME, SEMANTIC_TYPE_NAME, args...)
#define DW_DESCRIBE_INDEX_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_UNNAMED_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PORT(TYPE_NAME, args...)
ExceptionSafeProcessNode(std::unique_ptr< Node > impl)
The interface to access parameter values identified by name and/or (semantic) type.
static constexpr auto describeInputPorts()
static constexpr auto describeOutputPorts()
static constexpr auto describeParameters()
static std::unique_ptr< dwPyramidNode > create(ParameterProvider &provider)
static constexpr char LOG_TAG[]
dwPyramidNode(const dwPyramidNodeParams &config, const dwContextHandle_t ctx)
static constexpr auto describePasses()
cupvaStream_t cupvastream
Data Type of pyramid.
constexpr auto describePortCollection(Args &&... args)
constexpr std::tuple< dw::core::StringView, dwProcessorType > describePass(dw::core::StringView const &&name, dwProcessorType processorType)
constexpr auto describeConstructorArgument(const Args &&... args)
dwPyramidNodeParams { uint32_t width dwPyramidNodeParams
constexpr auto describePassCollection(const Args &&... args)
uint32_t levelCount
Height of level 0.
cudaStream_t stream
uint32_t height
Width of level 0.
dwTrivialDataType dataType
Number of levels in the pyramid.
Definition: Exception.hpp:47