/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  372877312; // maximum scratch memory size (in number of floats) needed for spectrogram HIP
130  // kernel in RNNT training
131 #define DROPOUT_FIXED_SEED 42 // Constant fixed seed for reproducing the dropout output
132 #define RANDOM_ERASE_NOISE_BUFFER_SIDE \
133  255 // Random erase spatial noise buffer height and width. Changing this constant will result
134  // in QA test failures for tiled noise mapping
135 
136 /******************** RPP typedefs ********************/
137 
139 typedef unsigned char Rpp8u;
141 typedef signed char Rpp8s;
143 typedef unsigned short Rpp16u;
145 typedef short Rpp16s;
147 typedef unsigned int Rpp32u;
149 typedef int Rpp32s;
151 typedef unsigned long long Rpp64u;
153 typedef long long Rpp64s;
155 typedef float Rpp32f;
157 typedef double Rpp64f;
159 typedef void* RppPtr_t;
161 typedef size_t RppSize_t;
162 
166 typedef enum {
170  RPP_ERROR = -1,
248 } RppStatus;
249 
259 inline const char* rppGetStatusString(RppStatus status) noexcept {
260  // A switch over string literals keeps this allocation-free and non-throwing, so it stays safe
261  // to call from logging and error handling paths.
262  switch (status) {
263  case RPP_SUCCESS:
264  return "RPP_SUCCESS";
265  case RPP_ERROR:
266  return "RPP_ERROR";
268  return "RPP_ERROR_INVALID_ARGUMENTS";
270  return "RPP_ERROR_LOW_OFFSET";
272  return "RPP_ERROR_ZERO_DIVISION";
274  return "RPP_ERROR_HIGH_SRC_DIMENSION";
276  return "RPP_ERROR_NOT_IMPLEMENTED";
278  return "RPP_ERROR_INVALID_SRC_CHANNELS";
280  return "RPP_ERROR_INVALID_DST_CHANNELS";
282  return "RPP_ERROR_INVALID_SRC_LAYOUT";
284  return "RPP_ERROR_INVALID_DST_LAYOUT";
286  return "RPP_ERROR_INVALID_SRC_DATATYPE";
288  return "RPP_ERROR_INVALID_DST_DATATYPE";
290  return "RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE";
292  return "RPP_ERROR_INSUFFICIENT_DST_BUFFER_LENGTH";
294  return "RPP_ERROR_INVALID_PARAMETER_DATATYPE";
296  return "RPP_ERROR_NOT_ENOUGH_MEMORY";
298  return "RPP_ERROR_OUT_OF_BOUND_SRC_ROI";
300  return "RPP_ERROR_LAYOUT_MISMATCH";
302  return "RPP_ERROR_INVALID_CHANNELS";
304  return "RPP_ERROR_INVALID_OUTPUT_TILE_LENGTH";
306  return "RPP_ERROR_OUT_OF_BOUND_SHARED_MEMORY_SIZE";
308  return "RPP_ERROR_OUT_OF_BOUND_SCRATCH_MEMORY_SIZE";
310  return "RPP_ERROR_INVALID_SRC_DIMS";
312  return "RPP_ERROR_INVALID_DST_DIMS";
314  return "RPP_ERROR_INVALID_DIM_LENGTHS";
316  return "RPP_ERROR_INVALID_AXIS";
318  return "RPP_ERROR_INCOMPATIBLE_BACKEND";
320  return "RPP_ERROR_HIP_LAUNCH";
322  return "RPP_ERROR_HIP_RUNTIME";
323  }
324 
325  return "RPP_STATUS_UNKNOWN";
326 }
327 
331 typedef enum { RPP_HOST_BACKEND, RPP_HIP_BACKEND } RppBackend;
332 
336 typedef enum {
337  rppStatusSuccess = 0,
338  rppStatusBadParm = -1,
339  rppStatusUnknownError = -2,
340  rppStatusNotInitialized = -3,
341  rppStatusInvalidValue = -4,
342  rppStatusAllocFailed = -5,
343  rppStatusInternalError = -6,
344  rppStatusNotImplemented = -7,
345  rppStatusUnsupportedOp = -8,
346 } rppStatus_t;
347 
351 typedef enum {
352  RPP_TENSOR_OP_ADD,
353  RPP_TENSOR_OP_SUBTRACT,
354  RPP_TENSOR_OP_MULTIPLY,
355  RPP_TENSOR_OP_DIVIDE
356 } RpptOp;
357 
361 typedef enum { RPP_TENSOR_OP_AND, RPP_TENSOR_OP_OR, RPP_TENSOR_OP_XOR } RpptBitwiseOp;
362 
370 typedef enum {
371  RPP_BROADCAST_ENABLE,
372  RPP_BROADCAST_DISABLE // Broadcasting is disabled; Requires input tensors to be of the same
373  // shape
375 
379 typedef struct {
380  Rpp32u channelParam;
381  Rpp32u bufferMultiplier;
383 
387 typedef struct {
388  Rpp32f data[6];
389 } Rpp32f6;
390 
394 typedef struct {
395  Rpp32f data[9];
396 } Rpp32f9;
397 
401 typedef struct {
402  Rpp32s data[24];
403 } Rpp32s24;
404 
408 typedef struct {
409  Rpp32f data[24];
410 } Rpp32f24;
411 
412 /******************** RPPT typedefs ********************/
413 
417 typedef enum { U8, F32, F16, I8, I16, U16, I32, U32 } RpptDataType;
418 
422 typedef enum {
423  NCHW, // BatchSize-Channels-Height-Width
424  NHWC, // BatchSize-Height-Width-Channels
425  NCDHW, // BatchSize-Channels-Depth-Height-Width
426  NDHWC, // BatchSize-Depth-Height-Width-Channels
427  NHW, // BatchSize-Height-Width
428  NFT, // BatchSize-Frequency-Time -> Frequency Major used for Spectrogram / MelfilterBank
429  NTF // BatchSize-Time-Frequency -> Time Major used for Spectrogram / MelfilterBank
430 } RpptLayout;
431 
436 typedef enum {
445 
452 typedef enum {
456 
460 typedef enum {
461  LTRB, // Left-Top-Right-Bottom
462  XYWH // X-Y-Width-Height
463 } RpptRoiType;
464 
468 typedef enum {
469  LTFRBB, // Left-Top-Front-Right-Bottom-Back
470  XYZWHD // X-Y-Z-Width-Height-Depth
471 } RpptRoi3DType;
472 
476 typedef enum { RGBtype, BGRtype } RpptSubpixelLayout;
477 
481 typedef enum {
482  NEAREST_NEIGHBOR = 0,
483  BILINEAR,
484  BICUBIC,
485  LANCZOS,
486  GAUSSIAN,
487  TRIANGULAR
489 
493 typedef enum { ZERO = 0, CLAMP, REFLECT } RpptAudioBorderType;
494 
498 typedef enum { TOP_EDGE = 0, BOTTOM_EDGE, LEFT_EDGE, RIGHT_EDGE } RpptImageBorderEdge;
499 
503 typedef enum {
504  REPLICATE = 0, // Similar to Nearest Neighbors Padding
505  CONSTANT, // Unsupported Border Type
506  REFLECT_NO_EDGE // Unsupported Border Type
508 
512 typedef enum {
513  SLANEY = 0, // Follows Slaney’s MATLAB Auditory Modelling Work behavior
514  HTK, // Follows O’Shaughnessy’s book formula, consistent with Hidden Markov Toolkit(HTK), m =
515  // 2595 * log10(1 + (f/700))
517 
521 typedef struct {
522  int x;
523  int y;
524 } RpptPoint2D;
525 
529 typedef struct {
530  int x;
531  int y;
532  int z;
533 } RpptPoint3D;
534 
538 typedef struct {
539  RpptPoint2D lt, rb; // Left-Top point and Right-Bottom point
540 
541 } RpptRoiLtrb;
542 
546 typedef struct {
547  RpptPoint2D r;
548  RpptPoint2D g;
549  RpptPoint2D b;
551 
555 typedef struct {
556  RpptPoint3D ltf, rbb; // Left-Top-Front point and Right-Bottom-Back point
557 
558 } RpptRoiLtfrbb;
559 
563 typedef struct {
564  RpptPoint2D xy;
565  int roiWidth, roiHeight;
566 
567 } RpptRoiXywh;
568 
572 typedef struct {
573  RpptPoint3D xyz;
574  int roiWidth, roiHeight, roiDepth;
575 
576 } RpptRoiXyzwhd;
577 
581 typedef union {
582  RpptRoiLtrb ltrbROI; // ROI defined as Left-Top-Right-Bottom
583  RpptRoiXywh xywhROI; // ROI defined as X-Y-Width-Height
584 
585 } RpptROI, *RpptROIPtr;
586 
590 typedef union {
591  RpptRoiLtfrbb ltfrbbROI; // ROI defined as Left-Top-Front-Right-Bottom-Back
592  RpptRoiXyzwhd xyzwhdROI; // ROI defined as X-Y-Z-Width-Height-Depth
593 
595 
599 typedef struct {
600  Rpp32u nStride;
601  Rpp32u cStride;
602  Rpp32u hStride;
603  Rpp32u wStride;
604 } RpptStrides;
605 
609 struct RpptDesc {
610  RppSize_t numDims = 4;
611  Rpp32u offsetInBytes = 0;
612  RpptDataType dataType;
613  Rpp32u n, c, h, w;
614  RpptStrides strides;
615  RpptLayout layout;
616 
617  RpptDesc() = default;
618 
619  RpptDesc(Rpp32u n, Rpp32u c, Rpp32u h, Rpp32u w, RpptDataType dataType, RpptLayout layout)
620  : dataType(dataType), n(n), c(c), h(h), w(w), layout(layout) {
621  if (layout == NCHW) {
622  strides.nStride = c * h * w;
623  strides.cStride = h * w;
624  strides.hStride = w;
625  strides.wStride = 1;
626  } else if (layout == NHWC) {
627  strides.nStride = h * w * c;
628  strides.hStride = w * c;
629  strides.wStride = c;
630  strides.cStride = 1;
631  }
632  }
633 
634  RpptDesc(Rpp32u n, Rpp32u c, Rpp32u h, Rpp32u w, RpptDataType dataType, RpptLayout layout,
635  Rpp32u offsetInBytes, RpptStrides strides)
636  : offsetInBytes(offsetInBytes),
637  dataType(dataType),
638  n(n),
639  c(c),
640  h(h),
641  w(w),
642  strides(strides),
643  layout(layout) {}
644 };
645 typedef RpptDesc* RpptDescPtr;
646 
650 typedef struct {
651  RppSize_t numDims;
652  Rpp32u offsetInBytes;
653  RpptDataType dataType;
654  Rpp32u dims[RPPT_MAX_DIMS];
655  Rpp32u strides[RPPT_MAX_DIMS];
656  RpptLayout layout;
658 
662 typedef struct {
663  Rpp8u R;
664  Rpp8u G;
665  Rpp8u B;
666 } RpptRGB;
667 
671 typedef struct {
672  Rpp32f R;
673  Rpp32f G;
674  Rpp32f B;
675 } RpptFloatRGB;
676 
680 typedef struct {
681  Rpp32u x;
682  Rpp32u y;
684 
688 typedef struct {
689  Rpp32f x;
690  Rpp32f y;
692 
696 typedef struct {
697  Rpp32u width;
698  Rpp32u height;
700 
704 typedef struct {
705  Rpp32u x[5];
706  Rpp32u counter;
708 
712 typedef struct {
713  Rpp32s x[5];
714  Rpp32s counter;
715  int boxMullerFlag;
716  float boxMullerExtra;
718 
722 typedef struct {
723  Rpp32s24 srcLocsTL;
724  Rpp32s24 srcLocsTR;
725  Rpp32s24 srcLocsBL;
726  Rpp32s24 srcLocsBR;
728 
732 typedef struct {
733  Rpp32f24 srcValsTL;
734  Rpp32f24 srcValsTR;
735  Rpp32f24 srcValsBL;
736  Rpp32f24 srcValsBR;
738 
742 typedef struct GenericFilter {
743  Rpp32f scale = 1.0f;
744  Rpp32f radius = 1.0f;
745  Rpp32s size;
746  GenericFilter(RpptInterpolationType interpolationType, Rpp32s in_size, Rpp32s out_size,
747  Rpp32f scaleRatio) {
748  switch (interpolationType) {
749  case RpptInterpolationType::BICUBIC: {
750  this->radius = 2.0f;
751  break;
752  }
753  case RpptInterpolationType::LANCZOS: {
754  if (in_size > out_size) {
755  this->radius = 3.0f * scaleRatio;
756  this->scale = (1 / scaleRatio);
757  } else
758  this->radius = 3.0f;
759  break;
760  }
761  case RpptInterpolationType::GAUSSIAN: {
762  if (in_size > out_size) {
763  this->radius = scaleRatio;
764  this->scale = (1 / scaleRatio);
765  }
766  break;
767  }
768  case RpptInterpolationType::TRIANGULAR: {
769  if (in_size > out_size) {
770  this->radius = scaleRatio;
771  this->scale = (1 / scaleRatio);
772  }
773  break;
774  }
775  default: {
776  this->radius = 1.0f;
777  this->scale = 1.0f;
778  break;
779  }
780  }
781  this->size = std::ceil(2 * this->radius);
782  }
784 
788 typedef struct RpptResamplingWindow {
789  inline RPP_HOST_DEVICE void input_range(Rpp32f x, Rpp32s* loc0, Rpp32s* loc1) {
790  Rpp32s xc = std::ceil(x);
791  *loc0 = xc - lobes;
792  *loc1 = xc + lobes;
793  }
794 
795  inline Rpp32f operator()(Rpp32f x) {
796  Rpp32f locRaw = x * scale + center;
797  Rpp32s locFloor = std::floor(locRaw);
798  Rpp32f weight = locRaw - locFloor;
799  locFloor = std::max(std::min(locFloor, lookupSize - 2), 0);
800  Rpp32f current = lookup[locFloor];
801  Rpp32f next = lookup[locFloor + 1];
802  return current + weight * (next - current);
803  }
804 
805  inline __m128 operator()(__m128 x) {
806  __m128 pLocRaw = _mm_add_ps(_mm_mul_ps(x, pScale), pCenter);
807  __m128i pxLocFloor = _mm_cvttps_epi32(pLocRaw);
808  __m128 pLocFloor = _mm_cvtepi32_ps(pxLocFloor);
809  __m128 pWeight = _mm_sub_ps(pLocRaw, pLocFloor);
810  Rpp32s idx[4];
811  _mm_storeu_si128(reinterpret_cast<__m128i*>(idx), pxLocFloor);
812  __m128 pCurrent =
813  _mm_setr_ps(lookup[idx[0]], lookup[idx[1]], lookup[idx[2]], lookup[idx[3]]);
814  __m128 pNext = _mm_setr_ps(lookup[idx[0] + 1], lookup[idx[1] + 1], lookup[idx[2] + 1],
815  lookup[idx[3] + 1]);
816  return _mm_add_ps(pCurrent, _mm_mul_ps(pWeight, _mm_sub_ps(pNext, pCurrent)));
817  }
818 
819  Rpp32f scale = 1, center = 1;
820  Rpp32s lobes = 0, coeffs = 0;
821  Rpp32s lookupSize = 0;
822  Rpp32f* lookupPinned = nullptr;
823  std::vector<Rpp32f> lookup;
824  __m128 pCenter, pScale;
826 
830 struct BaseMelScale {
831  public:
832  inline RPP_HOST_DEVICE virtual Rpp32f hz_to_mel(Rpp32f hz) = 0;
833  inline RPP_HOST_DEVICE virtual Rpp32f mel_to_hz(Rpp32f mel) = 0;
834  virtual ~BaseMelScale() = default;
835 };
836 
840 struct HtkMelScale : public BaseMelScale {
841  inline RPP_HOST_DEVICE Rpp32f hz_to_mel(Rpp32f hz) {
842  return 1127.0f * std::log(1.0f + (hz / 700.0f));
843  }
844  inline RPP_HOST_DEVICE Rpp32f mel_to_hz(Rpp32f mel) {
845  return 700.0f * (std::exp(mel / 1127.0f) - 1.0f);
846  }
847 
848  public:
849  ~HtkMelScale() {};
850 };
851 
855 struct SlaneyMelScale : public BaseMelScale {
856  const Rpp32f freqLow = 0;
857  const Rpp32f fsp = 66.666667f;
858  const Rpp32f minLogHz = 1000.0;
859  const Rpp32f minLogMel = (minLogHz - freqLow) / fsp;
860  const Rpp32f stepLog = 0.068751777; // Equivalent to std::log(6.4) / 27.0;
861 
862  const Rpp32f invMinLogHz = 0.001f;
863  const Rpp32f invStepLog = 1.0f / stepLog;
864  const Rpp32f invFsp = 1.0f / fsp;
865 
866  inline RPP_HOST_DEVICE Rpp32f hz_to_mel(Rpp32f hz) {
867  Rpp32f mel = 0.0f;
868  if (hz >= minLogHz)
869  mel = minLogMel + std::log(hz * invMinLogHz) * invStepLog;
870  else
871  mel = (hz - freqLow) * invFsp;
872 
873  return mel;
874  }
875 
876  inline RPP_HOST_DEVICE Rpp32f mel_to_hz(Rpp32f mel) {
877  Rpp32f hz = 0.0f;
878  if (mel >= minLogMel)
879  hz = minLogHz * std::exp(stepLog * (mel - minLogMel));
880  else
881  hz = freqLow + mel * fsp;
882  return hz;
883  }
884 
885  public:
886  ~SlaneyMelScale() {};
887 };
888 
889 /******************** HOST memory typedefs ********************/
890 
894 typedef struct {
895  Rpp32f* scratchBufferHost;
896 } memCPU;
897 
898 #if RPP_BACKEND_HIP
899 
900 /******************** HIP memory typedefs ********************/
901 
905 typedef struct {
906  Rpp32f* floatmem;
907 } hipMemRpp32f;
908 
912 typedef struct {
913  hipMemRpp32f scratchBufferHip;
914  hipMemRpp32f scratchBufferPinned;
915 } memGPU;
916 
920 typedef struct {
921  memCPU mcpu;
922  memGPU mgpu;
923 } memMgmt;
924 
925 #else
926 
930 typedef struct {
931  memCPU mcpu;
932 } memMgmt;
933 
934 #endif // BACKEND
935 
939 typedef struct {
940  RppPtr_t cpuHandle;
941  Rpp32u nbatchSize;
942  memMgmt mem;
943 } InitHandle;
944 
945 #endif /* RPPDEFS_H */
unsigned int Rpp32u
32 bit unsigned int
Definition: rppdefs.h:147
int Rpp32s
32 bit signed int
Definition: rppdefs.h:149
signed char Rpp8s
8 bit signed char
Definition: rppdefs.h:141
RpptMelScaleFormula
RPPT Mel Scale Formula.
Definition: rppdefs.h:512
unsigned short Rpp16u
16 bit unsigned short
Definition: rppdefs.h:143
unsigned char Rpp8u
8 bit unsigned char
Definition: rppdefs.h:139
void * RppPtr_t
void pointer
Definition: rppdefs.h:159
RpptLayout
RPPT Tensor layout type enum.
Definition: rppdefs.h:422
RpptRoiType
RPPT Tensor 2D ROI type enum.
Definition: rppdefs.h:460
RpptDataType
RPPT Tensor datatype enum.
Definition: rppdefs.h:417
RpptImageBorderType
RPPT Image Border Type.
Definition: rppdefs.h:503
struct RpptResamplingWindow RpptResamplingWindow
RPPT Tensor RpptResamplingWindow type struct.
double Rpp64f
64 bit double
Definition: rppdefs.h:157
RpptImageBorderEdge
RPPT Image Border Edge type enum.
Definition: rppdefs.h:498
RpptAudioBorderType
RPPT Audio Border Type.
Definition: rppdefs.h:493
size_t RppSize_t
size_t
Definition: rppdefs.h:161
RpptBitwiseOp
RPPT Broadcast Mode type enum.
Definition: rppdefs.h:361
RpptColorStandard
Color space standard for NV12 to RGB (YUV/YCbCr to RGB matrix).
Definition: rppdefs.h:436
struct GenericFilter GenericFilter
RPPT Tensor GenericFilter type struct.
RppStatus
RPP RppStatus type enums.
Definition: rppdefs.h:166
RpptColorRange
Color range (luma/chroma legal levels) for NV12 to RGB.
Definition: rppdefs.h:452
RpptRoi3DType
RPPT Tensor 3D ROI type enum.
Definition: rppdefs.h:468
const char * rppGetStatusString(RppStatus status) noexcept
Get the string representation of a RPP status code.
Definition: rppdefs.h:259
unsigned long long Rpp64u
64 bit unsigned long long
Definition: rppdefs.h:151
#define RPPT_MAX_DIMS
RPP maximum dimensions in tensor .
Definition: rppdefs.h:76
RpptInterpolationType
RPPT Tensor interpolation type enum.
Definition: rppdefs.h:481
RpptSubpixelLayout
RPPT Tensor subpixel layout type enum.
Definition: rppdefs.h:476
RpptOp
RPP Tensor Operations type enum.
Definition: rppdefs.h:351
short Rpp16s
16 bit signed short
Definition: rppdefs.h:145
float Rpp32f
32 bit float
Definition: rppdefs.h:155
RppBackend
RPP RppBackend type enums.
Definition: rppdefs.h:331
long long Rpp64s
64 bit long long
Definition: rppdefs.h:153
rppStatus_t
RPP rppStatus_t type enums.
Definition: rppdefs.h:336
@ RpptColorStandard_FCC
Definition: rppdefs.h:438
@ RpptColorStandard_SMPTE240M
Definition: rppdefs.h:441
@ RpptColorStandard_BT601
Definition: rppdefs.h:440
@ RpptColorStandard_BT470BG
Definition: rppdefs.h:439
@ RpptColorStandard_BT709
Definition: rppdefs.h:437
@ RpptColorStandard_BT2020_NCL
Definition: rppdefs.h:442
@ RpptColorStandard_BT2020_CL
Definition: rppdefs.h:443
@ RPP_ERROR_NOT_IMPLEMENTED
Function variant requested is not implemented / unsupported.
Definition: rppdefs.h:183
@ RPP_ERROR_INVALID_DST_DATATYPE
Invalid dst tensor datatype. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:201
@ RPP_ERROR_INVALID_OUTPUT_TILE_LENGTH
Invalid output tile length (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:222
@ RPP_ERROR_INVALID_DIM_LENGTHS
Length in some dimensions are invalid. (Needs to adhere to function specification....
Definition: rppdefs.h:237
@ RPP_ERROR_OUT_OF_BOUND_SRC_ROI
Out of bound source ROI.
Definition: rppdefs.h:214
@ 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:225
@ RPP_ERROR_INCOMPATIBLE_BACKEND
The user specified backend is not compatible with the initialized handle group_rppdefs.
Definition: rppdefs.h:243
@ RPP_ERROR_HIP_LAUNCH
HIP/GPU runtime or kernel launch error.
Definition: rppdefs.h:245
@ RPP_ERROR_ZERO_DIVISION
Arguments provided will result in zero division error.
Definition: rppdefs.h:177
@ RPP_ERROR_INVALID_ARGUMENTS
One or more arguments invalid. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:173
@ RPP_ERROR_LAYOUT_MISMATCH
src and dst layout mismatch
Definition: rppdefs.h:216
@ RPP_ERROR_INVALID_CHANNELS
Number of channels is invalid. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:219
@ RPP_ERROR_INVALID_SRC_CHANNELS
Invalid src tensor number of channels. (Needs to adhere to function specification....
Definition: rppdefs.h:186
@ RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE
Invalid src/dst tensor datatype. (Needs to adhere to function specification.)
Definition: rppdefs.h:204
@ RPP_ERROR_INVALID_PARAMETER_DATATYPE
Invalid datatype.
Definition: rppdefs.h:209
@ RPP_ERROR_NOT_ENOUGH_MEMORY
Not enough memory to write outputs, as per dim-lengths and strides set in descriptor.
Definition: rppdefs.h:212
@ RPP_ERROR
Unspecified error.
Definition: rppdefs.h:170
@ RPP_ERROR_INVALID_SRC_DIMS
Number of src dims is invalid. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:231
@ 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:228
@ RPP_ERROR_INVALID_DST_LAYOUT
Invalid dst tensor layout. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:195
@ RPP_ERROR_INVALID_AXIS
The specified axis is invalid or out of range. (Needs to adhere to function specification....
Definition: rppdefs.h:240
@ RPP_ERROR_INVALID_DST_CHANNELS
Invalid dst tensor number of channels. (Needs to adhere to function specification....
Definition: rppdefs.h:189
@ RPP_ERROR_HIP_RUNTIME
Internal HIP/GPU runtime error.
Definition: rppdefs.h:247
@ RPP_ERROR_INVALID_SRC_DATATYPE
Invalid src tensor datatype. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:198
@ RPP_ERROR_INVALID_SRC_LAYOUT
Invalid src tensor layout. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:192
@ RPP_ERROR_HIGH_SRC_DIMENSION
Src tensor / src ROI dimension too high. (Needs to adhere to function specification....
Definition: rppdefs.h:180
@ RPP_SUCCESS
No error.
Definition: rppdefs.h:168
@ RPP_ERROR_INSUFFICIENT_DST_BUFFER_LENGTH
Insufficient dst buffer length provided. (Needs to adhere to function specification....
Definition: rppdefs.h:207
@ RPP_ERROR_INVALID_DST_DIMS
Number of dst dims is invalid. (Needs to adhere to function specification.) group_rppdefs.
Definition: rppdefs.h:234
@ RPP_ERROR_LOW_OFFSET
Low tensor offsetInBytes provided for src/dst tensor.
Definition: rppdefs.h:175
@ RpptColorRange_FULL
Definition: rppdefs.h:454
@ RpptColorRange_STUDIO
Definition: rppdefs.h:453
RpptBroadcastMode
Broadcast support mode for RPP Tensor operations.
Definition: rppdefs.h:370
Base class for Mel scale conversions.
Definition: rppdefs.h:830
RPPT Tensor GenericFilter type struct.
Definition: rppdefs.h:742
Derived class for HTK Mel scale conversions.
Definition: rppdefs.h:840
RPP initialize handle.
Definition: rppdefs.h:939
RPP 24 float vector.
Definition: rppdefs.h:408
RPP 6 float vector.
Definition: rppdefs.h:387
RPP 9 float vector.
Definition: rppdefs.h:394
RPP 24 signed int vector.
Definition: rppdefs.h:401
RPP layout params.
Definition: rppdefs.h:379
RPPT Tensor 2D bilinear neighborhood 32-bit signed int 8-length-vectors type struct.
Definition: rppdefs.h:722
RPPT Tensor 2D bilinear neighborhood 32-bit float 8-length-vectors type struct.
Definition: rppdefs.h:732
RPPT Tensor Channel Offsets struct.
Definition: rppdefs.h:546
RPPT Tensor descriptor type struct.
Definition: rppdefs.h:609
RPPT Tensor 32-bit float RGB type struct.
Definition: rppdefs.h:671
RPPT Tensor 2D 32-bit float vector type struct.
Definition: rppdefs.h:688
RPPT Tensor Generic descriptor type struct.
Definition: rppdefs.h:650
RPPT Tensor 2D image patch dimensions type struct.
Definition: rppdefs.h:696
RPPT Image 2D cartesian point type struct.
Definition: rppdefs.h:521
RPPT Image 3D point type struct.
Definition: rppdefs.h:529
RPPT Tensor 8-bit uchar RGB type struct.
Definition: rppdefs.h:662
RPPT Tensor RpptResamplingWindow type struct.
Definition: rppdefs.h:788
RPPT Tensor 3D ROI LTFRBB struct.
Definition: rppdefs.h:555
RPPT Tensor 2D ROI LTRB struct.
Definition: rppdefs.h:538
RPPT Tensor 2D ROI XYWH struct.
Definition: rppdefs.h:563
RPPT Tensor 3D ROI XYZWHD struct.
Definition: rppdefs.h:572
RPPT Tensor strides type struct.
Definition: rppdefs.h:599
RPPT Tensor 2D 32-bit uint vector type struct.
Definition: rppdefs.h:680
RPPT Tensor random number generator state (xorwow box muller state) type struct.
Definition: rppdefs.h:712
RPPT Tensor random number generator state (xorwow state) type struct.
Definition: rppdefs.h:704
Derived class for Slaney Mel scale conversions.
Definition: rppdefs.h:855
RPP HIP 32-bit float memory.
Definition: rppdefs.h:905
RPP HOST memory type struct.
Definition: rppdefs.h:894
RPP HIP memory management type struct.
Definition: rppdefs.h:912
RPP HIP-HOST memory management.
Definition: rppdefs.h:920
RPPT Tensor 3D ROI union.
Definition: rppdefs.h:590
RPPT Tensor 2D ROI union.
Definition: rppdefs.h:581