summaryrefslogtreecommitdiff
path: root/cpu_ref/rsCpuScriptGroup2.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Avoid accessing TLS in rsClearObject()Yang Ni2016-04-061-4/+2
| | | | | | | | | | | | | | | | | | | 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)
* Fixed intrinsics inside a script groupYang Ni2016-03-221-1/+18
| | | | | | | | | | | | | | | | 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)
* Various fixes in setting globals in a script groupYang Ni2015-11-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Bug: 25602504 1) Fixed setting 64-bit globals on a 32-bit platform. The long values were casted to pointer-size integers (uintptr_t) or void* in the runtime implementation. This caused the upper 32 bits to be lost on 32-bit platforms. Fixed that by casting to int64_t instead. 2) Fixed setting Allocation values (either as arg or a global) in a script group. The size for a value in a script is signed, with -1 indicating that the value is an Allocation. The sign has to be kept across different layers of our stack. 3) Added a test for both native and support libraries for passing floating point values to a script group, and for passing 64-bit values (long or double) to a script group. Change-Id: Ifff099a76be7707df7b67c388395f5a00f9cae66
* Add a basic implementation of the reduce kernel API to the CPUMatt Wala2015-08-141-6/+6
| | | | | | | | | | reference implementation. Bug: 22631253 For now, this just runs a serial reduction on one thread. Change-Id: I34c96d24bb6f44274de72bb53160abcf79d143b0
* Add a flag to the API to specify -O0 on the bcc command line.verena beckham2015-07-171-2/+7
| | | | | | | | | 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>
* Avoid overwriting shared library file that is openYang Ni2015-06-291-3/+44
| | | | | | | | | | | b/21949580 Writing different contents to an existing .so file, which is currently open, may corrupt its globals and code. Choose a different file name instead. Change-Id: I3e649b09a55b43339283aa1c46f2844c66434c17 (cherry picked from commit 9844cffc8af28c4829012bc0c48f85d04b671f88)
* Check for kernel chaining in ScriptGroupYang Ni2015-06-231-1/+20
| | | | | | | | | | | | | | | b/21958851 bcc expects kernels chained up via input and output. Check this in the runtime before passing ScriptGroup to bcc for compiler fusion. This serves the same purpose as https://googleplex-android-review.git.corp.google.com/#/c/713267, but provides additional checks in the runtime before bcc is even called. Change-Id: I6004d577410ea1684f5043babadc1e1b885c4f6a (cherry picked from commit 08e7693c13f895677b93537af3b6bc353318a81c)
* Avoid casting for CpuScript objectYang Ni2015-05-271-6/+9
| | | | | | | | | | b/20894664 Vendor driver may have different layout for the Script object. Avoid casting mHal.drv but use the vendor provided lookupScript callback instead. Change-Id: Ie492dd98a435b35843ca222a8430c51ccfc8aea9
* Generate global info for fused kernelYang Ni2015-05-141-0/+10
| | | | | | | b/21114118 Change-Id: I6332572f2f2e6f7857a50bf503e73984371cfe0b (cherry picked from commit b616bcf3df4ce5d7ccc369acf8e90afe59c359fa)
* Add a way to link against different driver names.Stephen Hines2015-05-061-1/+2
| | | | | | | | | | 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 not. Change-Id: I0c4a4f12f5db819b234952bc8f364ac6300f147b
* Dedup checksum calculation routinesYang Ni2015-04-161-63/+34
| | | | | | | | | | | | 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
* Compute checksum for script group generated codeYang Ni2015-04-141-21/+81
| | | | Change-Id: I5f469266fd11b5031d1357f356ac40e00f5c0348
* Added a name to ScriptGroup2Yang Ni2015-04-131-1/+3
| | | | | | | Implemented in the runtime and CPU driver the new script group name. Code caching is not implemented yet, and to be added in another CL. Change-Id: I46e351c8412740512f56b7915b14f36183c6eeaf
* Clean up ScriptGroup2 implementationYang Ni2015-03-311-5/+3
| | | | | | | | | b/19944127 - Adjust ref counting - Fix value size type in closure creation Change-Id: I1179d34aa67f845578740e71cc2da4f82419f251
* Wrap TEMP_FAILURE_RETRY around system callsPirama Arumuga Nainar2015-03-251-40/+6
| | | | | | | | | | | | | | 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
* Pass RsExpandKernelDriverInfo not RsExpandKernelParams.David Gross2015-03-161-23/+21
| | | | | | | | | Which is to say: retire RsExpandKernelParams and pass RsExpandKernelDriverInfo directly to kernel wrapper functions instead. Requires related change in frameworks/compile/libbcc. Change-Id: I453f45ec18f389e88e27fcfa57ddf245d077cb98
* Merge "Handle FP precision in kernel fusion"Yang Ni2015-03-121-4/+35
|\
| * Handle FP precision in kernel fusionYang Ni2015-03-111-4/+35
| | | | | | | | | | | | | | | | | | | | b/19098612 Find the proper core lib for full-precision and relaxed-precions FP. Path both to bcc while compiling a script group, and let bcc pick the right one based on the precision of the merged module. Change-Id: I2a641387f0990463887594729a935a5c3f0f856f
* | Add new APIs rsGetDim[XYZ]() and add RSTest test cases to exercise them.David Gross2015-03-111-0/+1
|/ | | | | | | | | | | | Test UT_kernel3d does not pass reliably, so it is disabled for now. Tests will not compile without related platform/frameworks/compile/libbcc and platform/frameworks/compile/slang changes. Bug: 18964628 Change-Id: I39660400953306ceb47c8b5e9665e8f0084775dd
* Runtime support for Script Group as single moduleYang Ni2015-03-101-76/+156
| | | | | | | | | | | 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
* Merge "Move use of tempnam to mkstemp."Yabin Cui2015-02-241-4/+15
|\
| * Move use of tempnam to mkstemp.Yabin Cui2015-02-241-4/+15
| | | | | | | | | | Bug: 19340053 Change-Id: I1734e085beef395ebcc6453af1efaa19f7409e22
* | Moved class ScriptExecutable to its own moduleYang Ni2015-02-201-12/+4
|/ | | | | | | | b/19283946 This move also included the related class SharedObjectUtils. Change-Id: Iefd587b659c4ad99340c330955b41cd92df45563
* Reformat and remove STL reference from headerYang Ni2015-02-101-34/+35
| | | | | | | | | b/19148482 Reformmated according to Android C++ style guidelines. Removed STL references in headers. Change-Id: I6d82b8fe5ac868067b6d9ebe797125feb97e5641
* Runtime support for invocables in ScriptGroupsYang Ni2015-02-041-278/+311
| | | | | | This also includes support for InvokeID Change-Id: I5b59df166ea30b309b8dd9623825ac0e72d03856
* Runtime support for compiler kernel fusion.Yang Ni2015-02-021-29/+245
| | | | | | The runtime will start a seperate process to call the new bcc to fuse kernels. Change-Id: Ia73ea917a126a5055ec97f13d90a5feaafd6a2f5
* add array launch support.Jason Sams2015-01-261-8/+9
| | | | Change-Id: I66cd89b5b44eafa92f391708a06464cd7cdde3ed
* New Script Group API: runtime and cpu driver support.Yang Ni2015-01-071-0/+192
Change-Id: I9c612cf8874aabaf0ca7d1640567464c71ed3070