Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "rsCpuCore.h" |
| 18 | #include "rsCpuScript.h" |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 19 | #include "rsScriptGroup.h" |
| 20 | #include "rsCpuScriptGroup.h" |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 21 | |
| 22 | using namespace android; |
| 23 | using namespace android::renderscript; |
| 24 | |
Yang Ni | 1ffd86b | 2015-01-07 09:16:40 -0800 | [diff] [blame] | 25 | CpuScriptGroupImpl::CpuScriptGroupImpl(RsdCpuReferenceImpl *ctx, const ScriptGroupBase *sg) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 26 | mCtx = ctx; |
Yang Ni | 1ffd86b | 2015-01-07 09:16:40 -0800 | [diff] [blame] | 27 | mSG = (ScriptGroup*)sg; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | CpuScriptGroupImpl::~CpuScriptGroupImpl() { |
| 31 | |
| 32 | } |
| 33 | |
| 34 | bool CpuScriptGroupImpl::init() { |
| 35 | return true; |
| 36 | } |
| 37 | |
| 38 | void CpuScriptGroupImpl::setInput(const ScriptKernelID *kid, Allocation *a) { |
| 39 | } |
| 40 | |
| 41 | void CpuScriptGroupImpl::setOutput(const ScriptKernelID *kid, Allocation *a) { |
| 42 | } |
| 43 | |
| 44 | |
Chris Wailes | 80ef693 | 2014-07-08 11:22:18 -0700 | [diff] [blame] | 45 | typedef void (*ScriptGroupRootFunc_t)(const RsExpandKernelParams *kparams, |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 46 | uint32_t xstart, uint32_t xend, |
Chris Wailes | 9ed7910 | 2014-07-25 15:53:28 -0700 | [diff] [blame] | 47 | uint32_t outstep); |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 48 | |
Chris Wailes | 80ef693 | 2014-07-08 11:22:18 -0700 | [diff] [blame] | 49 | void CpuScriptGroupImpl::scriptGroupRoot(const RsExpandKernelParams *kparams, |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 50 | uint32_t xstart, uint32_t xend, |
Chris Wailes | 9ed7910 | 2014-07-25 15:53:28 -0700 | [diff] [blame] | 51 | uint32_t outstep) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 52 | |
| 53 | |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 54 | const ScriptList *sl = (const ScriptList *)kparams->usr; |
Chris Wailes | 80ef693 | 2014-07-08 11:22:18 -0700 | [diff] [blame] | 55 | RsExpandKernelParams *mkparams = (RsExpandKernelParams *)kparams; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 56 | |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 57 | const void **oldIns = mkparams->ins; |
| 58 | uint32_t *oldStrides = mkparams->inEStrides; |
| 59 | |
| 60 | void *localIns[1]; |
| 61 | uint32_t localStride[1]; |
| 62 | |
| 63 | mkparams->ins = (const void**)localIns; |
| 64 | mkparams->inEStrides = localStride; |
| 65 | |
Chris Wailes | 80ef693 | 2014-07-08 11:22:18 -0700 | [diff] [blame] | 66 | for (size_t ct = 0; ct < sl->count; ct++) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 67 | ScriptGroupRootFunc_t func; |
Chris Wailes | 80ef693 | 2014-07-08 11:22:18 -0700 | [diff] [blame] | 68 | func = (ScriptGroupRootFunc_t)sl->fnPtrs[ct]; |
| 69 | mkparams->usr = sl->usrPtrs[ct]; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 70 | |
Stephen Hines | 4b2bea3 | 2014-08-13 17:32:10 +0000 | [diff] [blame] | 71 | if (sl->ins[ct]) { |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 72 | localIns[0] = sl->ins[ct]->mHal.drvState.lod[0].mallocPtr; |
Stephen Hines | 4b2bea3 | 2014-08-13 17:32:10 +0000 | [diff] [blame] | 73 | |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 74 | localStride[0] = sl->ins[ct]->mHal.state.elementSizeBytes; |
Chris Wailes | 80ef693 | 2014-07-08 11:22:18 -0700 | [diff] [blame] | 75 | |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 76 | if (sl->inExts[ct]) { |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 77 | localIns[0] = (void*) |
| 78 | ((const uint8_t *)localIns[0] + |
| 79 | sl->ins[ct]->mHal.drvState.lod[0].stride * kparams->y); |
Chris Wailes | 80ef693 | 2014-07-08 11:22:18 -0700 | [diff] [blame] | 80 | |
| 81 | } else if (sl->ins[ct]->mHal.drvState.lod[0].dimY > kparams->lid) { |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 82 | localIns[0] = (void*) |
| 83 | ((const uint8_t *)localIns[0] + |
| 84 | sl->ins[ct]->mHal.drvState.lod[0].stride * kparams->lid); |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 85 | } |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 86 | |
| 87 | } else { |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 88 | localIns[0] = nullptr; |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 89 | localStride[0] = 0; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 90 | } |
| 91 | |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 92 | uint32_t ostep; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 93 | if (sl->outs[ct]) { |
Chris Wailes | 80ef693 | 2014-07-08 11:22:18 -0700 | [diff] [blame] | 94 | mkparams->out = |
| 95 | (uint8_t *)sl->outs[ct]->mHal.drvState.lod[0].mallocPtr; |
| 96 | |
Jason Sams | 17e3cdc | 2013-09-09 17:32:16 -0700 | [diff] [blame] | 97 | ostep = sl->outs[ct]->mHal.state.elementSizeBytes; |
Chris Wailes | 80ef693 | 2014-07-08 11:22:18 -0700 | [diff] [blame] | 98 | |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 99 | if (sl->outExts[ct]) { |
Chris Wailes | 80ef693 | 2014-07-08 11:22:18 -0700 | [diff] [blame] | 100 | mkparams->out = |
| 101 | (uint8_t *)mkparams->out + |
| 102 | sl->outs[ct]->mHal.drvState.lod[0].stride * kparams->y; |
| 103 | |
| 104 | } else if (sl->outs[ct]->mHal.drvState.lod[0].dimY > kparams->lid) { |
| 105 | mkparams->out = |
| 106 | (uint8_t *)mkparams->out + |
| 107 | sl->outs[ct]->mHal.drvState.lod[0].stride * kparams->lid; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 108 | } |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 109 | } else { |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 110 | mkparams->out = nullptr; |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 111 | ostep = 0; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | //ALOGE("kernel %i %p,%p %p,%p", ct, mp->ptrIn, mp->in, mp->ptrOut, mp->out); |
Chris Wailes | 9ed7910 | 2014-07-25 15:53:28 -0700 | [diff] [blame] | 115 | func(kparams, xstart, xend, ostep); |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 116 | } |
| 117 | //ALOGE("script group root"); |
| 118 | |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 119 | mkparams->ins = oldIns; |
| 120 | mkparams->inEStrides = oldStrides; |
| 121 | mkparams->usr = sl; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | |
| 125 | |
| 126 | void CpuScriptGroupImpl::execute() { |
Chris Wailes | 93d6bc8 | 2014-07-28 16:54:38 -0700 | [diff] [blame] | 127 | std::vector<Allocation *> ins; |
| 128 | std::vector<char> inExts; |
| 129 | std::vector<Allocation *> outs; |
| 130 | std::vector<char> outExts; |
| 131 | std::vector<const ScriptKernelID *> kernels; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 132 | bool fieldDep = false; |
| 133 | |
| 134 | for (size_t ct=0; ct < mSG->mNodes.size(); ct++) { |
| 135 | ScriptGroup::Node *n = mSG->mNodes[ct]; |
| 136 | Script *s = n->mKernels[0]->mScript; |
Stephen Hines | c78839b | 2013-09-10 17:40:41 -0700 | [diff] [blame] | 137 | if (s->hasObjectSlots()) { |
| 138 | // Disable the ScriptGroup optimization if we have global RS |
| 139 | // objects that might interfere between kernels. |
| 140 | fieldDep = true; |
| 141 | } |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 142 | |
| 143 | //ALOGE("node %i, order %i, in %i out %i", (int)ct, n->mOrder, (int)n->mInputs.size(), (int)n->mOutputs.size()); |
| 144 | |
| 145 | for (size_t ct2=0; ct2 < n->mInputs.size(); ct2++) { |
| 146 | if (n->mInputs[ct2]->mDstField.get() && n->mInputs[ct2]->mDstField->mScript) { |
| 147 | //ALOGE("field %p %zu", n->mInputs[ct2]->mDstField->mScript, n->mInputs[ct2]->mDstField->mSlot); |
| 148 | s->setVarObj(n->mInputs[ct2]->mDstField->mSlot, n->mInputs[ct2]->mAlloc.get()); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | for (size_t ct2=0; ct2 < n->mKernels.size(); ct2++) { |
| 153 | const ScriptKernelID *k = n->mKernels[ct2]; |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 154 | Allocation *ain = nullptr; |
| 155 | Allocation *aout = nullptr; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 156 | bool inExt = false; |
| 157 | bool outExt = false; |
| 158 | |
| 159 | for (size_t ct3=0; ct3 < n->mInputs.size(); ct3++) { |
| 160 | if (n->mInputs[ct3]->mDstKernel.get() == k) { |
| 161 | ain = n->mInputs[ct3]->mAlloc.get(); |
Yang Ni | 5f6f16f | 2014-07-25 13:51:09 -0700 | [diff] [blame] | 162 | break; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 163 | } |
| 164 | } |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 165 | if (ain == nullptr) { |
Yang Ni | 5f6f16f | 2014-07-25 13:51:09 -0700 | [diff] [blame] | 166 | for (size_t ct3=0; ct3 < mSG->mInputs.size(); ct3++) { |
| 167 | if (mSG->mInputs[ct3]->mKernel == k) { |
| 168 | ain = mSG->mInputs[ct3]->mAlloc.get(); |
| 169 | inExt = true; |
| 170 | break; |
| 171 | } |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 172 | } |
| 173 | } |
| 174 | |
| 175 | for (size_t ct3=0; ct3 < n->mOutputs.size(); ct3++) { |
| 176 | if (n->mOutputs[ct3]->mSource.get() == k) { |
| 177 | aout = n->mOutputs[ct3]->mAlloc.get(); |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 178 | if(n->mOutputs[ct3]->mDstField.get() != nullptr) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 179 | fieldDep = true; |
| 180 | } |
Yang Ni | 5f6f16f | 2014-07-25 13:51:09 -0700 | [diff] [blame] | 181 | break; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 182 | } |
| 183 | } |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 184 | if (aout == nullptr) { |
Yang Ni | 5f6f16f | 2014-07-25 13:51:09 -0700 | [diff] [blame] | 185 | for (size_t ct3=0; ct3 < mSG->mOutputs.size(); ct3++) { |
| 186 | if (mSG->mOutputs[ct3]->mKernel == k) { |
| 187 | aout = mSG->mOutputs[ct3]->mAlloc.get(); |
| 188 | outExt = true; |
| 189 | break; |
| 190 | } |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 191 | } |
| 192 | } |
| 193 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 194 | rsAssert((k->mHasKernelOutput == (aout != nullptr)) && |
| 195 | (k->mHasKernelInput == (ain != nullptr))); |
Yang Ni | 5f6f16f | 2014-07-25 13:51:09 -0700 | [diff] [blame] | 196 | |
Chris Wailes | 93d6bc8 | 2014-07-28 16:54:38 -0700 | [diff] [blame] | 197 | ins.push_back(ain); |
| 198 | inExts.push_back(inExt); |
| 199 | outs.push_back(aout); |
| 200 | outExts.push_back(outExt); |
| 201 | kernels.push_back(k); |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | } |
| 205 | |
| 206 | MTLaunchStruct mtls; |
| 207 | |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 208 | if (fieldDep) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 209 | for (size_t ct=0; ct < ins.size(); ct++) { |
| 210 | Script *s = kernels[ct]->mScript; |
| 211 | RsdCpuScriptImpl *si = (RsdCpuScriptImpl *)mCtx->lookupScript(s); |
| 212 | uint32_t slot = kernels[ct]->mSlot; |
| 213 | |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 214 | uint32_t inLen; |
| 215 | const Allocation **ains; |
| 216 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 217 | if (ins[ct] == nullptr) { |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 218 | inLen = 0; |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 219 | ains = nullptr; |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 220 | |
| 221 | } else { |
| 222 | inLen = 1; |
| 223 | ains = const_cast<const Allocation**>(&ins[ct]); |
| 224 | } |
| 225 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 226 | si->forEachMtlsSetup(ains, inLen, outs[ct], nullptr, 0, nullptr, &mtls); |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 227 | |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 228 | si->forEachKernelSetup(slot, &mtls); |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 229 | si->preLaunch(slot, ains, inLen, outs[ct], mtls.fep.usr, |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 230 | mtls.fep.usrLen, nullptr); |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 231 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 232 | mCtx->launchThreads(ains, inLen, outs[ct], nullptr, &mtls); |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 233 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 234 | si->postLaunch(slot, ains, inLen, outs[ct], nullptr, 0, nullptr); |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 235 | } |
| 236 | } else { |
| 237 | ScriptList sl; |
Chris Wailes | 93d6bc8 | 2014-07-28 16:54:38 -0700 | [diff] [blame] | 238 | |
| 239 | /* |
| 240 | * TODO: This is a hacky way of doing this and should be replaced by a |
| 241 | * call to std::vector's data() member once we have a C++11 |
| 242 | * version of the STL. |
| 243 | */ |
| 244 | sl.ins = &ins.front(); |
| 245 | sl.outs = &outs.front(); |
| 246 | sl.kernels = &kernels.front(); |
| 247 | sl.count = kernels.size(); |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 248 | |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 249 | uint32_t inLen; |
| 250 | const Allocation **ains; |
| 251 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 252 | if (ins[0] == nullptr) { |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 253 | inLen = 0; |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 254 | ains = nullptr; |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 255 | |
| 256 | } else { |
| 257 | inLen = 1; |
| 258 | ains = const_cast<const Allocation**>(&ins[0]); |
| 259 | } |
| 260 | |
Chris Wailes | 93d6bc8 | 2014-07-28 16:54:38 -0700 | [diff] [blame] | 261 | std::vector<const void *> usrPtrs; |
| 262 | std::vector<const void *> fnPtrs; |
| 263 | std::vector<uint32_t> sigs; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 264 | for (size_t ct=0; ct < kernels.size(); ct++) { |
| 265 | Script *s = kernels[ct]->mScript; |
| 266 | RsdCpuScriptImpl *si = (RsdCpuScriptImpl *)mCtx->lookupScript(s); |
| 267 | |
| 268 | si->forEachKernelSetup(kernels[ct]->mSlot, &mtls); |
Chris Wailes | 93d6bc8 | 2014-07-28 16:54:38 -0700 | [diff] [blame] | 269 | fnPtrs.push_back((void *)mtls.kernel); |
| 270 | usrPtrs.push_back(mtls.fep.usr); |
| 271 | sigs.push_back(mtls.fep.usrLen); |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 272 | si->preLaunch(kernels[ct]->mSlot, ains, inLen, outs[ct], |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 273 | mtls.fep.usr, mtls.fep.usrLen, nullptr); |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 274 | } |
Chris Wailes | 93d6bc8 | 2014-07-28 16:54:38 -0700 | [diff] [blame] | 275 | |
| 276 | sl.sigs = &sigs.front(); |
| 277 | sl.usrPtrs = &usrPtrs.front(); |
| 278 | sl.fnPtrs = &fnPtrs.front(); |
| 279 | |
| 280 | sl.inExts = (bool*)&inExts.front(); |
| 281 | sl.outExts = (bool*)&outExts.front(); |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 282 | |
| 283 | Script *s = kernels[0]->mScript; |
| 284 | RsdCpuScriptImpl *si = (RsdCpuScriptImpl *)mCtx->lookupScript(s); |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 285 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 286 | si->forEachMtlsSetup(ains, inLen, outs[0], nullptr, 0, nullptr, &mtls); |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 287 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 288 | mtls.script = nullptr; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 289 | mtls.kernel = (void (*)())&scriptGroupRoot; |
| 290 | mtls.fep.usr = &sl; |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 291 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 292 | mCtx->launchThreads(ains, inLen, outs[0], nullptr, &mtls); |
Jason Sams | 17e3cdc | 2013-09-09 17:32:16 -0700 | [diff] [blame] | 293 | |
| 294 | for (size_t ct=0; ct < kernels.size(); ct++) { |
| 295 | Script *s = kernels[ct]->mScript; |
| 296 | RsdCpuScriptImpl *si = (RsdCpuScriptImpl *)mCtx->lookupScript(s); |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 297 | si->postLaunch(kernels[ct]->mSlot, ains, inLen, outs[ct], nullptr, 0, |
| 298 | nullptr); |
Jason Sams | 17e3cdc | 2013-09-09 17:32:16 -0700 | [diff] [blame] | 299 | } |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 300 | } |
| 301 | } |