Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix npp imgproc #50

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions bmf/hml/src/kernel/npp/imgproc.cu
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Tensor &yuv_to_rgb_cuda(Tensor &dst, const TensorList &src, PPixelFormat pformat

//[NOTE] batch call need copy NppiImageDescriptor to device
auto func = nppiYCbCr420ToRGB_8u_P3C3R_Ctx;
if(pformat == PixelFormat::I420){
if(pformat == PPixelFormat::I420){
func = nppiYUV420ToRGB_8u_P3C3R_Ctx;
}

Expand All @@ -52,12 +52,12 @@ Tensor &yuv_to_rgb_cuda(Tensor &dst, const TensorList &src, PPixelFormat pformat
}


TensorList &rgb_to_yuv_cuda(TensorList &dst, const Tensor &src, PixelFormat pformat, ChannelFormat cformat)
TensorList &rgb_to_yuv_cuda(TensorList &dst, const Tensor &src, PPixelFormat pformat, ChannelFormat cformat)
{
int width = src.size(2);
int height = src.size(1);

if(pformat == PixelFormat::H420 || pformat == PixelFormat::I420){
if(pformat == PPixelFormat::H420 || pformat == PPixelFormat::I420){
HMP_REQUIRE(dst.size() == 3, "rgbx_to_yuv_cuda: expect 3 planes, got {}", dst.size());
auto streamCtx = makeNppStreamContext();
auto batch = src.size(0);
Expand All @@ -74,7 +74,7 @@ TensorList &rgb_to_yuv_cuda(TensorList &dst, const Tensor &src, PixelFormat pfor

//[NOTE] batch call need copy NppiImageDescriptor to device
auto func = nppiRGBToYCbCr420_8u_C3P3R_Ctx;
if(pformat == PixelFormat::I420){
if(pformat == PPixelFormat::I420){
func = nppiRGBToYUV420_8u_C3P3R_Ctx;
}

Expand All @@ -93,7 +93,7 @@ TensorList &rgb_to_yuv_cuda(TensorList &dst, const Tensor &src, PixelFormat pfor


TensorList &yuv_resize_cuda(TensorList &dst, const TensorList &src,
PixelFormat format, ImageFilterMode mode)
PPixelFormat format, ImageFilterMode mode)
{
auto streamCtx = makeNppStreamContext();
auto batch = dst[0].size(0);
Expand All @@ -114,7 +114,7 @@ TensorList &yuv_resize_cuda(TensorList &dst, const TensorList &src,


TensorList &yuv_rotate_cuda(TensorList &dst, const TensorList &src,
PixelFormat format, ImageRotationMode rotate)
PPixelFormat format, ImageRotationMode rotate)
{
auto streamCtx = makeNppStreamContext();
auto batch = dst[0].size(0);
Expand All @@ -133,7 +133,7 @@ TensorList &yuv_rotate_cuda(TensorList &dst, const TensorList &src,
}

TensorList &yuv_mirror_cuda(TensorList &dst, const TensorList &src,
PixelFormat format, ImageAxis axis)
PPixelFormat format, ImageAxis axis)
{
auto streamCtx = makeNppStreamContext();
auto batch = dst[0].size(0);
Expand Down