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

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

RPP: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rpp/checkouts/develop/projects/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 
36 #include <cmath>
37 #if RPP_BACKEND_HIP
38 #include <hip/hip_fp16.h>
39 #endif // RPP_BACKEND_HIP
40 #if __has_include(<half/half.hpp>)
41 #include <half/half.hpp>
42 #else
43 #include <half.hpp>
44 #endif
45 using halfhpp = half_float::half;
46 typedef halfhpp Rpp16f;
47 
48 #if _WIN32
49 #include <intrin.h>
50 #elif defined(__x86_64__) || defined(_M_X64)
51 #include <immintrin.h>
52 #include <smmintrin.h>
53 #include <x86intrin.h>
54 #else
55 // HIP device compiler cannot parse altivec.h ("vector" keyword clash),
56 // so disable SIMDE native backends during GPU compilation passes.
57 #if defined(__HIP_DEVICE_COMPILE__)
58 #define SIMDE_NO_NATIVE
59 #endif
60 #define SIMDE_ENABLE_NATIVE_ALIASES
61 #include <simde/x86/avx2.h>
62 #include <simde/x86/f16c.h>
63 #include <simde/x86/fma.h>
64 // SIMDE bug: native alias block omits _MM_FROUND_NO_EXC
65 #ifndef _MM_FROUND_NO_EXC
66 #define _MM_FROUND_NO_EXC 0x08
67 #endif
68 #endif
69 #include <vector>
70 
72 #define RPP_MIN_8U (0)
74 #define RPP_MAX_8U (255)
76 #define RPPT_MAX_DIMS (5)
79 #define RPPT_MAX_DIMS_SAMPLE (4)
81 #define RPPT_MAX_AUDIO_CHANNELS (16)
82 
85 #define RPP_RETURN_IF_ERROR(expr) \
86  do { \
87  RppStatus _rpp_status = (expr); \
88  if (_rpp_status != RPP_SUCCESS) return _rpp_status; \
89  } while (0)
90 
91 #if RPP_BACKEND_HIP
92 #include <hip/hip_runtime.h>
93 #define RPP_HOST_DEVICE __host__ __device__
94 
97 #define RPP_HIP_RETURN_IF_ERROR(expr) \
98  do { \
99  hipError_t _rpp_hip_err = (expr); \
100  if (_rpp_hip_err != hipSuccess) { \
101  fprintf(stderr, "HIP runtime error: %s returned %d at %s:%d", #expr, _rpp_hip_err, \
102  __FILE__, __LINE__); \
103  return RPP_ERROR_HIP_RUNTIME; \
104  } \
105  } while (0)
106 
109 #define HIP_CHECK_LAUNCH_RETURN() \
110  do { \
111  hipError_t status = hipGetLastError(); \
112  if (status != hipSuccess) { \
113  fprintf(stderr, "HIP kernel launch error: returned %d at %s:%d", status, __FILE__, \
114  __LINE__); \
115  return RPP_ERROR_HIP_LAUNCH; \
116  } \
117  } while (0)
118 #else
119 #define RPP_HOST_DEVICE
120 #endif
121 
122 const float ONE_OVER_6 = 1.0f / 6;
123 const float ONE_OVER_3 = 1.0f / 3;
124 const float TWO_OVER_3 = 2.0f / 3;
125 const float ONE_OVER_255 = 1.0f / 255;
126 const uint MMS_MAX_SCRATCH_MEMORY = 115293120; // maximum scratch memory size (in number of floats)
127  // needed for MMS buffer in RNNT training
128 const uint SPECTROGRAM_MAX_SCRATCH_MEMORY =
129  742413440; // maximum scratch memory size (in number of floats) needed for spectrogram HIP
130  // kernel in RNNT training with rocFFT:
131  // = windowLength + windowOutput + fftOutput(complex)
132  // = 512 + (512 * 3754 * 192) + (257 * 3754 * 192 * 2)
133  // = 512 + 371,392,512 + 371,020,416 = 742,413,440
134 #define DROPOUT_FIXED_SEED 42 // Constant fixed seed for reproducing the dropout output
135 #define RANDOM_ERASE_NOISE_BUFFER_SIDE \
136  255 // Random erase spatial noise buffer height and width. Changing this constant will result
137  // in QA test failures for tiled noise mapping
138 
139 /******************** RPP typedefs ********************/
140 
142 typedef unsigned char Rpp8u;
144 typedef signed char Rpp8s;
146 typedef unsigned short Rpp16u;
148 typedef short Rpp16s;
150 typedef unsigned int Rpp32u;
152 typedef int Rpp32s;
154 typedef unsigned long long Rpp64u;
156 typedef long long Rpp64s;
158 typedef float Rpp32f;
160 typedef double Rpp64f;
162 typedef void* RppPtr_t;
164 typedef size_t RppSize_t;
165 
169 typedef enum {
173  RPP_ERROR = -1,
251 } RppStatus;
252 
262 inline const char* rppGetStatusString(RppStatus status) noexcept {
263  // A switch over string literals keeps this allocation-free and non-throwing, so it stays safe
264  // to call from logging and error handling paths.
265  switch (status) {
266  case RPP_SUCCESS:
267  return "RPP_SUCCESS";
268  case RPP_ERROR:
269  return "RPP_ERROR";
271  return "RPP_ERROR_INVALID_ARGUMENTS";
273  return "RPP_ERROR_LOW_OFFSET";
275  return "RPP_ERROR_ZERO_DIVISION";
277  return "RPP_ERROR_HIGH_SRC_DIMENSION";
279  return "RPP_ERROR_NOT_IMPLEMENTED";
281  return "RPP_ERROR_INVALID_SRC_CHANNELS";
283  return "RPP_ERROR_INVALID_DST_CHANNELS";
285  return "RPP_ERROR_INVALID_SRC_LAYOUT";
287  return "RPP_ERROR_INVALID_DST_LAYOUT";
289  return "RPP_ERROR_INVALID_SRC_DATATYPE";
291  return "RPP_ERROR_INVALID_DST_DATATYPE";
293  return "RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE";
295  return "RPP_ERROR_INSUFFICIENT_DST_BUFFER_LENGTH";
297  return "RPP_ERROR_INVALID_PARAMETER_DATATYPE";
299  return "RPP_ERROR_NOT_ENOUGH_MEMORY";
301  return "RPP_ERROR_OUT_OF_BOUND_SRC_ROI";
303  return "RPP_ERROR_LAYOUT_MISMATCH";
305  return "RPP_ERROR_INVALID_CHANNELS";
307  return "RPP_ERROR_INVALID_OUTPUT_TILE_LENGTH";
309  return "RPP_ERROR_OUT_OF_BOUND_SHARED_MEMORY_SIZE";
311  return "RPP_ERROR_OUT_OF_BOUND_SCRATCH_MEMORY_SIZE";
313  return "RPP_ERROR_INVALID_SRC_DIMS";
315  return "RPP_ERROR_INVALID_DST_DIMS";
317  return "RPP_ERROR_INVALID_DIM_LENGTHS";
319  return "RPP_ERROR_INVALID_AXIS";
321  return "RPP_ERROR_INCOMPATIBLE_BACKEND";
323  return "RPP_ERROR_HIP_LAUNCH";
325  return "RPP_ERROR_HIP_RUNTIME";
326  }
327 
328  return "RPP_STATUS_UNKNOWN";
329 }
330 
334 typedef enum { RPP_HOST_BACKEND, RPP_HIP_BACKEND } RppBackend;
335 
339 typedef enum {
340  rppStatusSuccess = 0,
341  rppStatusBadParm = -1,
342  rppStatusUnknownError = -2,
343  rppStatusNotInitialized = -3,
344  rppStatusInvalidValue = -4,
345  rppStatusAllocFailed = -5,
346  rppStatusInternalError = -6,
347  rppStatusNotImplemented = -7,
348  rppStatusUnsupportedOp = -8,
349 } rppStatus_t;
350 
354 typedef enum {
355  RPP_TENSOR_OP_ADD,
356  RPP_TENSOR_OP_SUBTRACT,
357  RPP_TENSOR_OP_MULTIPLY,
358  RPP_TENSOR_OP_DIVIDE
359 } RpptOp;
360 
364 typedef enum { RPP_TENSOR_OP_AND, RPP_TENSOR_OP_OR, RPP_TENSOR_OP_XOR } RpptBitwiseOp;
365 
373 typedef enum {
374  RPP_BROADCAST_ENABLE,
375  RPP_BROADCAST_DISABLE // Broadcasting is disabled; Requires input tensors to be of the same
376  // shape
378 
382 typedef struct {
383  Rpp32u channelParam;
384  Rpp32u bufferMultiplier;
386 
390 typedef struct {
391  Rpp32f data[6];
392 } Rpp32f6;
393 
397 typedef struct {
398  Rpp32f data[9];
399 } Rpp32f9;
400 
404 typedef struct {
405  Rpp32s data[24];
406 } Rpp32s24;
407 
411 typedef struct {
412  Rpp32f data[24];
413 } Rpp32f24;
414 
415 /******************** RPPT typedefs ********************/
416 
420 typedef enum { U8, F32, F16, I8, I16, U16, I32, U32 } RpptDataType;
421 
425 typedef enum {
426  NCHW, // BatchSize-Channels-Height-Width
427  NHWC, // BatchSize-Height-Width-Channels
428  NCDHW, // BatchSize-Channels-Depth-Height-Width
429  NDHWC, // BatchSize-Depth-Height-Width-Channels
430  NHW, // BatchSize-Height-Width
431  NFT, // BatchSize-Frequency-Time -> Frequency Major used for Spectrogram / MelfilterBank
432  NTF // BatchSize-Time-Frequency -> Time Major used for Spectrogram / MelfilterBank
433 } RpptLayout;
434 
439 typedef enum {
448 
455 typedef enum {
459 
465 typedef enum {
471 
475 typedef enum {
476  LTRB, // Left-Top-Right-Bottom
477  XYWH // X-Y-Width-Height
478 } RpptRoiType;
479 
483 typedef enum {
484  LTFRBB, // Left-Top-Front-Right-Bottom-Back
485  XYZWHD // X-Y-Z-Width-Height-Depth
486 } RpptRoi3DType;
487 
491 typedef enum { RGBtype, BGRtype } RpptSubpixelLayout;
492 
496 typedef enum {
497  NEAREST_NEIGHBOR = 0,
498  BILINEAR,
499  BICUBIC,
500  LANCZOS,
501  GAUSSIAN,
502  TRIANGULAR
504 
508 typedef enum { ZERO = 0, CLAMP, REFLECT } RpptAudioBorderType;
509 
513 typedef enum { TOP_EDGE = 0, BOTTOM_EDGE, LEFT_EDGE, RIGHT_EDGE } RpptImageBorderEdge;
514 
518 typedef enum {
519  REPLICATE = 0, // Similar to Nearest Neighbors Padding
520  CONSTANT, // Unsupported Border Type
521  REFLECT_NO_EDGE // Unsupported Border Type
523 
527 typedef enum {
528  SLANEY = 0, // Follows Slaney’s MATLAB Auditory Modelling Work behavior
529  HTK, // Follows O’Shaughnessy’s book formula, consistent with Hidden Markov Toolkit(HTK), m =
530  // 2595 * log10(1 + (f/700))
532 
536 typedef struct {
537  int x;
538  int y;
539 } RpptPoint2D;
540 
544 typedef struct {
545  int x;
546  int y;
547  int z;
548 } RpptPoint3D;
549 
553 typedef struct {
554  RpptPoint2D lt, rb; // Left-Top point and Right-Bottom point
555 
556 } RpptRoiLtrb;
557 
561 typedef struct {
562  RpptPoint2D r;
563  RpptPoint2D g;
564  RpptPoint2D b;
566 
570 typedef struct {
571  RpptPoint3D ltf, rbb; // Left-Top-Front point and Right-Bottom-Back point
572 
573 } RpptRoiLtfrbb;
574 
578 typedef struct {
579  RpptPoint2D xy;
580  int roiWidth, roiHeight;
581 
582 } RpptRoiXywh;
583 
587 typedef struct {
588  RpptPoint3D xyz;
589  int roiWidth, roiHeight, roiDepth;
590 
591 } RpptRoiXyzwhd;
592 
596 typedef union {
597  RpptRoiLtrb ltrbROI; // ROI defined as Left-Top-Right-Bottom
598  RpptRoiXywh xywhROI; // ROI defined as X-Y-Width-Height
599 
600 } RpptROI, *RpptROIPtr;
601 
605 typedef union {
606  RpptRoiLtfrbb ltfrbbROI; // ROI defined as Left-Top-Front-Right-Bottom-Back
607  RpptRoiXyzwhd xyzwhdROI; // ROI defined as X-Y-Z-Width-Height-Depth
608 
610 
614 typedef struct {
615  Rpp32u nStride;
616  Rpp32u cStride;
617  Rpp32u hStride;
618  Rpp32u wStride;
619 } RpptStrides;
620 
624 struct RpptDesc {
625  RppSize_t numDims = 4;
626  Rpp32u offsetInBytes = 0;
627  RpptDataType dataType;
628  Rpp32u n, c, h, w;
629  RpptStrides strides;
630  RpptLayout layout;
631 
632  RpptDesc() = default;
633 
634  RpptDesc(Rpp32u n, Rpp32u c, Rpp32u h, Rpp32u w, RpptDataType dataType, RpptLayout layout)
635  : dataType(dataType), n(n), c(c), h(h), w(w), layout(layout) {
636  if (layout == NCHW) {
637  strides.nStride = c * h * w;
638  strides.cStride = h * w;
639  strides.hStride = w;
640  strides.wStride = 1;
641  } else if (layout == NHWC) {
642  strides.nStride = h * w * c;
643  strides.hStride = w * c;
644  strides.wStride = c;
645  strides.cStride = 1;
646  }
647  }
648 
649  RpptDesc(Rpp32u n, Rpp32u c, Rpp32u h, Rpp32u w, RpptDataType dataType, RpptLayout layout,
650  Rpp32u offsetInBytes, RpptStrides strides)
651  : offsetInBytes(offsetInBytes),
652  dataType(dataType),
653  n(n),
654  c(c),
655  h(h),
656  w(w),
657  strides(strides),
658  layout(layout) {}
659 };
660 typedef RpptDesc* RpptDescPtr;
661 
665 typedef struct {
666  RppSize_t numDims;
667  Rpp32u offsetInBytes;
668  RpptDataType dataType;
669  Rpp32u dims[RPPT_MAX_DIMS];
670  Rpp32u strides[RPPT_MAX_DIMS];
671  RpptLayout layout;
673 
677 typedef struct {
678  Rpp8u R;
679  Rpp8u G;
680  Rpp8u B;
681 } RpptRGB;
682 
686 typedef struct {
687  Rpp32f R;
688  Rpp32f G;
689  Rpp32f B;
690 } RpptFloatRGB;
691 
695 typedef struct {
696  Rpp32u x;
697  Rpp32u y;
699 
703 typedef struct {
704  Rpp32f x;
705  Rpp32f y;
707 
711 typedef struct {
712  Rpp32u width;
713  Rpp32u height;
715 
719 typedef struct {
720  Rpp32u x[5];
721  Rpp32u counter;
723 
727 typedef struct {
728  Rpp32s x[5];
729  Rpp32s counter;
730  int boxMullerFlag;
731  float boxMullerExtra;
733 
737 typedef struct {
738  Rpp32s24 srcLocsTL;
739  Rpp32s24 srcLocsTR;
740  Rpp32s24 srcLocsBL;
741  Rpp32s24 srcLocsBR;
743 
747 typedef struct {
748  Rpp32f24 srcValsTL;
749  Rpp32f24 srcValsTR;
750  Rpp32f24 srcValsBL;
751  Rpp32f24 srcValsBR;
753 
757 typedef struct GenericFilter {
758  Rpp32f scale = 1.0f;
759  Rpp32f radius = 1.0f;
760  Rpp32s size;
761  GenericFilter(RpptInterpolationType interpolationType, Rpp32s in_size, Rpp32s out_size,
762  Rpp32f scaleRatio) {
763  switch (interpolationType) {
764  case RpptInterpolationType::BICUBIC: {
765  this->radius = 2.0f;
766  break;
767  }
768  case RpptInterpolationType::LANCZOS: {
769  if (in_size > out_size) {
770  this->radius = 3.0f * scaleRatio;
771  this->scale = (1 / scaleRatio);
772  } else
773  this->radius = 3.0f;
774  break;
775  }
776  case RpptInterpolationType::GAUSSIAN: {
777  if (in_size > out_size) {
778  this->radius = scaleRatio;
779  this->scale = (1 / scaleRatio);
780  }
781  break;
782  }
783  case RpptInterpolationType::TRIANGULAR: {
784  if (in_size > out_size) {
785  this->radius = scaleRatio;
786  this->scale = (1 / scaleRatio);
787  }
788  break;
789  }
790  default: {
791  this->radius = 1.0f;
792  this->scale = 1.0f;
793  break;
794  }
795  }
796  this->size = std::ceil(2 * this->radius);
797  }
799 
803 typedef struct RpptResamplingWindow {
804  inline RPP_HOST_DEVICE void input_range(Rpp32f x, Rpp32s* loc0, Rpp32s* loc1) {
805  Rpp32s xc = std::ceil(x);
806  *loc0 = xc - lobes;
807  *loc1 = xc + lobes;
808  }
809 
810  inline Rpp32f operator()(Rpp32f x) {
811  Rpp32f locRaw = x * scale + center;
812  Rpp32s locFloor = std::floor(locRaw);
813  Rpp32f weight = locRaw - locFloor;
814  locFloor = std::max(std::min(locFloor, lookupSize - 2), 0);
815  Rpp32f current = lookup[locFloor];
816  Rpp32f next = lookup[locFloor + 1];
817  return current + weight * (next - current);
818  }
819 
820  inline __m128 operator()(__m128 x) {
821  __m128 pLocRaw = _mm_add_ps(_mm_mul_ps(x, pScale), pCenter);
822  __m128i pxLocFloor = _mm_cvttps_epi32(pLocRaw);
823  __m128 pLocFloor = _mm_cvtepi32_ps(pxLocFloor);
824  __m128 pWeight = _mm_sub_ps(pLocRaw, pLocFloor);
825  Rpp32s idx[4];
826  _mm_storeu_si128(reinterpret_cast<__m128i*>(idx), pxLocFloor);
827  __m128 pCurrent =
828  _mm_setr_ps(lookup[idx[0]], lookup[idx[1]], lookup[idx[2]], lookup[idx[3]]);
829  __m128 pNext = _mm_setr_ps(lookup[idx[0] + 1], lookup[idx[1] + 1], lookup[idx[2] + 1],
830  lookup[idx[3] + 1]);
831  return _mm_add_ps(pCurrent, _mm_mul_ps(pWeight, _mm_sub_ps(pNext, pCurrent)));
832  }
833 
834  Rpp32f scale = 1, center = 1;
835  Rpp32s lobes = 0, coeffs = 0;
836  Rpp32s lookupSize = 0;
837  Rpp32f* lookupPinned = nullptr;
838  std::vector<Rpp32f> lookup;
839  __m128 pCenter, pScale;
841 
845 struct BaseMelScale {
846  public:
847  inline RPP_HOST_DEVICE virtual Rpp32f hz_to_mel(Rpp32f hz) = 0;
848  inline RPP_HOST_DEVICE virtual Rpp32f mel_to_hz(Rpp32f mel) = 0;
849  virtual ~BaseMelScale() = default;
850 };
851 
855 struct HtkMelScale : public BaseMelScale {
856  inline RPP_HOST_DEVICE Rpp32f hz_to_mel(Rpp32f hz) {
857  return 1127.0f * std::log(1.0f + (hz / 700.0f));
858  }
859  inline RPP_HOST_DEVICE Rpp32f mel_to_hz(Rpp32f mel) {
860  return 700.0f * (std::exp(mel / 1127.0f) - 1.0f);
861  }
862 
863  public:
864  ~HtkMelScale() {};
865 };
866 
870 struct SlaneyMelScale : public BaseMelScale {
871  const Rpp32f freqLow = 0;
872  const Rpp32f fsp = 66.666667f;
873  const Rpp32f minLogHz = 1000.0;
874  const Rpp32f minLogMel = (minLogHz - freqLow) / fsp;
875  const Rpp32f stepLog = 0.068751777; // Equivalent to std::log(6.4) / 27.0;
876 
877  const Rpp32f invMinLogHz = 0.001f;
878  const Rpp32f invStepLog = 1.0f / stepLog;
879  const Rpp32f invFsp = 1.0f / fsp;
880 
881  inline RPP_HOST_DEVICE Rpp32f hz_to_mel(Rpp32f hz) {
882  Rpp32f mel = 0.0f;
883  if (hz >= minLogHz)
884  mel = minLogMel + std::log(hz * invMinLogHz) * invStepLog;
885  else
886  mel = (hz - freqLow) * invFsp;
887 
888  return mel;
889  }
890 
891  inline RPP_HOST_DEVICE Rpp32f mel_to_hz(Rpp32f mel) {
892  Rpp32f hz = 0.0f;
893  if (mel >= minLogMel)
894  hz = minLogHz * std::exp(stepLog * (mel - minLogMel));
895  else
896  hz = freqLow + mel * fsp;
897  return hz;
898  }
899 
900  public:
901  ~SlaneyMelScale() {};
902 };
903 
904 /******************** HOST memory typedefs ********************/
905 
909 typedef struct {
910  Rpp32f* scratchBufferHost;
911 } memCPU;
912 
913 #if RPP_BACKEND_HIP
914 
915 /******************** HIP memory typedefs ********************/
916 
920 typedef struct {
921  Rpp32f* floatmem;
922 } hipMemRpp32f;
923 
927 typedef struct {
928  hipMemRpp32f scratchBufferHip;
929  hipMemRpp32f scratchBufferPinned;
930 } memGPU;
931 
935 typedef struct {
936  memCPU mcpu;
937  memGPU mgpu;
938 } memMgmt;
939 
940 #else
941 
945 typedef struct {
946  memCPU mcpu;
947 } memMgmt;
948 
949 #endif // BACKEND
950 
954 typedef struct {
955  RppPtr_t cpuHandle;
956  Rpp32u nbatchSize;
957  memMgmt mem;
958 } InitHandle;
959 
960 #endif /* RPPDEFS_H */
unsigned int Rpp32u
32 bit unsigned int
Definition: rppdefs.h:150
int Rpp32s
32 bit signed int
Definition: rppdefs.h:152
signed char Rpp8s
8 bit signed char
Definition: rppdefs.h:144
RpptMelScaleFormula
RPPT Mel Scale Formula.
Definition: rppdefs.h:527
unsigned short Rpp16u
16 bit unsigned short
Definition: rppdefs.h:146
unsigned char Rpp8u
8 bit unsigned char
Definition: rppdefs.h:142
void * RppPtr_t
void pointer
Definition: rppdefs.h:162
RpptLayout
RPPT Tensor layout type enum.
Definition: rppdefs.h:425
RpptBayerPattern
Bayer colour filter array pattern for rppt_bayer_to_rgb.
Definition: rppdefs.h:465
RpptRoiType
RPPT Tensor 2D ROI type enum.
Definition: rppdefs.h:475
RpptDataType
RPPT Tensor datatype enum.
Definition: rppdefs.h:420
RpptImageBorderType
RPPT Image Border Type.
Definition: rppdefs.h:518
struct RpptResamplingWindow RpptResamplingWindow
RPPT Tensor RpptResamplingWindow type struct.
double Rpp64f
64 bit double
Definition: rppdefs.h:160
RpptImageBorderEdge
RPPT Image Border Edge type enum.
Definition: rppdefs.h:513
RpptAudioBorderType
RPPT Audio Border Type.
Definition: rppdefs.h:508
size_t RppSize_t
size_t
Definition: rppdefs.h:164
RpptBitwiseOp
RPPT Broadcast Mode type enum.
Definition: rppdefs.h:364
RpptColorStandard
Color space standard for NV12 to RGB (YUV/YCbCr to RGB matrix).
Definition: rppdefs.h:439
struct GenericFilter GenericFilter
RPPT Tensor GenericFilter type struct.
RppStatus
RPP RppStatus type enums.
Definition: rppdefs.h:169
RpptColorRange
Color range (luma/chroma legal levels) for NV12 to RGB.
Definition: rppdefs.h:455
RpptRoi3DType
RPPT Tensor 3D ROI type enum.
Definition: rppdefs.h:483
const char * rppGetStatusString(RppStatus status) noexcept
Get the string representation of a RPP status code.
Definition: rppdefs.h:262
unsigned long long Rpp64u
64 bit unsigned long long
Definition: rppdefs.h:154
#define RPPT_MAX_DIMS
RPP maximum dimensions in tensor .
Definition: rppdefs.h:76
RpptInterpolationType
RPPT Tensor interpolation type enum.
Definition: rppdefs.h:496
RpptSubpixelLayout
RPPT Tensor subpixel layout type enum.
Definition: rppdefs.h:491
RpptOp
RPP Tensor Operations type enum.
Definition: rppdefs.h:354
short Rpp16s
16 bit signed short
Definition: rppdefs.h:148
float Rpp32f
32 bit float
Definition: rppdefs.h:158
RppBackend
RPP RppBackend type enums.
Definition: rppdefs.h:334
long long Rpp64s
64 bit long long
Definition: rppdefs.h:156
rppStatus_t
RPP rppStatus_t type enums.
Definition: rppdefs.h:339
@ RpptBayerPattern_RGGB
Definition: rppdefs.h:466
@ RpptBayerPattern_BGGR
Definition: rppdefs.h:467
@ RpptBayerPattern_GBRG
Definition: rppdefs.h:469
@ RpptBayerPattern_GRBG
Definition: rppdefs.h:468
@ RpptColorStandard_FCC
Definition: rppdefs.h:441
@ RpptColorStandard_SMPTE240M
Definition: rppdefs.h:444
@ RpptColorStandard_BT601
Definition: rppdefs.h:443
@ RpptColorStandard_BT470BG
Definition: rppdefs.h:442
@ RpptColorStandard_BT709
Definition: rppdefs.h:440
@ RpptColorStandard_BT2020_NCL
Definition: rppdefs.h:445
@ RpptColorStandard_BT2020_CL
Definition: rppdefs.h:446
@ RPP_ERROR_NOT_IMPLEMENTED
Function variant requested is not implemented / unsupported.
Definition: rppdefs.h:186
@ RPP_ERROR_INVALID_DST_DATATYPE
Invalid dst tensor datatype. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:204
@ RPP_ERROR_INVALID_OUTPUT_TILE_LENGTH
Invalid output tile length (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:225
@ RPP_ERROR_INVALID_DIM_LENGTHS
Length in some dimensions are invalid. (Needs to adhere to function specification....
Definition: rppdefs.h:240
@ RPP_ERROR_OUT_OF_BOUND_SRC_ROI
Out of bound source ROI.
Definition: rppdefs.h:217
@ 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:228
@ RPP_ERROR_INCOMPATIBLE_BACKEND
The user specified backend is not compatible with the initialized handle group_rppdefs.
Definition: rppdefs.h:246
@ RPP_ERROR_HIP_LAUNCH
HIP/GPU runtime or kernel launch error.
Definition: rppdefs.h:248
@ RPP_ERROR_ZERO_DIVISION
Arguments provided will result in zero division error.
Definition: rppdefs.h:180
@ RPP_ERROR_INVALID_ARGUMENTS
One or more arguments invalid. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:176
@ RPP_ERROR_LAYOUT_MISMATCH
src and dst layout mismatch
Definition: rppdefs.h:219
@ RPP_ERROR_INVALID_CHANNELS
Number of channels is invalid. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:222
@ RPP_ERROR_INVALID_SRC_CHANNELS
Invalid src tensor number of channels. (Needs to adhere to function specification....
Definition: rppdefs.h:189
@ RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE
Invalid src/dst tensor datatype. (Needs to adhere to function specification.)
Definition: rppdefs.h:207
@ RPP_ERROR_INVALID_PARAMETER_DATATYPE
Invalid datatype.
Definition: rppdefs.h:212
@ RPP_ERROR_NOT_ENOUGH_MEMORY
Not enough memory to write outputs, as per dim-lengths and strides set in descriptor.
Definition: rppdefs.h:215
@ RPP_ERROR
Unspecified error.
Definition: rppdefs.h:173
@ RPP_ERROR_INVALID_SRC_DIMS
Number of src dims is invalid. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:234
@ 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:231
@ RPP_ERROR_INVALID_DST_LAYOUT
Invalid dst tensor layout. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:198
@ RPP_ERROR_INVALID_AXIS
The specified axis is invalid or out of range. (Needs to adhere to function specification....
Definition: rppdefs.h:243
@ RPP_ERROR_INVALID_DST_CHANNELS
Invalid dst tensor number of channels. (Needs to adhere to function specification....
Definition: rppdefs.h:192
@ RPP_ERROR_HIP_RUNTIME
Internal HIP/GPU runtime error.
Definition: rppdefs.h:250
@ RPP_ERROR_INVALID_SRC_DATATYPE
Invalid src tensor datatype. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:201
@ RPP_ERROR_INVALID_SRC_LAYOUT
Invalid src tensor layout. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:195
@ RPP_ERROR_HIGH_SRC_DIMENSION
Src tensor / src ROI dimension too high. (Needs to adhere to function specification....
Definition: rppdefs.h:183
@ RPP_SUCCESS
No error.
Definition: rppdefs.h:171
@ RPP_ERROR_INSUFFICIENT_DST_BUFFER_LENGTH
Insufficient dst buffer length provided. (Needs to adhere to function specification....
Definition: rppdefs.h:210
@ RPP_ERROR_INVALID_DST_DIMS
Number of dst dims is invalid. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:237
@ RPP_ERROR_LOW_OFFSET
Low tensor offsetInBytes provided for src/dst tensor.
Definition: rppdefs.h:178
@ RpptColorRange_FULL
Definition: rppdefs.h:457
@ RpptColorRange_STUDIO
Definition: rppdefs.h:456
RpptBroadcastMode
Broadcast support mode for RPP Tensor operations.
Definition: rppdefs.h:373
Base class for Mel scale conversions.
Definition: rppdefs.h:845
RPPT Tensor GenericFilter type struct.
Definition: rppdefs.h:757
Derived class for HTK Mel scale conversions.
Definition: rppdefs.h:855
RPP initialize handle.
Definition: rppdefs.h:954
RPP 24 float vector.
Definition: rppdefs.h:411
RPP 6 float vector.
Definition: rppdefs.h:390
RPP 9 float vector.
Definition: rppdefs.h:397
RPP 24 signed int vector.
Definition: rppdefs.h:404
RPP layout params.
Definition: rppdefs.h:382
RPPT Tensor 2D bilinear neighborhood 32-bit signed int 8-length-vectors type struct.
Definition: rppdefs.h:737
RPPT Tensor 2D bilinear neighborhood 32-bit float 8-length-vectors type struct.
Definition: rppdefs.h:747
RPPT Tensor Channel Offsets struct.
Definition: rppdefs.h:561
RPPT Tensor descriptor type struct.
Definition: rppdefs.h:624
RPPT Tensor 32-bit float RGB type struct.
Definition: rppdefs.h:686
RPPT Tensor 2D 32-bit float vector type struct.
Definition: rppdefs.h:703
RPPT Tensor Generic descriptor type struct.
Definition: rppdefs.h:665
RPPT Tensor 2D image patch dimensions type struct.
Definition: rppdefs.h:711
RPPT Image 2D cartesian point type struct.
Definition: rppdefs.h:536
RPPT Image 3D point type struct.
Definition: rppdefs.h:544
RPPT Tensor 8-bit uchar RGB type struct.
Definition: rppdefs.h:677
RPPT Tensor RpptResamplingWindow type struct.
Definition: rppdefs.h:803
RPPT Tensor 3D ROI LTFRBB struct.
Definition: rppdefs.h:570
RPPT Tensor 2D ROI LTRB struct.
Definition: rppdefs.h:553
RPPT Tensor 2D ROI XYWH struct.
Definition: rppdefs.h:578
RPPT Tensor 3D ROI XYZWHD struct.
Definition: rppdefs.h:587
RPPT Tensor strides type struct.
Definition: rppdefs.h:614
RPPT Tensor 2D 32-bit uint vector type struct.
Definition: rppdefs.h:695
RPPT Tensor random number generator state (xorwow box muller state) type struct.
Definition: rppdefs.h:727
RPPT Tensor random number generator state (xorwow state) type struct.
Definition: rppdefs.h:719
Derived class for Slaney Mel scale conversions.
Definition: rppdefs.h:870
RPP HIP 32-bit float memory.
Definition: rppdefs.h:920
RPP HOST memory type struct.
Definition: rppdefs.h:909
RPP HIP memory management type struct.
Definition: rppdefs.h:927
RPP HIP-HOST memory management.
Definition: rppdefs.h:935
RPPT Tensor 3D ROI union.
Definition: rppdefs.h:605
RPPT Tensor 2D ROI union.
Definition: rppdefs.h:596