blob: 1cf889c86a456952a595f880d2f566b7301147ee [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
31 virtual void invokeFunction(uint32_t slot, const void *params, size_t paramLength);
32 virtual int invokeRoot();
33 virtual void invokeForEach(uint32_t slot,
34 const Allocation * ain,
35 Allocation * aout,
36 const void * usr,
37 uint32_t usrLen,
38 const RsScriptCall *sc);
39 virtual void forEachKernelSetup(uint32_t slot, MTLaunchStruct *mtls);
40 virtual void invokeInit();
41 virtual void invokeFreeChildren();
42
Jason Sams2282e282013-06-17 16:52:01 -070043 virtual void preLaunch(uint32_t slot, const Allocation * ain,
44 Allocation * aout, const void * usr,
45 uint32_t usrLen, const RsScriptCall *sc);
46 virtual void postLaunch(uint32_t slot, const Allocation * ain,
47 Allocation * aout, const void * usr,
48 uint32_t usrLen, const RsScriptCall *sc);
49
Jason Sams709a0972012-11-15 18:18:04 -080050 virtual void setGlobalVar(uint32_t slot, const void *data, size_t dataLength);
51 virtual void setGlobalVarWithElemDims(uint32_t slot, const void *data, size_t dataLength,
Stephen Hinesac8d1462014-06-25 00:01:23 -070052 const Element *e, const uint32_t *dims, size_t dimLength);
Jason Sams709a0972012-11-15 18:18:04 -080053 virtual void setGlobalBind(uint32_t slot, Allocation *data);
54 virtual void setGlobalObj(uint32_t slot, ObjectBase *data);
55
56 virtual ~RsdCpuScriptIntrinsic();
Jason Samsc905efd2012-11-26 15:20:18 -080057 RsdCpuScriptIntrinsic(RsdCpuReferenceImpl *ctx, const Script *s, const Element *,
58 RsScriptIntrinsicID iid);
Jason Sams709a0972012-11-15 18:18:04 -080059
60protected:
61 RsScriptIntrinsicID mID;
62 outer_foreach_t mRootPtr;
Jason Samsc905efd2012-11-26 15:20:18 -080063 ObjectBaseRef<const Element> mElement;
Jason Sams709a0972012-11-15 18:18:04 -080064
65};
66
67
68
69}
70}
71
72#endif