如何强制 Apple 的 OpenCL 编译器重新编译缓存的内核?

发布于 2024-09-19 12:45:30 字数 490 浏览 1 评论 0原文

我想在我的 OpenCL 内核中使用 #include 语句,但 Apple 的 OpenCL 编译器似乎会缓存内核,因此,如果您更改包含文件的内容而不是执行包含操作的文件,则程序在运行之间不会更改。

我编写了一个示例来说明这一点: http://github.com/enjalot/adventures_in_opencl/tree/master/experiments /inc/

如果编译并运行,它应该可以正常工作。然后,如果您注释掉 inc.cl 中的结构定义,它仍然可以正常运行(或更改 lvl2.cl 中的任何内容)。

在 Ubuntu 上使用 NVIDIA 编译器,您将获得预期的行为。

那么有没有办法强制 clBuildProgram 重新编译内核呢?

I want to use #include statements in my OpenCL kernels but it appears Apple's OpenCL compiler caches kernels, so if you change the contents of an included file but not the file doing the including, the program will not change between runs.

I've coded up an example which illustrates this:
http://github.com/enjalot/adventures_in_opencl/tree/master/experiments/inc/

If you compile and run, it should work fine. Then if you comment out the struct definition in inc.cl it will still run just fine (or change anything in lvl2.cl)

Using the NVIDIA compiler on Ubuntu you get the expected behavior.

So is there someway to force clBuildProgram to recompile the kernel?

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

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

发布评论

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

评论(1

£噩梦荏苒 2024-09-26 12:45:30

我从[电子邮件受保护]邮件列表中得到了答复

sudo Killall cvmsServ

看起来不太优雅,但是哦好吧

I got an answer from the [email protected] mailing list

sudo killall cvmsServ

Doesn't seem very graceful, but oh well

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