开发者

Setting up emacs with openCL

What steps are needed to get a simple OpenCL enabled program to co开发者_运维知识库mpile and run using emacs? We're developing with the C++ bindings right now and I have never used emacs but my teammate is very fond of it.

I just need to know how to set up the linker with ATI Stream SDK and basic OpenCL C++ bindings. The actual coding is not the problem.


OpenCL doesn't change anything about the C/C++ project, you can use any build system you would otherwise use (vanilla Makefiles, autotools, cmake, etc).

For .cl files I have this in my .emacs:

(setq auto-mode-alist (cons '("\.cl$" . c-mode) auto-mode-alist))

...which forces Emacs to treat them as C files.

I just need to know how to set up the linker with ATI Stream SDK and basic OpenCL C++ bindings.

You need to #include <CL/cl.hpp> and to pass -lOpenCL to the linker, that's all.


Care trying to make this more precise? OpenCL programs (kernels) are usually compiled using the API calls from a program written in C or C++. Running the program, as well as transferring data back and forth to the memory of the host program, are likewise handled through the API.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜