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
diff --git a/cpu_ref/rsCpuScript.h b/cpu_ref/rsCpuScript.h
index 248e5c7..2909dab 100644
--- a/cpu_ref/rsCpuScript.h
+++ b/cpu_ref/rsCpuScript.h
@@ -65,6 +65,11 @@
Allocation* aout,
const RsScriptCall* sc) override;
+ void invokeReduceNew(uint32_t slot,
+ const Allocation ** ains, uint32_t inLen,
+ Allocation* aout,
+ const RsScriptCall* sc) override;
+
void invokeInit() override;
void invokeFreeChildren() override;
@@ -89,12 +94,18 @@
virtual void forEachKernelSetup(uint32_t slot, MTLaunchStructForEach *mtls);
- // Build an MTLaunchStruct suitable for launching a reduce-style kernel.
+ // Build an MTLaunchStruct suitable for launching a simple reduce-style kernel.
bool reduceMtlsSetup(const Allocation *ain, const Allocation *aout,
const RsScriptCall *sc, MTLaunchStructReduce *mtls);
- // Finalize an MTLaunchStruct for launching a reduce-style kernel.
+ // Finalize an MTLaunchStruct for launching a simple reduce-style kernel.
virtual void reduceKernelSetup(uint32_t slot, MTLaunchStructReduce *mtls);
+ // Build an MTLaunchStruct suitable for launching a general reduce-style kernel.
+ bool reduceNewMtlsSetup(const Allocation ** ains, uint32_t inLen, const Allocation *aout,
+ const RsScriptCall *sc, MTLaunchStructReduceNew *mtls);
+ // Finalize an MTLaunchStruct for launching a general reduce-style kernel.
+ virtual void reduceNewKernelSetup(uint32_t slot, MTLaunchStructReduceNew *mtls);
+
const RsdCpuReference::CpuSymbol * lookupSymbolMath(const char *sym);
static void * lookupRuntimeStub(void* pContext, char const* name);