Hi JinGu, I'm not sure I understand.. VLAs are *not* supported in OpenCL. See Restrictions 6.9.d.
Thanks, Joey ________________________________________ From: [email protected] [[email protected]] On Behalf Of JinGu Kang [[email protected]] Sent: 29 November 2013 17:32 To: [email protected]; [email protected] Subject: Question about OpenCL language standard option Hi all, I got a error from a opencl test. The test code is as following: source code: __kernel void test_fn(__global uint *src, __global uint4 *results) { const size_t SIZE = 128; int tid = get_global_id(0); if (tid*4 >= SIZE) return; __private uint sPrivateStorage[SIZE]; for (size_t i=0 ; i<SIZE ; i++) sPrivateStorage[i] = src[i]; results[tid] = vload4(tid, sPrivateStorage); } and the error message is as following: "error: variable length arrays are not supported in OpenCL __private uint sPrivateStorage[SIZE];" The problem is that 'isArraySizeVLA' function calls 'VerifyIntegerConstantExpression' with 'S.LangOpts.GNUMode'. The OpenCL Language standard option does not have this option. It causes a error because 'AllowFold' is not set to 1. In order to fix this error, I think that we need to insert 'GNUMode' to OpenCL LANGSTANDARD or modify sligtly checking code. How do you feel about this? I can not guarantee the side effect of 'GNUMode' with OpenCL. I have attached a simple patch as reference. If there is something wrong, please let me know. Thanks, JinGu Kang -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590 ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782 _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
