/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rpp/checkouts/develop/include/rppdefs.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rpp/checkouts/develop/include/rppdefs.h Source File#

RPP: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rpp/checkouts/develop/include/rppdefs.h Source File
rppdefs.h
Go to the documentation of this file.
1 /*
2 MIT License
3 
4 Copyright (c) 2019 - 2024 Advanced Micro Devices, Inc.
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 SOFTWARE.
23 */
24 
25 #ifndef RPPDEFS_H
26 #define RPPDEFS_H
27 
34 #include <stddef.h>
35 #include <cmath>
36 #ifdef OCL_COMPILE
37 #include <CL/cl.h>
38 #endif
39 
40 #if _WIN32
41 #include <intrin.h>
42 #else
43 #include <x86intrin.h>
44 #include <smmintrin.h>
45 #include <immintrin.h>
46 #endif
47 #include<vector>
48 
50 #define RPP_MIN_8U ( 0 )
52 #define RPP_MAX_8U ( 255 )
54 #define RPPT_MAX_DIMS ( 5 )
56 #define RPPT_MAX_AUDIO_CHANNELS ( 16 )
57 
58 #define CHECK_RETURN_STATUS(x) do { \
59  int retval = (x); \
60  if (retval != 0) { \
61  fprintf(stderr, "Runtime error: %s returned %d at %s:%d", #x, retval, __FILE__, __LINE__); \
62  exit(-1); \
63  } \
64 } while (0)
65 
66 #ifdef HIP_COMPILE
67 #include <hip/hip_runtime.h>
68 #define RPP_HOST_DEVICE __host__ __device__
69 #else
70 #define RPP_HOST_DEVICE
71 #endif
72 
73 const float ONE_OVER_6 = 1.0f / 6;
74 const float ONE_OVER_3 = 1.0f / 3;
75 const float ONE_OVER_255 = 1.0f / 255;
76 const uint MMS_MAX_SCRATCH_MEMORY = 115293120; // maximum scratch memory size (in number of floats) needed for MMS buffer in RNNT training
77 const uint SPECTROGRAM_MAX_SCRATCH_MEMORY = 372877312; // maximum scratch memory size (in number of floats) needed for spectrogram HIP kernel in RNNT training
78 
79 /******************** RPP typedefs ********************/
80 
82 typedef unsigned char Rpp8u;
84 typedef signed char Rpp8s;
86 typedef unsigned short Rpp16u;
88 typedef short Rpp16s;
90 typedef unsigned int Rpp32u;
92 typedef int Rpp32s;
94 typedef unsigned long long Rpp64u;
96 typedef long long Rpp64s;
98 typedef float Rpp32f;
100 typedef double Rpp64f;
102 typedef void* RppPtr_t;
104 typedef size_t RppSize_t;
105 
109 typedef enum
110 {
114  RPP_ERROR = -1,
162 
166 typedef enum
167 {
168  rppStatusSuccess = 0,
169  rppStatusBadParm = -1,
170  rppStatusUnknownError = -2,
171  rppStatusNotInitialized = -3,
172  rppStatusInvalidValue = -4,
173  rppStatusAllocFailed = -5,
174  rppStatusInternalError = -6,
175  rppStatusNotImplemented = -7,
176  rppStatusUnsupportedOp = -8,
177 } rppStatus_t;
178 
182 typedef enum
183 {
184  RPP_SCALAR_OP_AND = 1,
185  RPP_SCALAR_OP_OR,
186  RPP_SCALAR_OP_XOR,
187  RPP_SCALAR_OP_NAND,
188  RPP_SCALAR_OP_EQUAL,
189  RPP_SCALAR_OP_NOTEQUAL,
190  RPP_SCALAR_OP_LESS,
191  RPP_SCALAR_OP_LESSEQ,
192  RPP_SCALAR_OP_GREATER,
193  RPP_SCALAR_OP_GREATEREQ,
194  RPP_SCALAR_OP_ADD,
195  RPP_SCALAR_OP_SUBTRACT,
196  RPP_SCALAR_OP_MULTIPLY,
197  RPP_SCALAR_OP_DIVIDE,
198  RPP_SCALAR_OP_MODULUS,
199  RPP_SCALAR_OP_MIN,
200  RPP_SCALAR_OP_MAX,
201 } RppOp;
202 
206 typedef enum
207 {
208  U8_S8,
209  S8_U8,
211 
215 typedef struct
216 {
217  Rpp32f rho;
218  Rpp32f theta;
219 } RppPointPolar;
220 
224 typedef struct
225 {
226  Rpp32u channelParam;
227  Rpp32u bufferMultiplier;
229 
233 typedef struct
234 {
235  Rpp32f data[6];
236 } Rpp32f6;
237 
241 typedef struct
242 {
243  Rpp32s data[24];
244 } Rpp32s24;
245 
249 typedef struct
250 {
251  Rpp32f data[24];
252 } Rpp32f24;
253 
254 /******************** RPPI typedefs ********************/
255 
259 typedef enum
260 {
261  RGB_HSV = 1,
262  HSV_RGB
264 
268 typedef enum
269 {
270  RPPI_LOW,
271  RPPI_MEDIUM,
272  RPPI_HIGH
274 
278 typedef enum
279 {
280  RPPI_CHN_PLANAR,
281  RPPI_CHN_PACKED
282 } RppiChnFormat;
283 
287 typedef enum
288 {
289  RPPI_HORIZONTAL_AXIS,
290  RPPI_VERTICAL_AXIS,
291  RPPI_BOTH_AXIS
292 } RppiAxis;
293 
297 typedef enum
298 {
299  GAUSS3,
300  GAUSS5,
301  GAUSS3x1,
302  GAUSS1x3,
303  AVG3 = 10,
304  AVG5
305 } RppiBlur;
306 
310 typedef enum
311 {
312  ZEROPAD,
313  NOPAD
314 } RppiPad;
315 
319 typedef enum
320 {
321  RGB,
322  HSV
323 } RppiFormat;
324 
328 typedef struct
329 {
330  unsigned int width;
331  unsigned int height;
332 } RppiSize;
333 
337 typedef struct
338 {
339  int x;
340  int y;
341 } RppiPoint;
342 
346 typedef struct
347 {
348  int x;
349  int y;
350  int z;
351 } RppiPoint3D;
352 
356 typedef struct
357 {
358  int x;
359  int y;
360  int width;
361  int height;
362 } RppiRect;
363 
367 typedef struct
368 {
369  unsigned int x;
370  unsigned int y;
371  unsigned int roiWidth;
372  unsigned int roiHeight;
373 } RppiROI;
374 
375 /******************** RPPT typedefs ********************/
376 
380 typedef enum
381 {
382  U8,
383  F32,
384  F16,
385  I8
386 } RpptDataType;
387 
391 typedef enum
392 {
393  NCHW, // BatchSize-Channels-Height-Width
394  NHWC, // BatchSize-Height-Width-Channels
395  NCDHW, // BatchSize-Channels-Depth-Height-Width
396  NDHWC, // BatchSize-Depth-Height-Width-Channels
397  NHW, // BatchSize-Height-Width
398  NFT, // BatchSize-Frequency-Time -> Frequency Major used for Spectrogram / MelfilterBank
399  NTF // BatchSize-Time-Frequency -> Time Major used for Spectrogram / MelfilterBank
400 } RpptLayout;
401 
405 typedef enum
406 {
407  LTRB, // Left-Top-Right-Bottom
408  XYWH // X-Y-Width-Height
409 } RpptRoiType;
410 
414 typedef enum
415 {
416  LTFRBB, // Left-Top-Front-Right-Bottom-Back
417  XYZWHD // X-Y-Z-Width-Height-Depth
418 } RpptRoi3DType;
419 
423 typedef enum
424 {
425  RGBtype,
426  BGRtype
428 
432 typedef enum
433 {
434  NEAREST_NEIGHBOR = 0,
435  BILINEAR,
436  BICUBIC,
437  LANCZOS,
438  GAUSSIAN,
439  TRIANGULAR
441 
445 typedef enum
446 {
447  ZERO = 0,
448  CLAMP,
449  REFLECT
451 
455 typedef enum
456 {
457  SLANEY = 0, // Follows Slaney’s MATLAB Auditory Modelling Work behavior
458  HTK, // Follows O’Shaughnessy’s book formula, consistent with Hidden Markov Toolkit(HTK), m = 2595 * log10(1 + (f/700))
460 
464 typedef struct
465 {
466  RppiPoint lt, rb; // Left-Top point and Right-Bottom point
467 
468 } RpptRoiLtrb;
469 
473 typedef struct
474 {
475  RppiPoint r;
476  RppiPoint g;
477  RppiPoint b;
479 
483 typedef struct
484 {
485  RppiPoint3D ltf, rbb; // Left-Top-Front point and Right-Bottom-Back point
486 
487 } RpptRoiLtfrbb;
488 
492 typedef struct
493 {
494  RppiPoint xy;
495  int roiWidth, roiHeight;
496 
497 } RpptRoiXywh;
498 
502 typedef struct
503 {
504  RppiPoint3D xyz;
505  int roiWidth, roiHeight, roiDepth;
506 
507 } RpptRoiXyzwhd;
508 
512 typedef union
513 {
514  RpptRoiLtrb ltrbROI; // ROI defined as Left-Top-Right-Bottom
515  RpptRoiXywh xywhROI; // ROI defined as X-Y-Width-Height
516 
517 } RpptROI, *RpptROIPtr;
518 
522 typedef union
523 {
524  RpptRoiLtfrbb ltfrbbROI; // ROI defined as Left-Top-Front-Right-Bottom-Back
525  RpptRoiXyzwhd xyzwhdROI; // ROI defined as X-Y-Z-Width-Height-Depth
526 
528 
532 typedef struct
533 {
534  Rpp32u nStride;
535  Rpp32u cStride;
536  Rpp32u hStride;
537  Rpp32u wStride;
538 } RpptStrides;
539 
543 typedef struct
544 {
545  RppSize_t numDims;
546  Rpp32u offsetInBytes;
547  RpptDataType dataType;
548  Rpp32u n, c, h, w;
549  RpptStrides strides;
550  RpptLayout layout;
552 
556 typedef struct
557 {
558  RppSize_t numDims;
559  Rpp32u offsetInBytes;
560  RpptDataType dataType;
561  Rpp32u dims[RPPT_MAX_DIMS];
562  Rpp32u strides[RPPT_MAX_DIMS];
563  RpptLayout layout;
565 
569 typedef struct
570 {
571  Rpp8u R;
572  Rpp8u G;
573  Rpp8u B;
574 } RpptRGB;
575 
579 typedef struct
580 {
581  Rpp32f R;
582  Rpp32f G;
583  Rpp32f B;
584 } RpptFloatRGB;
585 
589 typedef struct
590 {
591  Rpp32u x;
592  Rpp32u y;
594 
598 typedef struct
599 {
600  Rpp32f x;
601  Rpp32f y;
603 
607 typedef struct
608 {
609  Rpp32u width;
610  Rpp32u height;
612 
616 typedef struct
617 { Rpp32u x[5];
618  Rpp32u counter;
620 
624 typedef struct
625 { Rpp32s x[5];
626  Rpp32s counter;
627  int boxMullerFlag;
628  float boxMullerExtra;
630 
634 typedef struct
635 {
636  Rpp32s24 srcLocsTL;
637  Rpp32s24 srcLocsTR;
638  Rpp32s24 srcLocsBL;
639  Rpp32s24 srcLocsBR;
641 
645 typedef struct
646 {
647  Rpp32f24 srcValsTL;
648  Rpp32f24 srcValsTR;
649  Rpp32f24 srcValsBL;
650  Rpp32f24 srcValsBR;
652 
656 typedef struct GenericFilter
657 {
658  Rpp32f scale = 1.0f;
659  Rpp32f radius = 1.0f;
660  Rpp32s size;
661  GenericFilter(RpptInterpolationType interpolationType, Rpp32s in_size, Rpp32s out_size, Rpp32f scaleRatio)
662  {
663  switch(interpolationType)
664  {
665  case RpptInterpolationType::BICUBIC:
666  {
667  this->radius = 2.0f;
668  break;
669  }
670  case RpptInterpolationType::LANCZOS:
671  {
672  if(in_size > out_size)
673  {
674  this->radius = 3.0f * scaleRatio;
675  this->scale = (1 / scaleRatio);
676  }
677  else
678  this->radius = 3.0f;
679  break;
680  }
681  case RpptInterpolationType::GAUSSIAN:
682  {
683  if(in_size > out_size)
684  {
685  this->radius = scaleRatio;
686  this->scale = (1 / scaleRatio);
687  }
688  break;
689  }
690  case RpptInterpolationType::TRIANGULAR:
691  {
692  if(in_size > out_size)
693  {
694  this->radius = scaleRatio;
695  this->scale = (1 / scaleRatio);
696  }
697  break;
698  }
699  default:
700  {
701  this->radius = 1.0f;
702  this->scale = 1.0f;
703  break;
704  }
705  }
706  this->size = std::ceil(2 * this->radius);
707  }
709 
713 typedef struct RpptResamplingWindow
714 {
715  inline RPP_HOST_DEVICE void input_range(Rpp32f x, Rpp32s *loc0, Rpp32s *loc1)
716  {
717  Rpp32s xc = std::ceil(x);
718  *loc0 = xc - lobes;
719  *loc1 = xc + lobes;
720  }
721 
722  inline Rpp32f operator()(Rpp32f x)
723  {
724  Rpp32f locRaw = x * scale + center;
725  Rpp32s locFloor = std::floor(locRaw);
726  Rpp32f weight = locRaw - locFloor;
727  locFloor = std::max(std::min(locFloor, lookupSize - 2), 0);
728  Rpp32f current = lookup[locFloor];
729  Rpp32f next = lookup[locFloor + 1];
730  return current + weight * (next - current);
731  }
732 
733  inline __m128 operator()(__m128 x)
734  {
735  __m128 pLocRaw = _mm_add_ps(_mm_mul_ps(x, pScale), pCenter);
736  __m128i pxLocFloor = _mm_cvttps_epi32(pLocRaw);
737  __m128 pLocFloor = _mm_cvtepi32_ps(pxLocFloor);
738  __m128 pWeight = _mm_sub_ps(pLocRaw, pLocFloor);
739  Rpp32s idx[4];
740  _mm_storeu_si128(reinterpret_cast<__m128i*>(idx), pxLocFloor);
741  __m128 pCurrent = _mm_setr_ps(lookup[idx[0]], lookup[idx[1]], lookup[idx[2]], lookup[idx[3]]);
742  __m128 pNext = _mm_setr_ps(lookup[idx[0] + 1], lookup[idx[1] + 1], lookup[idx[2] + 1], lookup[idx[3] + 1]);
743  return _mm_add_ps(pCurrent, _mm_mul_ps(pWeight, _mm_sub_ps(pNext, pCurrent)));
744  }
745 
746  Rpp32f scale = 1, center = 1;
747  Rpp32s lobes = 0, coeffs = 0;
748  Rpp32s lookupSize = 0;
749  Rpp32f *lookupPinned = nullptr;
750  std::vector<Rpp32f> lookup;
751  __m128 pCenter, pScale;
753 
758 {
759  public:
760  inline RPP_HOST_DEVICE virtual Rpp32f hz_to_mel(Rpp32f hz) = 0;
761  inline RPP_HOST_DEVICE virtual Rpp32f mel_to_hz(Rpp32f mel) = 0;
762  virtual ~BaseMelScale() = default;
763 };
764 
768 struct HtkMelScale : public BaseMelScale
769 {
770  inline RPP_HOST_DEVICE Rpp32f hz_to_mel(Rpp32f hz) { return 1127.0f * std::log(1.0f + (hz / 700.0f)); }
771  inline RPP_HOST_DEVICE Rpp32f mel_to_hz(Rpp32f mel) { return 700.0f * (std::exp(mel / 1127.0f) - 1.0f); }
772  public:
773  ~HtkMelScale() {};
774 };
775 
780 {
781  const Rpp32f freqLow = 0;
782  const Rpp32f fsp = 66.666667f;
783  const Rpp32f minLogHz = 1000.0;
784  const Rpp32f minLogMel = (minLogHz - freqLow) / fsp;
785  const Rpp32f stepLog = 0.068751777; // Equivalent to std::log(6.4) / 27.0;
786 
787  const Rpp32f invMinLogHz = 0.001f;
788  const Rpp32f invStepLog = 1.0f / stepLog;
789  const Rpp32f invFsp = 1.0f / fsp;
790 
791  inline RPP_HOST_DEVICE Rpp32f hz_to_mel(Rpp32f hz)
792  {
793  Rpp32f mel = 0.0f;
794  if (hz >= minLogHz)
795  mel = minLogMel + std::log(hz * invMinLogHz) * invStepLog;
796  else
797  mel = (hz - freqLow) * invFsp;
798 
799  return mel;
800  }
801 
802  inline RPP_HOST_DEVICE Rpp32f mel_to_hz(Rpp32f mel)
803  {
804  Rpp32f hz = 0.0f;
805  if (mel >= minLogMel)
806  hz = minLogHz * std::exp(stepLog * (mel - minLogMel));
807  else
808  hz = freqLow + mel * fsp;
809  return hz;
810  }
811  public:
812  ~SlaneyMelScale() {};
813 };
814 
815 /******************** HOST memory typedefs ********************/
816 
820 typedef struct
821 {
822  Rpp32f *floatmem;
823 } memRpp32f;
824 
828 typedef struct
829 {
830  Rpp64f *doublemem;
831 } memRpp64f;
832 
836 typedef struct
837 {
838  Rpp32u *uintmem;
839 } memRpp32u;
840 
844 typedef struct
845 {
846  Rpp32s *intmem;
847 } memRpp32s;
848 
852 typedef struct
853 {
854  Rpp8u *ucharmem;
855 } memRpp8u;
856 
860 typedef struct
861 {
862  Rpp8s *charmem;
863 } memRpp8s;
864 
868 typedef struct
869 {
870  RpptRGB* rgbmem;
871 } memRpptRGB;
872 
876 typedef struct
877 {
878  Rpp32u *height;
879  Rpp32u *width;
880 } memSize;
881 
885 typedef struct
886 {
887  Rpp32u *x;
888  Rpp32u *y;
889  Rpp32u *roiHeight;
890  Rpp32u *roiWidth;
891 } memROI;
892 
896 typedef struct {
897  RppiSize *srcSize;
898  RppiSize *dstSize;
899  RppiSize *maxSrcSize;
900  RppiSize *maxDstSize;
901  RppiROI *roiPoints;
902  memRpp32f floatArr[10];
903  memRpp64f doubleArr[10];
904  memRpp32u uintArr[10];
905  memRpp32s intArr[10];
906  memRpp8u ucharArr[10];
907  memRpp8s charArr[10];
908  memRpptRGB rgbArr;
909  Rpp64u *srcBatchIndex;
910  Rpp64u *dstBatchIndex;
911  Rpp32u *inc;
912  Rpp32u *dstInc;
913  Rpp32f *scratchBufferHost;
914 } memCPU;
915 
916 #ifdef OCL_COMPILE
917 
918 /******************** OCL memory typedefs ********************/
919 
923 typedef struct
924 {
925  cl_mem floatmem;
926 } clmemRpp32f;
927 
931 typedef struct
932 {
933  cl_mem doublemem;
934 } clmemRpp64f;
935 
939 typedef struct
940 {
941  cl_mem uintmem;
942 } clmemRpp32u;
943 
947 typedef struct
948 {
949  cl_mem intmem;
950 } clmemRpp32s;
951 
955 typedef struct
956 {
957  cl_mem ucharmem;
958 } clmemRpp8u;
959 
963 typedef struct
964 {
965  cl_mem charmem;
966 } clmemRpp8s;
967 
971 typedef struct
972 {
973  cl_mem height;
974  cl_mem width;
975 } clmemSize;
976 
980 typedef struct
981 {
982  cl_mem x;
983  cl_mem y;
984  cl_mem roiHeight;
985  cl_mem roiWidth;
986 } clmemROI;
987 
991 typedef struct
992 {
993  memSize csrcSize;
994  memSize cdstSize;
995  memSize cmaxSrcSize;
996  memSize cmaxDstSize;
997  memROI croiPoints;
998  clmemSize srcSize;
999  clmemSize dstSize;
1000  clmemSize maxSrcSize;
1001  clmemSize maxDstSize;
1002  clmemROI roiPoints;
1003  clmemRpp32f floatArr[10];
1004  clmemRpp64f doubleArr[10];
1005  clmemRpp32u uintArr[10];
1006  clmemRpp32s intArr[10];
1007  clmemRpp8u ucharArr[10];
1008  clmemRpp8s charArr[10];
1009  cl_mem srcBatchIndex;
1010  cl_mem dstBatchIndex;
1011  cl_mem inc;
1012  cl_mem dstInc;
1013 } memGPU;
1014 
1018 typedef struct
1019 {
1020  memCPU mcpu;
1021  memGPU mgpu;
1022 } memMgmt;
1023 
1024 #elif defined(HIP_COMPILE)
1025 
1026 /******************** HIP memory typedefs ********************/
1027 
1031 typedef struct
1032 {
1033  Rpp32f* floatmem;
1034 } hipMemRpp32f;
1035 
1039 typedef struct
1040 {
1041  Rpp64f* doublemem;
1042 } hipMemRpp64f;
1043 
1047 typedef struct
1048 {
1049  Rpp32u* uintmem;
1050 } hipMemRpp32u;
1051 
1055 typedef struct
1056 {
1057  Rpp32s* intmem;
1058 } hipMemRpp32s;
1059 
1063 typedef struct
1064 {
1065  Rpp8u* ucharmem;
1066 } hipMemRpp8u;
1067 
1071 typedef struct
1072 {
1073  Rpp8s* charmem;
1074 } hipMemRpp8s;
1075 
1079 typedef struct
1080 {
1081  RpptRGB* rgbmem;
1082 } hipMemRpptRGB;
1083 
1087 typedef struct
1088 {
1089  Rpp32u* height;
1090  Rpp32u* width;
1091 } hipMemSize;
1092 
1096 typedef struct
1097 {
1098  Rpp32u* x;
1099  Rpp32u* y;
1100  Rpp32u* roiHeight;
1101  Rpp32u* roiWidth;
1102 } hipMemROI;
1103 
1107 typedef struct
1108 {
1109  memSize csrcSize;
1110  memSize cdstSize;
1111  memSize cmaxSrcSize;
1112  memSize cmaxDstSize;
1113  memROI croiPoints;
1114  hipMemSize srcSize;
1115  hipMemSize dstSize;
1116  hipMemSize maxSrcSize;
1117  hipMemSize maxDstSize;
1118  hipMemROI roiPoints;
1119  hipMemRpp32f floatArr[10];
1120  hipMemRpp32f float3Arr[10];
1121  hipMemRpp64f doubleArr[10];
1122  hipMemRpp32u uintArr[10];
1123  hipMemRpp32s intArr[10];
1124  hipMemRpp8u ucharArr[10];
1125  hipMemRpp8s charArr[10];
1126  hipMemRpptRGB rgbArr;
1127  hipMemRpp32f scratchBufferHip;
1128  Rpp64u* srcBatchIndex;
1129  Rpp64u* dstBatchIndex;
1130  Rpp32u* inc;
1131  Rpp32u* dstInc;
1132  hipMemRpp32f scratchBufferPinned;
1133 } memGPU;
1134 
1138 typedef struct
1139 {
1140  memCPU mcpu;
1141  memGPU mgpu;
1142 } memMgmt;
1143 
1144 #else
1145 
1149 typedef struct
1150 {
1151  memCPU mcpu;
1152 } memMgmt;
1153 
1154 #endif //BACKEND
1155 
1159 typedef struct
1160 {
1161  RppPtr_t cpuHandle;
1162  Rpp32u nbatchSize;
1163  memMgmt mem;
1164 } InitHandle;
1165 
1166 #endif /* RPPDEFS_H */
RppiPad
RPPI Image pad type enum.
Definition: rppdefs.h:311
RppiFormat
RPPI Image format type enum.
Definition: rppdefs.h:320
unsigned int Rpp32u
32 bit unsigned int
Definition: rppdefs.h:90
RppConvertBitDepthMode
RPP BitDepth Conversion type enum.
Definition: rppdefs.h:207
int Rpp32s
32 bit signed int
Definition: rppdefs.h:92
signed char Rpp8s
8 bit signed char
Definition: rppdefs.h:84
RppiChnFormat
RPPI Image channel format type enum.
Definition: rppdefs.h:279
RpptMelScaleFormula
RPPT Mel Scale Formula.
Definition: rppdefs.h:456
unsigned short Rpp16u
16 bit unsigned short
Definition: rppdefs.h:86
unsigned char Rpp8u
8 bit unsigned char
Definition: rppdefs.h:82
void * RppPtr_t
void pointer
Definition: rppdefs.h:102
RpptLayout
RPPT Tensor layout type enum.
Definition: rppdefs.h:392
RppiBlur
RPPI Image blur type enum.
Definition: rppdefs.h:298
RppiAxis
RPP Image axis type enum.
Definition: rppdefs.h:288
RpptRoiType
RPPT Tensor 2D ROI type enum.
Definition: rppdefs.h:406
RpptDataType
RPPT Tensor datatype enum.
Definition: rppdefs.h:381
struct RpptResamplingWindow RpptResamplingWindow
RPPT Tensor RpptResamplingWindow type struct.
double Rpp64f
64 bit double
Definition: rppdefs.h:100
RpptAudioBorderType
RPPT Audio Border Type.
Definition: rppdefs.h:446
size_t RppSize_t
size_t
Definition: rppdefs.h:104
struct GenericFilter GenericFilter
RPPT Tensor GenericFilter type struct.
RppStatus
RPP RppStatus type enums.
Definition: rppdefs.h:110
RpptRoi3DType
RPPT Tensor 3D ROI type enum.
Definition: rppdefs.h:415
RppOp
RPP Operations type enum.
Definition: rppdefs.h:183
unsigned long long Rpp64u
64 bit unsigned long long
Definition: rppdefs.h:94
#define RPPT_MAX_DIMS
RPP maximum dimensions in tensor .
Definition: rppdefs.h:54
RpptInterpolationType
RPPT Tensor interpolation type enum.
Definition: rppdefs.h:433
RpptSubpixelLayout
RPPT Tensor subpixel layout type enum.
Definition: rppdefs.h:424
short Rpp16s
16 bit signed short
Definition: rppdefs.h:88
RppiColorConvertMode
RPPI Image color convert mode type enum.
Definition: rppdefs.h:260
float Rpp32f
32 bit float
Definition: rppdefs.h:98
RppiFuzzyLevel
RPPI Image fuzzy level type enum.
Definition: rppdefs.h:269
long long Rpp64s
64 bit long long
Definition: rppdefs.h:96
rppStatus_t
RPP rppStatus_t type enums.
Definition: rppdefs.h:167
@ RPP_ERROR_NOT_IMPLEMENTED
Function variant requested is not implemented / unsupported.
Definition: rppdefs.h:124
@ RPP_ERROR_INVALID_DST_DATATYPE
Invalid dst tensor datatype. (Needs to adhere to function specification.)
Definition: rppdefs.h:136
@ RPP_ERROR_INVALID_OUTPUT_TILE_LENGTH
Invalid output tile length (Needs to adhere to function specification.)
Definition: rppdefs.h:152
@ RPP_ERROR_OUT_OF_BOUND_SRC_ROI
Out of bound source ROI.
Definition: rppdefs.h:146
@ RPP_ERROR_OUT_OF_BOUND_SHARED_MEMORY_SIZE
Shared memory size needed is beyond the bounds (Needs to adhere to function specification....
Definition: rppdefs.h:154
@ RPP_ERROR_ZERO_DIVISION
Arguments provided will result in zero division error.
Definition: rppdefs.h:120
@ RPP_ERROR_INVALID_ARGUMENTS
One or more arguments invalid. (Needs to adhere to function specification.)
Definition: rppdefs.h:116
@ RPP_ERROR_LAYOUT_MISMATCH
src and dst layout mismatch
Definition: rppdefs.h:148
@ RPP_ERROR_INVALID_CHANNELS
Number of channels is invalid. (Needs to adhere to function specification.)
Definition: rppdefs.h:150
@ RPP_ERROR_INVALID_SRC_CHANNELS
Invalid src tensor number of channels. (Needs to adhere to function specification....
Definition: rppdefs.h:126
@ RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE
Invalid src/dst tensor datatype. (Needs to adhere to function specification.)
Definition: rppdefs.h:138
@ RPP_ERROR_INVALID_PARAMETER_DATATYPE
Invalid datatype.
Definition: rppdefs.h:142
@ RPP_ERROR_NOT_ENOUGH_MEMORY
Not enough memory to write outputs, as per dim-lengths and strides set in descriptor.
Definition: rppdefs.h:144
@ RPP_ERROR
Unspecified error.
Definition: rppdefs.h:114
@ RPP_ERROR_INVALID_SRC_DIMS
Number of src dims is invalid. (Needs to adhere to function specification.)
Definition: rppdefs.h:158
@ RPP_ERROR_OUT_OF_BOUND_SCRATCH_MEMORY_SIZE
Scratch memory size needed is beyond the bounds (Needs to adhere to function specification....
Definition: rppdefs.h:156
@ RPP_ERROR_INVALID_DST_LAYOUT
Invalid dst tensor layout. (Needs to adhere to function specification.)
Definition: rppdefs.h:132
@ RPP_ERROR_INVALID_DST_CHANNELS
Invalid dst tensor number of channels. (Needs to adhere to function specification....
Definition: rppdefs.h:128
@ RPP_ERROR_INVALID_SRC_DATATYPE
Invalid src tensor datatype. (Needs to adhere to function specification.)
Definition: rppdefs.h:134
@ RPP_ERROR_INVALID_SRC_LAYOUT
Invalid src tensor layout. (Needs to adhere to function specification.)
Definition: rppdefs.h:130
@ RPP_ERROR_HIGH_SRC_DIMENSION
Src tensor / src ROI dimension too high. (Needs to adhere to function specification....
Definition: rppdefs.h:122
@ RPP_SUCCESS
No error.
Definition: rppdefs.h:112
@ RPP_ERROR_INSUFFICIENT_DST_BUFFER_LENGTH
Insufficient dst buffer length provided. (Needs to adhere to function specification....
Definition: rppdefs.h:140
@ RPP_ERROR_INVALID_DST_DIMS
Number of dst dims is invalid. (Needs to adhere to function specification.)
Definition: rppdefs.h:160
@ RPP_ERROR_LOW_OFFSET
Low tensor offsetInBytes provided for src/dst tensor.
Definition: rppdefs.h:118
Base class for Mel scale conversions.
Definition: rppdefs.h:758
RPPT Tensor GenericFilter type struct.
Definition: rppdefs.h:657
Derived class for HTK Mel scale conversions.
Definition: rppdefs.h:769
RPP initialize handle.
Definition: rppdefs.h:1160
RPP 24 float vector.
Definition: rppdefs.h:250
RPP 6 float vector.
Definition: rppdefs.h:234
RPP 24 signed int vector.
Definition: rppdefs.h:242
RPP layout params.
Definition: rppdefs.h:225
RPP polar point.
Definition: rppdefs.h:216
RPPI Image 3D point type struct.
Definition: rppdefs.h:347
RPPI Image 2D cartesian point type struct.
Definition: rppdefs.h:338
RPPI Image 2D ROI (XYWH format) type struct.
Definition: rppdefs.h:368
RPPI Image 2D Rectangle (XYWH format) type struct.
Definition: rppdefs.h:357
RPPI Image size(Width/Height dimensions) type struct.
Definition: rppdefs.h:329
RPPT Tensor 2D bilinear neighborhood 32-bit signed int 8-length-vectors type struct.
Definition: rppdefs.h:635
RPPT Tensor 2D bilinear neighborhood 32-bit float 8-length-vectors type struct.
Definition: rppdefs.h:646
RPPT Tensor Channel Offsets struct.
Definition: rppdefs.h:474
RPPT Tensor descriptor type struct.
Definition: rppdefs.h:544
RPPT Tensor 32-bit float RGB type struct.
Definition: rppdefs.h:580
RPPT Tensor 2D 32-bit float vector type struct.
Definition: rppdefs.h:599
RPPT Tensor Generic descriptor type struct.
Definition: rppdefs.h:557
RPPT Tensor 2D image patch dimensions type struct.
Definition: rppdefs.h:608
RPPT Tensor 8-bit uchar RGB type struct.
Definition: rppdefs.h:570
RPPT Tensor RpptResamplingWindow type struct.
Definition: rppdefs.h:714
RPPT Tensor 3D ROI LTFRBB struct.
Definition: rppdefs.h:484
RPPT Tensor 2D ROI LTRB struct.
Definition: rppdefs.h:465
RPPT Tensor 2D ROI XYWH struct.
Definition: rppdefs.h:493
RPPT Tensor 3D ROI XYZWHD struct.
Definition: rppdefs.h:503
RPPT Tensor strides type struct.
Definition: rppdefs.h:533
RPPT Tensor 2D 32-bit uint vector type struct.
Definition: rppdefs.h:590
RPPT Tensor random number generator state (xorwow box muller state) type struct.
Definition: rppdefs.h:625
RPPT Tensor random number generator state (xorwow state) type struct.
Definition: rppdefs.h:617
Derived class for Slaney Mel scale conversions.
Definition: rppdefs.h:780
RPP HIP 2D ROI memory.
Definition: rppdefs.h:1097
RPP HIP 32-bit float memory.
Definition: rppdefs.h:1032
RPP HIP 32-bit signed int memory.
Definition: rppdefs.h:1056
RPP HIP 32-bit unsigned int memory.
Definition: rppdefs.h:1048
RPP HIP 64-bit double memory.
Definition: rppdefs.h:1040
RPP HIP 8-bit signed char memory.
Definition: rppdefs.h:1072
RPP HIP 8-bit unsigned char memory.
Definition: rppdefs.h:1064
RPP HIP RGB memory.
Definition: rppdefs.h:1080
RPP HIP 2D dimensions memory.
Definition: rppdefs.h:1088
RPP HOST memory type struct.
Definition: rppdefs.h:896
RPP OCL memory management type struct.
Definition: rppdefs.h:1108
RPP HIP-HOST memory management.
Definition: rppdefs.h:1139
RPP HOST 2D ROI memory.
Definition: rppdefs.h:886
RPP HOST 32-bit float memory.
Definition: rppdefs.h:821
RPP HOST 32-bit signed int memory.
Definition: rppdefs.h:845
RPP HOST 32-bit unsigned int memory.
Definition: rppdefs.h:837
RPP HOST 64-bit double memory.
Definition: rppdefs.h:829
RPP HOST 8-bit signed char memory.
Definition: rppdefs.h:861
RPP HOST 8-bit unsigned char memory.
Definition: rppdefs.h:853
RPP HOST RGB memory.
Definition: rppdefs.h:869
RPP HOST 2D dimensions memory.
Definition: rppdefs.h:877
RPPT Tensor 3D ROI union.
Definition: rppdefs.h:523
RPPT Tensor 2D ROI union.
Definition: rppdefs.h:513