rsCpuScriptGroup.h revision 93eacc7ce0aad4314b4cb41a281f59ce54bb3286
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
20#include "rsd_cpu.h"
21
22namespace android {
23namespace renderscript {
24
25
26class CpuScriptGroupImpl : public RsdCpuReference::CpuScriptGroup {
27public:
28    virtual void setInput(const ScriptKernelID *kid, Allocation *);
29    virtual void setOutput(const ScriptKernelID *kid, Allocation *);
30    virtual void execute();
31    virtual ~CpuScriptGroupImpl();
32
33    CpuScriptGroupImpl(RsdCpuReferenceImpl *ctx, const ScriptGroup *sg);
34    bool init();
35
36    static void scriptGroupRoot(const RsForEachStubParamStruct *p,
37                                uint32_t xstart, uint32_t xend,
38                                uint32_t instep, uint32_t outstep);
39
40protected:
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
63