English 中文(简体)
What s the perror() equivalent for error codes in OpenCL?
原标题:

If I have something like:

err = clEnqueueReadBuffer(cmdQueue, output, CL_TRUE, 0, sizeof(float) * data_sz, &results, 0, NULL, NULL);

I d like to do:

if (err != CL_SUCCESS){
    perror("Read Failed!");
}

But the error constants like "CL_HOST_OUT_OF_MEMORY" and the like are (understandably) not known to perror().

I could go around grepping the .h files associated with opencl, but that is not an ideal solution. I m open to any other convenient ways of tracking down the error numbers. I m on OSX Snow Leopard (Including that just in case, but I don t think it s relevant)

最佳回答

If you have the NVIDIA OpenCL SDK then you could use the oclErrorString() function provided by oclUtils.

问题回答

There is none currently. I ended up writing my own, in the style of gluErrorString(). I just pasted all the cl_error codes into a file and processed each line in Emacs to convert it into a bunch of cases inside a switch statement (to allow for discontiguous entries) that return constant strings. It was pretty easy, and quite useful. I can post it somewhere if you like.





相关问题
Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Asp.Net MVC - Problem returning a model to the view

I ve recently started using the Areas functionality of the Preview2 and it was working ok until I needed to return a Model to the view. Controller: public ActionResult ForgotPassword() { return ...

Unable to generate PDB files in Visual Studio 2005

For most assemblies, I m able to generate their respective .pdb files. However, I ve got one project that isn t generating their .pdb files. I ve made sure that it on debug mode and that the project ...

热门标签