History log of /frameworks/compile/slang/slang_rs_export_foreach.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
13fad85b3c99a37c17d8acfec72f46b8ee64e912 24-Nov-2015 Stephen Hines <srhines@google.com> Void pointers can't be exported.

Bug: http://b/25853842

Change-Id: I5b11fd14b6cd57a06522e921c62ed033488aa08e
f075ffc10278e1c127bcf041fce7ce89d428f94c 03-Dec-2015 Stephen Hines <srhines@google.com> Fix a set of inverted conditionals for kernel validation.

Bug: http://b/25853842

A previous refactoring accidentally inverted the conditions here, using
|= instead of &= for a boolean that started as true. Whenever we would
get an invalid call, the |= meant that we would still retain our initial
true value (claiming that the incorrect code was valid). Luckily, other
subsequent checks would then cause the compilation to fail elsewhere
(usually by noticing that we had already queued up diagnostics). With
the increased checking for void * in Bug 25853842, a new test case
triggered a latent assertion that exposed this bug.

Change-Id: I85f4e6db64f5fc8eb0027c30c23dcee2dfaf9826
46e146e0cef555379699f06edb3b2d9673978703 12-Nov-2015 David Gross <dgross@google.com> Restructure handling of special kernel parameters.

This enables special kernel parameter processing to be shared
by foreach kernels and general reduction kernels.

Bug: 23535724

Change-Id: I4234aec2d82f4b39bb2a27f675c061c05ab6db91
1946749cebf4a64341d8210890688fef7d958c22 27-Oct-2015 Yang Ni <yangni@google.com> Launch options & multi inputs for single-source RS

Bug: 23535985

Also renamed rsParallelFor to rsForEach.
Added checks for number of allocations to rsForEach matching kernel function

Added slang tests.

Removed code from RSContext for remembering the rs_allocation AST subtree.

Change-Id: Ibc22bd5e9585a4471b15920ef60fe1fe2312de49
fb40ee2a90f37967bf4a40a18dec7f60e5c580d8 13-Oct-2015 Yang Ni <yangni@google.com> Revert "Revert "Handle kernel launch calls""

Bug: 23535985

This reverts commit 5d9263d3a3a7457b9e5fe6e518c0d822dcdfcda6.

This also fixes issues in change list 172074, which caused some
slang tests to fail due to changed hehavior in error handling.

The fix was based on changes originally posted by srhines@.

To keep single-source functionality working, I separated kernel
name logging from the final export processing code. We would
build a map from kernel funciton names to slot numbers as we parse
the script. The map is used when translating a rsParallelFor call
to a call to the internal rsForEachInternal API, so that we can find
the proper slot numbers.

Here is Steve's original commit message.

Only call processExports() after a successful C99 compilation.

This refactoring fixes a bug in the previous single-source patch, where
exported functions/variables/kernels were being processed during the
regular compilation steps. This wastes compile time, since we don't need
to actually prepare for outputting reflected Java/C++ code if the
compile is going to fail for regular C99 reasons.

Change-Id: I81d88731188f4258f12f4c90ae8dd8abc8c2d641
9741cd951d05b468bb15e7b1554f939393ddf582 11-Aug-2015 Jean-Luc Brouillet <jeanluc@google.com> am 9764eb3b: Change the name for the new rs_context parameter.

* commit '9764eb3be0f2dcaaefa62fddc9fbedf14784ae38':
Change the name for the new rs_context parameter.
9764eb3be0f2dcaaefa62fddc9fbedf14784ae38 08-Aug-2015 Jean-Luc Brouillet <jeanluc@google.com> Change the name for the new rs_context parameter.

Change the reserved name for the new rs_context parameter to be "context".

Since there can be only one rs_context parameter, report an error if the
name is incorrect.

Also use "special parameter" consistently in the error messages to help
our developers distinguish between regular and special parameters.

Finally, some refactoring to make the code more understandable.


Change-Id: I6f23dc5a8ba3659714ad1f7ba41836ff8b92d9ec
c0c5dd85f2d2df2bcf0cb284001f544d6c42eff9 24-Jul-2015 Matt Wala <wala@google.com> Add initial support for validating and exporting reduce kernels.

Bug: 22631253

This change adds support to slang to validate the reduce-style
kernels for errors, and also to create reduce metadata.

Change-Id: Ic9144402dff93a2a28687864637e67fca6808e2e
b3e022a62c7017f7853a6149a63bd00b13091a6c 21-May-2015 Stephen Hines <srhines@google.com> Update llvm-rs-cc version to 23 for M.

Bug: 22179874

This change updates the compiler version, as well as marks the new APIs
usable by Android M.

Change-Id: I2a943274a701e6301b6c41ac3bb4302e0a66b9d0
(cherry picked from commit bd0a7ddceac6c135ea975cefbac73877a1f9dae7)
bd0a7ddceac6c135ea975cefbac73877a1f9dae7 02-Jul-2015 Stephen Hines <srhines@google.com> Update llvm-rs-cc version to 23 for M.

Bug: 22179874

This change updates the compiler version, as well as marks the new APIs
usable by Android M.

Change-Id: I2a943274a701e6301b6c41ac3bb4302e0a66b9d0
a088faa4140ce179c38e56773f638b84c7120769 23-Jun-2015 Stephen Hines <srhines@google.com> Restore "Fix an assertion triggered when using anonymous structs in kernel"

This reverts commit d463956aa4e3e1a26eeb32dc9d705b4b59865041.

Legacy kernels can/will use void pointers for some kernels, which can't
be exported, but are still legal.

Change-Id: Iba405356fe09385ddd424805787ce1c596c37dac
d463956aa4e3e1a26eeb32dc9d705b4b59865041 23-Jun-2015 Stephen Hines <srhines@google.com> Revert "Fix an assertion triggered when using anonymous structs in kernel"

This reverts commit 3f9d0db0d0c841327dbcefe3f2c032ea449d6973.
798e6ab621314f6cd890a14251d4d12e849a17bb 23-Jun-2015 Stephen Hines <srhines@google.com> Merge "Extract special function handling functions into their own namespace."
eae0b7ad0195360b0afc37d51553f2917f1aa365 16-Jun-2015 Matt Wala <wala@google.com> Extract special function handling functions into their own namespace.

This moves a bunch of static functions out of RSExportForEach.

Change-Id: Ibe022105cc03239990af8df3dd13d86a1d4836ec
3f9d0db0d0c841327dbcefe3f2c032ea449d6973 19-Jun-2015 Matt Wala <wala@google.com> Fix an assertion triggered when using anonymous structs in kernel

With asserts enabled, using an anonymous structure in the signature of
a kernel would cause an assertion to be triggered, which caused slang
to exit prematurely instead of printing an error diagnostic.

The problem is in the code in RSExportForEach::Create that exports
the types in the kernel signature. I changed this code not to throw
asserts when it sees a type that cannot be exported. However, since we
expect an error in this circumstance, I added an assert to ensure
that the diagnostic has been issued.

Change-Id: I727695b07d1310c8317b973499faa8088e2b0b4e
e23d82b457517d0302ebabefad32118ac7b78023 12-Jun-2015 Stephen Hines <srhines@google.com> Move the error for pointers in structures earlier in the compile.

Bug: 21597073

This fixes an issue where a function argument is not checked for
compatibility until the reflected code generation (at which point the
message is far more cryptic). We do this by checking parameters for
externally-visible functions and externally-visible globals in our
ValidateType() routine.

Change-Id: I5ab9db1a11ed0e395c7623f1c9997632da057269
(cherry picked from commit ab94bccca64c9b126cbd1b732aa5e681d8639b99)
f5b882cc561f656eb650d0fa6db7bac57989ab12 16-Jun-2015 Matt Wala <wala@google.com> Move kernel/static incompatibility check into AST validator.

The predicate RSExportForEach::isRSForEachFunc() was checking and
reporting an error if kernel attributes were paired with static
function declarations, which is an error in RenderScript. It makes
more sense to do the check in the AST validator. That way the work of
the predicate function doesn't involve validation.

Change-Id: I8a956f5e4ad72845ed759f9088cf8e3d543d2a0a
ab94bccca64c9b126cbd1b732aa5e681d8639b99 12-Jun-2015 Stephen Hines <srhines@google.com> Move the error for pointers in structures earlier in the compile.

Bug: 21597073

This fixes an issue where a function argument is not checked for
compatibility until the reflected code generation (at which point the
message is far more cryptic). We do this by checking parameters for
externally-visible functions and externally-visible globals in our
ValidateType() routine.

Change-Id: I5ab9db1a11ed0e395c7623f1c9997632da057269
fb78d4c6604bd243578ce8071e31f68c023d82cf 31-Mar-2015 David Gross <dgross@google.com> Support new-style kernels with no output and no input.

Such kernels get the definition of their iteration space solely through LaunchOptions.

No runtime testing of no-allocation kernels yet.

Bug 19950069

Change-Id: I452f948967d52e0ce8998628d554ab188cae9116
cd7d3128f41a59692e5c59a2b81969616579aae4 13-Mar-2015 David Gross <dgross@google.com> A kernel may have at most 8 inputs.

Change-Id: I09bbd52d9f4d4cd4f6772ae75b1eeb9096017472
7cc6876212646f91cd718a72a1845a0563838fe9 11-Mar-2015 David Gross <dgross@google.com> Remove extraneous semicolon from namespace-closing curly brace; was breaking some builds.

Change-Id: I6d9c24615e741e271584a10f301325bc54675461
18c50ebf6e87a6f51de8f21dce6282d1096e50c2 30-Jan-2015 David Gross <dgross@google.com> Frontend support for new special kernel params ctxt and z.

Includes new test cases to ensure we can check for proper usage.

This change will not compile without related platform/frameworks/compile/libbcc changes.

Bug: 18964628

Change-Id: I6e5cd6f221469426a84cff11be6a101a5855456d
5abbe0e9ca2508260b627ffef2bf01e2554e8357 13-Aug-2014 Chris Wailes <chriswailes@google.com> Replace the NULL macro with nullptr literal.

Change-Id: I33609969cd0d7aa55eaa83fb2c65f5faa6d55fa0
c9454afec1649846512993d0ef65a9f868976bb4 14-Jun-2014 Chris Wailes <chriswailes@google.com> Adds support for multi-input kernels to Slang.

This patch modifies slang in the folowing ways:
* Updates some of the development target API logic.
* Adds logic for validating kernels with multiple inputs.
* Added support for multi-input kernels to the Java reflection code.
* Adds tests for these new features.
* Updated existing tests with the new error messages.

Change-Id: I46d2834c37075b2a2407fd8b010546818a4540d1
eca0534a31b6185d6ab758f5e97acd7a4cb21e8e 15-May-2014 Jean-Luc Brouillet <jeanluc@google.com> Add details to the TODO, simplify dummy names

Change-Id: I37451d8217c3d61ea76db377785045edb2d5c4b0
ee4016d1247d3fbe50822de279d3da273d8aef4c 11-Apr-2014 Tim Murray <timmurray@google.com> Update Slang for Clang/LLVM 3.5a.

Change-Id: Icd59efa1197098076555c505c31939866e504a83
482caac59574f980cc78b2ac63e01a926da86a96 18-Jan-2014 Jean-Luc Brouillet <jeanluc@google.com> Allow 'x' and 'y' to be of type signed int. Validates they are of the same type.

Change-Id: I408a009df25a179c7e2256a02c6e5dd16c3c74fa
42f81b2b44205f421c6bd4727ce8c25b0effcb55 17-Jan-2014 Jean-Luc Brouillet <jeanluc@google.com> Require 'x' and 'y' as the parameter names of the iterators.

By requiring the iterators to be named exactly 'x' and 'y', we can simplify processing. We can also improve the error messages. Note that the error messages are not printed in strict increasing order. If that's important, it's trivial to separate the search for IndexOfFirstIterator into its own function.

Change-Id: I71ebf4118154924d67af31c44dbdb07ed0f54a77
d3f7527b105d21f1c69d3473eb88a762f2c3ab5a 17-Jan-2014 Jean-Luc Brouillet <jeanluc@google.com> Add ReportErrror/Warning to RSContext.

Remove a lot of boilerplate code by adding error reporting methods to RSContext. There are still a few additional files that could be cleaned. That will be for another CL someday.

Change-Id: I6a261735720227ac87d94dbdea5ce4a7b8ef6cca
0f2a2397df53a1bb74609abe3c27719bc7e3c328 14-Jan-2014 Jean-Luc Brouillet <jeanluc@google.com> Code refactoring, no behavior change.

Changed a couple of member variables to be more descriptive. Unified setting of signature metadata into one function.

Change-Id: I4b4730d8159b8a67a4d9d39713dc2bec8eb8d01a
23c4358f12bd9d0ba7166eceebd683db95a41b3f 10-Jan-2013 Stephen Hines <srhines@google.com> Updates for LLVM merge to r171906 on 20130108.

Change-Id: I4cf3718041d8876d4a23a412b6b4fa4226ec3b50
089cde338148fbb75825aea4539ccdae8211ffef 08-Dec-2012 Stephen Hines <srhines@google.com> Forbid non-const static variables in kernels.

Bug: 7688011
Change-Id: If03084a9ece76478e0ed0847b75f09c41b89a500
9ca96e70657cf5437a294213f56ba4768dc08ad2 14-Sep-2012 Stephen Hines <srhines@google.com> Support for pass-by-value kernels.

This change allows the JB-mr1+ target API to declare compute kernels
using "__attribute__((kernel))". This disables the use of pointers in the
function signature and forces any output to be explicitly returned and
input to be passed only by value. We still allow the user to add x, y
coordinates if they want them.

Bug: 7166741

Change-Id: I1407fceefb11c7d6c17221ca156cfce443c2b218
43730fe3c839af391efe6bdf56b0479860121924 03-Aug-2012 Shih-wei Liao <sliao@google.com> Apply changes to migrate to CLANG-160673-20120724.

Change-Id: I666df2ff91532318883dd48ea1249178b2ebda81
c17e198ffcd37bfc57e3add1f6eee952ae2a2eab 22-Feb-2012 Stephen Hines <srhines@google.com> Support dummy root() and re-ordering in presence of non-root kernels.


Change-Id: Ib3ed249916d36acf68ab32e9216804ae1da5e991
7b51b55e4467605a599e868a0dde7cb95c5ab76e 16-Feb-2012 Stephen Hines <srhines@google.com> Export ForEach on non-root functions.


This change also updates expected diagnostics for our existing tests.

Change-Id: I98e12625d121ae20fcb6dcaacf0852c0f239c604
9999ec3aa0c4d7a6befd3a300dc07f0cea91cb6c 11-Feb-2012 Stephen Hines <srhines@google.com> Clean up graphics/compute root() distinction.


Change-Id: I29096556dff2072a8757e0dfd3321006cd60bb27
f8c8600eb5eebee41fd88611e5c770a42f3330b5 09-Nov-2011 Conley Owens <cco3@android.com> Remove unused variable

This unused variable breaks the build in an Ubuntu 11.10 environment.

Change-Id: Ieeb206d1a3689217070cfb8e8dee8a2c9c467b44
fbfd7f5fd97458b6b23437556025ac1d55e98fd4 28-Oct-2011 Stephen Hines <srhines@google.com> resolved conflicts for merge of f736d5a1 to ics-mr1

Change-Id: If31e6d49af2571458500f42f8cc2310758dfaa26
f736d5a12269e7e74740b130cdca98d9839b31e6 27-Oct-2011 Stephen Hines <srhines@google.com> Add back pre-ICS support for "int root(int);".


Change-Id: Ic1f3c071562c687a98125c2151e306313c5405b8
9207a2e495c8363606861e4f034504ec5c153dab 21-Oct-2011 Logan Chien <loganchien@google.com> Apply changes to migrate to LLVM upstream Oct 20th 2011.

- StructType::isAnonymous is renamed to StructType::isLiteral.

- PassManagerBuilder has been moved from
llvm/Support/PassManagerBuilder.h to

- Include llvm/Transforms/IPO.h for llvm::createInternalizePass.

- clang::DiagClient has be renamed to clang::DiagnosticConsumer.
Besides, we have to implement one additional pure virtual method
'clone' for create a clone of slang::DiagnosticBuffer.

- llvm::Linker::LinkModules comes with one additional parameter.
Passing llvm::Linker::DestroySource should be equivalent to
the old code we were using.

- slang::Slang is now derived from clang::ModuleLoader and implemented
loadModule pure virtual method (though we will always return NULL.)

- clang::Preprocessor is taking one additional parameter for

- clang::Diagnostic has been changed. A lot of the method has been
moved to clang::DiagnosticsEngine, and we can no longer 'Report' a
diagnostic from clang::Diagnostic. We have to use
clang::DiagnosticEngine instead.

- llvm::setCodeModel has been removed.

Change-Id: I1f2a4cbeaf61a8ed1d0d635a5a0e1baa90d99d07
12580dcd125d958bff87385ab13599ad01bd8aea 11-Oct-2011 Stephen Hines <srhines@google.com> Generate an error for skipped root() params in HC.


Change-Id: Ie41ef5feac1637c8fe146f065416f3d33527b0bb
688e64b2d56e4218c680b9d6523c5de672f55757 24-Aug-2011 Stephen Hines <srhines@google.com> Generate .rs.dtor() to clean up globals.


Change-Id: I9d1996153fe774a5ce95646a8a2e07aa6e7fa85f
4ccf75e55fe460a8daa49247d7e5a797329c71a6 17-Aug-2011 Stephen Hines <srhines@google.com> Fix up parsing of root() function arguments.


Change-Id: I6ef41ebd237c864e46beee26f5952879d3712819
b69aa6557572c9ca91c46add3016962af0c993e7 22-Jul-2011 Stephen Hines <srhines@google.com> Fix double delete (from RSExportable during teardown).

I should not have attempted to delete the storage in this case. At this point
in compilation, we have already appended it to a list of objects to be cleaned
up. This results in a mistaken double deletion of the same object, which in
turn causes the compiler to seg fault (instead of terminating nicely).

Change-Id: I479153e146ef3ed3a5c728494c35d7d2b75fc292
1688a3c56851f235866d6870c89ddb20650cc030 22-Jun-2011 Shih-wei Liao <sliao@google.com> In syncing to 133163, now clang::FieldDecl::Create has 1 more parameter.

Namely, HasInit at the end of parameter list.

Change-Id: I9eaf1dc4a539011a9e4a3ded8870e7d450450703
b5a89fbfcba6d8817c1c3700ed78bd6482cf1a5d 17-May-2011 Stephen Hines <srhines@google.com> Clean up forEach reflection code.


Change-Id: I8196608408fe333bd8e875d9517b8e875bdce17d
593a894650e81be54173106ec266f0311cebebd3 11-May-2011 Stephen Hines <srhines@google.com> Simple support for reflecting rsForEach().


Change-Id: Idf722ee3fb07c8e46ac0c4628e753ff2fa6840cf