diff options
| author | Jason Sams <jsams@google.com> | 2015-05-11 18:44:55 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-05-11 18:44:55 +0000 |
| commit | 1de97c307624f57d95281ebaa77c2129e66e21bc (patch) | |
| tree | c38cd5e7328f182c842bdf4d383007433775b83f /cpu_ref/rsCpuScript.cpp | |
| parent | 254cd3a34c644321efb23f3624706e3df8a29910 (diff) | |
| parent | 8409d6414dd4a42aa59779fcfe9fce18648cb135 (diff) | |
Merge "Add RSGlobalInfoPass information to RS driver."
Diffstat (limited to 'cpu_ref/rsCpuScript.cpp')
| -rw-r--r-- | cpu_ref/rsCpuScript.cpp | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp index 32823747..65ced662 100644 --- a/cpu_ref/rsCpuScript.cpp +++ b/cpu_ref/rsCpuScript.cpp @@ -55,6 +55,9 @@ #endif namespace { + +static const bool kDebugGlobalVariables = false; + #ifndef RS_COMPATIBILITY_LIB static bool is_force_recompile() { @@ -83,11 +86,18 @@ static void setCompileArguments(std::vector<const char*>* args, const std::string& bcFileName, const char* cacheDir, const char* resName, const char* core_lib, bool useRSDebugContext, - const char* bccPluginName) { + const char* bccPluginName, bool emitGlobalInfo, + bool emitGlobalInfoSkipConstant) { rsAssert(cacheDir && resName && core_lib); args->push_back(android::renderscript::RsdCpuScriptImpl::BCC_EXE_PATH); args->push_back("-unroll-runtime"); args->push_back("-scalarize-load-store"); + if (emitGlobalInfo) { + args->push_back("-rs-global-info"); + if (emitGlobalInfoSkipConstant) { + args->push_back("-rs-global-info-skip-constant"); + } + } args->push_back("-o"); args->push_back(resName); args->push_back("-output_path"); @@ -276,6 +286,10 @@ bool RsdCpuScriptImpl::storeRSInfoFromSO() { mIsThreadable = mScriptExec->getThreadable(); //ALOGE("Script isThreadable? %d", mIsThreadable); + if (kDebugGlobalVariables) { + mScriptExec->dumpGlobalInfo(); + } + return true; } @@ -326,8 +340,11 @@ bool RsdCpuScriptImpl::init(char const *resName, char const *cacheDir, bcFileName.append(".bc"); std::vector<const char*> compileArguments; + bool emitGlobalInfo = mCtx->getEmbedGlobalInfo(); + bool emitGlobalInfoSkipConstant = mCtx->getEmbedGlobalInfoSkipConstant(); setCompileArguments(&compileArguments, bcFileName, cacheDir, resName, core_lib, - useRSDebugContext, bccPluginName); + useRSDebugContext, bccPluginName, emitGlobalInfo, + emitGlobalInfoSkipConstant); mChecksumNeeded = isChecksumNeeded(); if (mChecksumNeeded) { @@ -889,6 +906,22 @@ Allocation * RsdCpuScriptImpl::getAllocationForPointer(const void *ptr) const { return nullptr; } +int RsdCpuScriptImpl::getGlobalEntries() const { + return mScriptExec->getGlobalEntries(); +} + +const char * RsdCpuScriptImpl::getGlobalName(int i) const { + return mScriptExec->getGlobalName(i); +} + +const void * RsdCpuScriptImpl::getGlobalAddress(int i) const { + return mScriptExec->getGlobalAddress(i); +} + +size_t RsdCpuScriptImpl::getGlobalSize(int i) const { + return mScriptExec->getGlobalSize(i); +} + void RsdCpuScriptImpl::preLaunch(uint32_t slot, const Allocation ** ains, uint32_t inLen, Allocation * aout, const void * usr, uint32_t usrLen, |
