Aocl Getting Started

17
Altera SDK for OpenCL Getting Started Guide 101 Innovation Drive San Jose, CA 95134 www.altera.com OCL001-13.1.1 2013.12.13 Subscribe Send Feedback

description

Aocl Getting Started

Transcript of Aocl Getting Started

Page 2: Aocl Getting Started

Contents

Altera SDK for OpenCL Getting Started Guide.................................................1-1About Altera SDK for OpenCL Getting Started Guide..........................................................................1-1Prerequisites..................................................................................................................................................1-1Overview of the AOCL Setup Process.......................................................................................................1-2Downloading the Software.........................................................................................................................1-4Installing the AOCL and the Quartus II Software Together..................................................................1-5Setting Up the AOCL as a Stand-Alone Software...................................................................................1-5

Installing and Uninstalling the AOCL on Windows..................................................................1-5Installing and Uninstalling the AOCL on Linux.........................................................................1-6

Installing an FPGA Board...........................................................................................................................1-7Creating the FPGA Hardware Configuration File of an OpenCL Kernel............................................1-8Updating the Hardware Image on the FPGA..........................................................................................1-9

Programming the Flash Memory of an FPGA.............................................................................1-9Setting Up the Host Application..............................................................................................................1-10

Building and Running the Host Application on Windows......................................................1-11Building and Running the Host Application on Linux............................................................1-11AOC Output from Successful Kernel Execution.......................................................................1-12

Conclusion..................................................................................................................................................1-13Document Revision History.....................................................................................................................1-13

Altera Corporation

Altera SDK for OpenCLGetting Started GuideTOC-2

Page 3: Aocl Getting Started

1Altera SDK for OpenCL Getting Started Guide

2013.12.13

OCL001-13.1.1 Subscribe Send Feedback

About Altera SDK for OpenCL Getting Started GuideTheAltera Software Development Kit (SDK) for OpenCL Getting Started Guide describes the procedures youfollow to install the Altera SDK forOpenCL (AOCL) version 13.1. This document also contains instructionson how to compile an example OpenCL(1) application with the AOCL(2).

OpenCL is a C-based open standard for the programming of heterogeneous parallel devices. The AOCLprovides a compiler and tools for you to build and run OpenCL applications that target Altera fieldprogrammable gate arrays (FPGAs).

The AOCL supports the embedded profile of the OpenCL Specification version 1.0.Note:

Related Information

• OpenCL Reference PagesRefer to the OpenCL Reference Pages for more information on the OpenCL Specification verison 1.0.

• OpenCL Specification version 1.0Refer to the OpenCL Specification version 1.0 for detailed information on the OpenCL applicationprogramming interface (API) and programming language.

PrerequisitesTo install the AOCL and create an OpenCL application for an Altera preferred FPGA board, your systemmust meet certain hardware, operating system (OS), and software requirements.

(1) OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission of the Khronos Group™.(2) The Altera SDK for OpenCL is based on a published Khronos Specification, and has passed the Khronos

Conformance Testing Process. Current conformance status can be found at www.khronos.org/conformance.

ISO9001:2008Registered

© 2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX wordsand logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All otherwords and logos identified as trademarks or service marks are the property of their respective holders as described atwww.altera.com/common/legal.html. Altera warrants performance of its semiconductor products to current specifications in accordance withAltera's standard warranty, but reserves the right to make changes to any products and services at any time without notice. Altera assumesno responsibility or liability arising out of the application or use of any information, product, or service described herein except as expresslyagreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any publishedinformation and before placing orders for products or services.

www.altera.com

101 Innovation Drive, San Jose, CA 95134

Page 4: Aocl Getting Started

Host System Requirements

To install an Altera preferred FPGA board, the host system must meet the following minimum hardwareand OS requirements:

• The preferred accelerator board contains Stratix®

V FPGAs.

• The host system has at least 24 gigabytes (GB) of RAM.

• The host system must be running a 64-bit OS. Any binaries that your system builds must be 64-bitexecutables.

The AOCL supports the following OS:

• Microsoft 64-bit Windows 7.• Red Hat Enterprise 64-bit Linux (RHEL) 5.6.

You must install the Linux OS kernel source and headers, and the GNU CompilerCollection (GCC).

Important:

You must have administrator privileges on the host system to install the necessary packagesand drivers.

Caution:

• The host machine motherboard must have at least one eight-lane PCI Express® port (PCIe® x8). If aneight-lane port is not available, you may use a sixteen-lane (PCIe x16) port.

Software Prerequisites

Ensure that the version of your C compiler or software development environment is compatible with thecurrent version of the AOCL and Quartus

®II software.

Build your host executable code using the following C compiler or software development environment:

• For Windows systems, use Microsoft Visual Studio verison 2010 Professional.• For Linux systems, use the C compiler included with the GCC.

Overview of the AOCL Setup ProcessThe AOCL Getting Started Guide outlines the procedures for installing the AOCL and programming yourFPGA.

The figure below summarizes the steps for setting up the necessary software and installing the FPGA board.

Altera SDK for OpenCL Getting Started GuideAltera Corporation

Send Feedback

OCL001-13.1.1Overview of the AOCL Setup Process1-2 2013.12.13

Page 5: Aocl Getting Started

Figure 1-1: AOCL Installation Process Overview

Review prerequisites

Download installer(Quartus II software

Stratix V device support, AOCL)

Install Quartus II software,Stratix V device support,

AOCL

Install FPGA board(aocl install)

HW, SW, OSprereq satisfied?

Acquire prerequisiteHW, SW, OS

aoc executableruns?

aocldiagnostic =

PASSED?

NO

YES

NO YES

NO

YES

Run hello_worldon FPGA

Legend

Action

Decision

After you complete the initial software and hardware setup successfully, you can create a hardware imagefrom the hello_world example OpenCL application. Before you program your FPGA with the hardwareimage, ensure that your FPGA contains an image created using a current version of the AOCL.

The figure below summarizes the steps you perform to program your FPGA.

Altera CorporationAltera SDK for OpenCL Getting Started Guide

Send Feedback

1-3Overview of the AOCL Setup ProcessOCL001-13.1.12013.12.13

Page 6: Aocl Getting Started

Figure 1-2: FPGA Programming Overview

Extract hello_worldOpenCL example

Buildhost application

Run host application(host.exe)

Check setting ofAOCL_BOARD_PACKAGE_ROOT

Select target FPGA board(aoc --list-boards)

Compile kernel for target board(aoc -v --board <board_name> hello_world.cl)

hello_world.aoco

hello_world.aocx

Build successful?NO

YES

Legend

Action

Decision

File

FPGA imagefrom current ACDS

version?

NO

Program FPGAflash memory

YES

Downloading the SoftwareYou can download the Quartus II software version 13.1, the Stratix V device support, and the AOCL version13.1 from the Download Center of the Altera website.

To download the AOCL and all related software, perform the following tasks:

1. On the main page of the Altera website, click myAltera to log on to your myAltera account.If you do not have a myAltera account, follow the instructions on the page to create one.

2. Click Download Center.3. Select to download the Subscription Edition of the Quartus II software.4. Select the OS (that is, Windows or Linux).

Altera SDK for OpenCL Getting Started GuideAltera Corporation

Send Feedback

OCL001-13.1.1Downloading the Software1-4 2013.12.13

Page 7: Aocl Getting Started

5. If you install the AOCL as part of the Quartus II software, perform the following steps:a. Under the Individual Files tab, select to download the Quartus II software package and the Stratix V

device support.b. Under the Additional Software tab, select to download the Altera SDK for OpenCL.The Quartus II software installer installs the Quartus II software, the Stratix V device support, and theAOCL.

6. If you install theAOCL as a standalone software, only select theAltera SDK forOpenCL underAdditionalSoftware.The AOCL installer installs the AOCL without the Quartus II software and the Stratix V device support.

7. Perform the steps outlined in the download and installation instructions on the download page.

Installing the AOCL and the Quartus II Software TogetherIf you download the AOCL, the Quartus II software, and the Stratix V device support together, you caninstall the AOCL and the Stratix V device support as part of the Quartus II software.

1. Run the QuartusSetup installer, and follow the installation instructions in theAltera Software Installationand Licensing Manual.a. For Windows systems, run the QuartusSetup-<version>.exe file.b. For Linux systems, run the QuartusSetup-<version>.run file.

2. The Quartus II software installer sets the environment variable ALTERAOCLSDKROOT. Ensure thatALTERAOCLSDKROOT points to the current version of the AOCL.

Refer to the Altera Software Installation and Licensing Manual for licensing and uninstallation instructionsof the Quartus II software, the Stratix V device support, and the AOCL.

Related InformationAltera Software Installation and Licensing Manual

Setting Up the AOCL as a Stand-Alone SoftwareThe installation procedure for the AOCL is OS-specific.

You must install the Quartus II software and the Stratix V device support before installing theAOCL.

Caution:

Installing and Uninstalling the AOCL on Windows on page 1-5

Installing and Uninstalling the AOCL on Linux on page 1-6

Installing and Uninstalling the AOCL on Windows

Installing the AOCLTo install the AOCL on Windows, you must install it in an appropriate folder, and set all the necessaryenvironment variables.

Altera CorporationAltera SDK for OpenCL Getting Started Guide

Send Feedback

1-5Installing the AOCL and the Quartus II Software TogetherOCL001-13.1.12013.12.13

Page 8: Aocl Getting Started

Before you begin

You must have administrator privileges.Attention:

1. Direct the installer AOCLSetup-<version>.exe to extract the AOCL to an empty folder that you own, nota system folder (for example, C:\altera\<version>\hld).

The path must not contain any spaces.Caution:

2. Verify that the environment variables listed below are set.

Path AddedEnvironment Variable

Environment variables set by the installer:

<path_to_hld>, which is the absolute path to the folder containing theextracted installation package

ALTERAOCLSDKROOT

Environment variables you must set manually:

%ALTERAOCLSDKROOT%\binPATH

all the necessary license.dat filesLM_LICENSE_FILE

3. Verify the successful installation of the AOCL by performing the following tasks:a. Run the cmd.exe executable.b. Type the where aoc command. If the path to the aoc.exe file is not returned, installation was

unsuccessful.If installation was unsuccessful, reinstall the AOCL.

Uninstalling the AOCLTo uninstall the AOCL on Windows, you must run the uninstaller, and modify the PATH andALTERAOCLSDKROOT environment variables.

1. From theWindows StartMenu shortcut, navigate to the Altera <version>\Altera SDK for OpenCL <version>folder.

2. Run Uninstall Altera SDK for OpenCL <version>.3. Remove the following paths from the PATH environment variable:

a. %ALTERAOCLSDKROOT%\bin

b. %ALTERAOCLSDKROOT%\host\windows64\bin

4. Remove the ALTERAOCLSDKROOT environment variable.

Installing and Uninstalling the AOCL on Linux

Installing the AOCLTo install the AOCL on Linux, you must install it in an appropriate directory, and set all the necessaryenvironment variables.

Before you begin

You must have sudo or root privileges.Attention:

Altera SDK for OpenCL Getting Started GuideAltera Corporation

Send Feedback

OCL001-13.1.1Uninstalling the AOCL1-6 2013.12.13

Page 9: Aocl Getting Started

1. Direct the installer AOCLSetup-<version>.run to extract the AOCL to an empty directory that you own,not a system directory (for example, /usr/altera/<version>/hld).

The path must not contain any spaces.Caution:

2. Verify that the environment variables listed below are set.

Path AddedEnvironment Variable

Environment variables set by the installer:

<path_to_hld>, which is the absolute path to the directory containingthe extracted installation package

ALTERAOCLSDKROOT

Environment variables you must set manually:

$ALTERAOCLSDKROOT/binPATH

all the necessary license.dat filesLM_LICENSE_FILE

If you install the AOCL on a system that does not contain any C Shell Resource file (.cshrc) orBash Resource file (.bashrc) in your directory, you must set the environment variables

Warning:

ALTERAOCLSDKROOT andPATHmanually. Alternatively, youmay create the .cshrc and .bashrcfiles, and then append the environment variables to them. To ensure that the updates take effect,restart your terminal after you set the environment variables.

Uninstalling the AOCLTo uninstall the AOCL on Linux, you must run the uninstaller, and modify the PATH andALTERAOCLSDKROOT environment variables.

1. Run the aocl-<version>-uninstall.run program located in the <install directory>/uninstall directory.2. Remove $ALTERAOCLSDKROOT/bin from the PATH environment variable.3. Remove $ALTERAOCLSDKROOT/host/linux64/lib from the LD_LIBRARY_PATH environment variable.4. Remove the ALTERAOCLSDKROOT environment variable.

Installing an FPGA BoardFor the AOCL to target your FPGA board, you must download and install the board package for your FPGAboard from your board vendor.

Before you begin

You must have administrator privileges.Attention:

To install an Altera preferred FPGA board, perform the following tasks:

1. Follow your board vendor's instructions to connect the FPGA board to your system.2. Download the Altera Preferred Board Partner Program (APBPP) board package for your FPGA board

from your board vendor's website.3. Install the board package in a local folder or directory (for example,

ALTERAOCLSDKROOT/board/<board_family> folder or directory, where ALTERAOCLSDKROOT pointsto the absolute path to the AOCL).

Altera CorporationAltera SDK for OpenCL Getting Started Guide

Send Feedback

1-7Uninstalling the AOCLOCL001-13.1.12013.12.13

Page 10: Aocl Getting Started

4. Set the environment variable AOCL_BOARD_PACKAGE_ROOT to the local folder or directory in Step3.

5. Invoke the command aocl install at a command prompt.

By invoking the aocl install command, you also install a board driver that allowscommunication between host programs and hardware kernel programs.

Important:

6. To verify the successful installation of the FPGA board, invoke the command aocl diagnostic torun any board vendor-recommended diagnostic test.

Creating the FPGA Hardware Configuration File of an OpenCL KernelThe FPGA hardware configuration file of an OpenCL kernel is called an Altera Offline Compiler (AOC)Executable file (.aocx). To create the .aocx file for the hello_world example OpenCL application, you mustextract the source files first, and then compile the kernel using the AOC.

Before you begin

ForWindows system, youmust develop your code inMicrosoft Visual Studio 2010 Professionalbecause the Altera SDK for OpenCL (AOCL) is compatible with 64-bit host binaries only.

Remember:

For Linux system, you need GNU develop tools such as gcc and make to build the OpenCLapplication.

Remember:

1. Download the hello_world example OpenCL application from the OpenCL Design Examples page onthe Altera website.

2. Extract the hello_world example to a location to which you have write access.3. Ensure that you have installed the board package provided by your board vendor successfully.4. Ensure that the environment variable AOCL_BOARD_PACKAGE_ROOT points to a local folder or

directory such as ALTERAOCLSDKROOT/board/<board_family>.5. Select your target FPGA board. To list the FPGA boards available in your board package, invoke the

command aoc --list-boards at a command prompt.6. At a command prompt, navigate to the hello_world design.7. To compile the kernel for your target FPGA board, invoke the following command:

aoc -v --board <board_name> hello_world.clThis command performs the following tasks:

• Generates the Quartus II design project files from the OpenCL source code.• Checks for initial syntax errors.• Performs basic optimizations.• Creates a <your_kernel_filename> folder or subdirectory containing necessary intermediate files.• Creates the Altera Offline Compiler Object file (.aoco).• Creates the .aocx hardware configuration file.

Altera SDK for OpenCL Getting Started GuideAltera Corporation

Send Feedback

OCL001-13.1.1Creating the FPGA Hardware Configuration File of an OpenCL Kernel1-8 2013.12.13

Page 11: Aocl Getting Started

The .aocx file might take hours to build, depending on the complexity of the kernel. To viewthe progress of the compilation on-screen, include the -v flag in your aoc command. Anexample output is shown below.

$ aoc --board pcie385n_a7 -v hello_world.claoc: Environment checks are completed successfully.

Attention:

You are now compiling the full flow!!aoc: Selected target board pcie385n_a7aoc: Running OpenCL parser....aoc: OpenCL parser completed successfully.aoc: Compiling....aoc: Linking with IP library ...aoc: First stage compilation completed successfully.aoc: Running Quartus design generator....aoc: Quartus design generator completed successfully.aoc: Compiling Quartus project.aoc: Hardware generation completed successfully.

When the lineaoc: Compiling Quartus project. appears, it signifies the beginningof the hardware build, which is the time-consuming part of the compilation process. TheAOCdisplays the lineaoc: Hardware generation completed successfully.to signify the completion of the compilation process.

Related Information

• Installing an FPGA Board on page 1-7

• Altera SDK for OpenCL Programming GuideFor more information on the --list-boards and --board <board_name> options of the aoccommand, refer to the AOC Modifiers section of the AOCL Programming Guide. For more informationon the -v option of the aoc command, refer to the -v section of the AOCL Programming Guide.

Updating the Hardware Image on the FPGABefore you execute an OpenCL kernel program on your FPGA, ensure that the flash memory of your FPGAcontains a hardware image created using a current version of the AOCL.

For every major release of the AOCL and Quartus II software, you must program the flashmemory of your FPGA with a hardware image created using the current version of the AOCL.

Remember:

Programming the Flash Memory of an FPGABy default, you configure an FPGA using the hardware image stored in the flash memory of the device.When there is no power, the FPGA retains the hardware configuration file in the flash memory. When youpower up the system, it configures the FPGA circuitry based on this hardware image in the flash memory.Therefore, it is imperative that an OpenCL-compatible hardware configuration file is loaded into the flashmemory to ensure proper configuration of the FPGA.

FPGA OpenCL kernels communicate with the host program via a PCI Express (PCIe) device in the FPGA.An FPGA board compatible with the AOCL version 13.1 should be preprogrammed with a default hardwareconfiguration file that configures the PCIe device inside the FPGA. Nevertheless, you must program the

Altera CorporationAltera SDK for OpenCL Getting Started Guide

Send Feedback

1-9Updating the Hardware Image on the FPGAOCL001-13.1.12013.12.13

Page 12: Aocl Getting Started

flash memory of the FPGA with an OpenCL-compatible image. If the system fails to configure the PCIedevice in your FPGA board properly, the default image in the flash memory will configure the FPGA andinstantiate the PCIe device.

When you load the hardware configuration file into the flash memory of the FPGA, do not powerdown the system prematurely. Also, do not launch any host code that calls OpenCL kernels ormight otherwise communicate with the FPGA board.

Caution:

To load your hardware configuration file into the flash memory of your FPGA board, perform the followingtasks:

1. If applicable, for a Windows system, install the USB-Blaster™ driver so that you can load your hardwareconfiguration file into the flash memory. For installation instructions, refer to the USB-Blaster Driverfor Windows 7 and Windows Vista page on the Altera website.

If you have a Linux system, proceed to Step 2. RHEL 5.6 host systems natively include the USBdriver.

Note:

2. Ensure that you set the AOCL_BOARD_PACKAGE_ROOT environment variable to the board packagethat corresponds to your FPGA board (that is, ALTERAOCLSDKROOT/board/<board_family>).

3. At a command prompt, navigate to the hello_world design.

You can download the hello_world design from the OpenCL Design Examples page, andextract the example to a location to which you have write access.

Remember:

4. Invoke the command aocl flash hello_world.aocx to load the hardware configuration fileinto the flash memory.

5. Power down your host machine and then power it up again.

If you do not power down your hostmachine after you program the flashmemory, youmightnot have a valid image loaded onto your FPGA.

Warning:

Setting Up the Host ApplicationThe procedures to build and run the host application that executes the OpenCL kernel on your FPGA areOS-specific.

Building and Running the Host Application on Windows on page 1-11You must build your host application in Microsoft Visual Studio version 2010 Professional, and run theapplication by invoking the host.exe command.

Building and Running the Host Application on Linux on page 1-11You must build your host application with the Makefile.linux file, and run the application by invoking thehost.exe command.

AOC Output from Successful Kernel Execution on page 1-12When you run the host application to execute your OpenCL kernel on the target FPGA, the AOC notifiesyou of a successful kernel execution.

Altera SDK for OpenCL Getting Started GuideAltera Corporation

Send Feedback

OCL001-13.1.1Setting Up the Host Application1-10 2013.12.13

Page 13: Aocl Getting Started

Building and Running the Host Application on WindowsYou must build your host application in Microsoft Visual Studio version 2010 Professional, and run theapplication by invoking the host.exe command.

Building the Host ApplicationThe hello_world_vs2010_<board_vendor>.sln file in the hello_world folder contains the host solution. Afteryou open this .sln file in Microsoft Visual Studio 2010 Professional, you can build the host-side code in themain.cpp file.

To build the host application, perform the following tasks:

1. Open the .sln file in Microsoft Visual Studio.2. Verify that the build configuration is correct. The default build configuration is Debug, but you can use

Release. You must select the x64 option as the solution platform.3. Build the solution by selecting the Build > Build Solution menu option, or by pressing the F7 key.4. Verify that the build is correct. An output ending with a message similar to the one shown below notifies

you of a successful build:

1> Build succeeded.1>1> Time Elapsed 00:00:03:29========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

You can ignore the LNK4009: PDB 'vc90.pdb' was not found with...warnings because they have no effect on the build. The compiler might issue this type of

Attention:

warning messages if you have built your Windows libraries using a previous version ofMicrosoft Visual Studio.

Running the Host ApplicationTo execute the OpenCL kernel on the FPGA, run the Windows host application that you built from the .slnfile.

1. Add the path %ALTERAOCLSDKROOT%\host\windows64\bin to the PATH environment variable.2. At a command prompt, navigate to the host executable within the hello_world_<board_name> folder.3. Invoke the host.exe command.

This command runs the host executable, which in turn executes the kernel code on the FPGA.

Building and Running the Host Application on LinuxYou must build your host application with the Makefile.linux file, and run the application by invoking thehost.exe command.

Building the Host ApplicationBuild the host executable with the Makefile.linux file, located in the hello_world_<board_name> directory.

To build the host application, perform the following tasks:

1. Navigate to the hello_world_<board_name> directory.2. Invoke the $ make -f Makefile.linux command.

Altera CorporationAltera SDK for OpenCL Getting Started Guide

Send Feedback

1-11Building and Running the Host Application on WindowsOCL001-13.1.12013.12.13

Page 14: Aocl Getting Started

Running the Host ApplicationTo execute the OpenCL kernel on the FPGA , run the Linux host application that you built from theMakefile.linux file.

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 hello_world_<board_name> directory.3. Invoke the host.exe command.

This command runs the host executable, which in turn executes the kernel code on the FPGA.

AOC Output from Successful Kernel ExecutionWhen you run the host application to execute your OpenCL kernel on the target FPGA, the AOC notifiesyou of a successful kernel execution.

Example output:

Found 1 OpenCL platforms.

Querying platform for info:==========================CL_PLATFORM_NAME = Altera SDK for OpenCLCL_PLATFORM_VENDOR = Altera CorporationCL_PLATFORM_VERSION = OpenCL 1.0 Altera SDK for OpenCL, Version 13.1

Querying device for info:========================CL_DEVICE_NAME = pcie385n_a7 : PCIe-385N Altera Stratix V Computing CardCL_DEVICE_VENDOR = Nallatech Inc.CL_DEVICE_VENDOR_ID = 4466CL_DEVICE_VERSION = OpenCL 1.0 Altera SDK for OpenCL, Version 13.1CL_DRIVER_VERSION = 13.1CL_DEVICE_ADDRESS_BITS = 64CL_DEVICE_AVAILABLE = trueCL_DEVICE_ENDIAN_LITTLE = trueCL_DEVICE_GLOBAL_MEM_CACHE_SIZE = 32768CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE = 0CL_DEVICE_GLOBAL_MEM_SIZE = 0CL_DEVICE_IMAGE_SUPPORT = falseCL_DEVICE_LOCAL_MEM_SIZE = 16384CL_DEVICE_MAX_CLOCK_FREQUENCY = 1000CL_DEVICE_MAX_COMPUTE_UNITS = 1CL_DEVICE_MAX_CONSTANT_ARGS = 8CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 1073741824CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = 3CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = 1024CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE = 128CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR = 4CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT = 2CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT = 1CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG = 1CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT = 1CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE = 0Command queue out of order? = falseCommand queue profiling enabled? = true

Altera SDK for OpenCL Getting Started GuideAltera Corporation

Send Feedback

OCL001-13.1.1Running the Host Application1-12 2013.12.13

Page 15: Aocl Getting Started

Kernel initialization is complete.Launching the kernel...

Thread #2: Hello from Altera's OpenCL Compiler!

Kernel execution is complete.

ConclusionYou have performed successfully all the steps necessary to execute an OpenCL application on a preferredFPGA-based accelerator board. You may follow the same steps to execute a different OpenCL exampleapplication using the AOCL.

Formore in-depth explanation on the features of theAOCL, refer to theAltera SDK forOpenCLProgrammingGuide. The programming guide also serves as a general guide to writing OpenCL applications with theAOCL. TheAltera SDK forOpenCLOptimizationGuide helps youmaster optimization techniques for AOCLapplications. Both guides are available on the AOCL documentation page of the Altera website.

Related Information

• Altera SDK for OpenCL Programming GuideRefer to theAOCLProgrammingGuide for guidelines on creatingOpenCL applications using theAOCL.

• Altera SDK for OpenCL Optimization GuideRefer to the AOCL Optimization Guide for guidelines on optimizing your OpenCL applications usingthe AOCL.

Document Revision History

ChangesVersionDate

• Updated the Prerequisites section to include a reminder to install Linuxkernel source, headers, and GCC.

13.1.1December 2013

Altera CorporationAltera SDK for OpenCL Getting Started Guide

Send Feedback

1-13ConclusionOCL001-13.1.12013.12.13

Page 16: Aocl Getting Started

ChangesVersionDate

• Reorganized information flow.• Updated the Prerequisites section.• Updated board installation instructions.• Updated software download instructions.• Inserted the section Installing the AOCL and the Quartus II Software

Together.• Updated software installation and uninstallation instructions.• Inserted the following figures:

• AOCL Installation Process Overview• FPGA Programming Overview

• Removed the Licensing section.• Removed all board-specific installation and configuration instructions.• Changed example OpenCL application used to demonstrate kernel

configuration and FPGA programming from moving_average tohello_world.

• Inserted the section Updating the Hardware Image on the FPGA, whichcontained the updated flash programming instructions.

• Removed the section Installing the USB-Blaster Driver on Windows.• Updated output from successful execution of hello_world kernel on

FPGA for Windows and Linux systems.• Removed the figure Contents of the Moving Average Example.• Removed the figure Opening host.sln in Visual Studio.

13.1.0November 2013

• Updated requisite Quartus II and AOCL software versions from 13.0to 13.0 SP1.

• Inserted the figure A Correct Windows Device Manager After CompleteBoard Driver Installation for a BittWare Board.

• Updated the vendor and device IDs in the Verifying the Functionalityof the BittWare Board section for Windows.

• Updated the AOCL installation instructions for Linux systems that donot contain a .cshrc or a .bashrc file in the directory.

• Updated path to the AOCL design examples.• Updated the figure Contents of the Moving Average Example.• Updated flash programming instructions.

13.0 SP1.0June 2013

Altera SDK for OpenCL Getting Started GuideAltera Corporation

Send Feedback

OCL001-13.1.1Document Revision History1-14 2013.12.13

Page 17: Aocl Getting Started

ChangesVersionDate

• Renamed the OpenCL_SDK folder or directory to AOCL.• Inserted warning about the AOCL installation dependency on .cshrc

and .bashrc files for Linux systems.• Included reminder to BittWare board users about installing the BittWare

development software.• Inserted warning about potential Jungo WinDriver installation failure

for systems running onWindows 7. Included reinstallation instructions.• Insertedwarnings about errormessages displayed foraocl commands

that have not been implemented for the BittWare FPGA board.• Inserted caution message about setting the environment variable

AOCL_BOARD_PACKAGE_ROOT.• Updated board driver installation procedures for Windows and Linux

systems.• Modified the path to the default location of the AOCL for Windows

and Linux systems.• Modified the path name added to thePATH environment variable when

installing the AOCL on Linux systems. The path name should be$QUARTUS_ROOTDIR/bin instead of $QUARTUS_ROOTDIR/bin64.

13.0.1May 2013

• Updated installation and compilation procedures.• Incorporated licensing procedure.• Updated flash programming procedure and moved it to Appendix A.• Updated links to software and documentation download pages.

13.0.0May 2013

Initial release.12.1.0November 2012

Altera CorporationAltera SDK for OpenCL Getting Started Guide

Send Feedback

1-15Document Revision HistoryOCL001-13.1.12013.12.13