blob: 95aaa1414c80c8eb5c8f099dcb4637282b6a72c4 [file] [log] [blame]
Jason Sams709a0972012-11-15 18:18:04 -08001/*
2 * Copyright (C) 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_CPU_SCRIPT_INTRINSIC_H
18#define RSD_CPU_SCRIPT_INTRINSIC_H
19
20#include "rsCpuScript.h"
21
22
23namespace android {
24namespace renderscript {
25
26
27class RsdCpuScriptIntrinsic : public RsdCpuScriptImpl {
28public:
29 virtual void populateScript(Script *) = 0;
30
Chris Wailesf3712132014-07-16 15:18:30 -070031 virtual void invokeFunction(uint32_t slot, const void * params,
32 size_t paramLength);
Jason Sams709a0972012-11-15 18:18:04 -080033 virtual int invokeRoot();
Chris Wailesf3712132014-07-16 15:18:30 -070034
Jason Sams709a0972012-11-15 18:18:04 -080035 virtual void invokeForEach(uint32_t slot,
Chris Wailesf3712132014-07-16 15:18:30 -070036 const Allocation ** ain,
37 uint32_t inLen,
38 Allocation * aout,
39 const void * usr,
40 uint32_t usrLen,
41 const RsScriptCall *sc);
Chris Wailes4b3c34e2014-06-11 12:00:29 -070042
Chris Wailesf3712132014-07-16 15:18:30 -070043 virtual void forEachKernelSetup(uint32_t slot, MTLaunchStruct * mtls);
Jason Sams709a0972012-11-15 18:18:04 -080044 virtual void invokeInit();
45 virtual void invokeFreeChildren();
46
Chris Wailesf3712132014-07-16 15:18:30 -070047 virtual void preLaunch(uint32_t slot, const Allocation ** ains,
48 uint32_t inLen, Allocation * aout, const void * usr,
49 uint32_t usrLen, const RsScriptCall * sc);
50 virtual void postLaunch(uint32_t slot, const Allocation ** ains,
51 uint32_t inLen, Allocation * aout,
52 const void * usr, uint32_t usrLen,
53 const RsScriptCall * sc);
Jason Sams2282e282013-06-17 16:52:01 -070054
Chris Wailesf3712132014-07-16 15:18:30 -070055 virtual void setGlobalVar(uint32_t slot, const void * data,
56 size_t dataLength);
57 virtual void setGlobalVarWithElemDims(uint32_t slot, const void * data,
58 size_t dataLength, const Element * e,
59 const uint32_t * dims,
60 size_t dimLength);
Jason Sams709a0972012-11-15 18:18:04 -080061 virtual void setGlobalBind(uint32_t slot, Allocation *data);
62 virtual void setGlobalObj(uint32_t slot, ObjectBase *data);
63
64 virtual ~RsdCpuScriptIntrinsic();
Chris Wailesf3712132014-07-16 15:18:30 -070065 RsdCpuScriptIntrinsic(RsdCpuReferenceImpl * ctx, const Script * s,
66 const Element * e, RsScriptIntrinsicID iid);
Jason Sams709a0972012-11-15 18:18:04 -080067
68protected:
69 RsScriptIntrinsicID mID;
70 outer_foreach_t mRootPtr;
Jason Samsc905efd2012-11-26 15:20:18 -080071 ObjectBaseRef<const Element> mElement;
Jason Sams709a0972012-11-15 18:18:04 -080072
73};
74
75
76
77}
78}
79
80#endif