blob: 810488afb1456a9be91718f6a74e3285b54e8c76 [file] [log] [blame]
Jason Sams709a0972012-11-15 18:18:04 -08001/*
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 Sams93eacc72012-12-18 14:26:57 -080020#include "rsd_cpu.h"
Jason Sams709a0972012-11-15 18:18:04 -080021
22namespace android {
23namespace renderscript {
24
25
26class CpuScriptGroupImpl : public RsdCpuReference::CpuScriptGroup {
27public:
Stephen Hinesc060f142015-05-13 19:26:09 -070028 void setInput(const ScriptKernelID *kid, Allocation *) override;
29 void setOutput(const ScriptKernelID *kid, Allocation *) override;
30 void execute() override;
31 ~CpuScriptGroupImpl() override;
Jason Sams709a0972012-11-15 18:18:04 -080032
Yang Ni1ffd86b2015-01-07 09:16:40 -080033 CpuScriptGroupImpl(RsdCpuReferenceImpl *ctx, const ScriptGroupBase *sg);
Jason Sams709a0972012-11-15 18:18:04 -080034 bool init();
35
David Grossb0abb142015-03-12 15:23:03 -070036 static void scriptGroupRoot(const RsExpandKernelDriverInfo *info,
Jason Sams709a0972012-11-15 18:18:04 -080037 uint32_t xstart, uint32_t xend,
Chris Wailes9ed79102014-07-25 15:53:28 -070038 uint32_t outstep);
Jason Sams709a0972012-11-15 18:18:04 -080039
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