OpenCL™ 2.0 Samples

The newest release of the AMD APP SDK contains the OpenCL 2.0 samples listed in the table below. To get started with those, head over to the blog to read more or go to the AMD APP SDK page and download the latest release.

Samples

New Samples
Sample OpenCL™ 2.0 feature Description
SVMBinaryTreeSearch SVM Coarse Grain demonstrates the coarse-grain Shared Virtual Memory (SVM) feature of OpenCL 2.0 using a Binary Tree search algorithm
SimplePipe Pipe demonstrates the Pipe memory object and its APIs
PipeProducerConsumerKernels Pipe demonstrates the Pipe as a data-sharing FIFO for a producer kernel and a consumer kernel
BuiltInScan New Workgroup Built-in APIs demonstrates the work group level scan and work group level broadcast features introduced in OpenCL 2.0 using the PrefixSum algorithm
ImageBinarization Image Read and Write demonstrates using images with read_write qualifier support, which is new in OpenCL 2.0
RecursiveGaussian_ProgramScope Program Scope Variable demonstrates Program Scope Variables, a new feature of OpenCL 2.0, using a Recursive Gaussian filter implementation
SimpleGenericAddressSpace Generic Address Space demonstrates the Generic Address Space feature introduced in OpenCL 2.0, which allows pointers to be declared without qualifying with a named address space
RangeMinimumQuery Shared Virtual Memory pointer with offset demonstrates passing a pointer with offset as a kernel argument using Range Minimum Query algorithm, new in OpenCL 2.0
SVMAtomicsBinaryTreeInsert SVM Fine Grain Buffer + Platform Atomics demonstrates the Fine Grain SVM buffer with Platform atomics using a Binary Tree node insertion algorithm
CalcPie C++ 11 Atomics demonstrates atomics in OpenCL 2.0. It calculates the value of Pi using MonteCarlo analysis
FineGrainSVM SVM Fine Grain Buffer + C++ 11 Atomics demonstrates the memory model of loads and stores with new C++11 standard, which is adopted by OpenCL 2.0 (Linux APU device)
FineGrainSVMCAS SVM Fine Grain Buffer + C++ 11 Atomics demonstrates the atomic operation “CompareAndSwap” call called “atomic_compare_exchange”, introduced in OpenCL 2.0 (adopted fromC11 standards – requires Linux APU device)
RegionGrowingSegmentation Device-side Enqueue demonstrates how to use the device-side enqueue feature of OpenCL 2.0 for a Region Growing Segmentation algorithm
DeviceEnqueueBFS Device-side Enqueue demonstrates Breadth First Search implementation using the device-side enqueue feature of OpenCL 2.0.
ExtractPrimes Device-side Enqueue + New Workgroup Built-in APIs demonstrates the new workgroup builtins and device-side enqueue in a finding Prime number algorithm
SimpleSPIR SPIR Consumption (Not a OpenCL 2.0 feature) demonstrates SPIR code consumption using OpenCL APIs
SimpleDepthImage Depth Image demonstrates the depth Image APIs
Updated Samples
Sample OpenCL™  2.0 feature Description
GlobalMemoryBandwidth Shared Virtual Memory measures the peak-bandwidth of the device buffer. For devices on OpenCL version 2.0 and higher, it additionally shows peak bandwidth for the Shared Virtual Memory (SVM) buffer
BinarySearch_DeviceSideEnqueue Device-side Enqueue enhanced to use device-side enqueue for Binary Search on an OpenCL 2.0 device. Uses iterative host side enqueue for OpenCL 1.x devices
BufferImageInterop Buffer Image Interop updated to skip checking for the BufferImageInterop extension on an OpenCL 2.0 compliant platform as it is a core feature of OpenCL 2.0
BufferBandwidth Shared Virtual Memory now also measures the SVM buffer bandwidth on a OpenCL 2.0 compliant device

 

The OpenCL™ 2.0 samples posted below were provided as part of the AMD APP SDK 3.0 Beta release, and accompany a series of blog posts where we attempt to demystify the most important OpenCL™ 2.0 features by investigating their significance as well as how and under what conditions they improve programmability and performance.  The best way to learn about the features, of course, is to use them:

  • Download and install the latest driver for your platform here.
  • Download the code sample(s) from the table below and run them on any of the AMD platforms listed on the driver download page (link above). See the Readme file in the sample package for further details.

Downloads

File Name Version Size Launch Date OS Bitness Description
Binary Search using OpenCL 2.0 SVM

File Name

Version

N/A

Size

124 KB

Launch Date

10/24/2014

OS

Windows and Linux

Bitness

64-bit

Description

Sample code showing use of OpenCL 2.0 SVM feature in a binary tree search
Producer/consumer sample using OpenCL 2.0 Pipes

File Name

Version

N/A

Size

128 KB

Launch Date

10/31/2014

OS

Windows and Linux

Bitness

64-bit

Description

Sample code implemeting a producer/consumer construct using OpenCL 2.0 pipes
OpenCL 2.0 Device Enqueue

File Name

Version

N/A

Size

818 KB

Launch Date

11/17/2014

OS

Windows and Linux

Bitness

64-bit

Description

Sample code illustrating the use of OpenCL 2.0 Device Enqueue feature