Getting Started with OpenCL Code Builder

Getting Started with OpenCL Code Builder

About this Document

The intention of this guide is to provide quick steps to create, build, debug, and analyze OpenCL™ applications with the OpenCL™ Code Builder, a part of Intel® Integrated Native Development Environment (Intel® INDE)

Intel® INDE provides integrated development environment for Windows* and Android* applications for mobile and desktop client systems. If you wish to target your OpenCL applications for Linux systems or other server and embedded configurations, additional OpenCL Code Builder options are available athttps://software.intel.com/en-us/intel-opencl.

About the OpenCL™ Code Builder

OpenCL™ Code Builder is a software tool suite that enables development of OpenCL applications via well-known integrated development environments, targeting the Intel® Architecture processors with the Intel® Processor Graphics.
OpenCL™ Code Builder has the following capabilities:

  • OpenCL C kernel code compilation and analysis
  • OpenCL C kernel code debugging
  • Integration into Microsoft Visual Studio* and Eclipse* IDEs for development of applications in one place
  • Remote development and compilation for Android* OS

 

Which Version of the OpenCL™ Code Builder to Pick?

Depending on your target operating systems and hardware set, select between the Intel® INDE and other versions of the OpenCL™ Code Builder.
The Intel® INDE version of the OpenCL™ Code Builder provides the following features:

  • Tools to build, debug, and analyze:
  • Microsoft* Visual Studio* and Eclipse* IDE integration
  • OpenCL C kernel development framework
  • OpenCL 2.0 development environment
  • OpenCL API debugging and tracing
  • Remote development for Android* OS
  • Preview OpenCL analyze capabilities
  • Latest standards support:
  • OpenCL 2.0 & 1.2
  • SPIR 1.2
  • Portability between OSs and devices:
  • Intel processors and Intel® Processor Graphics support
  • Windows* host development environment
  • Android* and Windows* targets
  • Intel® Architecture optimizations with graphics compute:
  • New Intel® Core™ M and 5th Generation Intel® Core™ processors
  • Intel® Atom processors
  • On-die heterogeneous computing with shared virtual memory

For a full list of features, refer to the Intel® INDE version of the Code Builder Release Notes.
Are you looking for more configurations, like OpenCL support for Intel® Processor Graphics for Linux* OS? Use the OpenCL™ Code Builder available with the Intel® Media Server Studio. See even more configurations at https://software.intel.com/en-us/intel-opencl

Prerequisites

The following components must be installed on the system to ensure the Code Builder components work:

  • For OpenCL support on Intel® Processor Graphics, use machines with the 3rd Generation Intel® Core™ processors, Intel® Atom processors previously known as "Bay Trail", and higher versions of the hardware
  • Intel Graphics Driver version 15.33 and higher
  • OpenCL on Intel® Processor Graphics is not available in virtual environments. In this case, as well as with older versions of Intel processors you have to manually pre-install the OpenCL Runtime 15.1 for CPU devices. Refer to the OpenCL Runtime release notes for a full list of supported hardware
  • For Android development, you need an Intel-based Android* OS system with OpenCL enabled. Alternatively, you can use OpenCL CPU for Android on your Android emulation.
  • Optional: Microsoft Visual Studio* 2010, 2012, or 2013, or Eclipse* (Keppler and higher).

For help on installing the product refer to the "Installation Guidelines" sections in release notes.

Quickly Install and Develop with the OpenCL™ Code Builder

Intel® INDE provides a comprehensive toolset for developing applications targeting both CPU and GPUs, enriching the development experience of an OpenCL developer. Yet, if you got used to work with the legacy Intel® SDK for OpenCL™ Applications, you may still be looking for the same capabilities to develop only the OpenCL code with the same tools. This option is supported.
To get started and build your first OpenCL code quickly, you can follow these steps and install only the OpenCL™ Code Builder component of Intel INDE (for more detailed version, see "Getting Started with OpenCL Development on Windows with Intel® INDE"),

  • At the Intel INDE downloads page select Online Installer (9 MB)
  • Run the installer and select applicable options.
  • At the Suit installation step, click Skip IDE Integration.
  • In the Options step, select only OpenCL™ Code Builder in the Build category, and click Next.
  • Finish installation according the installer guidelines.

This will install OpenCL Code Builder, including Visual Studio and Eclipse plug-ins.
Now you are ready to start developing your OpenCL code

Getting Started with the OpenCL™ Code Builder Tools

A simple way to get started with the OpenCL™ Code Builder is using its Visual Studio* plug-in.

Check OpenCL™ Platform Availability

Right after installing the OpenCL™ Code Builder, you can check availability of the OpenCL platform on your system. To do so,
1. Run Visual Studio.
2. Go to CODE-BUILDER > Platform Info…
As a result you should see the Platform Info window with the list of available platforms and your hardware properties.

Build an OpenCL™ Kernel

Next step is to build an OpenCL kernel using the Visual Studio plug-in.
In this example we use a ready code sample from the list of Intel’s OpenCL code samples to test the plug-in.
 To build a sample application
1. Download the OpenCL Platform Capabilities Viewer Sample or any other available code sample.
2. Unpack the archive to the destination of your choice.
3. Select the solution file corresponding to your Visual Studio* version.
4. Press Ctrl+Shift+B.
In case of a successful build operation, you receive the following output:

In case of a failure, you receive error messages. For example:

You can develop an OpenCL kernel yourself.
See the User Manual for more information about developing kernels using the Code Builder plug-in for Visual Studio.

Debug and Analyze OpenCL™ Applications

A nice way to debug OpenCL applications is using the API debugging capabilities of the OpenCL™ Code Builder plug-in for Microsoft Visual Studio* IDE.
To start debugging API calls of an OpenCL application, you need to configure the API debugger. To do so, simply
1. Start Visual Studio*.
2. Go to CODE BUILDER > OpenCL Debugger > Options > API Debugger.
3. And check Enable OpenCL API Debugger.
Then you can insert breakpoints in the application near different OpenCL API calls and start debugging in a common way – with F5.
The API Debugger provides multiple views of the API calls. To open the views of your interest, just go to CODE BUILDER > OpenCL Debugger.

Use the following link to parts of the OpenCL™ Code Builder User Manual for more information about each of the API Debugger views:
1. Trace View
2. Objects Tree View
3. Properties View
4. Command Queue View
5. Problems View
6. Image View
7. Data View
8. Memory Tracing
For the full list of Code Builder plug-in capabilities as well as instructions for using them, refer to theOpenCL Code Builder – User Manual.

Might also Be Useful

Consider the following documents and web articles to get started with the OpenCL™ Code builder:

  • OpenCL 2.0 Specification – contains basic information about the OpenCL technology
  • Khronos* OpenCL Registry – all official information about OpenCL provided by Khronos*
  • OpenCL™ Code Builder Documentation – full set of information on using the product tools, features, OpenCL™ runtime, and also guidelines for optimizing OpenCL applications
  • OpenCL Code Samples – all publically available OpenCL code samples developed by Intel Corporation

For more such Android resources and tools from Intel, please visit the Intel® Developer Zone

Source: https://software.intel.com/en-us/articles/getting-started-with-opencl-code-builder

Digit.in
Logo
Digit.in
Logo