是否支持OpenCL的布尔变量? [英] Does opencl support boolean variables?
问题描述
是否支持OpenCL的布尔变量?我目前使用JOCL(Java)来写我的OpenCL调用code和我没有看到任何布尔
Does openCL support boolean variables? I am currently using JOCL (java) to write my openCL calling code and I don't see anything about booleans.
推荐答案
是的;但一个布尔值的大小的不的定义。因此,它并没有相关的API类型(如什么尺寸的值应是依赖于设备)。
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).
请参阅第6.1.1节内置的OpenCL 1.1规范的标量数据类型支持的标量类型的列表。
See section 6.1.1 Built-in Scalar Data Type of the OpenCL 1.1 specification for a list of supported scalar types.
这部分6.8.k
参数来__kernel在一个程序功能不能与内置声明
标量类型BOOL,一半,为size_t,ptrdiff_t的,使用intptr_t和uintptr_t形式提供。该
大小在这些类型的字节除一半实现定义,此外可以
也有对OpenCL设备和主机处理器使得难以不同
分配缓冲区对象被作为参数传递给声明为指针,这些内核
类型
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
这篇关于是否支持OpenCL的布尔变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!