/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 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,
169 
173 typedef enum
174 {
175  rppStatusSuccess = 0,
176  rppStatusBadParm = -1,
177  rppStatusUnknownError = -2,
178  rppStatusNotInitialized = -3,
179  rppStatusInvalidValue = -4,
180  rppStatusAllocFailed = -5,
181  rppStatusInternalError = -6,
182  rppStatusNotImplemented = -7,
183  rppStatusUnsupportedOp = -8,
184 } rppStatus_t;
185 
189 typedef enum
190 {
191  RPP_SCALAR_OP_AND = 1,
192  RPP_SCALAR_OP_OR,
193  RPP_SCALAR_OP_XOR,
194  RPP_SCALAR_OP_NAND,
195  RPP_SCALAR_OP_EQUAL,
196  RPP_SCALAR_OP_NOTEQUAL,
197  RPP_SCALAR_OP_LESS,
198  RPP_SCALAR_OP_LESSEQ,
199  RPP_SCALAR_OP_GREATER,
200  RPP_SCALAR_OP_GREATEREQ,
201  RPP_SCALAR_OP_ADD,
202  RPP_SCALAR_OP_SUBTRACT,
203  RPP_SCALAR_OP_MULTIPLY,
204  RPP_SCALAR_OP_DIVIDE,
205  RPP_SCALAR_OP_MODULUS,
206  RPP_SCALAR_OP_MIN,
207  RPP_SCALAR_OP_MAX,
208 } RppOp;
209 
213 typedef enum
214 {
215  U8_S8,
216  S8_U8,
218 
222 typedef struct
223 {
224  Rpp32f rho;
225  Rpp32f theta;
226 } RppPointPolar;
227 
231 typedef struct
232 {
233  Rpp32u channelParam;
234  Rpp32u bufferMultiplier;
236 
240 typedef struct
241 {
242  Rpp32f data[6];
243 } Rpp32f6;
244 
248 typedef struct
249 {
250  Rpp32f data[9];
251 } Rpp32f9;
252 
256 typedef struct
257 {
258  Rpp32s data[24];
259 } Rpp32s24;
260 
264 typedef struct
265 {
266  Rpp32f data[24];
267 } Rpp32f24;
268 
269 /******************** RPPI typedefs ********************/
270 
274 typedef enum
275 {
276  RGB_HSV = 1,
277  HSV_RGB
279 
283 typedef enum
284 {
285  RPPI_LOW,
286  RPPI_MEDIUM,
287  RPPI_HIGH
289 
293 typedef enum
294 {
295  RPPI_CHN_PLANAR,
296  RPPI_CHN_PACKED
297 } RppiChnFormat;
298 
302 typedef enum
303 {
304  RPPI_HORIZONTAL_AXIS,
305  RPPI_VERTICAL_AXIS,
306  RPPI_BOTH_AXIS
307 } RppiAxis;
308 
312 typedef enum
313 {
314  GAUSS3,
315  GAUSS5,
316  GAUSS3x1,
317  GAUSS1x3,
318  AVG3 = 10,
319  AVG5
320 } RppiBlur;
321 
325 typedef enum
326 {
327  ZEROPAD,
328  NOPAD
329 } RppiPad;
330 
334 typedef enum
335 {
336  RGB,
337  HSV
338 } RppiFormat;
339 
343 typedef struct
344 {
345  unsigned int width;
346  unsigned int height;
347 } RppiSize;
348 
352 typedef struct
353 {
354  int x;
355  int y;
356 } RppiPoint;
357 
361 typedef struct
362 {
363  int x;
364  int y;
365  int z;
366 } RppiPoint3D;
367 
371 typedef struct
372 {
373  int x;
374  int y;
375  int width;
376  int height;
377 } RppiRect;
378 
382 typedef struct
383 {
384  unsigned int x;
385  unsigned int y;
386  unsigned int roiWidth;
387  unsigned int roiHeight;
388 } RppiROI;
389 
390 /******************** RPPT typedefs ********************/
391 
395 typedef enum
396 {
397  U8,
398  F32,
399  F16,
400  I8
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  RppiPoint lt, rb; // Left-Top point and Right-Bottom point
482 
483 } RpptRoiLtrb;
484 
488 typedef struct
489 {
490  RppiPoint r;
491  RppiPoint g;
492  RppiPoint b;
494 
498 typedef struct
499 {
500  RppiPoint3D ltf, rbb; // Left-Top-Front point and Right-Bottom-Back point
501 
502 } RpptRoiLtfrbb;
503 
507 typedef struct
508 {
509  RppiPoint xy;
510  int roiWidth, roiHeight;
511 
512 } RpptRoiXywh;
513 
517 typedef struct
518 {
519  RppiPoint3D xyz;
520  int roiWidth, roiHeight, roiDepth;
521 
522 } RpptRoiXyzwhd;
523 
527 typedef union
528 {
529  RpptRoiLtrb ltrbROI; // ROI defined as Left-Top-Right-Bottom
530  RpptRoiXywh xywhROI; // ROI defined as X-Y-Width-Height
531 
532 } RpptROI, *RpptROIPtr;
533 
537 typedef union
538 {
539  RpptRoiLtfrbb ltfrbbROI; // ROI defined as Left-Top-Front-Right-Bottom-Back
540  RpptRoiXyzwhd xyzwhdROI; // ROI defined as X-Y-Z-Width-Height-Depth
541 
543 
547 typedef struct
548 {
549  Rpp32u nStride;
550  Rpp32u cStride;
551  Rpp32u hStride;
552  Rpp32u wStride;
553 } RpptStrides;
554 
558 typedef struct
559 {
560  RppSize_t numDims;
561  Rpp32u offsetInBytes;
562  RpptDataType dataType;
563  Rpp32u n, c, h, w;
564  RpptStrides strides;
565  RpptLayout layout;
567 
571 typedef struct
572 {
573  RppSize_t numDims;
574  Rpp32u offsetInBytes;
575  RpptDataType dataType;
576  Rpp32u dims[RPPT_MAX_DIMS];
577  Rpp32u strides[RPPT_MAX_DIMS];
578  RpptLayout layout;
580 
584 typedef struct
585 {
586  Rpp8u R;
587  Rpp8u G;
588  Rpp8u B;
589 } RpptRGB;
590 
594 typedef struct
595 {
596  Rpp32f R;
597  Rpp32f G;
598  Rpp32f B;
599 } RpptFloatRGB;
600 
604 typedef struct
605 {
606  Rpp32u x;
607  Rpp32u y;
609 
613 typedef struct
614 {
615  Rpp32f x;
616  Rpp32f y;
618 
622 typedef struct
623 {
624  Rpp32u width;
625  Rpp32u height;
627 
631 typedef struct
632 { Rpp32u x[5];
633  Rpp32u counter;
635 
639 typedef struct
640 { Rpp32s x[5];
641  Rpp32s counter;
642  int boxMullerFlag;
643  float boxMullerExtra;
645 
649 typedef struct
650 {
651  Rpp32s24 srcLocsTL;
652  Rpp32s24 srcLocsTR;
653  Rpp32s24 srcLocsBL;
654  Rpp32s24 srcLocsBR;
656 
660 typedef struct
661 {
662  Rpp32f24 srcValsTL;
663  Rpp32f24 srcValsTR;
664  Rpp32f24 srcValsBL;
665  Rpp32f24 srcValsBR;
667 
671 typedef struct GenericFilter
672 {
673  Rpp32f scale = 1.0f;
674  Rpp32f radius = 1.0f;
675  Rpp32s size;
676  GenericFilter(RpptInterpolationType interpolationType, Rpp32s in_size, Rpp32s out_size, Rpp32f scaleRatio)
677  {
678  switch(interpolationType)
679  {
680  case RpptInterpolationType::BICUBIC:
681  {
682  this->radius = 2.0f;
683  break;
684  }
685  case RpptInterpolationType::LANCZOS:
686  {
687  if(in_size > out_size)
688  {
689  this->radius = 3.0f * scaleRatio;
690  this->scale = (1 / scaleRatio);
691  }
692  else
693  this->radius = 3.0f;
694  break;
695  }
696  case RpptInterpolationType::GAUSSIAN:
697  {
698  if(in_size > out_size)
699  {
700  this->radius = scaleRatio;
701  this->scale = (1 / scaleRatio);
702  }
703  break;
704  }
705  case RpptInterpolationType::TRIANGULAR:
706  {
707  if(in_size > out_size)
708  {
709  this->radius = scaleRatio;
710  this->scale = (1 / scaleRatio);
711  }
712  break;
713  }
714  default:
715  {
716  this->radius = 1.0f;
717  this->scale = 1.0f;
718  break;
719  }
720  }
721  this->size = std::ceil(2 * this->radius);
722  }
724 
728 typedef struct RpptResamplingWindow
729 {
730  inline RPP_HOST_DEVICE void input_range(Rpp32f x, Rpp32s *loc0, Rpp32s *loc1)
731  {
732  Rpp32s xc = std::ceil(x);
733  *loc0 = xc - lobes;
734  *loc1 = xc + lobes;
735  }
736 
737  inline Rpp32f operator()(Rpp32f x)
738  {
739  Rpp32f locRaw = x * scale + center;
740  Rpp32s locFloor = std::floor(locRaw);
741  Rpp32f weight = locRaw - locFloor;
742  locFloor = std::max(std::min(locFloor, lookupSize - 2), 0);
743  Rpp32f current = lookup[locFloor];
744  Rpp32f next = lookup[locFloor + 1];
745  return current + weight * (next - current);
746  }
747 
748  inline __m128 operator()(__m128 x)
749  {
750  __m128 pLocRaw = _mm_add_ps(_mm_mul_ps(x, pScale), pCenter);
751  __m128i pxLocFloor = _mm_cvttps_epi32(pLocRaw);
752  __m128 pLocFloor = _mm_cvtepi32_ps(pxLocFloor);
753  __m128 pWeight = _mm_sub_ps(pLocRaw, pLocFloor);
754  Rpp32s idx[4];
755  _mm_storeu_si128(reinterpret_cast<__m128i*>(idx), pxLocFloor);
756  __m128 pCurrent = _mm_setr_ps(lookup[idx[0]], lookup[idx[1]], lookup[idx[2]], lookup[idx[3]]);
757  __m128 pNext = _mm_setr_ps(lookup[idx[0] + 1], lookup[idx[1] + 1], lookup[idx[2] + 1], lookup[idx[3] + 1]);
758  return _mm_add_ps(pCurrent, _mm_mul_ps(pWeight, _mm_sub_ps(pNext, pCurrent)));
759  }
760 
761  Rpp32f scale = 1, center = 1;
762  Rpp32s lobes = 0, coeffs = 0;
763  Rpp32s lookupSize = 0;
764  Rpp32f *lookupPinned = nullptr;
765  std::vector<Rpp32f> lookup;
766  __m128 pCenter, pScale;
768 
773 {
774  public:
775  inline RPP_HOST_DEVICE virtual Rpp32f hz_to_mel(Rpp32f hz) = 0;
776  inline RPP_HOST_DEVICE virtual Rpp32f mel_to_hz(Rpp32f mel) = 0;
777  virtual ~BaseMelScale() = default;
778 };
779 
783 struct HtkMelScale : public BaseMelScale
784 {
785  inline RPP_HOST_DEVICE Rpp32f hz_to_mel(Rpp32f hz) { return 1127.0f * std::log(1.0f + (hz / 700.0f)); }
786  inline RPP_HOST_DEVICE Rpp32f mel_to_hz(Rpp32f mel) { return 700.0f * (std::exp(mel / 1127.0f) - 1.0f); }
787  public:
788  ~HtkMelScale() {};
789 };
790 
795 {
796  const Rpp32f freqLow = 0;
797  const Rpp32f fsp = 66.666667f;
798  const Rpp32f minLogHz = 1000.0;
799  const Rpp32f minLogMel = (minLogHz - freqLow) / fsp;
800  const Rpp32f stepLog = 0.068751777; // Equivalent to std::log(6.4) / 27.0;
801 
802  const Rpp32f invMinLogHz = 0.001f;
803  const Rpp32f invStepLog = 1.0f / stepLog;
804  const Rpp32f invFsp = 1.0f / fsp;
805 
806  inline RPP_HOST_DEVICE Rpp32f hz_to_mel(Rpp32f hz)
807  {
808  Rpp32f mel = 0.0f;
809  if (hz >= minLogHz)
810  mel = minLogMel + std::log(hz * invMinLogHz) * invStepLog;
811  else
812  mel = (hz - freqLow) * invFsp;
813 
814  return mel;
815  }
816 
817  inline RPP_HOST_DEVICE Rpp32f mel_to_hz(Rpp32f mel)
818  {
819  Rpp32f hz = 0.0f;
820  if (mel >= minLogMel)
821  hz = minLogHz * std::exp(stepLog * (mel - minLogMel));
822  else
823  hz = freqLow + mel * fsp;
824  return hz;
825  }
826  public:
827  ~SlaneyMelScale() {};
828 };
829 
830 /******************** HOST memory typedefs ********************/
831 
835 typedef struct
836 {
837  Rpp32f *floatmem;
838 } memRpp32f;
839 
843 typedef struct
844 {
845  Rpp64f *doublemem;
846 } memRpp64f;
847 
851 typedef struct
852 {
853  Rpp32u *uintmem;
854 } memRpp32u;
855 
859 typedef struct
860 {
861  Rpp32s *intmem;
862 } memRpp32s;
863 
867 typedef struct
868 {
869  Rpp8u *ucharmem;
870 } memRpp8u;
871 
875 typedef struct
876 {
877  Rpp8s *charmem;
878 } memRpp8s;
879 
883 typedef struct
884 {
885  RpptRGB* rgbmem;
886 } memRpptRGB;
887 
891 typedef struct
892 {
893  Rpp32u *height;
894  Rpp32u *width;
895 } memSize;
896 
900 typedef struct
901 {
902  Rpp32u *x;
903  Rpp32u *y;
904  Rpp32u *roiHeight;
905  Rpp32u *roiWidth;
906 } memROI;
907 
911 typedef struct {
912  RppiSize *srcSize;
913  RppiSize *dstSize;
914  RppiSize *maxSrcSize;
915  RppiSize *maxDstSize;
916  RppiROI *roiPoints;
917  memRpp32f floatArr[10];
918  memRpp64f doubleArr[10];
919  memRpp32u uintArr[10];
920  memRpp32s intArr[10];
921  memRpp8u ucharArr[10];
922  memRpp8s charArr[10];
923  memRpptRGB rgbArr;
924  Rpp64u *srcBatchIndex;
925  Rpp64u *dstBatchIndex;
926  Rpp32u *inc;
927  Rpp32u *dstInc;
928  Rpp32f *scratchBufferHost;
929 } memCPU;
930 
931 #ifdef OCL_COMPILE
932 
933 /******************** OCL memory typedefs ********************/
934 
938 typedef struct
939 {
940  cl_mem floatmem;
941 } clmemRpp32f;
942 
946 typedef struct
947 {
948  cl_mem doublemem;
949 } clmemRpp64f;
950 
954 typedef struct
955 {
956  cl_mem uintmem;
957 } clmemRpp32u;
958 
962 typedef struct
963 {
964  cl_mem intmem;
965 } clmemRpp32s;
966 
970 typedef struct
971 {
972  cl_mem ucharmem;
973 } clmemRpp8u;
974 
978 typedef struct
979 {
980  cl_mem charmem;
981 } clmemRpp8s;
982 
986 typedef struct
987 {
988  cl_mem height;
989  cl_mem width;
990 } clmemSize;
991 
995 typedef struct
996 {
997  cl_mem x;
998  cl_mem y;
999  cl_mem roiHeight;
1000  cl_mem roiWidth;
1001 } clmemROI;
1002 
1006 typedef struct
1007 {
1008  memSize csrcSize;
1009  memSize cdstSize;
1010  memSize cmaxSrcSize;
1011  memSize cmaxDstSize;
1012  memROI croiPoints;
1013  clmemSize srcSize;
1014  clmemSize dstSize;
1015  clmemSize maxSrcSize;
1016  clmemSize maxDstSize;
1017  clmemROI roiPoints;
1018  clmemRpp32f floatArr[10];
1019  clmemRpp64f doubleArr[10];
1020  clmemRpp32u uintArr[10];
1021  clmemRpp32s intArr[10];
1022  clmemRpp8u ucharArr[10];
1023  clmemRpp8s charArr[10];
1024  cl_mem srcBatchIndex;
1025  cl_mem dstBatchIndex;
1026  cl_mem inc;
1027  cl_mem dstInc;
1028 } memGPU;
1029 
1033 typedef struct
1034 {
1035  memCPU mcpu;
1036  memGPU mgpu;
1037 } memMgmt;
1038 
1039 #elif defined(HIP_COMPILE)
1040 
1041 /******************** HIP memory typedefs ********************/
1042 
1046 typedef struct
1047 {
1048  Rpp32f* floatmem;
1049 } hipMemRpp32f;
1050 
1054 typedef struct
1055 {
1056  Rpp64f* doublemem;
1057 } hipMemRpp64f;
1058 
1062 typedef struct
1063 {
1064  Rpp32u* uintmem;
1065 } hipMemRpp32u;
1066 
1070 typedef struct
1071 {
1072  Rpp32s* intmem;
1073 } hipMemRpp32s;
1074 
1078 typedef struct
1079 {
1080  Rpp8u* ucharmem;
1081 } hipMemRpp8u;
1082 
1086 typedef struct
1087 {
1088  Rpp8s* charmem;
1089 } hipMemRpp8s;
1090 
1094 typedef struct
1095 {
1096  RpptRGB* rgbmem;
1097 } hipMemRpptRGB;
1098 
1102 typedef struct
1103 {
1104  Rpp32u* height;
1105  Rpp32u* width;
1106 } hipMemSize;
1107 
1111 typedef struct
1112 {
1113  Rpp32u* x;
1114  Rpp32u* y;
1115  Rpp32u* roiHeight;
1116  Rpp32u* roiWidth;
1117 } hipMemROI;
1118 
1122 typedef struct
1123 {
1124  memSize csrcSize;
1125  memSize cdstSize;
1126  memSize cmaxSrcSize;
1127  memSize cmaxDstSize;
1128  memROI croiPoints;
1129  hipMemSize srcSize;
1130  hipMemSize dstSize;
1131  hipMemSize maxSrcSize;
1132  hipMemSize maxDstSize;
1133  hipMemROI roiPoints;
1134  hipMemRpp32f floatArr[10];
1135  hipMemRpp32f float3Arr[10];
1136  hipMemRpp64f doubleArr[10];
1137  hipMemRpp32u uintArr[10];
1138  hipMemRpp32s intArr[10];
1139  hipMemRpp8u ucharArr[10];
1140  hipMemRpp8s charArr[10];
1141  hipMemRpptRGB rgbArr;
1142  hipMemRpp32f scratchBufferHip;
1143  Rpp64u* srcBatchIndex;
1144  Rpp64u* dstBatchIndex;
1145  Rpp32u* inc;
1146  Rpp32u* dstInc;
1147  hipMemRpp32f scratchBufferPinned;
1148 } memGPU;
1149 
1153 typedef struct
1154 {
1155  memCPU mcpu;
1156  memGPU mgpu;
1157 } memMgmt;
1158 
1159 #else
1160 
1164 typedef struct
1165 {
1166  memCPU mcpu;
1167 } memMgmt;
1168 
1169 #endif //BACKEND
1170 
1174 typedef struct
1175 {
1176  RppPtr_t cpuHandle;
1177  Rpp32u nbatchSize;
1178  memMgmt mem;
1179 } InitHandle;
1180 
1181 #endif /* RPPDEFS_H */
RppiPad
RPPI Image pad type enum.
Definition: rppdefs.h:326
RppiFormat
RPPI Image format type enum.
Definition: rppdefs.h:335
unsigned int Rpp32u
32 bit unsigned int
Definition: rppdefs.h:97
RppConvertBitDepthMode
RPP BitDepth Conversion type enum.
Definition: rppdefs.h:214
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:294
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
RppiBlur
RPPI Image blur type enum.
Definition: rppdefs.h:313
RppiAxis
RPP Image axis type enum.
Definition: rppdefs.h:303
RpptRoiType
RPPT Tensor 2D ROI type enum.
Definition: rppdefs.h:421
RpptDataType
RPPT Tensor datatype enum.
Definition: rppdefs.h:396
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
RppOp
RPP Operations type enum.
Definition: rppdefs.h:190
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
RppiColorConvertMode
RPPI Image color convert mode type enum.
Definition: rppdefs.h:275
float Rpp32f
32 bit float
Definition: rppdefs.h:105
RppiFuzzyLevel
RPPI Image fuzzy level type enum.
Definition: rppdefs.h:284
long long Rpp64s
64 bit long long
Definition: rppdefs.h:103
rppStatus_t
RPP rppStatus_t type enums.
Definition: rppdefs.h:174
@ 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_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_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:773
RPPT Tensor GenericFilter type struct.
Definition: rppdefs.h:672
Derived class for HTK Mel scale conversions.
Definition: rppdefs.h:784
RPP initialize handle.
Definition: rppdefs.h:1175
RPP 24 float vector.
Definition: rppdefs.h:265
RPP 6 float vector.
Definition: rppdefs.h:241
RPP 9 float vector.
Definition: rppdefs.h:249
RPP 24 signed int vector.
Definition: rppdefs.h:257
RPP layout params.
Definition: rppdefs.h:232
RPP polar point.
Definition: rppdefs.h:223
RPPI Image 3D point type struct.
Definition: rppdefs.h:362
RPPI Image 2D cartesian point type struct.
Definition: rppdefs.h:353
RPPI Image 2D ROI (XYWH format) type struct.
Definition: rppdefs.h:383
RPPI Image 2D Rectangle (XYWH format) type struct.
Definition: rppdefs.h:372
RPPI Image size(Width/Height dimensions) type struct.
Definition: rppdefs.h:344
RPPT Tensor 2D bilinear neighborhood 32-bit signed int 8-length-vectors type struct.
Definition: rppdefs.h:650
RPPT Tensor 2D bilinear neighborhood 32-bit float 8-length-vectors type struct.
Definition: rppdefs.h:661
RPPT Tensor Channel Offsets struct.
Definition: rppdefs.h:489
RPPT Tensor descriptor type struct.
Definition: rppdefs.h:559
RPPT Tensor 32-bit float RGB type struct.
Definition: rppdefs.h:595
RPPT Tensor 2D 32-bit float vector type struct.
Definition: rppdefs.h:614
RPPT Tensor Generic descriptor type struct.
Definition: rppdefs.h:572
RPPT Tensor 2D image patch dimensions type struct.
Definition: rppdefs.h:623
RPPT Tensor 8-bit uchar RGB type struct.
Definition: rppdefs.h:585
RPPT Tensor RpptResamplingWindow type struct.
Definition: rppdefs.h:729
RPPT Tensor 3D ROI LTFRBB struct.
Definition: rppdefs.h:499
RPPT Tensor 2D ROI LTRB struct.
Definition: rppdefs.h:480
RPPT Tensor 2D ROI XYWH struct.
Definition: rppdefs.h:508
RPPT Tensor 3D ROI XYZWHD struct.
Definition: rppdefs.h:518
RPPT Tensor strides type struct.
Definition: rppdefs.h:548
RPPT Tensor 2D 32-bit uint vector type struct.
Definition: rppdefs.h:605
RPPT Tensor random number generator state (xorwow box muller state) type struct.
Definition: rppdefs.h:640
RPPT Tensor random number generator state (xorwow state) type struct.
Definition: rppdefs.h:632
Derived class for Slaney Mel scale conversions.
Definition: rppdefs.h:795
RPP HIP 2D ROI memory.
Definition: rppdefs.h:1112
RPP HIP 32-bit float memory.
Definition: rppdefs.h:1047
RPP HIP 32-bit signed int memory.
Definition: rppdefs.h:1071
RPP HIP 32-bit unsigned int memory.
Definition: rppdefs.h:1063
RPP HIP 64-bit double memory.
Definition: rppdefs.h:1055
RPP HIP 8-bit signed char memory.
Definition: rppdefs.h:1087
RPP HIP 8-bit unsigned char memory.
Definition: rppdefs.h:1079
RPP HIP RGB memory.
Definition: rppdefs.h:1095
RPP HIP 2D dimensions memory.
Definition: rppdefs.h:1103
RPP HOST memory type struct.
Definition: rppdefs.h:911
RPP OCL memory management type struct.
Definition: rppdefs.h:1123
RPP HIP-HOST memory management.
Definition: rppdefs.h:1154
RPP HOST 2D ROI memory.
Definition: rppdefs.h:901
RPP HOST 32-bit float memory.
Definition: rppdefs.h:836
RPP HOST 32-bit signed int memory.
Definition: rppdefs.h:860
RPP HOST 32-bit unsigned int memory.
Definition: rppdefs.h:852
RPP HOST 64-bit double memory.
Definition: rppdefs.h:844
RPP HOST 8-bit signed char memory.
Definition: rppdefs.h:876
RPP HOST 8-bit unsigned char memory.
Definition: rppdefs.h:868
RPP HOST RGB memory.
Definition: rppdefs.h:884
RPP HOST 2D dimensions memory.
Definition: rppdefs.h:892
RPPT Tensor 3D ROI union.
Definition: rppdefs.h:538
RPPT Tensor 2D ROI union.
Definition: rppdefs.h:528