Running OpenCL C Kernels on Vulkan for Fun and Profit · © 2018 Adobe Systems Incorporated. All...

8
© 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Running OpenCL C Kernels on Vulkan for Fun and Profit Eric Berdahl | Sr. Engineering Manager, Mobile Video Products

Transcript of Running OpenCL C Kernels on Vulkan for Fun and Profit · © 2018 Adobe Systems Incorporated. All...

Page 1: Running OpenCL C Kernels on Vulkan for Fun and Profit · © 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. SIGGRAPH 2017 Khronos BoF Memories C o p y r

© 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Running OpenCL C Kernels on Vulkan for Fun and ProfitEric Berdahl | Sr. Engineering Manager, Mobile Video Products

Page 2: Running OpenCL C Kernels on Vulkan for Fun and Profit · © 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. SIGGRAPH 2017 Khronos BoF Memories C o p y r

© 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

SIGGRAPH 2017 Khronos BoF Memories

© Copyright Khronos Group 2017 - Page 60

Vulkan Compute

Ralph Potter, Codeplay

Porting OpenCL C to Vulkan

2

CLSPV Compiler

OpenCL C Clang

(OpenCL C Frontend)

SPIR 1.2

(LLVM IR)

CLSPV Module PassesDescriptor

MapVulkan SPIR-V

Acknowledgements

David Neto

John Kessenich

Neil Henning

JinGu KangEric Berdahl

15 August 2018Adobe – SIGGRAPH 2018 Khronos BoF

Page 3: Running OpenCL C Kernels on Vulkan for Fun and Profit · © 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. SIGGRAPH 2017 Khronos BoF Memories C o p y r

© 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Adobe Premiere Pro CC

3

15 August 2018Adobe – SIGGRAPH 2018 Khronos BoF

workflows and user experience

Mercury Playback Engine

+=

Page 4: Running OpenCL C Kernels on Vulkan for Fun and Profit · © 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. SIGGRAPH 2017 Khronos BoF Memories C o p y r

© 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Thought Experiment: Mercury Playback Everywhere?

4

15 August 2018Adobe – SIGGRAPH 2018 Khronos BoF

Mercury Playback Engine

CUDA, OpenCL, Metal CUDA, OpenCL Metal Vulkan?

Page 5: Running OpenCL C Kernels on Vulkan for Fun and Profit · © 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. SIGGRAPH 2017 Khronos BoF Memories C o p y r

© 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Managing Complexity

15 August 2018

Adobe – SIGGRAPH 2018 Khronos BoF

5

• Great Flexibility• Expensive to rewrite

large amounts of code

• Greatest breadth and impact

• Sensitive to quality and performance

Tremendous leverage!

Page 6: Running OpenCL C Kernels on Vulkan for Fun and Profit · © 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. SIGGRAPH 2017 Khronos BoF Memories C o p y r

© 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Observations

▪ Vulkan and SPIR-V today are sufficient to host compute shaders written in novel languages

▪ In the App+Driver+Compiler triad, the compiler has huge advantages!

▪ Clspv has allowed us to compile several hundred thousand lines of OpenCL C code to SPIR-V (graphics) with minimal changes

▪ The Clspv experience revealed coverage gaps in Vulkan CTS

▪ We have improved CTS coverage

▪ Compilers are remarkably agile for working around bugs in drivers

▪ Clspv is today an insanely useful prototype with which I’m building a commercial Android product

6

15 August 2018Adobe – SIGGRAPH 2018 Khronos BoF

Page 7: Running OpenCL C Kernels on Vulkan for Fun and Profit · © 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. SIGGRAPH 2017 Khronos BoF Memories C o p y r

© 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Project Rush – Unveiled at VidCon 2018

7

15 August 2018Adobe – SIGGRAPH 2018 Khronos BoF

Page 8: Running OpenCL C Kernels on Vulkan for Fun and Profit · © 2018 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. SIGGRAPH 2017 Khronos BoF Memories C o p y r