[OpenCL] Turn on -fblocks by default for OpenCL 2.0

OpenCL 2.0 supports blocks as core feature. However, Clang does not turn on blocks support by default for OpenCL 2.0. An option -fblocks has to be used to turn on blocks.

Should this be changed?

Thanks.

Sam

Hi Sam,

Enabling blocks for OpenCL 2.0 by default makes sense to me.

I think it would be useful to define built-in vector types for OpenCL too. Right now they are defined in the header file.

I agree it is better to define the vector types and probably the size_t, ptrdiff_t, intptr_t, uintptr_t types in Clang instead of header file. This allows user to use these types without include the header.

I plan to work on that.

Thanks.

Sam

Yes, the blocks issue has to be sorted indeed.

I don’t feel strongly about the vector types as it’s rather useful than necessary to define them in Clang I think.

Thanks,

Anastasia

Those types are part of C99 too and it is rather common to define them in the header files. I wouldn’t overcomplicate Clang code with adding them unless there is a real benefit in that.

I think inclusion of headers is unavoidable anyways as we can’t add everything from CL libs into Clang directly without affecting it’s performance.

Also the headers will be hopefully committed upstream soon, and they can be used easily then.

Thanks,

Anastasia

I just hope we can commit the header file soon, but if it needs to be re-written using macros to represent all builtin functions for saving space, it could take several more weeks.

Sam

Replied to the review! I don’t think we should go for such change! :wink: