mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
[Fix] Apply kernel loop for bicubic interpolate (#271)
This commit is contained in:
parent
c213879103
commit
d5c3be9739
@ -89,10 +89,7 @@ __global__ void resize_cubic_kernel_torch(const int num_elements, const scalar_t
|
|||||||
int srcHeight, scalar_t *dst, int dstWidth, int dstHeight,
|
int srcHeight, scalar_t *dst, int dstWidth, int dstHeight,
|
||||||
bool align_corners, float height_scale,
|
bool align_corners, float height_scale,
|
||||||
float width_scale) {
|
float width_scale) {
|
||||||
int index = threadIdx.x + blockIdx.x * blockDim.x;
|
CUDA_1D_KERNEL_LOOP(index, num_elements) {
|
||||||
if (index >= num_elements) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Special case: input and output are the same size, just copy
|
// Special case: input and output are the same size, just copy
|
||||||
const int output_x = index % dstWidth;
|
const int output_x = index % dstWidth;
|
||||||
const int output_y = index / dstWidth;
|
const int output_y = index / dstWidth;
|
||||||
@ -141,6 +138,7 @@ __global__ void resize_cubic_kernel_torch(const int num_elements, const scalar_t
|
|||||||
coefficients[3], t_y));
|
coefficients[3], t_y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename scalar_t>
|
template <typename scalar_t>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user