diff options
author | Chris Wailes <chriswailes@google.com> | 2014-06-11 12:00:29 -0700 |
---|---|---|
committer | Chris Wailes <chriswailes@google.com> | 2014-07-08 11:46:34 -0700 |
commit | 4b3c34e6833e39bc89c2128002806b654b8e623d (patch) | |
tree | d5e1eeed6ac0e0f9b57488570680b6796ecd7735 /cpu_ref/rsCpuCore.h | |
parent | cb51798a0379409c0f9927c44bbcdd772ed7ec18 (diff) | |
download | rs-4b3c34e6833e39bc89c2128002806b654b8e623d.tar.gz |
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
kernel.
* Packs base pointers and step values for multi-input kernels into the new
RsForEachStubParamStruct members.
Change-Id: I46d2834c37075b2a2407fd8b010546818a4540d1
Diffstat (limited to 'cpu_ref/rsCpuCore.h')
-rw-r--r-- | cpu_ref/rsCpuCore.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cpu_ref/rsCpuCore.h b/cpu_ref/rsCpuCore.h index d2b47fb8..c54dca2a 100644 --- a/cpu_ref/rsCpuCore.h +++ b/cpu_ref/rsCpuCore.h @@ -35,6 +35,11 @@ namespace android { namespace renderscript { typedef struct { + uint32_t eStride; + uint32_t yStride; +} StridePair; + +typedef struct { const void *in; void *out; const void *usr; @@ -45,6 +50,10 @@ typedef struct { uint32_t lod; RsAllocationCubemapFace face; uint32_t ar[16]; + + const void **ins; + uint32_t *eStrideIns; + uint32_t lid; uint32_t dimX; @@ -59,6 +68,9 @@ typedef struct { uint32_t yStrideIn; uint32_t yStrideOut; uint32_t slot; + + const uint8_t** ptrIns; + StridePair* inStrides; } RsForEachStubParamStruct; extern bool gArchUseSIMD; @@ -99,6 +111,9 @@ typedef struct { uint32_t zEnd; uint32_t arrayStart; uint32_t arrayEnd; + + // Multi-input data. + const Allocation ** ains; } MTLaunchStruct; @@ -126,6 +141,9 @@ public: void launchThreads(const Allocation * ain, Allocation * aout, const RsScriptCall *sc, MTLaunchStruct *mtls); + void launchThreads(const Allocation** ains, uint32_t inLen, Allocation* aout, + const RsScriptCall* sc, MTLaunchStruct* mtls); + virtual CpuScript * createScript(const ScriptC *s, char const *resName, char const *cacheDir, uint8_t const *bitcode, size_t bitcodeSize, |