KhronosGroup / webcl-validator

WebCL Validator
Other
38 stars 8 forks source link

WebCLAnalyser:handleVarDecl: global scope private variables are now collected #62

Closed eras closed 10 years ago

eras commented 10 years ago

Added also simple test case variable-global-scope.el.

eras commented 10 years ago

The comments were completely spot on, as I was probably seeing something that was originated from illegal code in the first place. This commit simply forbids globals that aren't in the constant address space.

It does also forbid 'const' globals. If they should be in the constant address space as well, then perhaps it should be done at some other level? Though I can easily see people wanting to declare constants that are not in constant address space, so both should be permitted :). I didn't find this subject handled by the OpenCL 1.1 standard.

The last patch reintroduces a change that should've come with "WebCLTransformer::rewriteOrForwardSamplerArgument: CLK_ADDRESS_NONE is not a valid address" but for some reason didn't.

elhigu commented 10 years ago

Probably it was my fault that CLK_ADDRESS_NONE fix went missing while I fixed one merge conflict earlier. This commit looks good now.