Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011-2012 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 | #ifndef RSD_SCRIPT_GROUP_H |
| 18 | #define RSD_SCRIPT_GROUP_H |
| 19 | |
Jason Sams | 93eacc7 | 2012-12-18 14:26:57 -0800 | [diff] [blame] | 20 | #include "rsd_cpu.h" |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 21 | |
| 22 | namespace android { |
| 23 | namespace renderscript { |
| 24 | |
| 25 | |
| 26 | class CpuScriptGroupImpl : public RsdCpuReference::CpuScriptGroup { |
| 27 | public: |
| 28 | virtual void setInput(const ScriptKernelID *kid, Allocation *); |
| 29 | virtual void setOutput(const ScriptKernelID *kid, Allocation *); |
| 30 | virtual void execute(); |
| 31 | virtual ~CpuScriptGroupImpl(); |
| 32 | |
Yang Ni | 1ffd86b | 2015-01-07 09:16:40 -0800 | [diff] [blame] | 33 | CpuScriptGroupImpl(RsdCpuReferenceImpl *ctx, const ScriptGroupBase *sg); |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 34 | bool init(); |
| 35 | |
David Gross | b0abb14 | 2015-03-12 15:23:03 -0700 | [diff] [blame] | 36 | static void scriptGroupRoot(const RsExpandKernelDriverInfo *info, |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 37 | uint32_t xstart, uint32_t xend, |
Chris Wailes | 9ed7910 | 2014-07-25 15:53:28 -0700 | [diff] [blame] | 38 | uint32_t outstep); |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 39 | |
| 40 | protected: |
| 41 | struct ScriptList { |
| 42 | size_t count; |
| 43 | Allocation *const* ins; |
| 44 | bool const* inExts; |
| 45 | Allocation *const* outs; |
| 46 | bool const* outExts; |
| 47 | const void *const* usrPtrs; |
| 48 | size_t const *usrSizes; |
| 49 | uint32_t const *sigs; |
| 50 | const void *const* fnPtrs; |
| 51 | |
| 52 | const ScriptKernelID *const* kernels; |
| 53 | }; |
| 54 | ScriptList mSl; |
| 55 | const ScriptGroup *mSG; |
| 56 | RsdCpuReferenceImpl *mCtx; |
| 57 | }; |
| 58 | |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | #endif // RSD_SCRIPT_GROUP_H |