SlideShare uma empresa Scribd logo
1 de 29
Baixar para ler offline
Inspecting Block
Closures
To Generate Shaders for GPU Execution

Ronie Salgado

ISCLab, DCC, University of Chile
Talk Outline
• Motivation.

• GPU Hardware and Programming Model.

• Smalltalk -> Shader: Code Generation Pipeline.

• Case Studies:

• Procedural Texture Generation.

• Particle Simulation and Rendering.

• Future Work.
Motivation
• High performance for parallel task.

• Facilitate shader debugging.

• Smalltalk on the GPU.

• Reduce impedance mismatch between CPU <-> GPU.
Why BlockClosure?
• Closures look like functions: f := [:x | …]

• They encapsulate Code and Data.

• Easy to use for scripting in a Playground.

• Map-Reduce style computations.
Why BlockClosure?
GPU Hardware
• In the case of the AMD GCN architecture.

• Multiple independent Compute Unit.

• Scalar ALU (Control Flow)

• Vectorial ALU (SIMD, Data Processing)
Mike Mantor. 2012. AMD Radeon™ HD 7970 with graphics core next (GCN) architecture. In 2012 IEEE Hot Chips 24 Symposium (HCS). IEEE 

Programming Environment
Constraints
• No Dynamic Lookup.

• No Arithmetic Traps (e.g SmallInteger -> LargeInteger).

• No Dynamic Memory Allocation inside the GPU (No
objects or GC).
GPU Programming Model
• Graphics pipeline (OpenGL, Metal, Vulkan, D3D):

• Vertex Shader.

• … Rasterization …

• Fragment Shader.

• Compute pipeline (Graphics APIs, CUDA, OpenCL):

• Compute Shader.
Smalltalk -> Shader Pipeline
“Parsing”
• Take a block closure.

• Obtain the AST node from the closure.

• 

• Obtain the captured variable values
“Semantic Analysis”
• Local type inference

• Literals.

• Captured variables.

• Special objects (e.g: Color Ramp).

• Type information is used for mapping messages to functions.

• Some messages are always mapped to the same function name
(e.g. abs, cos, sin).

• AST is visited, and type information is propagated.
“Code Generation”
• Generate the AST of another shader language.

• Woden Engine has the custom shader language Dastrel.

• Dastrel has C++ 11 style type inference (auto keyword).

• The full Dastrel compiler is written in Pharo.

• Dastrel output is the Slovim (Smalltalk Low-Level Virtual
Machine) SSA IR. Heavily based on LLVM.

• Slovim has a Spir-V backend for (SSA IR for Vulkan).
Translation difficulties
• Dastrel syntax is statement based like C.

• Type inference ambiguities.
“Runtime System”
Final shader compilation
Shader compilation result
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Input_v2float = OpTypePointer Input %v2float
%FragmentInput_sve_texcoord = OpVariable %_ptr_Input_v2float Input
%v4float = OpTypeVector %float 4
%16 = OpTypeFunction %v4float %float %float
%float_2 = OpConstant %float 2
%float_1 = OpConstant %float 1
%float_10 = OpConstant %float 10
%float_0_5 = OpConstant %float 0.5
%38 = OpTypeFunction %v4float %float
%bool = OpTypeBool
%float_0 = OpConstant %float 0
%48 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%54 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
%64 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%65 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
%71 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
%72 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
%_ptr_Output_v4float = OpTypePointer Output %v4float
%FragmentStage_sve_colorOutput0 = OpVariable %_ptr_Output_v4float Output
%_anonF0 = OpFunction %v4float None %38
%39 = OpFunctionParameter %float
%40 = OpLabel
%41 = OpFOrdLessThan %bool %39 %float_0
OpSelectionMerge %46 None
OpBranchConditional %41 %45 %46
%45 = OpLabel
OpReturnValue %48
%46 = OpLabel
%49 = OpFOrdGreaterThan %bool %39 %float_1
OpSelectionMerge %52 None
OpBranchConditional %49 %51 %52
%51 = OpLabel
OpReturnValue %54
•
Fragment of a Spir-V shader disassembly.
This is an encoding for a control flow graph.
Code Generation for Other
Backends
• The Khronos Group maintains spirv-cross

• Decompile Spir-V to other shader languages.

• Integrated in the graphics API abstraction layer.
Spir-V to Metal
MacBook-Air-de-Ronie:woden-esug-2019-demo ronie$ spirv-cross --msl test.spv
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 FragmentStage_sve_colorOutput0 [[color(0)]];
};
struct main0_in
{
float2 FragmentInput_sve_texcoord [[user(locn0)]];
};
float4 _anonF0(float _39)
{
if (_39 < 0.0)
{
return float4(1.0, 0.0, 0.0, 1.0);
Graphics API Shading
Languages
• Vulkan: Spir-V SSA IR (GLSL compiler available)

• D3D12: HLSL, DirectX Bytecode, DirectX IR (LLVM
Bitcode)

• OpenGL: GLSL

• Metal: Metal Shading Language (Modified C++ 11,
compiled to undocumented and packed LLVM Bitcode)
Case Study: Procedural
Texture Generation
• A texture is a function F that assign a Color (R, G, B, A) to
a point (u,v) in a 2D surface:

• 

• Generating a texture consists on evaluating F in all point
in the texture grid.
F(u, v) with u, v ∈ [0,1]
Procedural Texture
Generation Sample
Speedup factor: 262.45
Case Study: Particle
Simulation
• A particle p has a state in a given instant of time t.

• Particle simulation consists on computing
for each particle p in a particle
system.

• S is a function that simulates a single particle
Qp,t
Qp,t+Δt = S(Qp,t, p, Δt)
Particle State Q
• Position.

• Velocity.

• Remaining time of life.

• Size.

• Random number generation seed.
Particle Simulation
Results
• Significant speedup factor by using BlockClosures
translated to shaders. (Between 14 and 262 times)

• Feasible to translate restricted subset of Smalltalk to
shaders.
Limitations
• Benchmarking biasing against CPU performance.

• Manual message mapping between Pharo methods and
target language is required.

• Type inference failures.
Limitation: message
mapping
Related Work
• Slang.

• ShaderToy.

• Others DSLs targeting the GPU.
Conclusions and Future
Work
• Feasibility of translating Pharo BlockClosures to shaders.

• Speedup factor between 14 and 262 for procedural
texture generation.

• Use a target AST with more direct mapping from
Smalltalk.
Questions?
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Input_v2float = OpTypePointer Input %v2float
%FragmentInput_sve_texcoord = OpVariable %_ptr_Input_v2float Input
%v4float = OpTypeVector %float 4
%16 = OpTypeFunction %v4float %float %float
%float_2 = OpConstant %float 2
%float_1 = OpConstant %float 1
%float_10 = OpConstant %float 10
%float_0_5 = OpConstant %float 0.5
%38 = OpTypeFunction %v4float %float
%bool = OpTypeBool
%float_0 = OpConstant %float 0
%48 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%54 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
%64 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%65 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
%71 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
%72 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
%_ptr_Output_v4float = OpTypePointer Output %v4float
%FragmentStage_sve_colorOutput0 = OpVariable %_ptr_Output_v4float Output
%_anonF0 = OpFunction %v4float None %38
%39 = OpFunctionParameter %float
%40 = OpLabel
%41 = OpFOrdLessThan %bool %39 %float_0
OpSelectionMerge %46 None
OpBranchConditional %41 %45 %46
%45 = OpLabel
OpReturnValue %48
%46 = OpLabel
%49 = OpFOrdGreaterThan %bool %39 %float_1
OpSelectionMerge %52 None
OpBranchConditional %49 %51 %52
%51 = OpLabel
OpReturnValue %54
•

Mais conteúdo relacionado

Mais procurados

Return oriented programming
Return oriented programmingReturn oriented programming
Return oriented programminghybr1s
 
Android OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final ReportAndroid OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final ReportJungsoo Nam
 
Introduction to Khronos SYCL
Introduction to Khronos SYCLIntroduction to Khronos SYCL
Introduction to Khronos SYCLMin-Yih Hsu
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGLJungsoo Nam
 
A Source-To-Source Approach to HPC Challenges
A Source-To-Source Approach to HPC ChallengesA Source-To-Source Approach to HPC Challenges
A Source-To-Source Approach to HPC ChallengesChunhua Liao
 
Verilog HDL Training Course
Verilog HDL Training CourseVerilog HDL Training Course
Verilog HDL Training CoursePaul Laskowski
 
Java Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoJava Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoValeriia Maliarenko
 
Verilog Lecture1
Verilog Lecture1Verilog Lecture1
Verilog Lecture1Béo Tú
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programmingMohammed Romi
 
Megamodeling of Complex, Distributed, Heterogeneous CPS Systems
Megamodeling of Complex, Distributed, Heterogeneous CPS SystemsMegamodeling of Complex, Distributed, Heterogeneous CPS Systems
Megamodeling of Complex, Distributed, Heterogeneous CPS SystemsEugenio Villar
 
[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtoolingDouglas Chen
 
Introduction to D programming language at Weka.IO
Introduction to D programming language at Weka.IOIntroduction to D programming language at Weka.IO
Introduction to D programming language at Weka.IOLiran Zvibel
 
VHDL summer training (ppt)
 VHDL summer training (ppt) VHDL summer training (ppt)
VHDL summer training (ppt)HoneyKumar34
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotationsmametter
 
Graal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution PlatformGraal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution PlatformThomas Wuerthinger
 
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3mametter
 
Optimising code using Span<T>
Optimising code using Span<T>Optimising code using Span<T>
Optimising code using Span<T>Mirco Vanini
 

Mais procurados (20)

Return oriented programming
Return oriented programmingReturn oriented programming
Return oriented programming
 
Android OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final ReportAndroid OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final Report
 
Introduction to Khronos SYCL
Introduction to Khronos SYCLIntroduction to Khronos SYCL
Introduction to Khronos SYCL
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL
 
GCC RTL and Machine Description
GCC RTL and Machine DescriptionGCC RTL and Machine Description
GCC RTL and Machine Description
 
A Source-To-Source Approach to HPC Challenges
A Source-To-Source Approach to HPC ChallengesA Source-To-Source Approach to HPC Challenges
A Source-To-Source Approach to HPC Challenges
 
Verilog HDL Training Course
Verilog HDL Training CourseVerilog HDL Training Course
Verilog HDL Training Course
 
Java Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoJava Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey Kovalenko
 
Verilog Lecture1
Verilog Lecture1Verilog Lecture1
Verilog Lecture1
 
VHDL CODE
VHDL CODE VHDL CODE
VHDL CODE
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programming
 
Megamodeling of Complex, Distributed, Heterogeneous CPS Systems
Megamodeling of Complex, Distributed, Heterogeneous CPS SystemsMegamodeling of Complex, Distributed, Heterogeneous CPS Systems
Megamodeling of Complex, Distributed, Heterogeneous CPS Systems
 
[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling
 
Introduction to D programming language at Weka.IO
Introduction to D programming language at Weka.IOIntroduction to D programming language at Weka.IO
Introduction to D programming language at Weka.IO
 
Logic Synthesis
Logic SynthesisLogic Synthesis
Logic Synthesis
 
VHDL summer training (ppt)
 VHDL summer training (ppt) VHDL summer training (ppt)
VHDL summer training (ppt)
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
 
Graal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution PlatformGraal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution Platform
 
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
 
Optimising code using Span<T>
Optimising code using Span<T>Optimising code using Span<T>
Optimising code using Span<T>
 

Semelhante a Inspecting Block Closures To Generate Shaders for GPU Execution

Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingPositive Hack Days
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin敬倫 林
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfSamiraKids
 
3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)mistercteam
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Languagezefhemel
 
Porting VisualWorks code to Pharo
Porting VisualWorks code to PharoPorting VisualWorks code to Pharo
Porting VisualWorks code to PharoESUG
 
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio [Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio Owen Wu
 
Seattle Spark Meetup Mobius CSharp API
Seattle Spark Meetup Mobius CSharp APISeattle Spark Meetup Mobius CSharp API
Seattle Spark Meetup Mobius CSharp APIshareddatamsft
 
Building a SIMD Supported Vectorized Native Engine for Spark SQL
Building a SIMD Supported Vectorized Native Engine for Spark SQLBuilding a SIMD Supported Vectorized Native Engine for Spark SQL
Building a SIMD Supported Vectorized Native Engine for Spark SQLDatabricks
 
Peyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_futurePeyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_futureTakayuki Muranushi
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSkills Matter
 
Introduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan NevraevIntroduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan NevraevAMD Developer Central
 
ElixirでFPGAを設計する
ElixirでFPGAを設計するElixirでFPGAを設計する
ElixirでFPGAを設計するHideki Takase
 
[Osxdev]metal
[Osxdev]metal[Osxdev]metal
[Osxdev]metalNAVER D2
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 
Scala & Spark(1.6) in Performance Aspect for Scala Taiwan
Scala & Spark(1.6) in Performance Aspect for Scala TaiwanScala & Spark(1.6) in Performance Aspect for Scala Taiwan
Scala & Spark(1.6) in Performance Aspect for Scala TaiwanJimin Hsieh
 
Real Time Data Processing With Spark Streaming, Node.js and Redis with Visual...
Real Time Data Processing With Spark Streaming, Node.js and Redis with Visual...Real Time Data Processing With Spark Streaming, Node.js and Redis with Visual...
Real Time Data Processing With Spark Streaming, Node.js and Redis with Visual...Brandon O'Brien
 

Semelhante a Inspecting Block Closures To Generate Shaders for GPU Execution (20)

Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash Cracking
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
 
3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Language
 
Porting VisualWorks code to Pharo
Porting VisualWorks code to PharoPorting VisualWorks code to Pharo
Porting VisualWorks code to Pharo
 
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio [Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
 
Seattle Spark Meetup Mobius CSharp API
Seattle Spark Meetup Mobius CSharp APISeattle Spark Meetup Mobius CSharp API
Seattle Spark Meetup Mobius CSharp API
 
Building a SIMD Supported Vectorized Native Engine for Spark SQL
Building a SIMD Supported Vectorized Native Engine for Spark SQLBuilding a SIMD Supported Vectorized Native Engine for Spark SQL
Building a SIMD Supported Vectorized Native Engine for Spark SQL
 
Peyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_futurePeyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_future
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
Vhdl new
Vhdl newVhdl new
Vhdl new
 
A Common Backend for Hardware Acceleration of DSLs on FPGA
A Common Backend for Hardware Acceleration of DSLs on FPGAA Common Backend for Hardware Acceleration of DSLs on FPGA
A Common Backend for Hardware Acceleration of DSLs on FPGA
 
Introduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan NevraevIntroduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan Nevraev
 
C Language
C LanguageC Language
C Language
 
ElixirでFPGAを設計する
ElixirでFPGAを設計するElixirでFPGAを設計する
ElixirでFPGAを設計する
 
[Osxdev]metal
[Osxdev]metal[Osxdev]metal
[Osxdev]metal
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
Scala & Spark(1.6) in Performance Aspect for Scala Taiwan
Scala & Spark(1.6) in Performance Aspect for Scala TaiwanScala & Spark(1.6) in Performance Aspect for Scala Taiwan
Scala & Spark(1.6) in Performance Aspect for Scala Taiwan
 
Real Time Data Processing With Spark Streaming, Node.js and Redis with Visual...
Real Time Data Processing With Spark Streaming, Node.js and Redis with Visual...Real Time Data Processing With Spark Streaming, Node.js and Redis with Visual...
Real Time Data Processing With Spark Streaming, Node.js and Redis with Visual...
 

Mais de ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

Mais de ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Último

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 

Último (20)

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 

Inspecting Block Closures To Generate Shaders for GPU Execution

  • 1. Inspecting Block Closures To Generate Shaders for GPU Execution Ronie Salgado ISCLab, DCC, University of Chile
  • 2. Talk Outline • Motivation. • GPU Hardware and Programming Model. • Smalltalk -> Shader: Code Generation Pipeline. • Case Studies: • Procedural Texture Generation. • Particle Simulation and Rendering. • Future Work.
  • 3. Motivation • High performance for parallel task. • Facilitate shader debugging. • Smalltalk on the GPU. • Reduce impedance mismatch between CPU <-> GPU.
  • 4. Why BlockClosure? • Closures look like functions: f := [:x | …] • They encapsulate Code and Data. • Easy to use for scripting in a Playground. • Map-Reduce style computations.
  • 6. GPU Hardware • In the case of the AMD GCN architecture. • Multiple independent Compute Unit. • Scalar ALU (Control Flow) • Vectorial ALU (SIMD, Data Processing) Mike Mantor. 2012. AMD Radeon™ HD 7970 with graphics core next (GCN) architecture. In 2012 IEEE Hot Chips 24 Symposium (HCS). IEEE 

  • 7. Programming Environment Constraints • No Dynamic Lookup. • No Arithmetic Traps (e.g SmallInteger -> LargeInteger). • No Dynamic Memory Allocation inside the GPU (No objects or GC).
  • 8. GPU Programming Model • Graphics pipeline (OpenGL, Metal, Vulkan, D3D): • Vertex Shader. • … Rasterization … • Fragment Shader. • Compute pipeline (Graphics APIs, CUDA, OpenCL): • Compute Shader.
  • 9. Smalltalk -> Shader Pipeline “Parsing” • Take a block closure. • Obtain the AST node from the closure. • • Obtain the captured variable values
  • 10. “Semantic Analysis” • Local type inference • Literals. • Captured variables. • Special objects (e.g: Color Ramp). • Type information is used for mapping messages to functions. • Some messages are always mapped to the same function name (e.g. abs, cos, sin). • AST is visited, and type information is propagated.
  • 11. “Code Generation” • Generate the AST of another shader language. • Woden Engine has the custom shader language Dastrel. • Dastrel has C++ 11 style type inference (auto keyword). • The full Dastrel compiler is written in Pharo. • Dastrel output is the Slovim (Smalltalk Low-Level Virtual Machine) SSA IR. Heavily based on LLVM. • Slovim has a Spir-V backend for (SSA IR for Vulkan).
  • 12. Translation difficulties • Dastrel syntax is statement based like C. • Type inference ambiguities.
  • 15. Shader compilation result %void = OpTypeVoid %3 = OpTypeFunction %void %float = OpTypeFloat 32 %v2float = OpTypeVector %float 2 %_ptr_Input_v2float = OpTypePointer Input %v2float %FragmentInput_sve_texcoord = OpVariable %_ptr_Input_v2float Input %v4float = OpTypeVector %float 4 %16 = OpTypeFunction %v4float %float %float %float_2 = OpConstant %float 2 %float_1 = OpConstant %float 1 %float_10 = OpConstant %float 10 %float_0_5 = OpConstant %float 0.5 %38 = OpTypeFunction %v4float %float %bool = OpTypeBool %float_0 = OpConstant %float 0 %48 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1 %54 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1 %64 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1 %65 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1 %71 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1 %72 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1 %_ptr_Output_v4float = OpTypePointer Output %v4float %FragmentStage_sve_colorOutput0 = OpVariable %_ptr_Output_v4float Output %_anonF0 = OpFunction %v4float None %38 %39 = OpFunctionParameter %float %40 = OpLabel %41 = OpFOrdLessThan %bool %39 %float_0 OpSelectionMerge %46 None OpBranchConditional %41 %45 %46 %45 = OpLabel OpReturnValue %48 %46 = OpLabel %49 = OpFOrdGreaterThan %bool %39 %float_1 OpSelectionMerge %52 None OpBranchConditional %49 %51 %52 %51 = OpLabel OpReturnValue %54 • Fragment of a Spir-V shader disassembly. This is an encoding for a control flow graph.
  • 16. Code Generation for Other Backends • The Khronos Group maintains spirv-cross • Decompile Spir-V to other shader languages. • Integrated in the graphics API abstraction layer.
  • 17. Spir-V to Metal MacBook-Air-de-Ronie:woden-esug-2019-demo ronie$ spirv-cross --msl test.spv #pragma clang diagnostic ignored "-Wmissing-prototypes" #include <metal_stdlib> #include <simd/simd.h> using namespace metal; struct main0_out { float4 FragmentStage_sve_colorOutput0 [[color(0)]]; }; struct main0_in { float2 FragmentInput_sve_texcoord [[user(locn0)]]; }; float4 _anonF0(float _39) { if (_39 < 0.0) { return float4(1.0, 0.0, 0.0, 1.0);
  • 18. Graphics API Shading Languages • Vulkan: Spir-V SSA IR (GLSL compiler available) • D3D12: HLSL, DirectX Bytecode, DirectX IR (LLVM Bitcode) • OpenGL: GLSL • Metal: Metal Shading Language (Modified C++ 11, compiled to undocumented and packed LLVM Bitcode)
  • 19. Case Study: Procedural Texture Generation • A texture is a function F that assign a Color (R, G, B, A) to a point (u,v) in a 2D surface: • • Generating a texture consists on evaluating F in all point in the texture grid. F(u, v) with u, v ∈ [0,1]
  • 21. Case Study: Particle Simulation • A particle p has a state in a given instant of time t. • Particle simulation consists on computing for each particle p in a particle system. • S is a function that simulates a single particle Qp,t Qp,t+Δt = S(Qp,t, p, Δt)
  • 22. Particle State Q • Position. • Velocity. • Remaining time of life. • Size. • Random number generation seed.
  • 24. Results • Significant speedup factor by using BlockClosures translated to shaders. (Between 14 and 262 times) • Feasible to translate restricted subset of Smalltalk to shaders.
  • 25. Limitations • Benchmarking biasing against CPU performance. • Manual message mapping between Pharo methods and target language is required. • Type inference failures.
  • 27. Related Work • Slang. • ShaderToy. • Others DSLs targeting the GPU.
  • 28. Conclusions and Future Work • Feasibility of translating Pharo BlockClosures to shaders. • Speedup factor between 14 and 262 for procedural texture generation. • Use a target AST with more direct mapping from Smalltalk.
  • 29. Questions? %void = OpTypeVoid %3 = OpTypeFunction %void %float = OpTypeFloat 32 %v2float = OpTypeVector %float 2 %_ptr_Input_v2float = OpTypePointer Input %v2float %FragmentInput_sve_texcoord = OpVariable %_ptr_Input_v2float Input %v4float = OpTypeVector %float 4 %16 = OpTypeFunction %v4float %float %float %float_2 = OpConstant %float 2 %float_1 = OpConstant %float 1 %float_10 = OpConstant %float 10 %float_0_5 = OpConstant %float 0.5 %38 = OpTypeFunction %v4float %float %bool = OpTypeBool %float_0 = OpConstant %float 0 %48 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1 %54 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1 %64 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1 %65 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1 %71 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1 %72 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1 %_ptr_Output_v4float = OpTypePointer Output %v4float %FragmentStage_sve_colorOutput0 = OpVariable %_ptr_Output_v4float Output %_anonF0 = OpFunction %v4float None %38 %39 = OpFunctionParameter %float %40 = OpLabel %41 = OpFOrdLessThan %bool %39 %float_0 OpSelectionMerge %46 None OpBranchConditional %41 %45 %46 %45 = OpLabel OpReturnValue %48 %46 = OpLabel %49 = OpFOrdGreaterThan %bool %39 %float_1 OpSelectionMerge %52 None OpBranchConditional %49 %51 %52 %51 = OpLabel OpReturnValue %54 •