OpenCL 内联函数可以返回 OpenCL 类型吗?

发布于 2024-09-16 13:23:34 字数 109 浏览 4 评论 0原文

我知道 OpenCL 支持内联函数,但这些函数可以接受并返回 OpenCL 类型吗?

具体来说,我对带有此签名的东西感兴趣: float4 func(float4 x, float4 y)

I know OpenCL supports inline functions, but can those functions accept and return OpenCL types?

Specifically, I am interested in something with this signature:
float4 func(float4 x, float4 y)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

黯然 2024-09-23 13:23:34

是的,对于大多数 GPU,所有函数都是内联的,即使您没有指定它。

Yes, for most GPUs, all functions are inlined anyway, even if you don't specify it.

执笏见 2024-09-23 13:23:34

只有内核函数具有特定的返回类型,该返回类型为 void。任何其他函数都可以返回任何有效的 OpenCL 类型。

Only kernel functions has a specific return type which is void. Any other function can return any valid OpenCL type.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文