History log of /frameworks/rs/rsov/compiler/Wrapper.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
28faded3432d20cc2e9b9e58b4706031bd6ea9c9 22-Feb-2017 Yang Ni <yangni@google.com> Added support for global variables

Bug: 30964317

Pass necessary metadata about global variables--i.e., offsets of each
global variable in the synthesized global buffer--from the compiler to
the driver. This metadata is encoded as an OpString in the generated
SPIR-V code. The driver also creates the global buffer to store all
global variables.

Added support for sharing globals between invokes and kernels. rs2spirv
also does global variable access to global buffer field access
transformation for the CPU code, so that CPU and GPU access the same
global buffer resident in shared memory assuming the same data layout.

Added in the compiler support to handle global variable intializers,
and contantant expressions.

Removed capability Address, since Vulkan validation rules disallow it.
Converted OpInBoundsPtrAccessChain into OpInBoundsAccessChain, since the
former requires capability Address. OpInBoundsPtrAccessChain
instructions get generated for accesses to global variables, which are
now fields in the global buffer.

Added an RSoV test for global variables. Adjusted lit tests to check
the new OpString.

This CL is limited to non-allocation global variables, as global
rs_allocations are handled in separate CLs.

This CL does not handle constant globals either, which will be dealt
with in followup CLs.

Test: lit tests and RSoVTest

Change-Id: Ia8f44c4ffa22046a72a58a26942ced595b3f5f53
/frameworks/rs/rsov/compiler/Wrapper.cpp
eb6548743c40f4129ca55a58ff2d5254f22e95e1 22-Feb-2017 Yang Ni <yangni@google.com> Reorganized metadata related code in rs2spirv

Bug: 30964317

Added a Context class, which is a singleton that is shared across
all LLVM and Spirit compiler passes for rs2spirv. Inside Context,
there is a bcinfo::MetadataExtractor, as well as data structures
for quick lookup of information about foreach kernels and exported
variables.

Cleaned up passes which used to use MetadataExtractor to use this
new Context.

Test: lit tests
Change-Id: I3c88f8e8e75b354d87c155312176544fb660526b
/frameworks/rs/rsov/compiler/Wrapper.cpp
3e5fbb6faf66488ba49c9d2396350ae567dba315 27-Feb-2017 Yang Ni <yangni@google.com> Added methods to serialize/deserialize into/from words

Bug: 30964317

Without requirement to create input/output word streams.

Updated tests and dependent modules to use word vector as input
and output whereever applicable, instead of using word streams.

Test: unit tests, lit tests, and RSoVTest.

Change-Id: I013b1ae7eb70c189142300629bfc5339e8358168
/frameworks/rs/rsov/compiler/Wrapper.cpp
3f30b6202dd5ad6ff66959131d216405850ed152 26-Feb-2017 Yang Ni <yangni@google.com> Added Pass and PassQueue to Spirit

Bug: 30964317

Reorganized rs2spirv using PassQueue.

Changed LiteralString from const char * to std::string, so that the
life cycle of the underneath string is correctly managed.

Improved Transformer so that it can capture changes made to the
global or decoration section while transforming function defintions.

Fixed #include order per LLVM coding convention.

Test: unit tests, lit tests, and RSoVTest

Change-Id: I93b2588f94541ae90d3a847ce3fc3eaa941b7a59
/frameworks/rs/rsov/compiler/Wrapper.cpp
9d73d08c545462e706ef6951952acff94c37605a 23-Feb-2017 I-Jui (Ray) Sung <ijsung@google.com> LLVM and SPIRIT transformations for global allocations

This is the initial compiler-side transformations for global allocation
support.

Added an LLVM pass to lower rsAllocationDimX calls for later SPIRIT
passes. References to alllocations in those calls are lowered into some
unique ID representing allocations of a module.

Also added a SPIRIT pass to transform lowered accessor
(rsAllocationGetDimX) in previous pass to SPIR-V load instructions from
the metadata buffer.

Generate global allocation metadata, necessary SPIR-V decorations and
declarations in the wrapper generation stage for the generated load
instrutions.

Bug: 30964317
Test: RSoV lit tests, SPIRIT unit tests
Change-Id: I00846c255bd76e77c89a16de0e553acc5f73bbfe
/frameworks/rs/rsov/compiler/Wrapper.cpp
bf22a8ab4f46a98ee37f95fc0402744132cc3ed2 07-Feb-2017 Yang Ni <yangni@google.com> Rewrite rs2spirv using spirit

Bug: 30964317

Rewrote the wrapper generation and builtin/runtime function
translation passes in rs2spirv using spirit.

Also added support for about a dozen more floating-point builtin
math functions.

Added support for new-style root kernel with lit test. Added check
for old-style kernels with lit test. Updated existing lit tests
since generated code are slightly different, mostly on temp names.

Added SPIR-V validation to all lit tests.

Updated the RSoV driver to work with the new spirit-based compiler.

The entry point is now named entry_<kernel name>.

Fixed an issue with multi-input kernel, so that the type count is
correctly set.

Minor cleanup to destroy descriptor sets after a kernel launch
and to remove an outdated comment.

Test: lit tests and RSoVTest

Change-Id: I07b5957667892e532dcbc2da98ed38fe783af5e9
/frameworks/rs/rsov/compiler/Wrapper.cpp