Building the host application, Running the host application – Altera RTE for OpenCL User Manual

Page 51

Advertising
background image

Build your host application using the GNU Compiler Collection (GCC) cross-compiler available with the

SoC Embedded Design Suite (EDS).

Related Information

Creating the Hardware Configuration File of an OpenCL Kernel for SoC

Building the Host Application

Build your SoC-specific OpenCL host application using the GNU Compiler Collection (GCC) cross-

compiler available with the SoC Embedded Design Suite (EDS).

1. Perform the following tasks to download the hello_world design example.

a. Download the SoC-specific hello_world design example (<version> Arm32 Linux package (.tgz))

from the Hello World Design Example page within the Altera website.

b. Extract

exm_opencl_hello_world_arm32_linux_<version>.tar

to a location to which you have write

access.

c. Ensure that you set the environment variable AOCL_BOARD_PACKAGE_ROOT to point to the

Cyclone V SoC Development Kit Reference Platform (that is,

$ALTERAOCLSDKROOT/board/c5soc

).

2. At a command prompt, invoke the following command to set the PATH environment variable:

export PATH=<path_to_SoCEDS_installation_dir>/ds-5/sw/gcc/bin:$PATH

3. Navigate to the

<path_to_exm_opencl_hello_world_arm32_linux_<version>>/hello_world

directory.

4. Invoke the

make -f Makefile

command. Alternatively, you can simply invoke the

make

command.

The hello_world executable will be in the

<path_to_exm_opencl_hello_world_arm32_linux_<version>>/hello_

world/bin

directory.

Running the Host Application

To execute the

hello_world.aocx

Altera Offline Compiler Executable file on the SoC, run the host

application you built from the ARM-specific

Makefile

.

1. Log into your SoC board.

2. Copy the

hello_world.aocx

hardware configuration file and the hello_world host executable from the

<exm_opencl_hello_world_arm32_linux_<version>>/hello_world/bin

to the board.

3. Ensure that the LD_LIBRARY_PATH environment variable includes the

$ALTERAOCLSDKROOT/host/

arm32/lib

.

4. To execute the kernel on the SoC, at a command prompt, navigate to the host executable directory and

run the hello_world host executable.

Output from Successful Kernel Execution on the Cyclone V SoC Development Kit

When you run the host application to execute your OpenCL kernel on the Cyclone V SoC Development

Kit, the software notifies you of a successful kernel execution.
Example output:

Found 1 OpenCL platforms.

Querying platform for info:
==========================
CL_PLATFORM_NAME = Altera SDK for OpenCL
CL_PLATFORM_VENDOR = Altera Corporation
CL_PLATFORM_VERSION = OpenCL 1.0 Altera SDK for OpenCL, Version <version>

4-22

Building the Host Application

OCL005-15.0.0

2015.05.04

Altera Corporation

Getting Started with the Altera RTE for OpenCL for Altera ARMv7-A SoC

Send Feedback

Advertising