OpenCL 代码可以在 Linux 上编译,但不能在 Windows 上编译

发布于 2024-09-11 03:38:25 字数 644 浏览 0 评论 0原文

我最近在 Linux 上编写了一些 OpenCL 代码(ubuntu 10.4、ati Catalyst 10.4 和 ati sdk v2.1),并且它在 Linux 上运行得很好。

当我想在 Windows 上运行我的代码时,我收到程序构建错误,抱怨

“此声明没有存储类或类型说明符”

,然后“全局变量必须在 addrSapce 常量中声明”,

即使有一个 void 内核也不起作用,天哪,我评论了代码,但它仍然给出了相同的错误,哈哈!

很奇怪,样本 r 工作得很好。当我将代码复制到示例项目中时,它给出了相同的错误。

我正在使用 Windows 7 32 位、ati Stream sdk v2.1 和 v10.6 驱动程序(因为我在任何地方都找不到适用于 Windows 的 10.4,这很遗憾,因为 10.6 不能保证支持 OpenCL,方式去 amd 哈哈!)

我把所有的内核都切掉了,只留下了这个,我仍然遇到同样的错误,这是

__kernel void set_float( __global float* buff ,
                                   float v) { 
            buff[get_global_id(0)]=v;
}

i've been writing some OpenCL code lately on linux (ubuntu 10.4, ati catalyst 10.4 and ati sdk v2.1) and its working great on linux.

When i wanted to run my code on windows, i got program build errors complaining about

"this declaration has no storage class or type specifier"

and then "global variable must be declared in addrSapce constant"

even having a void kernel doesn't do, hell i commented the code and it still gave same errors lol!

weird enough that samples r working just fine. when i copied my code into the samples projects, it gave same errors.

i'm using windows 7 32-bit, ati stream sdk v2.1 and v10.6 drivers (cause i couldn't find the 10.4 for windows anywhere, which is sad since 10.6 doesn't have a guarantee to support OpenCL, way to go amd lol! )

i cut all the kernels out and left just this one, i still got same errors, here it is

__kernel void set_float( __global float* buff ,
                                   float v) { 
            buff[get_global_id(0)]=v;
}

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

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

发布评论

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

评论(2

蓝眼睛不忧郁 2024-09-18 03:38:25

伙计,无论你被绳子咬了多少次,你都永远学不会。

这只是一个非空终止的字符串问题哈哈。

Man, no matter how many times u get bitten by strings, one never learns.

It was just a non-null terminated string problem lol.

娇纵 2024-09-18 03:38:25

它对我有用(使用 AMD Stream Kernel Analyzer 成功编译)。在 Win7 64 位上,sdk v2.1 和 v10.6 驱动程序。不过你的格式太糟糕了。

It works for me (successfully compiled using AMD Stream Kernel Analyzer). On Win7 64-bit, sdk v2.1 and v10.6 drivers. Your formatting is horrible though.

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