Device Namespace Reference

Device Namespace Reference#

7 min read time

Applies to Linux

rocCV: Kernels::Device Namespace Reference
Kernels::Device Namespace Reference

Functions

template<typename T , typename SrcWrapper , typename DstWrapper >
__global__ void bilateral_filter (SrcWrapper input, DstWrapper output, int radius, float sigmaColor, float sigmaSpace, float spaceCoeff, float colorCoeff)
 
template<typename SrcWrapper , typename DstWrapper >
__global__ void binary_generic (SrcWrapper input, DstWrapper output, roccv::GenericTensorWrapper< double > thresh, roccv::GenericTensorWrapper< double > maxVal, const int32_t maxBatchSize)
 
template<typename SrcWrapper , typename DstWrapper >
__global__ void binary_inv_generic (SrcWrapper input, DstWrapper output, roccv::GenericTensorWrapper< double > thresh, roccv::GenericTensorWrapper< double > maxVal, const int32_t maxBatchSize)
 
template<bool has_alpha, typename T , typename SrcWrapper , typename DstWrapper , typename BT = detail::BaseType<T>>
__global__ void bndbox_kernel (SrcWrapper input, DstWrapper output, Rect_t *rects, size_t n_rects, int64_t batch, int64_t height, int64_t width)
 
template<typename SrcWrapper , typename MaskWrapper , typename DstWrapper >
__global__ void composite (SrcWrapper foreground, SrcWrapper background, MaskWrapper mask, DstWrapper output)
 
template<typename SrcDesc , typename DstDesc >
__global__ void copy_make_border (SrcDesc src, DstDesc dst, int32_t top, int32_t left)
 GPU kernel for CopyMakeBorder operator. More...
 
template<typename SrcWrapper , typename DstWrapper >
__global__ void custom_crop (SrcWrapper input, DstWrapper output, Box_t cropRect)
 
template<eAxis FlipType, typename SrcWrapper , typename DstWrapper >
__global__ void flip (SrcWrapper input, DstWrapper output)
 
template<typename SrcWrapper , typename DstWrapper >
__global__ void gamma_contrast (SrcWrapper input, DstWrapper output, float gamma)
 
template<typename T , typename SrcWrapper , typename MaskWrapper >
__global__ void histogram_kernel (SrcWrapper input, MaskWrapper mask, roccv::GenericTensorWrapper< T > histogram)
 
template<typename T , typename SrcWrapper >
__global__ void histogram_kernel (SrcWrapper input, roccv::GenericTensorWrapper< T > histogram)
 
__global__ void non_maximum_suppression (roccv::GenericTensorWrapper< short4 > input, roccv::GenericTensorWrapper< uint8_t > output, roccv::GenericTensorWrapper< float > scores, int numBoxes, float scoresThreshold, float iouThreshold)
 
template<bool ScaleStddev, typename SrcWrapper , typename DstWrapper , typename ScaleWrapper , typename BaseWrapper >
__global__ void normalize (SrcWrapper input, BaseWrapper base, ScaleWrapper scale, DstWrapper output, float globalScale, float shift, float epsilon)
 
template<typename SrcWrapper , typename DstWrapper , typename MapWrapper >
__global__ void remap (SrcWrapper input, DstWrapper output, MapWrapper map)
 
template<typename T , roccv::eSwizzle S, typename SrcWrapper , typename DstWrapper >
__global__ void reorder (SrcWrapper input, DstWrapper output)
 
template<typename SrcWrapper , typename DstWrapper >
__global__ void resize (SrcWrapper input, DstWrapper output, float scaleX, float scaleY)
 
template<typename T , roccv::eSwizzle S, typename SrcWrapper , typename DstWrapper >
__global__ void rgb_or_bgr_to_grayscale (SrcWrapper input, DstWrapper output)
 
template<typename T , roccv::eSwizzle S, typename SrcWrapper , typename DstWrapper >
__global__ void rgb_or_bgr_to_yuv (SrcWrapper input, DstWrapper output, float delta)
 
template<typename SrcWrapper , typename DstWrapper , typename MatWrapper >
__global__ void rotate (SrcWrapper src, DstWrapper dst, MatWrapper affineMat)
 
template<typename SrcWrapper , typename DstWrapper >
__global__ void tozero_generic (SrcWrapper input, DstWrapper output, roccv::GenericTensorWrapper< double > thresh, const int32_t maxBatchSize)
 
template<typename SrcWrapper , typename DstWrapper >
__global__ void tozeroinv_generic (SrcWrapper input, DstWrapper output, roccv::GenericTensorWrapper< double > thresh, const int32_t maxBatchSize)
 
template<typename SrcWrapper , typename DstWrapper >
__global__ void trunc_generic (SrcWrapper input, DstWrapper output, roccv::GenericTensorWrapper< double > thresh, const int32_t maxBatchSize)
 
template<typename SrcWrapper , typename DstWrapper , typename Mat >
__global__ void warp_perspective (SrcWrapper input, DstWrapper output, Mat mat)
 
template<typename T , roccv::eSwizzle S, typename SrcWrapper , typename DstWrapper >
__global__ void yuv_to_rgb_or_bgr (SrcWrapper input, DstWrapper output, float delta)
 

Detailed Description

Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Function Documentation

◆ bilateral_filter()

template<typename T , typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::bilateral_filter ( SrcWrapper  input,
DstWrapper  output,
int  radius,
float  sigmaColor,
float  sigmaSpace,
float  spaceCoeff,
float  colorCoeff 
)

◆ binary_generic()

template<typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::binary_generic ( SrcWrapper  input,
DstWrapper  output,
roccv::GenericTensorWrapper< double >  thresh,
roccv::GenericTensorWrapper< double >  maxVal,
const int32_t  maxBatchSize 
)

◆ binary_inv_generic()

template<typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::binary_inv_generic ( SrcWrapper  input,
DstWrapper  output,
roccv::GenericTensorWrapper< double >  thresh,
roccv::GenericTensorWrapper< double >  maxVal,
const int32_t  maxBatchSize 
)

◆ bndbox_kernel()

template<bool has_alpha, typename T , typename SrcWrapper , typename DstWrapper , typename BT = detail::BaseType<T>>
__global__ void Kernels::Device::bndbox_kernel ( SrcWrapper  input,
DstWrapper  output,
Rect_t rects,
size_t  n_rects,
int64_t  batch,
int64_t  height,
int64_t  width 
)

◆ composite()

template<typename SrcWrapper , typename MaskWrapper , typename DstWrapper >
__global__ void Kernels::Device::composite ( SrcWrapper  foreground,
SrcWrapper  background,
MaskWrapper  mask,
DstWrapper  output 
)

◆ copy_make_border()

template<typename SrcDesc , typename DstDesc >
__global__ void Kernels::Device::copy_make_border ( SrcDesc  src,
DstDesc  dst,
int32_t  top,
int32_t  left 
)

GPU kernel for CopyMakeBorder operator.

Template Parameters
SrcDescMust be a BorderWrapper.
DstDescMust be a ImageWrapper.
Parameters
srcA BorderWrapper containing information for the input tensor.
dstA ImageWrapper containing information for the output tensor.
topThe top pixel coordinate on the y-axis where the border should start.
leftThe left-most pixel coordinate on the x-axis where the border should start.
Returns
global

◆ custom_crop()

template<typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::custom_crop ( SrcWrapper  input,
DstWrapper  output,
Box_t  cropRect 
)

◆ flip()

template<eAxis FlipType, typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::flip ( SrcWrapper  input,
DstWrapper  output 
)

◆ gamma_contrast()

template<typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::gamma_contrast ( SrcWrapper  input,
DstWrapper  output,
float  gamma 
)

◆ histogram_kernel() [1/2]

template<typename T , typename SrcWrapper , typename MaskWrapper >
__global__ void Kernels::Device::histogram_kernel ( SrcWrapper  input,
MaskWrapper  mask,
roccv::GenericTensorWrapper< T >  histogram 
)

◆ histogram_kernel() [2/2]

template<typename T , typename SrcWrapper >
__global__ void Kernels::Device::histogram_kernel ( SrcWrapper  input,
roccv::GenericTensorWrapper< T >  histogram 
)

◆ non_maximum_suppression()

__global__ void Kernels::Device::non_maximum_suppression ( roccv::GenericTensorWrapper< short4 >  input,
roccv::GenericTensorWrapper< uint8_t >  output,
roccv::GenericTensorWrapper< float >  scores,
int  numBoxes,
float  scoresThreshold,
float  iouThreshold 
)

◆ normalize()

template<bool ScaleStddev, typename SrcWrapper , typename DstWrapper , typename ScaleWrapper , typename BaseWrapper >
__global__ void Kernels::Device::normalize ( SrcWrapper  input,
BaseWrapper  base,
ScaleWrapper  scale,
DstWrapper  output,
float  globalScale,
float  shift,
float  epsilon 
)

◆ remap()

template<typename SrcWrapper , typename DstWrapper , typename MapWrapper >
__global__ void Kernels::Device::remap ( SrcWrapper  input,
DstWrapper  output,
MapWrapper  map 
)

◆ reorder()

template<typename T , roccv::eSwizzle S, typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::reorder ( SrcWrapper  input,
DstWrapper  output 
)

◆ resize()

template<typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::resize ( SrcWrapper  input,
DstWrapper  output,
float  scaleX,
float  scaleY 
)

◆ rgb_or_bgr_to_grayscale()

template<typename T , roccv::eSwizzle S, typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::rgb_or_bgr_to_grayscale ( SrcWrapper  input,
DstWrapper  output 
)

◆ rgb_or_bgr_to_yuv()

template<typename T , roccv::eSwizzle S, typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::rgb_or_bgr_to_yuv ( SrcWrapper  input,
DstWrapper  output,
float  delta 
)

◆ rotate()

template<typename SrcWrapper , typename DstWrapper , typename MatWrapper >
__global__ void Kernels::Device::rotate ( SrcWrapper  src,
DstWrapper  dst,
MatWrapper  affineMat 
)

◆ tozero_generic()

template<typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::tozero_generic ( SrcWrapper  input,
DstWrapper  output,
roccv::GenericTensorWrapper< double >  thresh,
const int32_t  maxBatchSize 
)

◆ tozeroinv_generic()

template<typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::tozeroinv_generic ( SrcWrapper  input,
DstWrapper  output,
roccv::GenericTensorWrapper< double >  thresh,
const int32_t  maxBatchSize 
)

◆ trunc_generic()

template<typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::trunc_generic ( SrcWrapper  input,
DstWrapper  output,
roccv::GenericTensorWrapper< double >  thresh,
const int32_t  maxBatchSize 
)

◆ warp_perspective()

template<typename SrcWrapper , typename DstWrapper , typename Mat >
__global__ void Kernels::Device::warp_perspective ( SrcWrapper  input,
DstWrapper  output,
Mat  mat 
)

◆ yuv_to_rgb_or_bgr()

template<typename T , roccv::eSwizzle S, typename SrcWrapper , typename DstWrapper >
__global__ void Kernels::Device::yuv_to_rgb_or_bgr ( SrcWrapper  input,
DstWrapper  output,
float  delta 
)