api/rppdefs.h Source File

api/rppdefs.h Source File#

RPP: api/rppdefs.h Source File
rppdefs.h
Go to the documentation of this file.
1 /*
2 MIT License
3 
4 Copyright (c) 2019 - 2025 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 HIP_COMPILE
37  #include <hip/hip_fp16.h>
38 #endif // HIP_COMPILE
39 #include <half/half.hpp>
40 using halfhpp = half_float::half;
41 typedef halfhpp Rpp16f;
42 
43 #ifdef OCL_COMPILE
44 #include <CL/cl.h>
45 #endif
46 
47 #if _WIN32
48 #include <intrin.h>
49 #else
50 #include <x86intrin.h>
51 #include <smmintrin.h>
52 #include <immintrin.h>
53 #endif
54 #include<vector>
55 
57 #define RPP_MIN_8U ( 0 )
59 #define RPP_MAX_8U ( 255 )
61 #define RPPT_MAX_DIMS ( 5 )
63 #define RPPT_MAX_AUDIO_CHANNELS ( 16 )
64 
65 #define CHECK_RETURN_STATUS(x) do { \
66  int retval = (x); \
67  if (retval != 0) { \
68  fprintf(stderr, "Runtime error: %s returned %d at %s:%d", #x, retval, __FILE__, __LINE__); \
69  exit(-1); \
70  } \
71 } while (0)
72 
73 #ifdef HIP_COMPILE
74 #include <hip/hip_runtime.h>
75 #define RPP_HOST_DEVICE __host__ __device__
76 #else
77 #define RPP_HOST_DEVICE
78 #endif
79 
80 const float ONE_OVER_6 = 1.0f / 6;
81 const float ONE_OVER_3 = 1.0f / 3;
82 const float ONE_OVER_255 = 1.0f / 255;
83 const uint MMS_MAX_SCRATCH_MEMORY = 115293120; // maximum scratch memory size (in number of floats) needed for MMS buffer in RNNT training
84 const uint SPECTROGRAM_MAX_SCRATCH_MEMORY = 372877312; // maximum scratch memory size (in number of floats) needed for spectrogram HIP kernel in RNNT training
85 
86 /******************** RPP typedefs ********************/
87 
89 typedef unsigned char Rpp8u;
91 typedef signed char Rpp8s;
93 typedef unsigned short Rpp16u;
95 typedef short Rpp16s;
97 typedef unsigned int Rpp32u;
99 typedef int Rpp32s;
101 typedef unsigned long long Rpp64u;
103 typedef long long Rpp64s;
105 typedef float Rpp32f;
107 typedef double Rpp64f;
109 typedef void* RppPtr_t;
111 typedef size_t RppSize_t;
112 
116 typedef enum
117 {
121  RPP_ERROR = -1,
173 
177 typedef enum
178 {
179  RPP_HOST_BACKEND,
180  RPP_HIP_BACKEND,
181  RPP_OCL_BACKEND
182 } RppBackend;
183 
187 typedef enum
188 {
189  rppStatusSuccess = 0,
190  rppStatusBadParm = -1,
191  rppStatusUnknownError = -2,
192  rppStatusNotInitialized = -3,
193  rppStatusInvalidValue = -4,
194  rppStatusAllocFailed = -5,
195  rppStatusInternalError = -6,
196  rppStatusNotImplemented = -7,
197  rppStatusUnsupportedOp = -8,
198 } rppStatus_t;
199 
200 #ifdef LEGACY_SUPPORT
204 typedef enum
205 {
206  RPP_SCALAR_OP_AND = 1,
207  RPP_SCALAR_OP_OR,
208  RPP_SCALAR_OP_XOR,
209  RPP_SCALAR_OP_NAND,
210  RPP_SCALAR_OP_EQUAL,
211  RPP_SCALAR_OP_NOTEQUAL,
212  RPP_SCALAR_OP_LESS,
213  RPP_SCALAR_OP_LESSEQ,
214  RPP_SCALAR_OP_GREATER,
215  RPP_SCALAR_OP_GREATEREQ,
216  RPP_SCALAR_OP_ADD,
217  RPP_SCALAR_OP_SUBTRACT,
218  RPP_SCALAR_OP_MULTIPLY,
219  RPP_SCALAR_OP_DIVIDE,
220  RPP_SCALAR_OP_MODULUS,
221  RPP_SCALAR_OP_MIN,
222  RPP_SCALAR_OP_MAX,
223 } RppOp;
224 
228 typedef enum
229 {
230  U8_S8,
231  S8_U8,
232 } RppConvertBitDepthMode;
233 
237 typedef struct
238 {
239  Rpp32f rho;
240  Rpp32f theta;
241 } RppPointPolar;
242 #endif
243 
247 typedef struct
248 {
249  Rpp32u channelParam;
250  Rpp32u bufferMultiplier;
252 
256 typedef struct
257 {
258  Rpp32f data[6];
259 } Rpp32f6;
260 
264 typedef struct
265 {
266  Rpp32f data[9];
267 } Rpp32f9;
268 
272 typedef struct
273 {
274  Rpp32s data[24];
275 } Rpp32s24;
276 
280 typedef struct
281 {
282  Rpp32f data[24];
283 } Rpp32f24;
284 
285 /******************** RPPI typedefs ********************/
286 
287 #ifdef LEGACY_SUPPORT
291 typedef enum
292 {
293  RGB_HSV = 1,
294  HSV_RGB
295 } RppiColorConvertMode;
296 
300 typedef enum
301 {
302  RPPI_LOW,
303  RPPI_MEDIUM,
304  RPPI_HIGH
305 } RppiFuzzyLevel;
306 
310 typedef enum
311 {
312  RPPI_HORIZONTAL_AXIS,
313  RPPI_VERTICAL_AXIS,
314  RPPI_BOTH_AXIS
315 } RppiAxis;
316 
320 typedef enum
321 {
322  GAUSS3,
323  GAUSS5,
324  GAUSS3x1,
325  GAUSS1x3,
326  AVG3 = 10,
327  AVG5
328 } RppiBlur;
329 
333 typedef enum
334 {
335  ZEROPAD,
336  NOPAD
337 } RppiPad;
338 
342 typedef enum
343 {
344  RGB,
345  HSV
346 } RppiFormat;
347 
351 typedef struct
352 {
353  int x;
354  int y;
355  int width;
356  int height;
357 } RppiRect;
358 #endif
359 
363 typedef enum
364 {
365  RPPI_CHN_PLANAR,
366  RPPI_CHN_PACKED
367 } RppiChnFormat;
368 
372 typedef struct
373 {
374  unsigned int width;
375  unsigned int height;
376 } RppiSize;
377 
381 typedef struct
382 {
383  unsigned int x;
384  unsigned int y;
385  unsigned int roiWidth;
386  unsigned int roiHeight;
387 } RppiROI;
388 
389 /******************** RPPT typedefs ********************/
390 
394 typedef enum
395 {
396  U8,
397  F32,
398  F16,
399  I8,
400  I16
401 } RpptDataType;
402 
406 typedef enum
407 {
408  NCHW, // BatchSize-Channels-Height-Width
409  NHWC, // BatchSize-Height-Width-Channels
410  NCDHW, // BatchSize-Channels-Depth-Height-Width
411  NDHWC, // BatchSize-Depth-Height-Width-Channels
412  NHW, // BatchSize-Height-Width
413  NFT, // BatchSize-Frequency-Time -> Frequency Major used for Spectrogram / MelfilterBank
414  NTF // BatchSize-Time-Frequency -> Time Major used for Spectrogram / MelfilterBank
415 } RpptLayout;
416 
420 typedef enum
421 {
422  LTRB, // Left-Top-Right-Bottom
423  XYWH // X-Y-Width-Height
424 } RpptRoiType;
425 
429 typedef enum
430 {
431  LTFRBB, // Left-Top-Front-Right-Bottom-Back
432  XYZWHD // X-Y-Z-Width-Height-Depth
433 } RpptRoi3DType;
434 
438 typedef enum
439 {
440  RGBtype,
441  BGRtype
443 
447 typedef enum
448 {
449  NEAREST_NEIGHBOR = 0,
450  BILINEAR,
451  BICUBIC,
452  LANCZOS,
453  GAUSSIAN,
454  TRIANGULAR
456 
460 typedef enum
461 {
462  ZERO = 0,
463  CLAMP,
464  REFLECT
466 
470 typedef enum
471 {
472  SLANEY = 0, // Follows Slaney’s MATLAB Auditory Modelling Work behavior
473  HTK, // Follows O’Shaughnessy’s book formula, consistent with Hidden Markov Toolkit(HTK), m = 2595 * log10(1 + (f/700))
475 
479 typedef struct
480 {
481  int x;
482  int y;
483 } RpptPoint2D;
484 
488 typedef struct
489 {
490  int x;
491  int y;
492  int z;
493 } RpptPoint3D;
494 
498 typedef struct
499 {
500  RpptPoint2D lt, rb; // Left-Top point and Right-Bottom point
501 
502 } RpptRoiLtrb;
503 
507 typedef struct
508 {
509  RpptPoint2D r;
510  RpptPoint2D g;
511  RpptPoint2D b;
513 
517 typedef struct
518 {
519  RpptPoint3D ltf, rbb; // Left-Top-Front point and Right-Bottom-Back point
520 
521 } RpptRoiLtfrbb;
522 
526 typedef struct
527 {
528  RpptPoint2D xy;
529  int roiWidth, roiHeight;
530 
531 } RpptRoiXywh;
532 
536 typedef struct
537 {
538  RpptPoint3D xyz;
539  int roiWidth, roiHeight, roiDepth;
540 
541 } RpptRoiXyzwhd;
542 
546 typedef union
547 {
548  RpptRoiLtrb ltrbROI; // ROI defined as Left-Top-Right-Bottom
549  RpptRoiXywh xywhROI; // ROI defined as X-Y-Width-Height
550 
551 } RpptROI, *RpptROIPtr;
552 
556 typedef union
557 {
558  RpptRoiLtfrbb ltfrbbROI; // ROI defined as Left-Top-Front-Right-Bottom-Back
559  RpptRoiXyzwhd xyzwhdROI; // ROI defined as X-Y-Z-Width-Height-Depth
560 
562 
566 typedef struct
567 {
568  Rpp32u nStride;
569  Rpp32u cStride;
570  Rpp32u hStride;
571  Rpp32u wStride;
572 } RpptStrides;
573 
577 typedef struct
578 {
579  RppSize_t numDims;
580  Rpp32u offsetInBytes;
581  RpptDataType dataType;
582  Rpp32u n, c, h, w;
583  RpptStrides strides;
584  RpptLayout layout;
586 
590 typedef struct
591 {
592  RppSize_t numDims;
593  Rpp32u offsetInBytes;
594  RpptDataType dataType;
595  Rpp32u dims[RPPT_MAX_DIMS];
596  Rpp32u strides[RPPT_MAX_DIMS];
597  RpptLayout layout;
599 
603 typedef struct
604 {
605  Rpp8u R;
606  Rpp8u G;
607  Rpp8u B;
608 } RpptRGB;
609 
613 typedef struct
614 {
615  Rpp32f R;
616  Rpp32f G;
617  Rpp32f B;
618 } RpptFloatRGB;
619 
623 typedef struct
624 {
625  Rpp32u x;
626  Rpp32u y;
628 
632 typedef struct
633 {
634  Rpp32f x;
635  Rpp32f y;
637 
641 typedef struct
642 {
643  Rpp32u width;
644  Rpp32u height;
646 
650 typedef struct
651 { Rpp32u x[5];
652  Rpp32u counter;
654 
658 typedef struct
659 { Rpp32s x[5];
660  Rpp32s counter;
661  int boxMullerFlag;
662  float boxMullerExtra;
664 
668 typedef struct
669 {
670  Rpp32s24 srcLocsTL;
671  Rpp32s24 srcLocsTR;
672  Rpp32s24 srcLocsBL;
673  Rpp32s24 srcLocsBR;
675 
679 typedef struct
680 {
681  Rpp32f24 srcValsTL;
682  Rpp32f24 srcValsTR;
683  Rpp32f24 srcValsBL;
684  Rpp32f24 srcValsBR;
686 
690 typedef struct GenericFilter
691 {
692  Rpp32f scale = 1.0f;
693  Rpp32f radius = 1.0f;
694  Rpp32s size;
695  GenericFilter(RpptInterpolationType interpolationType, Rpp32s in_size, Rpp32s out_size, Rpp32f scaleRatio)
696  {
697  switch(interpolationType)
698  {
699  case RpptInterpolationType::BICUBIC:
700  {
701  this->radius = 2.0f;
702  break;
703  }
704  case RpptInterpolationType::LANCZOS:
705  {
706  if(in_size > out_size)
707  {
708  this->radius = 3.0f * scaleRatio;
709  this->scale = (1 / scaleRatio);
710  }
711  else
712  this->radius = 3.0f;
713  break;
714  }
715  case RpptInterpolationType::GAUSSIAN:
716  {
717  if(in_size > out_size)
718  {
719  this->radius = scaleRatio;
720  this->scale = (1 / scaleRatio);
721  }
722  break;
723  }
724  case RpptInterpolationType::TRIANGULAR:
725  {
726  if(in_size > out_size)
727  {
728  this->radius = scaleRatio;
729  this->scale = (1 / scaleRatio);
730  }
731  break;
732  }
733  default:
734  {
735  this->radius = 1.0f;
736  this->scale = 1.0f;
737  break;
738  }
739  }
740  this->size = std::ceil(2 * this->radius);
741  }
743 
747 typedef struct RpptResamplingWindow
748 {
749  inline RPP_HOST_DEVICE void input_range(Rpp32f x, Rpp32s *loc0, Rpp32s *loc1)
750  {
751  Rpp32s xc = std::ceil(x);
752  *loc0 = xc - lobes;
753  *loc1 = xc + lobes;
754  }
755 
756  inline Rpp32f operator()(Rpp32f x)
757  {
758  Rpp32f locRaw = x * scale + center;
759  Rpp32s locFloor = std::floor(locRaw);
760  Rpp32f weight = locRaw - locFloor;
761  locFloor = std::max(std::min(locFloor, lookupSize - 2), 0);
762  Rpp32f current = lookup[locFloor];
763  Rpp32f next = lookup[locFloor + 1];
764  return current + weight * (next - current);
765  }
766 
767  inline __m128 operator()(__m128 x)
768  {
769  __m128 pLocRaw = _mm_add_ps(_mm_mul_ps(x, pScale), pCenter);
770  __m128i pxLocFloor = _mm_cvttps_epi32(pLocRaw);
771  __m128 pLocFloor = _mm_cvtepi32_ps(pxLocFloor);
772  __m128 pWeight = _mm_sub_ps(pLocRaw, pLocFloor);
773  Rpp32s idx[4];
774  _mm_storeu_si128(reinterpret_cast<__m128i*>(idx), pxLocFloor);
775  __m128 pCurrent = _mm_setr_ps(lookup[idx[0]], lookup[idx[1]], lookup[idx[2]], lookup[idx[3]]);
776  __m128 pNext = _mm_setr_ps(lookup[idx[0] + 1], lookup[idx[1] + 1], lookup[idx[2] + 1], lookup[idx[3] + 1]);
777  return _mm_add_ps(pCurrent, _mm_mul_ps(pWeight, _mm_sub_ps(pNext, pCurrent)));
778  }
779 
780  Rpp32f scale = 1, center = 1;
781  Rpp32s lobes = 0, coeffs = 0;
782  Rpp32s lookupSize = 0;
783  Rpp32f *lookupPinned = nullptr;
784  std::vector<Rpp32f> lookup;
785  __m128 pCenter, pScale;
787 
792 {
793  public:
794  inline RPP_HOST_DEVICE virtual Rpp32f hz_to_mel(Rpp32f hz) = 0;
795  inline RPP_HOST_DEVICE virtual Rpp32f mel_to_hz(Rpp32f mel) = 0;
796  virtual ~BaseMelScale() = default;
797 };
798 
802 struct HtkMelScale : public BaseMelScale
803 {
804  inline RPP_HOST_DEVICE Rpp32f hz_to_mel(Rpp32f hz) { return 1127.0f * std::log(1.0f + (hz / 700.0f)); }
805  inline RPP_HOST_DEVICE Rpp32f mel_to_hz(Rpp32f mel) { return 700.0f * (std::exp(mel / 1127.0f) - 1.0f); }
806  public:
807  ~HtkMelScale() {};
808 };
809 
814 {
815  const Rpp32f freqLow = 0;
816  const Rpp32f fsp = 66.666667f;
817  const Rpp32f minLogHz = 1000.0;
818  const Rpp32f minLogMel = (minLogHz - freqLow) / fsp;
819  const Rpp32f stepLog = 0.068751777; // Equivalent to std::log(6.4) / 27.0;
820 
821  const Rpp32f invMinLogHz = 0.001f;
822  const Rpp32f invStepLog = 1.0f / stepLog;
823  const Rpp32f invFsp = 1.0f / fsp;
824 
825  inline RPP_HOST_DEVICE Rpp32f hz_to_mel(Rpp32f hz)
826  {
827  Rpp32f mel = 0.0f;
828  if (hz >= minLogHz)
829  mel = minLogMel + std::log(hz * invMinLogHz) * invStepLog;
830  else
831  mel = (hz - freqLow) * invFsp;
832 
833  return mel;
834  }
835 
836  inline RPP_HOST_DEVICE Rpp32f mel_to_hz(Rpp32f mel)
837  {
838  Rpp32f hz = 0.0f;
839  if (mel >= minLogMel)
840  hz = minLogHz * std::exp(stepLog * (mel - minLogMel));
841  else
842  hz = freqLow + mel * fsp;
843  return hz;
844  }
845  public:
846  ~SlaneyMelScale() {};
847 };
848 
849 /******************** HOST memory typedefs ********************/
850 
854 typedef struct
855 {
856  Rpp32f *floatmem;
857 } memRpp32f;
858 
862 typedef struct
863 {
864  Rpp64f *doublemem;
865 } memRpp64f;
866 
870 typedef struct
871 {
872  Rpp32u *uintmem;
873 } memRpp32u;
874 
878 typedef struct
879 {
880  Rpp32s *intmem;
881 } memRpp32s;
882 
886 typedef struct
887 {
888  Rpp8u *ucharmem;
889 } memRpp8u;
890 
894 typedef struct
895 {
896  Rpp8s *charmem;
897 } memRpp8s;
898 
902 typedef struct
903 {
904  RpptRGB* rgbmem;
905 } memRpptRGB;
906 
910 typedef struct
911 {
912  Rpp32u *height;
913  Rpp32u *width;
914 } memSize;
915 
919 typedef struct
920 {
921  Rpp32u *x;
922  Rpp32u *y;
923  Rpp32u *roiHeight;
924  Rpp32u *roiWidth;
925 } memROI;
926 
930 typedef struct {
931  RppiSize *srcSize;
932  RppiSize *dstSize;
933  RppiSize *maxSrcSize;
934  RppiSize *maxDstSize;
935  RppiROI *roiPoints;
936  memRpp32f floatArr[10];
937  memRpp64f doubleArr[10];
938  memRpp32u uintArr[10];
939  memRpp32s intArr[10];
940  memRpp8u ucharArr[10];
941  memRpp8s charArr[10];
942  memRpptRGB rgbArr;
943  Rpp64u *srcBatchIndex;
944  Rpp64u *dstBatchIndex;
945  Rpp32u *inc;
946  Rpp32u *dstInc;
947  Rpp32f *scratchBufferHost;
948 } memCPU;
949 
950 #ifdef OCL_COMPILE
951 
952 /******************** OCL memory typedefs ********************/
953 
957 typedef struct
958 {
959  cl_mem floatmem;
960 } clmemRpp32f;
961 
965 typedef struct
966 {
967  cl_mem doublemem;
968 } clmemRpp64f;
969 
973 typedef struct
974 {
975  cl_mem uintmem;
976 } clmemRpp32u;
977 
981 typedef struct
982 {
983  cl_mem intmem;
984 } clmemRpp32s;
985 
989 typedef struct
990 {
991  cl_mem ucharmem;
992 } clmemRpp8u;
993 
997 typedef struct
998 {
999  cl_mem charmem;
1000 } clmemRpp8s;
1001 
1005 typedef struct
1006 {
1007  cl_mem height;
1008  cl_mem width;
1009 } clmemSize;
1010 
1014 typedef struct
1015 {
1016  cl_mem x;
1017  cl_mem y;
1018  cl_mem roiHeight;
1019  cl_mem roiWidth;
1020 } clmemROI;
1021 
1025 typedef struct
1026 {
1027  memSize csrcSize;
1028  memSize cdstSize;
1029  memSize cmaxSrcSize;
1030  memSize cmaxDstSize;
1031  memROI croiPoints;
1032  clmemSize srcSize;
1033  clmemSize dstSize;
1034  clmemSize maxSrcSize;
1035  clmemSize maxDstSize;
1036  clmemROI roiPoints;
1037  clmemRpp32f floatArr[10];
1038  clmemRpp64f doubleArr[10];
1039  clmemRpp32u uintArr[10];
1040  clmemRpp32s intArr[10];
1041  clmemRpp8u ucharArr[10];
1042  clmemRpp8s charArr[10];
1043  cl_mem srcBatchIndex;
1044  cl_mem dstBatchIndex;
1045  cl_mem inc;
1046  cl_mem dstInc;
1047 } memGPU;
1048 
1052 typedef struct
1053 {
1054  memCPU mcpu;
1055  memGPU mgpu;
1056 } memMgmt;
1057 
1058 #elif defined(HIP_COMPILE)
1059 
1060 /******************** HIP memory typedefs ********************/
1061 
1065 typedef struct
1066 {
1067  Rpp32f* floatmem;
1068 } hipMemRpp32f;
1069 
1073 typedef struct
1074 {
1075  Rpp64f* doublemem;
1076 } hipMemRpp64f;
1077 
1081 typedef struct
1082 {
1083  Rpp32u* uintmem;
1084 } hipMemRpp32u;
1085 
1089 typedef struct
1090 {
1091  Rpp32s* intmem;
1092 } hipMemRpp32s;
1093 
1097 typedef struct
1098 {
1099  Rpp8u* ucharmem;
1100 } hipMemRpp8u;
1101 
1105 typedef struct
1106 {
1107  Rpp8s* charmem;
1108 } hipMemRpp8s;
1109 
1113 typedef struct
1114 {
1115  RpptRGB* rgbmem;
1116 } hipMemRpptRGB;
1117 
1121 typedef struct
1122 {
1123  Rpp32u* height;
1124  Rpp32u* width;
1125 } hipMemSize;
1126 
1130 typedef struct
1131 {
1132  Rpp32u* x;
1133  Rpp32u* y;
1134  Rpp32u* roiHeight;
1135  Rpp32u* roiWidth;
1136 } hipMemROI;
1137 
1141 typedef struct
1142 {
1143  memSize csrcSize;
1144  memSize cdstSize;
1145  memSize cmaxSrcSize;
1146  memSize cmaxDstSize;
1147  memROI croiPoints;
1148  hipMemSize srcSize;
1149  hipMemSize dstSize;
1150  hipMemSize maxSrcSize;
1151  hipMemSize maxDstSize;
1152  hipMemROI roiPoints;
1153  hipMemRpp32f floatArr[10];
1154  hipMemRpp32f float3Arr[10];
1155  hipMemRpp64f doubleArr[10];
1156  hipMemRpp32u uintArr[10];
1157  hipMemRpp32s intArr[10];
1158  hipMemRpp8u ucharArr[10];
1159  hipMemRpp8s charArr[10];
1160  hipMemRpptRGB rgbArr;
1161  hipMemRpp32f scratchBufferHip;
1162  Rpp64u* srcBatchIndex;
1163  Rpp64u* dstBatchIndex;
1164  Rpp32u* inc;
1165  Rpp32u* dstInc;
1166  hipMemRpp32f scratchBufferPinned;
1167 } memGPU;
1168 
1172 typedef struct
1173 {
1174  memCPU mcpu;
1175  memGPU mgpu;
1176 } memMgmt;
1177 
1178 #else
1179 
1183 typedef struct
1184 {
1185  memCPU mcpu;
1186 } memMgmt;
1187 
1188 #endif //BACKEND
1189 
1193 typedef struct
1194 {
1195  RppPtr_t cpuHandle;
1196  Rpp32u nbatchSize;
1197  memMgmt mem;
1198 } InitHandle;
1199 
1200 #endif /* RPPDEFS_H */
unsigned int Rpp32u
32 bit unsigned int
Definition: rppdefs.h:97
int Rpp32s
32 bit signed int
Definition: rppdefs.h:99
signed char Rpp8s
8 bit signed char
Definition: rppdefs.h:91
RppiChnFormat
RPPI Image channel format type enum.
Definition: rppdefs.h:364
RpptMelScaleFormula
RPPT Mel Scale Formula.
Definition: rppdefs.h:471
unsigned short Rpp16u
16 bit unsigned short
Definition: rppdefs.h:93
unsigned char Rpp8u
8 bit unsigned char
Definition: rppdefs.h:89
void * RppPtr_t
void pointer
Definition: rppdefs.h:109
RpptLayout
RPPT Tensor layout type enum.
Definition: rppdefs.h:407
RpptRoiType
RPPT Tensor 2D ROI type enum.
Definition: rppdefs.h:421
RpptDataType
RPPT Tensor datatype enum.
Definition: rppdefs.h:395
struct RpptResamplingWindow RpptResamplingWindow
RPPT Tensor RpptResamplingWindow type struct.
double Rpp64f
64 bit double
Definition: rppdefs.h:107
RpptAudioBorderType
RPPT Audio Border Type.
Definition: rppdefs.h:461
size_t RppSize_t
size_t
Definition: rppdefs.h:111
struct GenericFilter GenericFilter
RPPT Tensor GenericFilter type struct.
RppStatus
RPP RppStatus type enums.
Definition: rppdefs.h:117
RpptRoi3DType
RPPT Tensor 3D ROI type enum.
Definition: rppdefs.h:430
unsigned long long Rpp64u
64 bit unsigned long long
Definition: rppdefs.h:101
#define RPPT_MAX_DIMS
RPP maximum dimensions in tensor .
Definition: rppdefs.h:61
RpptInterpolationType
RPPT Tensor interpolation type enum.
Definition: rppdefs.h:448
RpptSubpixelLayout
RPPT Tensor subpixel layout type enum.
Definition: rppdefs.h:439
short Rpp16s
16 bit signed short
Definition: rppdefs.h:95
float Rpp32f
32 bit float
Definition: rppdefs.h:105
RppBackend
RPP RppBackend type enums.
Definition: rppdefs.h:178
long long Rpp64s
64 bit long long
Definition: rppdefs.h:103
rppStatus_t
RPP rppStatus_t type enums.
Definition: rppdefs.h:188
@ RPP_ERROR_NOT_IMPLEMENTED
Function variant requested is not implemented / unsupported.
Definition: rppdefs.h:131
@ RPP_ERROR_INVALID_DST_DATATYPE
Invalid dst tensor datatype. (Needs to adhere to function specification.)
Definition: rppdefs.h:143
@ RPP_ERROR_INVALID_OUTPUT_TILE_LENGTH
Invalid output tile length (Needs to adhere to function specification.)
Definition: rppdefs.h:159
@ RPP_ERROR_INVALID_DIM_LENGTHS
Length in some dimensions are invalid. (Needs to adhere to function specification....
Definition: rppdefs.h:169
@ RPP_ERROR_OUT_OF_BOUND_SRC_ROI
Out of bound source ROI.
Definition: rppdefs.h:153
@ 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:161
@ RPP_ERROR_ZERO_DIVISION
Arguments provided will result in zero division error.
Definition: rppdefs.h:127
@ RPP_ERROR_INVALID_ARGUMENTS
One or more arguments invalid. (Needs to adhere to function specification.)
Definition: rppdefs.h:123
@ RPP_ERROR_LAYOUT_MISMATCH
src and dst layout mismatch
Definition: rppdefs.h:155
@ RPP_ERROR_INVALID_CHANNELS
Number of channels is invalid. (Needs to adhere to function specification.)
Definition: rppdefs.h:157
@ RPP_ERROR_INVALID_SRC_CHANNELS
Invalid src tensor number of channels. (Needs to adhere to function specification....
Definition: rppdefs.h:133
@ RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE
Invalid src/dst tensor datatype. (Needs to adhere to function specification.)
Definition: rppdefs.h:145
@ RPP_ERROR_INVALID_PARAMETER_DATATYPE
Invalid datatype.
Definition: rppdefs.h:149
@ RPP_ERROR_NOT_ENOUGH_MEMORY
Not enough memory to write outputs, as per dim-lengths and strides set in descriptor.
Definition: rppdefs.h:151
@ RPP_ERROR
Unspecified error.
Definition: rppdefs.h:121
@ RPP_ERROR_INVALID_SRC_DIMS
Number of src dims is invalid. (Needs to adhere to function specification.)
Definition: rppdefs.h:165
@ 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:163
@ RPP_ERROR_INVALID_DST_LAYOUT
Invalid dst tensor layout. (Needs to adhere to function specification.)
Definition: rppdefs.h:139
@ RPP_ERROR_INVALID_AXIS
The specified axis is invalid or out of range. (Needs to adhere to function specification....
Definition: rppdefs.h:171
@ RPP_ERROR_INVALID_DST_CHANNELS
Invalid dst tensor number of channels. (Needs to adhere to function specification....
Definition: rppdefs.h:135
@ RPP_ERROR_INVALID_SRC_DATATYPE
Invalid src tensor datatype. (Needs to adhere to function specification.)
Definition: rppdefs.h:141
@ RPP_ERROR_INVALID_SRC_LAYOUT
Invalid src tensor layout. (Needs to adhere to function specification.)
Definition: rppdefs.h:137
@ RPP_ERROR_HIGH_SRC_DIMENSION
Src tensor / src ROI dimension too high. (Needs to adhere to function specification....
Definition: rppdefs.h:129
@ RPP_SUCCESS
No error.
Definition: rppdefs.h:119
@ RPP_ERROR_INSUFFICIENT_DST_BUFFER_LENGTH
Insufficient dst buffer length provided. (Needs to adhere to function specification....
Definition: rppdefs.h:147
@ RPP_ERROR_INVALID_DST_DIMS
Number of dst dims is invalid. (Needs to adhere to function specification.)
Definition: rppdefs.h:167
@ RPP_ERROR_LOW_OFFSET
Low tensor offsetInBytes provided for src/dst tensor.
Definition: rppdefs.h:125
Base class for Mel scale conversions.
Definition: rppdefs.h:792
RPPT Tensor GenericFilter type struct.
Definition: rppdefs.h:691
Derived class for HTK Mel scale conversions.
Definition: rppdefs.h:803
RPP initialize handle.
Definition: rppdefs.h:1194
RPP 24 float vector.
Definition: rppdefs.h:281
RPP 6 float vector.
Definition: rppdefs.h:257
RPP 9 float vector.
Definition: rppdefs.h:265
RPP 24 signed int vector.
Definition: rppdefs.h:273
RPP layout params.
Definition: rppdefs.h:248
RPPI Image 2D ROI (XYWH format) type struct.
Definition: rppdefs.h:382
RPPI Image size(Width/Height dimensions) type struct.
Definition: rppdefs.h:373
RPPT Tensor 2D bilinear neighborhood 32-bit signed int 8-length-vectors type struct.
Definition: rppdefs.h:669
RPPT Tensor 2D bilinear neighborhood 32-bit float 8-length-vectors type struct.
Definition: rppdefs.h:680
RPPT Tensor Channel Offsets struct.
Definition: rppdefs.h:508
RPPT Tensor descriptor type struct.
Definition: rppdefs.h:578
RPPT Tensor 32-bit float RGB type struct.
Definition: rppdefs.h:614
RPPT Tensor 2D 32-bit float vector type struct.
Definition: rppdefs.h:633
RPPT Tensor Generic descriptor type struct.
Definition: rppdefs.h:591
RPPT Tensor 2D image patch dimensions type struct.
Definition: rppdefs.h:642
RPPT Image 2D cartesian point type struct.
Definition: rppdefs.h:480
RPPT Image 3D point type struct.
Definition: rppdefs.h:489
RPPT Tensor 8-bit uchar RGB type struct.
Definition: rppdefs.h:604
RPPT Tensor RpptResamplingWindow type struct.
Definition: rppdefs.h:748
RPPT Tensor 3D ROI LTFRBB struct.
Definition: rppdefs.h:518
RPPT Tensor 2D ROI LTRB struct.
Definition: rppdefs.h:499
RPPT Tensor 2D ROI XYWH struct.
Definition: rppdefs.h:527
RPPT Tensor 3D ROI XYZWHD struct.
Definition: rppdefs.h:537
RPPT Tensor strides type struct.
Definition: rppdefs.h:567
RPPT Tensor 2D 32-bit uint vector type struct.
Definition: rppdefs.h:624
RPPT Tensor random number generator state (xorwow box muller state) type struct.
Definition: rppdefs.h:659
RPPT Tensor random number generator state (xorwow state) type struct.
Definition: rppdefs.h:651
Derived class for Slaney Mel scale conversions.
Definition: rppdefs.h:814
RPP HIP 2D ROI memory.
Definition: rppdefs.h:1131
RPP HIP 32-bit float memory.
Definition: rppdefs.h:1066
RPP HIP 32-bit signed int memory.
Definition: rppdefs.h:1090
RPP HIP 32-bit unsigned int memory.
Definition: rppdefs.h:1082
RPP HIP 64-bit double memory.
Definition: rppdefs.h:1074
RPP HIP 8-bit signed char memory.
Definition: rppdefs.h:1106
RPP HIP 8-bit unsigned char memory.
Definition: rppdefs.h:1098
RPP HIP RGB memory.
Definition: rppdefs.h:1114
RPP HIP 2D dimensions memory.
Definition: rppdefs.h:1122
RPP HOST memory type struct.
Definition: rppdefs.h:930
RPP OCL memory management type struct.
Definition: rppdefs.h:1142
RPP HIP-HOST memory management.
Definition: rppdefs.h:1173
RPP HOST 2D ROI memory.
Definition: rppdefs.h:920
RPP HOST 32-bit float memory.
Definition: rppdefs.h:855
RPP HOST 32-bit signed int memory.
Definition: rppdefs.h:879
RPP HOST 32-bit unsigned int memory.
Definition: rppdefs.h:871
RPP HOST 64-bit double memory.
Definition: rppdefs.h:863
RPP HOST 8-bit signed char memory.
Definition: rppdefs.h:895
RPP HOST 8-bit unsigned char memory.
Definition: rppdefs.h:887
RPP HOST RGB memory.
Definition: rppdefs.h:903
RPP HOST 2D dimensions memory.
Definition: rppdefs.h:911
RPPT Tensor 3D ROI union.
Definition: rppdefs.h:557
RPPT Tensor 2D ROI union.
Definition: rppdefs.h:547