2012-10-23 20 views
11

lấy lại hình ảnh với phiên bản trình điều khiển 275,50 và 280,19 cho GPU Nvidia GTX480 cho ít thay đổi về giá trị màu xám. Có lẽ nó là một vấn đề nội suy. Tôi không thể xác định những gì đã thay đổi trong phiên bản mới, ngoại trừ việc thực hiện OpenCL phiên bản 1.1. Chỉ sử dụng OpenCL 1.0 cho những thay đổi nhỏ trong giá trị màu xám.Sự khác biệt về trình điều khiển nvidia 275,50 và 280,19 cho GPU GTX480 trong việc lấy lại mã vạch

Trong sau đó là mã mà cho kết quả khác nhau betwenn phiên bản driver 275,50 và 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; 
} 
+2

Câu hỏi là gì? – tripleee

Trả lời

1

Để có được một kết quả hữu ích bạn nên:

(từ 1) Hiểu nếu sự khác biệt trong hành vi là được đề cập trong thông số kỹ thuật OpenCL.

(2) Nếu có, hãy tạo ra một testcase đó chứng tỏ nó

(3) Nộp báo cáo lỗi với Nvidia

(4) ???

(5) Lợi nhuận

Tôi không thấy như thế nào người dân nơi đây có thể giúp bạn vượt qua bước 1-5.