SlideShare a Scribd company logo
C++ Single-Source Heterogeneous Programming for OpenCL
Khronos SYCL
Bekket McClane
@ Advanced Programming
Language, Jenq-Kuen Lee
2016 Spring, NTHU
Syllabus
❖ Heterogeneous Computing By OpenCL
❖ Introducing to SYCL
❖ SYCL Internals
❖ Programming Model
❖ Execution Model
❖ Memory Model
❖ Summary
OpenCL
Host Program
(C/C++, …)
OpenCL Kernel
(OpenCL C)
Dispatch
Propertied
Device Compiler
Accelerated
Devices
(GPU, DSP…)
SPIR-V
Compiler
Source
Propertied
SPIR-V Compiler
SPIR-V
OpenCL the Bad Part 1
OpenCL the Bad Part 1
Kernel Code
OpenCL the Bad Part 1
Kernel Code
Host Code
OpenCL the Bad Part 2
OpenCL the Bad Part 3
OPENCL
(CPU) FALLBACK IMPLEMENTATION?
OpenCL the Bad Part 3
OPENCL
(CPU) FALLBACK IMPLEMENTATION?
SYCL Start Up
SYCL Start Up
Single Source
SYCL Start Up
Single Source
Multiple Implementations
SYCL Programming Model
❖ All C++14 features. Except Runtime Type Information(RTTI)
❖ Exception Handling
❖ C++11 lambda
❖ C++11 variadic templates, template aliases
❖ C++11 rvalue reference
❖ C++11 std::function, std::string, std::vector
SYCL Data Parallel 101
SYCL Data Parallel With Workgroup
SYCL Execution Model
❖ Platforms
❖ Devices
❖ Command Queue
❖ Command Group
❖ Kernel
❖ Context
❖ Program
Terms
SYCL Execution Model
❖ Platforms
❖ Devices
❖ Command Queue
❖ Command Group
❖ Kernel
❖ Context
❖ Program
Terms
Same as OpenCL
SYCL Command Group
❖ Group of OpenCL commands
❖ Commands in group are executed in-order
❖ The smallest scheduling unit
❖ Different command groups may executed out-of-order
SYCL Command Group
SYCL Kernel
SYCL Kernel
SYCL Device-side Enqueue
❖ Has same behavior as that in OpenCL 2.x
❖ Sub-kernel has separated command queue
❖ Use out-of-order command queue like OpenCL

(No command group?)
❖ Use events to manage command orders
❖ No concrete examples so far
SYCL Memory Model
❖ Global, Constant, Local, Private just like OpenCL
❖ cl::sycl::accessor
❖ cl::sycl::buffer : Unified handle to many kinds of
memory
❖ Allow Shared Virtual Memory
❖ Allow atomic access
SYCL Local Variables
SYCL Local Variables
Powerful Accessor Template
• Read
• Write
• Read/Write Atomic Related*
SVM Related
SYCL Shared Virtual Memory
SYCL Shared Virtual Memory
SVM buffer allocation
SYCL Shared Virtual Memory
Host Access
SVM buffer allocation
SYCL Shared Virtual Memory
Host Access
SVM buffer allocation
Device Access
SYCL the Good Part - Memory
❖ Both cl::sycl::buffer and cl::sycl::accessor
encapsulate underlying memory into a “handle”
❖ The “handle” provides a flexible way to manipulate data
❖ Adoption of C++ template reserves spaces for features in
the future
Summary
triSYCL
❖ Use Boost library(http://www.boost.org) to simulate
❖ The only implementation(and header files) seen so far
❖ Latest SYCL 2.2!
❖ Need to be compiled with C++14 ! (-std=c++14)
https://github.com/amd/triSYCL
SYCL the Missing Part
❖ Where are the (official)header files?
❖ Little examples
❖ SYCL to SPIR-V compiler?
❖ Still a young project
SYCL in a Nutshell
❖ Single source. Neat syntax
❖ All the shiny C++ features
❖ Easy-implement fallbacks
❖ Follow the version(steps) of OpenCL
❖ No real devices(platforms) available for playing so far
❖ *NOT intended to replace OpenCL

(Still needs exist OpenCL drivers/implementations)
Thank You
Q & A

More Related Content

PDF
Git rebase
PPTX
Example feedforward backpropagation
PDF
NLOUG 2017- Oracle WebCenter Portal 12c Performance
PDF
Faster R-CNN - PR012
PPTX
About chtMultiRegionFoam
PDF
Introduction to OpenFlow
PDF
Faster R-CNN: Towards real-time object detection with region proposal network...
PDF
Gentle Introduction to Dirichlet Processes
Git rebase
Example feedforward backpropagation
NLOUG 2017- Oracle WebCenter Portal 12c Performance
Faster R-CNN - PR012
About chtMultiRegionFoam
Introduction to OpenFlow
Faster R-CNN: Towards real-time object detection with region proposal network...
Gentle Introduction to Dirichlet Processes

Similar to Introduction to Khronos SYCL (20)

PDF
3 Open-Source-SYCL-Intel-Khronos-EVS-Workshop_May19.pdf
PDF
Sycl 1.2 Reference Card
PPTX
OpenCL Overview Japan Virtual Open House Feb 2021
PDF
“Khronos Group Standards: Powering the Future of Embedded Vision,” a Presenta...
PDF
SYCL 2020 Specification
PDF
MattsonTutorialSC14.pdf
PPTX
MattsonTutorialSC14.pptx
PDF
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
PDF
"An Update on Open Standard APIs for Vision Processing," a Presentation from ...
PDF
SYCL 1.2.1 Reference Card
PDF
Open CL For Speedup Workshop
PPTX
Open Standards for ADAS: Andrew Richards, Codeplay, at AutoSens 2016
PDF
20150207 howes-gpgpu8-dark secrets
PDF
General Purpose GPU Computing
PDF
Andes open cl for RISC-V
PDF
Introduction to OpenCL, 2010
PDF
Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...
PDF
Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...
PDF
TRACK F: OpenCL for ALTERA FPGAs, Accelerating performance and design product...
PDF
“Open Standards: Powering the Future of Embedded Vision,” a Presentation from...
3 Open-Source-SYCL-Intel-Khronos-EVS-Workshop_May19.pdf
Sycl 1.2 Reference Card
OpenCL Overview Japan Virtual Open House Feb 2021
“Khronos Group Standards: Powering the Future of Embedded Vision,” a Presenta...
SYCL 2020 Specification
MattsonTutorialSC14.pdf
MattsonTutorialSC14.pptx
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
"An Update on Open Standard APIs for Vision Processing," a Presentation from ...
SYCL 1.2.1 Reference Card
Open CL For Speedup Workshop
Open Standards for ADAS: Andrew Richards, Codeplay, at AutoSens 2016
20150207 howes-gpgpu8-dark secrets
General Purpose GPU Computing
Andes open cl for RISC-V
Introduction to OpenCL, 2010
Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...
Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...
TRACK F: OpenCL for ALTERA FPGAs, Accelerating performance and design product...
“Open Standards: Powering the Future of Embedded Vision,” a Presentation from...
Ad

More from Min-Yih Hsu (14)

PDF
Debug Information And Where They Come From
PDF
MCA Daemon: Hybrid Throughput Analysis Beyond Basic Blocks
PDF
Handling inline assembly in Clang and LLVM
PDF
How to write a TableGen backend
PDF
[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly
PDF
[TGSA Academic Friday] How To Train Your Dragon - Intro to Modern Compiler Te...
PDF
Paper Study - Demand-Driven Computation of Interprocedural Data Flow
PDF
Paper Study - Incremental Data-Flow Analysis Algorithms by Ryder et al
PDF
Souper-Charging Peepholes with Target Machine Info
PDF
From V8 to Modern Compilers
PDF
Trace Scheduling
PDF
Polymer Start-Up (SITCON 2016)
PDF
War of Native Speed on Web (SITCON2016)
PDF
From Android NDK To AOSP
Debug Information And Where They Come From
MCA Daemon: Hybrid Throughput Analysis Beyond Basic Blocks
Handling inline assembly in Clang and LLVM
How to write a TableGen backend
[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly
[TGSA Academic Friday] How To Train Your Dragon - Intro to Modern Compiler Te...
Paper Study - Demand-Driven Computation of Interprocedural Data Flow
Paper Study - Incremental Data-Flow Analysis Algorithms by Ryder et al
Souper-Charging Peepholes with Target Machine Info
From V8 to Modern Compilers
Trace Scheduling
Polymer Start-Up (SITCON 2016)
War of Native Speed on Web (SITCON2016)
From Android NDK To AOSP
Ad

Recently uploaded (20)

PDF
PPT on Performance Review to get promotions
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PPT
introduction to datamining and warehousing
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
86236642-Electric-Loco-Shed.pdf jfkduklg
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
communication and presentation skills 01
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPTX
introduction to high performance computing
PDF
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PPT on Performance Review to get promotions
Exploratory_Data_Analysis_Fundamentals.pdf
introduction to datamining and warehousing
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
III.4.1.2_The_Space_Environment.p pdffdf
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
86236642-Electric-Loco-Shed.pdf jfkduklg
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
UNIT 4 Total Quality Management .pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
communication and presentation skills 01
Categorization of Factors Affecting Classification Algorithms Selection
introduction to high performance computing
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf

Introduction to Khronos SYCL