History log of /frameworks/rs/rsov/compiler/spirit/module.h
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/spirit/module.h
877083d07a7fbce460f7f083bc1d5deef4d9ed47 04-Mar-2017 I-Jui (Ray) Sung <ijsung@google.com> Added addString() method to android::spirit::Module

MakeString() was in Builder, but Module does not have the counterpart to
add an OpString to the Debug Info section. The OpString SPIR-V instruction
may be used to carry debugging information and other metadata. This CL
also added a test case to verify the result.

Bug: 30964317
Test: SPIRIT unit tests (gtest),
Change-Id: I5aff827041f5d5e71978a12e366f829d0de819c1
/frameworks/rs/rsov/compiler/spirit/module.h
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/spirit/module.h
4df77d18bf57187f8e7142c6f7a70a9cdd3d581e 31-Jan-2017 Yang Ni <yangni@google.com> SPIRIT: An in-memory IR for SPIR-V

Bug: 30964317

This is a C++ programming interface to create, serialize, deserialize,
and transform SPIR-V IR in memory.

The current focus is to generate and manipulate SPIR-V for Vulkan
compute shaders, which RSoV generates for RenderScript kernels.

Test: Unit tests (gtest), i.e.,
${ANDROID_BUILD_TOP}/out/host/linux-x86/nativetest64/libspirit_test/libspirit_test

Change-Id: I5ae9aec72311402e1f6513cac33fdc7bc1001be5
/frameworks/rs/rsov/compiler/spirit/module.h