Does opencl support boolean variables?

梦想与她 提交于 2019-12-05 03:35:40

Yes; but the size of a bool is not defined. Therefore, it does not have an associated API type (as what size the value should be is device dependent).

See section 6.1.1 Built-in Scalar Data Type of the OpenCL 1.1 specification for a list of supported scalar types.

From Section 6.8.k

Arguments to __kernel functions in a program cannot be declared with the built-in scalar types bool, half, size_t, ptrdiff_t, intptr_t, and uintptr_t. The size in bytes of these types except half are implementation-defined and in addition can also be different for the OpenCL device and the host processor making it difficult to allocate buffer objects to be passed as arguments to a kernel declared as pointer to these type

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!