【问题标题】:nvidia driver differences 275.50 and 280.19 for GTX480 GPU in opencl resamplingopencl 重采样中 GTX480 GPU 的 nvidia 驱动程序差异 275.50 和 280.19
【发布时间】:2012-10-13 09:59:45
【问题描述】:

使用 Nvidia GTX480 GPU 的驱动程序版本 275.50 和 280.19 对图像重新采样后,灰度值几乎没有变化。也许这是一个插值问题。除了实施 OpenCL 1.1 版之外,我无法确定新版本中发生了什么变化。仅使用 OpenCL 1.0 会在灰度值上产生相同的微小变化。

下面是在驱动程序版本 275.50 和 280.19 之间给出不同结果的代码:

success oclInitImgData(struct _Image2d *image)
{
cl_image_format volume_format;
volume_format.image_channel_order       = CL_R;
volume_format.image_channel_data_type   = CL_UNORM_INT16;

size = len[0] * sizeof(unsigned short);
img_h = clCreateImage2D(Ocl._GPUContext, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,
    &volume_format, len[0], len[1], size, data, &error);

resampledImg_h = clCreateBuffer(Ocl._GPUContext, CL_MEM_READ_WRITE, size, NULL, &error);
oclResampleImg(Ocl._GPUCommandQueue[posSet], Ocl._pGPUKernels[posSet][K_IMG_RESAMPLE], img_h, resampledImg_h , Size, PixelSize, mm_per_p, vm_h);
}

__kernel void resampleImage( __read_only image2d_t IN image, __global uint OUT *resampledImage)
    {
//get resampled position
int2 posResampledImg = (int2)(get_global_id(0), get_global_id(1));

//get dimension of the image
int2 imageSize = get_image_dim(image);

//calulate image size in mm
float2 imageSizemm = convert_float2(imageSize)*imagePixelSize;
float2 posImg = (posResampledImgmm + (imageSizemm*0.5f));
float2 posImgnorm = posImg/imageSizemm;
int2 posImgpix = convert_int2(posImg/imagePixelSize);

uint sample = 0;
if(read_imageui(image, CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST, posImgpix).x == 1)
{
    //get grey value and store it in the resampled image
    sample = read_imagef(image, CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_CLAMP | CLK_FILTER_LINEAR, posImgnorm).x * 65535.0f;
}
resampledImg[posResampledImg.y*convert_int(imageSizeResampled.x)+posResampledImg.x] = sample;
}

【问题讨论】:

    标签: driver opencl gpu resampling


    【解决方案1】:

    要获得有用的结果,您应该:

    (1) 了解 OpenCL 规范是否涵盖了行为差异。

    (2) 如果是,创建一个测试用例来演示它

    (3) 向 Nvidia 提交错误报告

    (4) ???

    (5) 利润

    我不明白这里的人们如何在步骤 1-5 之外为您提供帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-16
      • 1970-01-01
      • 2020-03-05
      • 2019-06-15
      • 1970-01-01
      • 2012-05-09
      • 1970-01-01
      相关资源
      最近更新 更多