gpt4 book ai didi

boolean - opencl支持 boolean 变量吗?

转载 作者:行者123 更新时间:2023-12-02 06:29:43 55 4
gpt4 key购买 nike

openCL 支持 boolean 变量吗?我目前正在使用 JOCL (java) 编写我的 openCL 调用代码,但我没有看到任何有关 boolean 值的信息。

最佳答案

tl;dr:是的,但您应该在内核函数签名中避免使用它。

是的;但 bool 的大小定义。因此,它没有关联的 API 类型(因为该值的大小应取决于设备)。

请参阅 OpenCL 1.1 规范的第 6.1.1 节“内置标量数据类型”,了解支持的标量类型列表。

来自第 6.8.k 节

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

关于boolean - opencl支持 boolean 变量吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4441280/

55 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com