added C version of example02
This commit is contained in:
committed by
dhstlaur
parent
15d0ffaac2
commit
c8179b88a7
@@ -7,12 +7,18 @@ This code uses OpenCL 1.1 on a NVIDIA GPU.
|
||||
### Linux
|
||||
(Only tested on Ubuntu). For NVIDIA GPUs, I've installed the following packages: `nvidia-346 nvidia-346-dev nvidia-346-uvm nvidia-libopencl1-346 nvidia-modprobe nvidia-opencl-icd-346 nvidia-settings`. Since the `opencl-headers` package in the main repository is for OpenCL 1.2, you can get the OpenCL 1.1 header files from [here](http://packages.ubuntu.com/precise/opencl-headers).
|
||||
|
||||
Then to compile:
|
||||
Then to compile the C++ code:
|
||||
|
||||
```
|
||||
g++ -std=c++0x main.cpp -o main.out -lOpenCL
|
||||
```
|
||||
|
||||
To compile the C code:
|
||||
|
||||
```
|
||||
gcc main.c -o main.out -lOpenCL
|
||||
```
|
||||
|
||||
### OS X
|
||||
OpenCL is installed on OS X by default, but since this code uses the C++ bindings, you'll need to get that too. Get the [official C++ bindings from the OpenCL registr](https://www.khronos.org/registry/cl/api/1.1/cl.hpp) and copy it to the OpenCL framework directory, or do the following:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user