/* Call Sinc even for SincFast to get better precision on GPU
and to avoid thread divergence. Sinc is pretty fast on GPU anyway...*/
case SincWeightingFunction:
- case SincFastWeightingFunction:
+ case SincFastWeightingFunction:
return Sinc(x);
case CubicBCWeightingFunction:
return CubicBC(x,filterCoefficients);
)
-
- STRINGIFY(
- __kernel __attribute__((reqd_work_group_size(256, 1, 1)))
- void ResizeHorizontalFilterSinc(const __global CLPixelType* inputImage, const unsigned int inputColumns, const unsigned int inputRows, const unsigned int matte
- , const float xFactor, __global CLPixelType* filteredImage, const unsigned int filteredColumns, const unsigned int filteredRows
- , const int resizeFilterType, const int resizeWindowType
- , const __global float* resizeFilterCubicCoefficients
- , const float resizeFilterScale, const float resizeFilterSupport, const float resizeFilterWindowSupport, const float resizeFilterBlur
- , __local CLPixelType* inputImageCache, const int numCachedPixels, const unsigned int pixelPerWorkgroup, const unsigned int pixelChunkSize
- , __local float4* outputPixelCache, __local float* densityCache, __local float* gammaCache) {
-
- ResizeHorizontalFilter(inputImage,inputColumns,inputRows,matte
- ,xFactor, filteredImage, filteredColumns, filteredRows
- ,SincWeightingFunction, SincWeightingFunction
- ,resizeFilterCubicCoefficients
- ,resizeFilterScale, resizeFilterSupport, resizeFilterWindowSupport, resizeFilterBlur
- ,inputImageCache, numCachedPixels, pixelPerWorkgroup, pixelChunkSize
- ,outputPixelCache, densityCache, gammaCache);
-
- }
- )
-
-
STRINGIFY(
__kernel __attribute__((reqd_work_group_size(1, 256, 1)))
void ResizeVerticalFilter(const __global CLPixelType* inputImage, const unsigned int inputColumns, const unsigned int inputRows, const unsigned int matte
}
)
-
-
- STRINGIFY(
- __kernel __attribute__((reqd_work_group_size(1, 256, 1)))
- void ResizeVerticalFilterSinc(const __global CLPixelType* inputImage, const unsigned int inputColumns, const unsigned int inputRows, const unsigned int matte
- , const float yFactor, __global CLPixelType* filteredImage, const unsigned int filteredColumns, const unsigned int filteredRows
- , const int resizeFilterType, const int resizeWindowType
- , const __global float* resizeFilterCubicCoefficients
- , const float resizeFilterScale, const float resizeFilterSupport, const float resizeFilterWindowSupport, const float resizeFilterBlur
- , __local CLPixelType* inputImageCache, const int numCachedPixels, const unsigned int pixelPerWorkgroup, const unsigned int pixelChunkSize
- , __local float4* outputPixelCache, __local float* densityCache, __local float* gammaCache) {
- ResizeVerticalFilter(inputImage,inputColumns,inputRows,matte
- ,yFactor,filteredImage,filteredColumns,filteredRows
- ,SincWeightingFunction, SincWeightingFunction
- ,resizeFilterCubicCoefficients
- ,resizeFilterScale,resizeFilterSupport,resizeFilterWindowSupport,resizeFilterBlur
- ,inputImageCache,numCachedPixels,pixelPerWorkgroup,pixelChunkSize
- ,outputPixelCache,densityCache,gammaCache);
- }
- )
-
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
resizeFilterType = (int)GetResizeFilterWeightingType(resizeFilter);
resizeWindowType = (int)GetResizeFilterWindowWeightingType(resizeFilter);
-
- if (resizeFilterType == SincFastWeightingFunction
- && resizeWindowType == SincFastWeightingFunction)
- {
- horizontalKernel = AcquireOpenCLKernel(clEnv, MAGICK_OPENCL_ACCELERATE, "ResizeHorizontalFilterSinc");
- }
- else
- {
- horizontalKernel = AcquireOpenCLKernel(clEnv, MAGICK_OPENCL_ACCELERATE, "ResizeHorizontalFilter");
- }
+ horizontalKernel = AcquireOpenCLKernel(clEnv, MAGICK_OPENCL_ACCELERATE, "ResizeHorizontalFilter");
if (horizontalKernel == NULL)
{
(void) OpenCLThrowMagickException(exception, GetMagickModule(), ResourceLimitWarning, "AcquireOpenCLKernel failed.", "'%s'", ".");
resizeFilterType = (int)GetResizeFilterWeightingType(resizeFilter);
resizeWindowType = (int)GetResizeFilterWindowWeightingType(resizeFilter);
- if (resizeFilterType == SincFastWeightingFunction
- && resizeWindowType == SincFastWeightingFunction)
- verticalKernel = AcquireOpenCLKernel(clEnv, MAGICK_OPENCL_ACCELERATE, "ResizeVerticalFilterSinc");
- else
- verticalKernel = AcquireOpenCLKernel(clEnv, MAGICK_OPENCL_ACCELERATE, "ResizeVerticalFilter");
-
+ verticalKernel = AcquireOpenCLKernel(clEnv, MAGICK_OPENCL_ACCELERATE, "ResizeVerticalFilter");
if (verticalKernel == NULL)
{
(void) OpenCLThrowMagickException(exception, GetMagickModule(), ResourceLimitWarning, "AcquireOpenCLKernel failed.", "'%s'", ".");