{"action":"opened","issue":{"url":"https://api.github.com/repos/KhronosGroup/SPIR/issues/53","repository_url":"https://api.github.com/repos/KhronosGroup/SPIR","labels_url":"https://api.github.com/repos/KhronosGroup/SPIR/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIR/issues/53/comments","events_url":"https://api.github.com/repos/KhronosGroup/SPIR/issues/53/events","html_url":"https://github.com/KhronosGroup/SPIR/issues/53","id":182601574,"number":53,"title":"There is a bug of \"get_image_width\"","user":{"login":"ncybmh99","id":18584702,"avatar_url":"https://avatars.githubusercontent.com/u/18584702?v=3","gravatar_id":"","url":"https://api.github.com/users/ncybmh99","html_url":"https://github.com/ncybmh99","followers_url":"https://api.github.com/users/ncybmh99/followers","following_url":"https://api.github.com/users/ncybmh99/following{/other_user}","gists_url":"https://api.github.com/users/ncybmh99/gists{/gist_id}","starred_url":"https://api.github.com/users/ncybmh99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncybmh99/subscriptions","organizations_url":"https://api.github.com/users/ncybmh99/orgs","repos_url":"https://api.github.com/users/ncybmh99/repos","events_url":"https://api.github.com/users/ncybmh99/events{/privacy}","received_events_url":"https://api.github.com/users/ncybmh99/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-12T18:40:30Z","updated_at":"2016-10-12T18:40:30Z","closed_at":null,"body":"Given a 1.2 kernel as image.cl\r\n\r\n__kernel void testWriteui(__global uchar *src, write_only image2d_t dstimg)\r\n{\r\n    int    tid_x = get_global_id(0);\r\n    int    tid_y = get_global_id(1);\r\n    int    indx = tid_y * get_image_width(dstimg) + tid_x;\r\n    uint4       color;\r\n\r\n    indx *= 4;\r\n         color.x = (uint)src[indx+0];\r\n         color.y = (uint)src[indx+1];\r\n         color.z = (uint)src[indx+2];\r\n         color.w = (uint)src[indx+3];\r\n    write_imageui(dstimg, (int2)(tid_x, tid_y), color);\r\n\r\n}\r\n\r\nclang -cc1 -emit-spirv  -triple=spir-unknown-unknown -cl-std=CL1.2 -include opencl.h image.cl\r\n\r\n\r\nimage.cl:5:27: error: no matching function for call to 'get_image_width'\r\n    int    indx = tid_y * get_image_width(dstimg) + tid_x;\r\n                          ^~~~~~~~~~~~~~~\r\nopencl.h:15380:48: note: candidate function not viable: no known conversion from '__write_only image2d_t' to '__read_only image1d_t' for 1st argument\r\nint __const_func __attribute__((overloadable)) get_image_width(image1d_t image);\r\n                                               ^\r\nopencl.h:15381:48: note: candidate function not viable: no known conversion from '__write_only image2d_t' to '__read_only image1d_buffer_t' for 1st argument\r\nint __const_func __attribute__((overloadable)) get_image_width(image1d_buffer_t image);\r\n                                               ^\r\nopencl.h:15382:48: note: candidate function not viable: no known conversion from '__write_only image2d_t' to '__read_only image2d_t' for 1st argument\r\nint __const_func __attribute__((overloadable)) get_image_width(image2d_t image);\r\n                                               ^\r\nopencl.h:15383:48: note: candidate function not viable: no known conversion from '__write_only image2d_t' to '__read_only image3d_t' for 1st argument\r\nint __const_func __attribute__((overloadable)) get_image_width(image3d_t image);\r\n                                               ^\r\nopencl.h:15384:48: note: candidate function not viable: no known conversion from '__write_only image2d_t' to '__read_only image1d_array_t' for 1st argument\r\nint __const_func __attribute__((overloadable)) get_image_width(image1d_array_t image);\r\n                                               ^\r\nopencl.h:15385:48: note: candidate function not viable: no known conversion from '__write_only image2d_t' to '__read_only image2d_array_t' for 1st argument\r\nint __const_func __attribute__((overloadable)) get_image_width(image2d_array_t image);\r\n                                               ^\r\n1 error generated.\r\n\r\n\r\n\"get_image_width\" with a write_only image is valid, isn't it?"}}
{"actor":{"display_login":"ncybmh99"}}