OpenCL compile on linux

徘徊边缘 提交于 2019-12-05 09:34:55

Install

The following steps have been tested on Ubuntu 12.04.

  1. Download the Intel SDK for Linux.
  2. Extract the RPM:

    $ tar zxvf intel_sdk_for_ocl_applications_2012_x64.tgz
    
  3. Convert to .deb and install:

    $ fakeroot alien --to-deb intel_ocl_sdk_2012_x64.rpm
    $ sudo dpkg -i intel-ocl-sdk_2.0-31361_amd64.deb
    
  4. Ensure that libOpenCL.so has been installed to /usr/lib/.

    $ sudo ln -s /usr/lib64/libOpenCL.so /usr/lib/libOpenCL.so
    $ sudo ldconfig
    

Compile

Simply link to the OpenCL library during compilation:

$ g++ main.cpp -lOpenCL
$ ./a.out
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!