开发者

Setting up emacs with openCL

开发者 https://www.devze.com 2023-03-16 05:47 出处:网络
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 teamm

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

精彩评论

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

关注公众号