Opencl SDK - Developer Guide - 2020.2 773042 773043
Opencl SDK - Developer Guide - 2020.2 773042 773043
OpenCL™ Applications
Developer Guide for Intel® SDK for OpenCL™ Applications
Contents
Chapter 1: Intel® SDK for OpenCL™ Applications Developer Guide
Introducing the Intel® SDK for OpenCL™ Applications ...................................... 3
What's New in This Release.........................................................................4
Which Version of the Intel® SDK for OpenCL™ Applications Should I Use? ........... 5
Intel® FPGA Emulation Platform for OpenCL™ Getting Started Guide .................. 5
Building with Intel® SDK for OpenCL™ Applications - Offline Compiler
Command-Line Interface ........................................................................8
CPU Kernel Debugging Issues...................................................................... 9
Getting Help and Support ...........................................................................9
Notices and Disclaimers............................................................................ 10
2
Intel® SDK for OpenCL™ Applications Developer Guide 1
Intel SDK for OpenCL Applications (also known as OpenCL Tools) is a software development tool that enables
development of OpenCL applications via well-known integrated development environments, targeting Intel®
architecture processors with Intel® Processor Graphics.
OpenCL Tools is available as a bundled component of Intel® System Studio, Intel® Media Server Studio, and
Intel® FPGA SDK for OpenCL™.
The tool supports local (host-based) and remote (target-based) development on the following platforms and
devices:
Operating System Host/Target Available as part of Available as part of Available as part of
Intel System Intel Media Server Intel FPGA SDK for
Studio Studio OpenCL
Microsoft Windows* Host Yes No Yes
Target Yes No Yes
Linux* Host Yes Yes Yes
Target Yes Yes Yes
3
1 Developer Guide for Intel® SDK for OpenCL™ Applications
2020 Gold
• Added support for Microsoft Visual Studio* 2019.
• Added support for the CentOS-8* platform
• Added support for generating an optimized ELF binary file from a SPIR-V file to the Offline Compiler
command-line interface
• Removal of SPIR* functionality (use SPIR-V* instead)
• Removal of Intel® Code Builder for OpenCL™ functionality
• Removal of Kernel Development Framework functionality (you can configure Intel® VTune™ Profiler to see
OpenCL API calls)
• Removal of OpenCL API Debugger functionality (you can use the Intercept Layer for OpenCL™ Applications
for debugging)
For more information, including system requirements, known issues, and installation notes, refer to the
Release Notes.
4
Intel® SDK for OpenCL™ Applications Developer Guide 1
Devices Intel SDK for OpenCL Intel SDK for OpenCL Intel SDK for OpenCL
Applications as part of Applications as part of Applications as part of
Intel System Studio Intel Media Server Intel FPGA SDK for
Studio OpenCL
Intel® Graphics (GPU) Yes Yes -
Intel® Processors (CPU) Yes Yes -
Intel FPGA - - Yes
IDE integration Host OS Intel SDK for Intel SDK for Intel SDK for
OpenCL OpenCL OpenCL
Applications as Applications as Applications as
part of Intel part of Intel Media part of Intel FPGA
System Studio Server Studio SDK for OpenCL
Microsoft Visual Windows Yes - Yes
Studio*
Eclipse* Windows No - No
Linux No No No
5
1 Developer Guide for Intel® SDK for OpenCL™ Applications
System Requirements
Refer to theIntel® oneAPI DPC++ Compiler and Intel® oneAPI DPC++ Library System Requirements.
NOTE The runtime cannot create more than four threads per logical core (physical cores with Intel®
HT Technology). For example, if application executes 32 kernels simultaneously it will require at least 8
logical cores (8 physical cores or 4 physical cores with HT option enabled).
Getting Started with Intel® FPGA Emulation Platform for OpenCL™ Technical Preview
The emulator provides a separate OpenCL™ platform with one OpenCL™ CPU device. It supports Intel® FPGA
OpenCL™ extensions.
6
Intel® SDK for OpenCL™ Applications Developer Guide 1
OpenCL programs written for FPGA device can be compiled and executed on this device, using standard
OpenCL API (including clCreateProgramWithBinary(), see the Offline Compilation section).
Offline Compilation
The Emulator supports OpenCL™ kernels compilation into binaries (similar to .aocx files used for FPGA
device), which can be used in clCreateProgramWithBinary().
Use Intel® SDK for OpenCL™ Applications - offline compiler ('ioc64' tool) to compile kernel binaries for the
emulator from OpenCL C source code. This tool is distributed as part of Intel® Code Builder for OpenCL™ API:
> ioc64 -bo='-cl-std=CL2.0' -device-fpga_fast_emu -input=source.cl -
ir=kernel_binary.elf
Name for the output file is arbitrary, and it can have .aocx extension to let a host program use the same
names for both FPGA device and the emulator.
Kernel binaries produced by the 'ioc' tool are not compatible with binaries compiled for FPGA device and vice
versa.
Execution
Set of environment variables mentioned in the Getting Started section can affect the emulator behavior.
Bash script (setupvars.sh) distributed with binaries can be used to simplify the environment setting. Please
uncomment/modify value for required variable in the script and run the command below:
> . /path/to/binaries/setupvars.sh
After that all application running in current console will use environment variables set in the script.
7
1 Developer Guide for Intel® SDK for OpenCL™ Applications
8
Intel® SDK for OpenCL™ Applications Developer Guide 1
• sse42 - Streaming SIMD Extensions 4.2
• avx - Intel Advanced Vector Extensions (Intel
AVX)
• avx2 - Intel Advanced Vector Extensions 2 (Intel
AVX2)
INTEL_OCL_DBG_LOG=1 INTEL_OCL_DBG_LOG_FILE=c:\temp\debugger.txt
2. Restart the Microsoft Visual Studio* IDE.
3. Continue debugging.
Using these environment variables, you generate a log file. Use it to determine the root cause of the issue.
You can submit the generated log through our support channels.
See Also
Intel® SDK for OpenCL™ Applications support site
9
1 Developer Guide for Intel® SDK for OpenCL™ Applications
10