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

BGR Inputs Into launchTensorNormMean Throw "cudaErrorInvalidValue" Despite Being Supported #1867

Open
eandert opened this issue Jun 19, 2024 · 0 comments

Comments

@eandert
Copy link

eandert commented Jun 19, 2024

if( format == IMAGE_RGB8 )
gpuTensorNormMean<uchar3, isBGR><<<gridDim, blockDim, 0, stream>>>((uchar3*)input, inputWidth, output, outputWidth, outputHeight, channelStride, scale, multiplier, range.x, mean, stdDev);
else if( format == IMAGE_RGBA8 )
gpuTensorNormMean<uchar4, isBGR><<<gridDim, blockDim, 0, stream>>>((uchar4*)input, inputWidth, output, outputWidth, outputHeight, channelStride, scale, multiplier, range.x, mean, stdDev);
else if( format == IMAGE_RGB32F )
gpuTensorNormMean<float3, isBGR><<<gridDim, blockDim, 0, stream>>>((float3*)input, inputWidth, output, outputWidth, outputHeight, channelStride, scale, multiplier, range.x, mean, stdDev);
else if( format == IMAGE_RGBA32F )
gpuTensorNormMean<float4, isBGR><<<gridDim, blockDim, 0, stream>>>((float4*)input, inputWidth, output, outputWidth, outputHeight, channelStride, scale, multiplier, range.x, mean, stdDev);
else
return cudaErrorInvalidValue;

I was able to fix and verify that BGR8 works great on my local build by changing the if statement from
if( format == IMAGE_RGB8 )
to instead be
if( format == IMAGE_RGB8 || format == IMAGE_BGR8 )

I assume this could be done for the other BGR color formats as well. The CUDA template supports isBGR = True already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant