DE5a-Net OpenCL
www.terasic.com
March 29, 2017
16
2
2
.
.
6
6
C
C
o
o
m
m
p
p
i
i
l
l
e
e
a
a
n
n
d
d
T
T
e
e
s
s
t
t
O
O
p
p
e
e
n
n
C
C
L
L
P
P
r
r
o
o
j
j
e
e
c
c
t
t
This section will show how to compile and test OpenCL kernel and OpenCL Host Program for the
vector_add project. Developers can use the same procedures to compile and test other OpenCL
examples for DE5a-Net.
Compile OpenCL Kernel
The utility
aoc
(Altera SDK for OpenCL Kernel Compiler) is used to compile OpenCL ker
nel. In Command Prompt window,type “cd C:\intelFPGA_pro\16.1\hld\board\de5a_net_e1\tests\
vector_add” to go to
vector_add
project folder, then type “
aoc device\vector_add.cl -o bin\
vector_add.aocx --board de5a_net_e1
” to compile the OpenCL kernel. It will take about o
ne hour for compiling. When the compilation process is finished, OpenCL image file vector
_add.aocx is generated.
Figure 2-13
is the screenshot when OpenCL kernel is compiled su
ccessfully. For required parameters to compile vector_add.cl, please refer to the README.tx
t that is in the same folder as the vector_add.cl. For detailed usage of
aoc
, please refer to
the
Altera SDK for OpenCL Programming Guide
:
https://www.altera.com/en_US/pdfs/literature/hb/opencl-sdk/aocl_programming_guide.pdf
Figure 2-13 “aoc vector_add.cl” OpenCL kernel compile