diff options
author | Stephen Hines <srhines@google.com> | 2016-01-30 17:44:32 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-01-30 17:44:32 +0000 |
commit | 672dd1d7021ce09a3045d1316d80ac2f42edc72a (patch) | |
tree | 7c02a3e929376da181451576ee7550b2e7a92863 | |
parent | 886e5a2f3670b31bcf02526343d364b86b3a2305 (diff) | |
parent | 15c1d06c654c246b8e8047f64f781add32483576 (diff) | |
download | rs-672dd1d7021ce09a3045d1316d80ac2f42edc72a.tar.gz |
Merge "Derive the bcc optimization level from the input bitcode."
-rw-r--r-- | cpp/RenderScript.cpp | 3 | ||||
-rw-r--r-- | cpp/rsCppStructs.h | 3 | ||||
-rw-r--r-- | rsContext.cpp | 3 | ||||
-rw-r--r-- | rsDefines.h | 3 | ||||
-rw-r--r-- | rsScriptC.cpp | 5 |
5 files changed, 8 insertions, 9 deletions
diff --git a/cpp/RenderScript.cpp b/cpp/RenderScript.cpp index ecc76c86..31414f4b 100644 --- a/cpp/RenderScript.cpp +++ b/cpp/RenderScript.cpp @@ -171,8 +171,7 @@ bool RS::init(const char * name, uint32_t flags, int targetApi) { } if (flags & ~(RS_CONTEXT_SYNCHRONOUS | RS_CONTEXT_LOW_LATENCY | - RS_CONTEXT_LOW_POWER | RS_CONTEXT_WAIT_FOR_ATTACH | - RS_CONTEXT_OPT_LEVEL_0)) { + RS_CONTEXT_LOW_POWER | RS_CONTEXT_WAIT_FOR_ATTACH)) { ALOGE("Invalid flags passed"); return false; } diff --git a/cpp/rsCppStructs.h b/cpp/rsCppStructs.h index cb912163..bb1c9a0e 100644 --- a/cpp/rsCppStructs.h +++ b/cpp/rsCppStructs.h @@ -72,8 +72,7 @@ class Sampler; RS_INIT_LOW_LATENCY = 2, ///< Prefer low latency devices over potentially higher throughput devices. // Bitflag 4 is reserved for the context flag low power RS_INIT_WAIT_FOR_ATTACH = 8, ///< Kernel execution will hold to give time for a debugger to be attached - RS_INIT_OPT_LEVEL_0 = 16, ///< Use the -O0 option to set the optimization level to zero when calling the bcc compiler. - RS_INIT_MAX = 32 + RS_INIT_MAX = 16 }; diff --git a/rsContext.cpp b/rsContext.cpp index 9048fbf9..ef155681 100644 --- a/rsContext.cpp +++ b/rsContext.cpp @@ -497,9 +497,6 @@ Context * Context::createContext(Device *dev, const RsSurfaceConfig *sc, if (flags & RS_CONTEXT_SYNCHRONOUS) { rsc->mSynchronous = true; } - if (flags & RS_CONTEXT_OPT_LEVEL_0) { - rsc->mOptLevel = 0; - } rsc->mContextType = ct; rsc->mHal.flags = flags; diff --git a/rsDefines.h b/rsDefines.h index 4dadca6e..4e5179bc 100644 --- a/rsDefines.h +++ b/rsDefines.h @@ -259,8 +259,7 @@ enum RsContextFlags { RS_CONTEXT_SYNCHRONOUS = 0x0001, RS_CONTEXT_LOW_LATENCY = 0x0002, RS_CONTEXT_LOW_POWER = 0x0004, - RS_CONTEXT_WAIT_FOR_ATTACH = 0x0008, - RS_CONTEXT_OPT_LEVEL_0 = 0x0010 + RS_CONTEXT_WAIT_FOR_ATTACH = 0x0008 }; enum RsBlasTranspose { diff --git a/rsScriptC.cpp b/rsScriptC.cpp index f6430934..d2d5b1fd 100644 --- a/rsScriptC.cpp +++ b/rsScriptC.cpp @@ -380,6 +380,11 @@ bool ScriptC::runCompiler(Context *rsc, } } + + // Set the optimization level of bcc to be the same as the + // optimization level used to compile the bitcode. + rsc->setOptLevel(bcWrapper.getOptimizationLevel()); + #endif if (!cacheDir) { // MUST BE FIXED BEFORE ANYTHING USING C++ API IS RELEASED |