/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/kernels/device/remap_device.hpp Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/kernels/device/remap_device.hpp Source File#

2 min read time

Applies to Linux

rocCV: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/kernels/device/remap_device.hpp Source File
remap_device.hpp
Go to the documentation of this file.
1 
22 #pragma once
23 
24 #include <hip/hip_runtime.h>
25 
26 #include "operator_types.h"
27 
28 namespace Kernels {
29 namespace Device {
30 template <typename SrcWrapper, typename DstWrapper, typename MapWrapper>
31 __global__ void remap(SrcWrapper input, DstWrapper output, MapWrapper map) {
32  const int x = blockDim.x * blockIdx.x + threadIdx.x;
33  const int y = blockDim.y * blockIdx.y + threadIdx.y;
34  const int b = blockIdx.z;
35 
36  if (x >= output.width() || y >= output.height()) return;
37 
38  float2 mapCoordinates = map.at(b, y, x, 0);
39  output.at(b, y, x, 0) = input.at(b, mapCoordinates.y, mapCoordinates.x, 0);
40 }
41 }; // namespace Device
42 }; // namespace Kernels
__global__ void remap(SrcWrapper input, DstWrapper output, MapWrapper map)
Definition: remap_device.hpp:31
Definition: non_max_suppression_helpers.hpp:26