Building the host application, Running the host application, Output from successful kernel execution – Altera RTE for OpenCL User Manual

Page 28: Building the host application -9, Running the host application -9, Output from successful kernel execution -9

Advertising
background image

Building the Host Application

Build the host executable with the

<path_to_exm_opencl_hello_world_x64_linux_<version>>/hello_world/

Makefile

file.

To build the host application, perform the following tasks:
1. Navigate to the

hello_world

directory.

2. 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_x64_linux_<version>>/hello_

world/bin

directory.

Running the Host Application

To execute the OpenCL kernel on the FPGA , run the Linux host application that you built from the

Makefile

.

1. Add the path

$ALTERAOCLSDKROOT/host/linux64/lib

to the LD_LIBRARY_PATH environment variable.

2. At a command prompt, navigate to the host executable within the

<path_to_exm_opencl_hello_world_x64_linux_<version>>/hello_world/bin

directory.

3. Invoke the

hello_world

executable.

The

hello_world

executable executes the kernel code on the FPGA.

Output from Successful Kernel Execution

When you run the host application to execute your OpenCL kernel on the target FPGA, the RTE 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>

Querying device for info:
========================
CL_DEVICE_NAME = <board_name> : <descriptive_board_name>
CL_DEVICE_VENDOR = <board_vendor_name>
CL_DEVICE_VENDOR_ID = <board_vendor_ID>
CL_DEVICE_VERSION = OpenCL 1.0 Altera SDK for OpenCL, Version <version>
CL_DRIVER_VERSION = <version>
CL_DEVICE_ADDRESS_BITS = 64
CL_DEVICE_AVAILABLE = true
CL_DEVICE_ENDIAN_LITTLE = true
CL_DEVICE_GLOBAL_MEM_CACHE_SIZE = 32768
CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE = 0
CL_DEVICE_GLOBAL_MEM_SIZE = 0
CL_DEVICE_IMAGE_SUPPORT = false
CL_DEVICE_LOCAL_MEM_SIZE = 16384
CL_DEVICE_MAX_CLOCK_FREQUENCY = 1000
CL_DEVICE_MAX_COMPUTE_UNITS = 1
CL_DEVICE_MAX_CONSTANT_ARGS = 8
CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 1073741824
CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = 3
CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = 1024

OCL005-15.0.0

2015.05.04

Building the Host Application

3-9

Getting Started with the Altera RTE for OpenCL for x86_64 Linux and 64-Bit Linux Big-Endian System

Altera Corporation

Send Feedback

Advertising