History log of /frameworks/rs/cpu_ref/rsCpuScript.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ae2ec3febedfc29376b9104413fb4042028f1265 01-Jun-2016 David Gross <dgross@google.com> Delete simple reduction implementation.

Bug: 27298560
Change-Id: I8c3d568e98aaf0b7d86881c985d13ed5b8e95338
87643a32d4eaefe349d3a81513fffe0c4e3e8a80 04-May-2016 Yang Ni <yangni@google.com> Avoid breaking on dead launch options

Bug: 28463187

Launch options array[2-4] are not initialized by the support library
in the current SDK.

They may have arbitrary values that invalidate the checks that this CL
is removing, and cause a kernel launch to bail out unnecessarily.

This CL removes those checks, since the array.*Start and array.*End
fields in the launch options are not used anywhere in the current

Change-Id: Ib8a2e551619f770b402f569acbde635ee047675a
5e48002cc4a11e9ce63852a77488cfb9f6765c2b 06-Apr-2016 Yang Ni <yangni@google.com> Avoid accessing TLS in rsClearObject()

Bug: 27874893
Bug: 27925095

rsClearObject() may be called on rsContextDestroy() in the JNI thread,
where TLS is not initialized.

This also reverted Icca50fade1199b6f530f963e9e694366b7d8cf67 that
made rsContextDestroy() go through the FIFO. rsContextDestroy() must
happen off the FIFO, since it joins the FIFO consuming thread.

Both the rsClearObject() change and the rsContextDestroy() revert need
to go together to make RenderScript and Camera CTS tests pass. Hence
this single CL for both changes.

Change-Id: I5f1d91a4cc1ce9bf2b3386fbef6f1171638b5266
(cherry picked from commit ade3137c22dd91694742145c2d5fe9d6bae17516)
abe31c581489727afa84f9b756f0d2a0f4be057e 30-Mar-2016 David Gross <dgross@google.com> Merge "Multithreaded execution of certain general reduction kernels; reduction test overhaul." into nyc-dev
10adb0c2029f112b5738228617d5645f6ecea0c5 29-Mar-2016 David Gross <dgross@google.com> Multithreaded execution of certain general reduction kernels; reduction test overhaul.

A reduction kernel is eligible for multithreaded execution if it has a
combiner function and it is launched over a 1D iteration space.

Note: Properties debug.rs.reduce-accum and debug.rs.reduce-split-accum
are added for debugging multithreaded reduction.

The following changes are made to reduction tests in RsTest:
- Overhaul the test framework -- now data-driven, and can execute the same
test multiple times with different seeds and input sizes, features
separate sets of quick correctness tests, full correctness tests,
and performance tests. (Performance tests are not run by default.)
- Report timing information for test execution.
- Report more information for fz* kernel testing.
- Remove dp kernel testing -- this involved floating-point arithmetic
which is not guaranteed to produce identical results between java
and rs or for different rs multithreaded executions.
- Add sumgcd kernel testing. This is intended to be representative of
a compute-heavy kernel.
- findMinAndMax kernel testing must compare cell value not cell index
-- two or more cells might have the same min or max value, and java
and various rs multithreaded executions are not guaranteed to find
the same cell.
- Fix bug in findMinAndMax kernel's combiner function. (It behaved
incorrectly when operating on an accumulator datum that has been
initialized but never passed to the accumulator function.)
- RsTest now requests largeHeap.

Bug: 27299475
Change-Id: I58f99c21389dbae5c8e3ad85d98700dc165664bb
a7481b21c4ad4127f54c02c7402039d068948a34 11-Mar-2016 Yang Ni <yangni@google.com> Fixed intrinsics inside a script group

Bug: 27439842

An RS intrinsic relies on RSExpandKernelDriverInfo.usr for the "this"
pointer to the ScriptIntrinsic object.

Need to to correctly set that field in a script execution for intrinsics.

Also fixed a bcc command-line option.

Added a test of script group with intrinsics to ImageProcessing GroupTest(native).

Change-Id: Ia8b45bca3396ac987ba167fd1709ee89123a2557
(cherry picked from commit 7a106adbb5e370b544f2cbf5b83c063560c81b57)
838c2d0dc0b8b07d4aa8de4360765738c6d2770e 25-Feb-2016 Miao Wang <miaowang@google.com> Better handle error log and nullptr reference.

Bug: 27367378

Change-Id: Ide29c702d7a70dfe087ddc600d3fd17279223196
(cherry picked from commit 68e00893f7400d1ce71a9ed92365ffdfd6730c03)
f7f9316f4cf373733285f947bea876ead7216715 18-Nov-2015 Verena Beckham <verena@codeplay.com> Add a new libclcore_g library which contains debug info.

Add a new libclcore_g.bc which is functionally equivalent to
libclcore.bc but is compiled with debug information and -O0.
To achieve this some allocation functions had to be written in C,
because they were previously available in LLVM IR without debug
The RenderScript cts has been run to verify these changes, both as it
is and forcing it to link with the new libclcore_g library. Both runs
show no regressions.

Signed-off-by: Verena Beckham <verena@codeplay.com>

(cherry picked from commit fb99e0f905b0f73a505c7900b434531ce7c3e2e5)

Change-Id: I64c82ce6f571e766c3c607e926326040dff8257c
6c1876bbef1b2c89975dce91230a168bd2d2ce4c 15-Jan-2016 David Gross <dgross@google.com> Support for general reduction kernels.

Requires coordinated change in frameworks/base.

Requires coordinated change in frameworks/compile/libbcc in order
for RsTest to run.

At present, general reduction kernels are run single-threaded.

Also: Remove dead struct field MTLaunchStructForEach::sig.

Bug: 23535724
Change-Id: Ice17ccf20a902f8a106eaa62ec071d46e3c0ad8c
14ce007a633b10e3b9a3fae29d8f53a7e8c9b59f 31-Jul-2015 Matt Wala <wala@google.com> Add a basic implementation of the reduce kernel API to the CPU
reference implementation.

Bug: 22631253

For now, this just runs a serial reduction on one thread.

Change-Id: I34c96d24bb6f44274de72bb53160abcf79d143b0
f5029803ae6ce9d92d70b76e7a7cdd8d484f31ca 22-May-2015 verena beckham <verena@codeplay.com> Add a flag to the API to specify -O0 on the bcc command line.

Add a flag RS_CONTEXT_OPT_LEVEL_0 which sets a field mOptLevel in the Context
to 0 when calling bcc.
Using this flag will result in an object file that is easier to debug.

Change-Id: I9673506710cc9f34c415b694fe5d6bc7e967f1db
Signed-off-by: verena beckham <verena@codeplay.com>
1efae29f4bbe6c165caf6dfc4b89cf8a5f8c469b 28-Jun-2015 Yang Ni <yangni@google.com> Avoid overwriting shared library file that is open


Writing different contents to an existing .so file, which is currently
open, may corrupt its globals and code. Choose a different file name

Change-Id: I3e649b09a55b43339283aa1c46f2844c66434c17
(cherry picked from commit 9844cffc8af28c4829012bc0c48f85d04b671f88)
6a236ad3a3760e8124b68a1b6220ed6e4fbfb152 22-Jun-2015 Stephen Hines <srhines@google.com> Skip the checksum if we have precompiled code on the /system/ partition.

Bug: 20894664

The system partition is read-only, and can/should be compiled correctly
during the offline creation of the system image. Since we cannot replace
these precompiled blobs (short of app update/OTA), there is no reason or
correct way to validate/replace the checksum.

Change-Id: Ia66bfdbe178bf215e146c3699f5bc7804222e978
c5b28f7626368e0ad5dc9ba5223c4a25b6e8b8e5 29-May-2015 David Gross <dgross@google.com> Merge "Remove dead uses of RSCompilerDriver and of compiler callbacks."
b043df0676fef226336deb3a00ead2f31e02343f 29-May-2015 David Gross <dgross@google.com> Remove dead uses of RSCompilerDriver and of compiler callbacks.

Change-Id: Ibe8725074724b75e35c25a404daaba07ffbca2ab
c246d91e490df18899490931469d277064070a63 22-May-2015 Yong Chen <yong.a.chen@intel.com> Fix memory leak when rs invoke function

Change-Id: I17c701dfda5b3031c1fc50bfc186e4b7f8b7ac1e
Signed-off-by: Yong Chen <yong.a.chen@intel.com>
cee9e9898ed549d00c1fd1c911feff66dbb4225e 23-May-2015 Stephen Hines <srhines@google.com> Merge changes from topic 'global_info'

* changes:
Update RS driver to support extraction of global variable properties.
Use "override" instead of "virtual" when replacing methods.
5aa018cc36e589b07674957714d27ae3d1fa1c4e 21-May-2015 Stephen Hines <srhines@google.com> Update RS driver to support extraction of global variable properties.

Bug: 20306487

This patch adds some new enums to classify properties (such as "static",
"constant", and "pointer") for global variables. The reference driver
is also extended to provide methods to examine these properties (when
the bitcode is compiled with bcc).

Change-Id: I331756f8a8990caf5ebdf85599060434a7cfdcb7
2df576745c52a04a42d615f83b03f19d803b7757 16-May-2015 Elliott Hughes <enh@google.com> Don't use TEMP_FAILURE_RETRY on close in frameworks/rs.

Bug: http://b/20501816
Change-Id: I63a7c690bc5bde3dc1354f6e04ad8d32b3b43015
1de97c307624f57d95281ebaa77c2129e66e21bc 11-May-2015 Jason Sams <jsams@google.com> Merge "Add RSGlobalInfoPass information to RS driver."
4c368af7e705f0bcb77fa99495b2e33ef20d2699 06-May-2015 Stephen Hines <srhines@google.com> Add a way to link against different driver names.

The existing linker path hard-coded "-lRSDriver" into the command line, but
this won't work for partner drivers that have a different implementation
loaded. In order to still properly handle use of the CPU driver, this needs
to change depending on whether we actually loaded an OVERRIDE_RS_DRIVER or

Change-Id: I0c4a4f12f5db819b234952bc8f364ac6300f147b
8409d6414dd4a42aa59779fcfe9fce18648cb135 29-Apr-2015 Stephen Hines <srhines@google.com> Add RSGlobalInfoPass information to RS driver.

Bug: 20306487

This change enables vendor drivers to configure support for including
additional information about global variables in the emitted CPU code.
This information includes the number of total global variables, the
names of these variables, the addresses of these variables and the
sizes of these variables. The driver can also select whether the
information includes constant (immutable) globals or not.

The reference driver defaults to embedding information about each of
the existing, non-constant global variables.

Change-Id: I1e55fc3f08e518f04eeee3e4f9dc7b6ea3b80d7c
80afd424b02291e6f088cab2961537c7ba1ee2a5 29-Apr-2015 Pirama Arumuga Nainar <pirama@google.com> SetError if forEachMtlsSetup fails sanity check

bug 19866850

Explicitly set error when a kernel launch fails.

Change-Id: If42419f3cf7557c524afc5bb27a0753460ca7e4e
247f8ee57196d6cf3264e6f7505f53e8f8a7860d 19-Apr-2015 Logan Chien <tzuhsiang.chien@gmail.com> Code cleanup: Remove unused typedefs and declarations.

Change-Id: I48dafb2bc1dc335a52b289db2981397251f673c8
f6dc05e18930bdb5ca74e5be773ee269263fb676 17-Apr-2015 Yang Ni <yangni@google.com> Merge "Dedup checksum calculation routines"
cb17015fed6b11a5028f31cc804a3847e379945d 16-Apr-2015 Yang Ni <yangni@google.com> Dedup checksum calculation routines

I introduced a separate routine to cacluate checksum for ScriptGroup
in my previous CL, in addition to the one we use for regular scripts.
This CL removes the new one and uses the old one.

While I am on it, I made some other minor changes, e.g., changing
mBuildChecksum in RsdCpuScriptIml from char* to uint32_t, and a few
other minor cleanups in ScriptGroup2 implementation.

Change-Id: I168fdbb4e7bd14f1549a687e7b0d0ca6dd4da866
a9139c724f8312b3634d213599f2d6b3b2505db2 17-Apr-2015 Jason Sams <jsams@google.com> Fix allocation-less launches.

Change-Id: I6d6b46c55f3e88a810ebe51def3ebaccb1fd3fa2
f02a2b0a2749d4a4f07edbc23eddff2e51d11b72 08-Apr-2015 Yang Ni <yangni@google.com> Compute checksum for script group generated code

Change-Id: I5f469266fd11b5031d1357f356ac40e00f5c0348
2fa8a238dd69afebdeb757adcb1d674043d78e32 26-Mar-2015 Pirama Arumuga Nainar <pirama@google.com> Wrap TEMP_FAILURE_RETRY around system calls

BUG 19934827

Wrap TEMP_FAILURE_RETRY around system calls that can return EINTR
(waitpid, close).

Refactor fork/exec flows in various places into a utility function
and log errors so we can better understand failures in the test server.

Fix a small use-after-free issue in ScriptGroups.

Change-Id: I60b192f83c395a13c27cd6bd2289c44132b84791
062c287f573ecc06c38ee4295e5627e12c52ac3d 21-Feb-2015 Yang Ni <yangni@google.com> Runtime support for Script Group as single module

Also made two other cleanups:
- Changed KernelID/InvokeID into IDBase in class Closure
Rather than having two fields in class Closure, one of type ScriptKernelID and
the other InovkeID, use a single field of the common base class IDBase. Added a
boolean field to indicate whether it is kernel or invoke, since -fno-rtti is on.
- Removed user pointer from CPU closure

Change-Id: I5553f86b2e58325f85649078d48685a38f12d62f
aa6757ffc1b23d771566439c3179fdbc1e5ba569 14-Feb-2015 Pirama Arumuga Nainar <pirama@google.com> Add build fingerprint and ensure match on .so load

bug 19216507

If ro.debuggable system property is set,
- Compute the Adler32 checksum of bitcode, compiler arguments, bcc,
libclcore files.
- On shared object load, check that there is an embedded checksum value
in .rs.info and it matches the value computed in the previous step.
The .so is not loaded if the checksums don't match.
- If invoking bcc, pass the checksum as an argument.

If ro.debuggable is not set, a constant checksum is added to .rs.info.
But it is never checked.

Change-Id: I0a9d16b34148b748daf744007a8515511714a5a5
2abfcc6d129fe3defddef4540aa95cc445c03a7a 18-Feb-2015 Yang Ni <yangni@google.com> Moved class ScriptExecutable to its own module


This move also included the related class SharedObjectUtils.

Change-Id: Iefd587b659c4ad99340c330955b41cd92df45563
c31585b8ca865bf2b35abc79c8a8ee42de27bee8 15-Feb-2015 Yang Ni <yangni@google.com> Remove STL references from header files


Replaced std::string with android::String8, and std::pair with
android::renderscript::Pair, in header files.

Change-Id: I20ac1a3b7a019e5eee12fac46ad6adf64d850459
508b1afdff080ccb8546021649559fc5c720aecd 19-Feb-2015 Pirama Arumuga Nainar <pirama@google.com> Move bcc::getCommandLine to fw/rs

libbcc had a utility function to concatenate string arguments. This
patch moves that function to frameworks/rs. The function will no longer
be needed in libbcc once we move all the checksum/cache invalidation
logic to frameworks/rs.

Change-Id: I2b1c15c2763d90d7b099e41257bb72f200680943
eb9aa675754c49f613c6ad71d41472b30f38b007 27-Jan-2015 Yang Ni <yangni@google.com> Runtime support for invocables in ScriptGroups

This also includes support for InvokeID

Change-Id: I5b59df166ea30b309b8dd9623825ac0e72d03856
fe4f02f81d7c461835be97eebbde744885846e99 05-Feb-2015 Miao Wang <miaowang@google.com> Merge "Make rsContext be able to have info about the path of native libs for 64bit Renderscript compat lib."
f3213d7fd648da98bb3b03204eaf90f03c31926b 14-Jan-2015 Miao Wang <miaowang@google.com> Make rsContext be able to have info about the path of native libs
for 64bit Renderscript compat lib.

- Native lib path stored in Java and queried from JNI.
- Then set to Context during context creation.

Change-Id: I3c997cf849efb7b9a0b0ac35d5b62289d70e7434
da0f069871343119251d6b0586be356dc2146a62 12-Jan-2015 Yang Ni <yangni@google.com> Runtime support for compiler kernel fusion.

The runtime will start a seperate process to call the new bcc to fuse kernels.

Change-Id: Ia73ea917a126a5055ec97f13d90a5feaafd6a2f5
e8f9fba78f0cb79fa8773373a635e30382113a75 30-Jan-2015 Yang Ni <yangni@google.com> Remove STL references from header files


Change-Id: I2138664d8ef51d15da23be69ac7d224f30224f42
68173de001c5d41c74828a426651e07cfd9e8710 28-Jan-2015 Pirama Arumuga Nainar <pirama@google.com> Mark scripts as threadable or not

bug 19095896

Read embedded flag in .rs.info and use it to mark Scripts as threadable.
In compat lib path, scripts are always threadable.

Change-Id: I85a3753ffae788dbdec5fd130c20581790c4ee07
bf2111d3b3de310932099514f06924e48fa1d7b2 27-Jan-2015 Jason Sams <jsams@google.com> add array launch support.

Change-Id: I66cd89b5b44eafa92f391708a06464cd7cdde3ed
a309ef08865aeccd5575b7e4f727936bb6c18aab 26-Jan-2015 Pirama Arumuga Nainar <pirama@google.com> Merge "Read pragma keys and values from .rs.info"
577194ac9c2bf10f31e564de91371764b265929a 23-Jan-2015 Pirama Arumuga Nainar <pirama@google.com> Read pragma keys and values from .rs.info

bug 18322681

Pragmas were not embedded into shared objects in the compat lib path
because they aren't used. Along with the sibling change in libbcc, this
patch stores and retrieves pragmas from the .rs.info varible embedded in
shared object files.

Change-Id: Iebbf9a79e715a5a4a1ee0962a08386fa78516c6b
bf96a520e162b503b293f65ca9ca9be66d4a0036 24-Jan-2015 Tim Murray <timmurray@google.com> Always recompile a script when using the debug context.

Change-Id: Icea9834805702c20c250d2dec48cdf8f11a0acfb
1c44cb6b1133730cd18929d637e71e9326c70bd0 22-Jan-2015 Yang Ni <yangni@google.com> Made shared lib routines public.

So that we can reuse the shared library create and loading routines
for script groups.

Change-Id: I9f35d8efc4be686c92141ab770f78f35ea3a02c1
d9bae689c1b8c3f2ed1a5f2b374dc9393584b8dd 21-Jan-2015 Yang Ni <yangni@google.com> Created a new class to represent executable.

The new class represents executables created from shared objects,
which allows query exported fields, for each, etc.
This allows this functionality to be shared with other part of the
system besides CPU script, e.g., script groups.

Change-Id: I5223c329bdb70085eb1dce7aab5ec91626f579f4
f0558cce29611fdba9fdd50d39785f53d95fe1d5 21-Jan-2015 Pirama Arumuga Nainar <pirama@google.com> Do not check for .so in /system in native mode

Bug: 18322681

In native mode, the .so file will be present only in the app specific
cache directory. Any match in /system/lib is merely due to name clash
with another app. Shared libraries in /system/lib are relevant only in
compatibility mode.

Change-Id: I2713820c76b63bd69f726e50f0a39974661c05f1
45e753a46e587c69b3b0d0c5138e88715a24a29a 20-Jan-2015 Stephen Hines <srhines@google.com> Remove linkloader from frameworks/rs.

Bug: 18322681

Now that we have switched completely to the new shared library object
loading path, we can safely remove the legacy linkloader path.

In frameworks/rs, this removes the actual linkloader code, as well as
all helper calls into linkloader. This change also coalesces code paths
between the support library version of RS and the native version of RS,
since they both now depend on a similar shared library loader. A missing
call to dlclose() on Script teardown is also added on the native library

Change-Id: Ie5cc152d93f5e75383f7c21a4523579cfae8823f
c0d68470b978a79ce024fde56f23ea3690603ccd 20-Jan-2015 Jason Sams <jsams@google.com> Cleanup of ForEachParams in cpu ref

Change-Id: I8cc51915b2a605c240d98e3010619b741a13bae2
b5215a52df4402a8a513c3dc65d06b9bd46e879d 16-Jan-2015 Pirama Arumuga Nainar <pirama@google.com> Turn on .so path by default

Bug: 18322681

If there are problems in the .so loading path, you can turn it off by
having is_skip_linkloader() return false.

Change-Id: I31ae2d8a65f70005f4d749f9ecbe55ae6f153d8c
dc0d8f7c0f1f43f25c34fbc04656ad578f6e953b 03-Dec-2014 Pirama Arumuga Nainar <pirama@google.com> Skip linkloader, use shared object files

Bug: 18322681

- In rsCpuScript, if property rs.skip.linkloader is set, look for a .so
file in the cache directory and load it. If it is not available, use
bcc to generate relocatable object file and link it to a .so using
ld.mc. Use the embedded symbols in .rs.info and follow steps similar
to the compatibility library to invoke script functions or access
script variables.
- Add rs* symbols like rsGetAllocation to libRSCpuRef (ala
libRSSupport). Do necessary changes to argument types to get mangled
names correct.
- Make 64-bit version of rsSetObject take two pointers instead of a
pointer and a large object. rsIsObject takes a pointer instead of a
large object. Otherwise, we get failures in x86_64 due to calling
convention mismatch. To match the function names in the shared object
path, define these functions as 'extern "C"' with their mangled names.
- Add stubbed Math functions from rsCpuRuntimeMath and
rsCpuRuntimeMathFuncs into libRSCpuRef.so.
- Coalesce separate #ifdef paths in libRSCpuRef. Function parameters
for runtime callbacks and bcc plugin are needed in the
non-compatibilty path, but take default NULL arguments. This patch
introduces these parameters into the compatibility path as well, and
passes default NULL arguments.

Change-Id: I8a853350e39d30b4d852c30e4b5da5a75a2f2820
687cfe85c3cffb244a7e5daeb1231f441a1ed54d 08-Jan-2015 Tim Murray <timmurray@google.com> Enable autovectorization in CPU driver.

Change-Id: Ibc10c61dee8d071256a9ebd6c4c47cb7dc617284
9cc5708a0bf7a81551ccad8ab5c5abe23ec1b853 06-Jan-2015 Jason Sams <jsams@google.com> Merge "Align ScriptInvokeV parameters to 16 bytes for x86_64"
584e58bb75a4d742e3a9dfcfea36eba59b38dbd9 17-Dec-2014 Stephen Hines <srhines@google.com> BCCContext is actually dead code.

This should have been removed as part of the switchover to standalone bcc.

Change-Id: Icbb9a4c064dd9f002f9acfa1ac7748745501de2b
eaba5a3ca215729258dcf9ac6f0bb5f88c78f998 12-Dec-2014 Yong Chen <yong.a.chen@intel.com> Align ScriptInvokeV parameters to 16 bytes for x86_64

Change-Id: I0c9aea220b12f364c0a1a90232fbaa40ad90aeec
Signed-off-by: Yong Chen <yong.a.chen@intel.com>
358ffb84f56929cd2d61f6429a790a1606eaf865 09-Dec-2014 Tim Murray <timmurray@google.com> Enable A53 erratum workaround in bcc.

bug 18683922

Change-Id: I33636dfa74605211c4898cc08fcee6e0f77978e5
7d774858f7b0459dc90158341a8f7eb4b395b61c 01-Oct-2014 Stephen Hines <srhines@google.com> Fix script instancing issue for RS compatibility library.

Bug: 17734273

This switches us from using symlinked files to using explicit copies. The
latest Android linker actually checks the inode for the loaded shared object,
so a symlink is now insufficient to have it count as a distinct object to

Change-Id: I729993696ef8d656761fe571703ab96d4bec940b
44bef6fba6244292b751387f3d6c31cca96c28ad 12-Aug-2014 Chris Wailes <chriswailes@google.com> Replace NULL macros with nullptr literals.

Change-Id: I918c40879aa547438f77e7d1a95fa2aa33bec398
6847e73314e13aa02231268cca245a81eb0539ca 12-Aug-2014 Chris Wailes <chriswailes@google.com> Replace android::String8 with std::string

Change-Id: I5b2b6d3e38afd0b040f0a584613745206bf01ba0
93d6bc872b7d9fba63abfa7513d56b38d9c3d371 29-Jul-2014 Chris Wailes <chriswailes@google.com> Replaced android::Vector with std::vector.

Change-Id: I4c6abd964dc4b1412ec2e592fc8e835fecfe53f6
70d4971878444fe7cf4263998b0c3f46e2b6c71f 08-Aug-2014 Chris Wailes <chriswailes@google.com> Adjust to handle the change to std::vector in libbcc.

Change-Id: I9bcf36d088d423246312d97e2a87a05e90f6617d
f37121300217d3b39ab66dd9c8881bcbcad932df 17-Jul-2014 Chris Wailes <chriswailes@google.com> Collapse code paths for single- and multi-input kernels.

This patch simplifies the RenderScript driver and CPU reference implementation
by removing the distinction between sing- and multi-input kernels in many
places. The distinction is maintained in some places due to the need to
maintain backwards compatibility. This permits the deletion of some functions
and struct members that are no longer needed. Several related functions were
also cleaned up.

Change-Id: Id70a223ea5e3aa2b0b935b2b7f9af933339ae8a4
4b2bea3dc20865f3a198797702e19912a6a2171c 13-Aug-2014 Stephen Hines <srhines@google.com> Revert "Collapse code paths for single- and multi-input kernels."

This reverts commit 818cfa034e257c7bb48356257f5cb67334e19aa6.

Change-Id: I59f39f52e6c8f60bb01cbcb8ccf2215eaf46a57f
818cfa034e257c7bb48356257f5cb67334e19aa6 17-Jul-2014 Chris Wailes <chriswailes@google.com> Collapse code paths for single- and multi-input kernels.

This patch simplifies the RenderScript driver and CPU reference implementation
by removing the distinction between sing- and multi-input kernels in many
places. The distinction is maintained in some places due to the need to
maintain backwards compatibility. This permits the deletion of some functions
and struct members that are no longer needed. Several related functions were
also cleaned up.

Change-Id: I77e4b155cc7ca1581b05bf901c70ae53a9ff0b12
05ef73f2d934f1083cc3b8aeb33fe21de9d6e88f 05-Aug-2014 Jason Sams <jsams@google.com> Fix isObject when in 64bit mode.

This also cleans up the passing of args to SetObject and ClearObject.
Fix related issues in 64bit teardown.

Change-Id: I90d1b93c45ff5bc84957d5441ab48a4e2f6feb20
f4d3836c83097f57b62c235910fbf490c56ddf56 10-Jul-2014 Jean-Luc Brouillet <jeanluc@google.com> Deprecate rs_fp_imprecise

Change-Id: I063e356e939393e6fa4f39d056cb526aeaf8ee70
a36c50a6ab87f4c9049318d4c6c8ec7b0a1e6e12 17-Jun-2014 Jason Sams <jsams@google.com> Add 64bit large object support

Add HAL hooks for filling in LO fields.

Change-Id: Ib9bdee714a062de519d2a9708c1016404a1b11a4

4b3c34e6833e39bc89c2128002806b654b8e623d 11-Jun-2014 Chris Wailes <chriswailes@google.com> Adds support for multi-input kernels to Frameworks/RS.

This patch modifies Frameworks/RS in the following ways:
* Adjusted the data-layout of the C/C++ version of RsForEachStubParamStruct to
accommodate a pointer to an array of input allocations and a pointer to an
array of stride sizes for each of these allocatoins.
* Adds a new code path for Java code to pass multiple allocations to a RS
* Packs base pointers and step values for multi-input kernels into the new
RsForEachStubParamStruct members.

Change-Id: I46d2834c37075b2a2407fd8b010546818a4540d1
32e093ad58e9b858a6a3b747f262c5f0757a2e22 27-Jun-2014 Jean-Luc Brouillet <jeanluc@google.com> Merge "Use build fingerprint and compile command for caching."
40e35cdbe217ec8bf9fc3c69873c7d62fc14158f 26-Jun-2014 Jean-Luc Brouillet <jeanluc@google.com> Use build fingerprint and compile command for caching.

If either of those have changed, we need to invalidate the
compiled bit code.

Change-Id: Ic0c392ea5bfff5bf6dc8511740306895b1b12c82
f94e8db4232979b2fc93e8a77c42bfa57d3da56a 26-Jun-2014 Stephen Hines <srhines@google.com> Add in a missing unlockMutex() on an error path.

Change-Id: I223e64381190184e37a92ce6478340cb7a323e29
ac8d146a41f18afad5314ac8af440d6aedbe20bf 25-Jun-2014 Stephen Hines <srhines@google.com> Switch the dimensions array to use uint32_t instead of size_t.

size_t isn't safe, since we pack/unpack the array as a 32-bit int array, but
that is the wrong type for 64-bit. Switching to uint32_t is better, since we
only support 1 dimension today, and won't need many more than that even for
complex cases in the future.

Change-Id: Ie0dda264a9398b0e385e0f9ee0a91cda08325dbc
9ab5094dd32352b33e251e540934f6e814c5fa5b 19-Jun-2014 Jean-Luc Brouillet <jeanluc@google.com> Move the lib paths out of RSInfo.

Change-Id: Ic65874459509043fef261f7e0122aade4e557c57
bee48d79ba974e3dfbb782f9cce5c8d554f488e7 13-Jun-2014 Tim Murray <timmurray@google.com> Disable NEON libclcore for AArch64.

On ARMv8/AArch64, we can use the standard libclcore.bc for any precision,
as ASIMD is full IEEE 754 precision.

Change-Id: Iecff433b20f40a7f2272e497ad2e47a2f4b63ef3
f4d216ee0f0ef18edbde208a61dc4e2fe4c8f050 10-Jun-2014 Jean-Luc Brouillet <jeanluc@google.com> Remove FAKE_ARM64_BUILD now that we have 64 build working.

Change-Id: Ieb6627adcd1d097fe709559e182efcfc6841d13e
29809d1f95d4cd4cbc6b2f9384b3321759691e13 28-May-2014 Tim Murray <timmurray@google.com> Modify script loading behavior.

This moves away from RSInfo and toward bcinfo. This also disables all caching for the time being.

Change-Id: Id7c717258d51e0b45540a78596f1bc9c94468efb
25e3af55a43faddced1a9931574dfdc3cc8ad8fd 22-May-2014 Stephen Hines <srhines@google.com> Switch to the separate RS loading path.

This change goes with a similar change to libbcc that separates compilation
from loading. We create our own symbol resolvers in the driver.

Change-Id: Ifdeed588d5935c49a1e19bdc46d0a8f0b9252e00
d69b0eb7f8c180b401b45376144ee05af078b13a 15-May-2014 Stephen Hines <srhines@google.com> Switch to standalone bcc compilation path (again).

Bug: 7342767
Change-Id: I6d876742cbd4dbbc7fac1d559a7c54da9e118889
82e0a6779cb1006921153081fb33374197e7c9de 06-May-2014 Stephen Hines <srhines@google.com> Use the proper triple when compiling with bcc.

Change-Id: I6cbd14e1e196012583929dd383803903dc80e9ff
748a43678b33a7d814f4466f2846b8c955a9e1e8 02-May-2014 Stephen Hines <srhines@google.com> Revert "Switch to standalone bcc compilation path."

The current standalone bcc on the device needs to be able to select from
multiple possible target triples before we enable it by default.

Bug: 14470052

This reverts commit 99281b5bc2a81a42fa490ddbc1496621c2d84486.

Change-Id: I68f98b3c4f78d708aa5f544d36570e3db9c3e7d1
99281b5bc2a81a42fa490ddbc1496621c2d84486 04-Feb-2014 Stephen Hines <srhines@google.com> Switch to standalone bcc compilation path.

Bug: 7342767
Change-Id: Idabdc75cb7daefa44177b23efe6ef8c3df4e908a
005113297b19ed256b6db9d6bc293ed9266899fc 31-Jan-2014 Stephen Hines <srhines@google.com> Configure standalone bcc compiler to work with plugin libraries.

Bug: 7342767

This change adds support (hidden behind the EXTERNAL_BCC_COMPILER ifdef)
for loading plugin libraries via the external bcc toolchain. The external
bcc compiler loads the named library and will then invoke a customized
rsCompilerDriverInit() from that library.

Change-Id: I07c2ea68be54c2255d36926fd37e395db790ef8f
e195a3f57ace3b66d313a6ee88c6e93d5c9d87f4 13-Mar-2014 Tim Murray <timmurray@google.com> Make RS compile on ARM64.

bug 13280327

Change-Id: I79080c448ca17d0cba8df075737c22b24ce9a085
ee48c0bbf290a73e2cd4710b70d62fc203dac0dc 31-Oct-2013 Stephen Hines <srhines@google.com> Create a cache directory for our symlinked files if necessary.

Bug: 11519886

Change-Id: I93d3c194a15e4842455c31406095e90bced882ee
4da42506a08ed7fdb61615b3524f111df939fc6e 03-Oct-2013 Stephen Hines <srhines@google.com> Remove references/use of ARCH_X86_HAVE_* in frameworks/rs.

Bug: 11048298

These SSE-related defines are unnecessary because all x86 Android devices
have these features. We switch all the checks to __i386__ instead.

This also fixes an issue where non-ARM bitcode files were being created with
the ARM defines present. This is problematic when we then try to do things
that would be arch-specific (i.e. the presence of SSE-enabled functions for
clamp(), ...).

This also cleans up the different target architecture specified in the x86
bitcode files so that they match the platform target (i686-unknown-linux).

Change-Id: I4776bbdce360de26e8a00e05d2cb19341d94a173
17e3cdc24776d8fdbf1ce16287b9b4dcd516708f 10-Sep-2013 Jason Sams <jsams@google.com> Fix ScriptGroup performance regression

bug 10151545

Change-Id: Ica4a30c6fe8718f7fdbff0b446885d9ac7083769
ddceab9a001f07a3395226c5e06e3b420720af0f 07-Aug-2013 Jason Sams <jsams@google.com> Refactor hal to remove cpuConsumer from drivers

This CL should minimize build breaks due to
BufferQueue changes in the future.

Change-Id: I565a6eae5cc25603741fef32f2cfcb31a32eb757
c2c11cc9037d5ddd55282c6dab82db542b398d9e 19-Jul-2013 Stephen Hines <srhines@google.com> Fix Script instancing issue for support library.

Our support library relies on opening shared library versions of Scripts
on older devices. This has the unfortunate side effect of sharing global
variables across Script instances. In traditional RenderScript, the actual
Scripts are always instanced, and thus have distinct storage/values for
every global (and static global).

This change fixes the instancing issue by keeping track of loaded libraries
(via a global set, since dlopen is tracked/shared per-process). If we detect
a collision, we create a new randomly named symlink of the library to actually
load from. The dlopen() function only looks at the library name passed to it,
so this allows us to cheaply create a duplicate instance. Once the symlinked
library is actually loaded, we destroy it.

A new unit test has also been added to RSTest_CompatLib to verify instance
behavior. This is a modified version of the same test we have present in CTS
for traditional RenderScript instance verification.

Change-Id: I6a0bca2b65d125b54793d98f0f73ae92e0280af7
140a7acade66ab5d1f3dc55803a3a65a71f3f86c 11-Jul-2013 Stephen Hines <srhines@google.com> resolved conflicts for merge of 5376c9bf to master

Change-Id: I51507da10f8d7116a2aa29446a00a43d397a37c8
b0934b67b95cc27e2358c2aa4db5f7c1067c8f9b 04-Jul-2013 Stephen Hines <srhines@google.com> Remove libutils and fix rsDebug for RS support library.

Bug: 9664050

Our bitcode runtime library translates vector rsDebug() calls into passing
their parameters via pointers. The previous version of libRSSupport.so was
being created with non-pointer versions of these routines accidentally.
This change also fixes a missing permission issue for ImageProcessing2, so
that the compatibility library can be verified.

This change also removes the use of libutils by switching the implementation of
String8/Vector in the compatibility library to internal types backed by

Change-Id: I20da75e8c19a82a42dc2bceaba1937d21372db84
b58d9adf52f0216c0281c749023bdd5b52236875 20-Jun-2013 Stephen Hines <srhines@google.com> Provide path to execute standalone bcc compiler.

Bug: 7342767

Change-Id: Ife9d9fee77416832445dcf30f0e3eba3dd173bad
47935ac8e3dd619f758abd576605a564e33bb59c 17-Jun-2013 Tobias Grosser <grosser@google.com> Add the name of the forEach functions to the tracing output

Instead of showing up as 'runForEach', kernels are now e.g. printed as

The String8 is carefully constructed here, such that we only pay
the string processing overhead in case tracing is actually enabled.

Change-Id: Id18319e271a02cbe888bcb9fe806794007d00fca
ba17ae494add84056bbf3275b68e40e62a643db0 06-Jun-2013 Stephen Hines <srhines@google.com> Switch to separate build/load steps for Scripts.

Bug: 7342767
Change-Id: I94f81cb4dc917dd2cfc10c7718e9263454571db4
b7d9c80c98fc96aa7c638e3124be24f13a6436b2 30-Apr-2013 Stephen Hines <srhines@google.com> Provide a mechanism for adjusting RSCompilerDriver after construction.

We add a simple callback to the reference implementation of libRSDriver.so,
such that additional BCC flags can be toggled/adjusted before doing any actual
CPU compilation.

Change-Id: Iaf253b7d967d0382937369b1c5dae2d23a99e8be
f47e8b4b86bf194e65398032f3f5f47a6da89f3f 18-Apr-2013 Stephen Hines <srhines@google.com> Mark use of a debug context with the RSCompilerDriver.

Bug: 7343201
Change-Id: Idb003a3314247481c38aa70f9991f000135996b3
cca3d6ca444bef3b6d75431ec19bd07bfe40a733 15-Apr-2013 Stephen Hines <srhines@google.com> Add support for DEBUG context type.

Bug: 7343201

This change adds switching for the debug runtime (libclcore_debug.bc) when
running under a DEBUG RS context. It also fixes a small naming issue for

Change-Id: I8b574c9ce915a440375530325ba7de2b46707cfd
886e51b2ef45ce123379c8a11579851c5580d957 12-Apr-2013 Tim Murray <timmurray@google.com> Merge "Add support for synchronous get()." into jb-mr2-dev
9c64239ebbfa4170190ede812e69150035e008e0 11-Apr-2013 Tim Murray <timmurray@google.com> Add support for synchronous get().

Change-Id: Ic94f1e36f7cffaaeda11fa9f0bb70e441fe1e535
ef7481e2f0a4ad7b32bb626245e4207cabe171dc 10-Apr-2013 Stephen Hines <srhines@google.com> Remove invalid logging on missing root.expand() functions.

Bug: 8566872

This log message is confusing and unncessary. Due to legacy compatibility,
slot 0 is always reserved for root.expand(). We know that root.expand() may
not exist for many user scripts, since we have supported proper names for
kernels for several releases now.

Change-Id: Id869496aa83f98ce64d6bd784314d788e25182e0
1d476620399d54774e4fd386c1d23cc583d49522 30-Mar-2013 Stephen Hines <srhines@google.com> Add callback to allow replacement of runtime support library.

Change-Id: I84ec56dfb29a0158015ebf31b3a73ac5bf34ef98
0b575de8ed0b628d84d256f5846500b0385979bd 15-Mar-2013 Tim Murray <timmurray@google.com> Add x86 server support.

Change-Id: I674acaf15b67afa48bc736f72942a11e2e38e940
110f181b7966212a36ef18016f9b81c7322d0a2f 15-Mar-2013 Jason Sams <jsams@google.com> Reduce diffs with compat lib.

Change-Id: Ibfa2c7c7da56d158f424ac343e364feacd0a21da
cadfac411e6690e39de36c4f9e94deb9b7d2d08e 07-Mar-2013 Jason Sams <jsams@google.com> Sync with compat lib.

Change-Id: Id8ace103814cf126f0d157100d1d4a12cc0b8664
3a25fdd3786c1a08b783d8a83ef94b756347ff5c 23-Feb-2013 Tim Murray <timmurray@google.com> Cleanup lots of things related to IO_OUTPUT and error checking.

Change-Id: Ic6802dd0ba9d3edc8c53f99002cdd905214a515c
f218bf115af4ae4fd79adbb8842608b308a4cf07 13-Feb-2013 Stephen Hines <srhines@google.com> Support LinkRuntimeCallback() with RS compiler.

Change-Id: I28ada4e7c462cb9673de6886d934dce855fac339
d4ecb17adc9b099351f2ca1779a74f5283f20a3d 07-Feb-2013 Tim Murray <timmurray@google.com> Add API entry points for clipped kernels and fix Z-dimension clipping.

Change-Id: I43074cb8556d9b28d3e549930f5ac68387f8d823
709a0978ae141198018ca9769f8d96292a8928e6 16-Nov-2012 Jason Sams <jsams@google.com> Separate CPU driver impl from reference driver.

Change-Id: Ifb484edda665959b81d7b1f890d108bfa20a535d