Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
npps_support_functions.h243 linesDownload Raw Back to include
1 /* Copyright 2010-2023 NVIDIA CORPORATION & AFFILIATES.  All rights reserved. 
2  * 
3  * NOTICE TO LICENSEE: 
4  * 
5  * The source code and/or documentation ("Licensed Deliverables") are 
6  * subject to NVIDIA intellectual property rights under U.S. and 
7  * international Copyright laws. 
8  * 
9  * The Licensed Deliverables contained herein are PROPRIETARY and 
10  * CONFIDENTIAL to NVIDIA and are being provided under the terms and 
11  * conditions of a form of NVIDIA software license agreement by and 
12  * between NVIDIA and Licensee ("License Agreement") or electronically 
13  * accepted by Licensee.  Notwithstanding any terms or conditions to 
14  * the contrary in the License Agreement, reproduction or disclosure 
15  * of the Licensed Deliverables to any third party without the express 
16  * written consent of NVIDIA is prohibited. 
17  * 
18  * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE 
19  * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE 
20  * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE.  THEY ARE 
21  * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. 
22  * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED 
23  * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, 
24  * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. 
25  * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE 
26  * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY 
27  * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY 
28  * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
29  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
30  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
31  * OF THESE LICENSED DELIVERABLES. 
32  * 
33  * U.S. Government End Users.  These Licensed Deliverables are a 
34  * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 
35  * 1995), consisting of "commercial computer software" and "commercial 
36  * computer software documentation" as such terms are used in 48 
37  * C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government 
38  * only as a commercial end item.  Consistent with 48 C.F.R.12.212 and 
39  * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all 
40  * U.S. Government End Users acquire the Licensed Deliverables with 
41  * only those rights set forth herein. 
42  * 
43  * Any use of the Licensed Deliverables in individual and commercial 
44  * software must include, in the user documentation and internal 
45  * comments to the code, the above Disclaimer and U.S. Government End 
46  * Users Notice. 
47  */ 
48#ifndef NV_NPPS_SUPPORT_FUNCTIONS_H
49#define NV_NPPS_SUPPORT_FUNCTIONS_H
50 
51/**
52 * \file npps_support_functions.h
53 * Signal Processing Support Functions.
54 */
55 
56#include "nppdefs.h"
57
58
59#ifdef __cplusplus
60extern "C" {
61#endif
62
63
64/** 
65 *  \page signal_memory_management Memory Management
66 *  @defgroup signal_memory_management Memory Management
67 *  @ingroup npps
68 * Functions that provide memory management functionality like malloc and free.
69 * @{
70 */
71
72/** 
73 * \section signal_malloc Malloc
74 * @defgroup signal_malloc Malloc
75 * Signal-allocator methods for allocating 1D arrays of data in device memory.
76 * All allocators have size parameters to specify the size of the signal (1D array)
77 * being allocated.
78 *
79 * The allocator methods return a pointer to the newly allocated memory of appropriate
80 * type. If device-memory allocation is not possible due to resource constaints
81 * the allocators return 0 (i.e. NULL pointer). 
82 *
83 * All signal allocators allocate memory aligned such that it is  beneficial to the 
84 * performance of the majority of the signal-processing primitives. 
85 * It is no mandatory however to use these allocators. Any valid
86 * CUDA device-memory pointers can be passed to NPP primitives. 
87 *
88 * @{
89 */
90
91/**
92 * 8-bit unsigned signal allocator.
93 * \param nSize Number of unsigned chars in the new signal.
94 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
95 *         that an error occurred during allocation.
96 */
97Npp8u * 
98nppsMalloc_8u(size_t nSize);
99
100/**
101 * 8-bit signed signal allocator.
102 * \param nSize Number of (signed) chars in the new signal.
103 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
104 *         that an error occurred during allocation.
105 */
106Npp8s * 
107nppsMalloc_8s(size_t nSize);
108
109/**
110 * 16-bit unsigned signal allocator.
111 * \param nSize Number of unsigned shorts in the new signal.
112 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
113 *         that an error occurred during allocation.
114 */
115Npp16u * 
116nppsMalloc_16u(size_t nSize);
117
118/**
119 * 16-bit signal allocator.
120 * \param nSize Number of shorts in the new signal.
121 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
122 *         that an error occurred during allocation.
123 */
124Npp16s * 
125nppsMalloc_16s(size_t nSize);
126
127/**
128 * 16-bit complex-value signal allocator.
129 * \param nSize Number of 16-bit complex numbers in the new signal.
130 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
131 *         that an error occurred during allocation.
132 */
133Npp16sc * 
134nppsMalloc_16sc(size_t nSize);
135
136/**
137 * 32-bit unsigned signal allocator.
138 * \param nSize Number of unsigned ints in the new signal.
139 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
140 *         that an error occurred during allocation.
141 */
142Npp32u * 
143nppsMalloc_32u(size_t nSize);
144
145/**
146 * 32-bit integer signal allocator.
147 * \param nSize Number of ints in the new signal.
148 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
149 *         that an error occurred during allocation.
150 */
151Npp32s * 
152nppsMalloc_32s(size_t nSize);
153
154/**
155 * 32-bit complex integer signal allocator.
156 * \param nSize Number of complex integner values in the new signal.
157 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
158 *         that an error occurred during allocation.
159 */
160Npp32sc * 
161nppsMalloc_32sc(size_t nSize);
162
163/**
164 * 32-bit float signal allocator.
165 * \param nSize Number of floats in the new signal.
166 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
167 *         that an error occurred during allocation.
168 */
169Npp32f * 
170nppsMalloc_32f(size_t nSize);
171
172/**
173 * 32-bit complex float signal allocator.
174 * \param nSize Number of complex float values in the new signal.
175 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
176 *         that an error occurred during allocation.
177 */
178Npp32fc * 
179nppsMalloc_32fc(size_t nSize);
180
181/**
182 * 64-bit long integer signal allocator.
183 * \param nSize Number of long ints in the new signal.
184 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
185 *         that an error occurred during allocation.
186 */
187Npp64s * 
188nppsMalloc_64s(size_t nSize);
189
190/**
191 * 64-bit complex long integer signal allocator.
192 * \param nSize Number of complex long int values in the new signal.
193 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
194 *         that an error occurred during allocation.
195 */
196Npp64sc * 
197nppsMalloc_64sc(size_t nSize);
198
199/**
200 * 64-bit float (double) signal allocator.
201 * \param nSize Number of doubles in the new signal.
202 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
203 *         that an error occurred during allocation.
204 */
205Npp64f * 
206nppsMalloc_64f(size_t nSize);
207
208/**
209 * 64-bit complex complex signal allocator.
210 * \param nSize Number of complex double valuess in the new signal.
211 * \return A pointer to the new signal. 0 (NULL-pointer) indicates
212 *         that an error occurred during allocation.
213 */
214Npp64fc * 
215nppsMalloc_64fc(size_t nSize);
216
217/** @} signal_malloc */
218
219/** 
220 * \section signal_free Free
221 * @defgroup signal_free Free
222 * Free  signal memory.
223 *
224 * @{
225 */
226 
227/**
228 * Free method for any signal memory.
229 * \param pValues A pointer to memory allocated using nppiMalloc_<modifier>.
230 */
231void nppsFree(void * pValues);
232
233/** @} signal_free */
234
235/** @} signal_memory_management */
236
237
238#ifdef __cplusplus
239} /* extern "C" */
240#endif
241
242#endif /* NV_NPPS_SUPPORT_FUNCTIONS_H */
243 
codekingpro/portable-devtools · Team Ai