“编译服务器错误".在构建OpenCL内核时 [英] "Compile Server Error." while building OpenCL kernels

查看:72
本文介绍了“编译服务器错误".在构建OpenCL内核时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在OS X上编译OpenCL内核.只有几行时,一切正常.但是,代码超过1.5k行之后,带有CL_PROGRAM_BUILD_LOG标志的clGetProgramBuildInfo返回编译服务器错误".每次.我用谷歌搜索,但一无所获.有人可以帮我吗?

I am trying to compile OpenCL kernels on OS X. Everything is ok when there are just a few lines. However, after the code grows over 1.5k lines, clGetProgramBuildInfo with CL_PROGRAM_BUILD_LOG flag returned "Compile Server Error." every time. I googled but found nothing about it. Could anyone help me?

推荐答案

您可以通过在cl.h中进行搜索来了解OpenCL错误代码的含义.在这种情况下,-11就是您所期望的CL_BUILD_PROGRAM_FAILURE.生成日志为空当然很好奇.两个问题:

You can learn the meaning of OpenCL error codes by searching in cl.h. In this case, -11 is just what you'd expect, CL_BUILD_PROGRAM_FAILURE. It's certainly curious that the build log is empty. Two questions:

1.)clGetProgramBuildInfo的返回值是什么?

1.) What is the return value from clGetProgramBuildInfo?

2.)您在什么平台上?如果使用的是Apple的OpenCL实现,则可以尝试在您的环境中设置CL_LOG_ERRORS = stdout.例如,从终端:

2.) What platform are you on? If you are using Apple's OpenCL implementation, you could try setting CL_LOG_ERRORS=stdout in your environment. For example, from Terminal:

$ CL_LOG_ERRORS = stdout ./myprog

$ CL_LOG_ERRORS=stdout ./myprog

在Xcode(编辑方案->参数->环境变量)中进行设置也很容易.

It's also pretty easy to set this in Xcode (Edit Scheme -> Arguments -> Environment Variables).

请找到原始答案通过@James

Please find the original answer by @James

这篇关于“编译服务器错误".在构建OpenCL内核时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆