blob: 9c7e172691ce9ffa78e84c1fc4271a87bb6fd0ae [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:
Stephen Hinesc060f142015-05-13 19:26:09 -070029 void populateScript(Script *) override = 0;
Jason Sams709a0972012-11-15 18:18:04 -080030
Stephen Hinesc060f142015-05-13 19:26:09 -070031 void invokeFunction(uint32_t slot, const void * params, size_t paramLength) override;
32 int invokeRoot() override;
Chris Wailesf3712132014-07-16 15:18:30 -070033
Stephen Hinesc060f142015-05-13 19:26:09 -070034 void invokeForEach(uint32_t slot,
35 const Allocation ** ain,
36 uint32_t inLen,
37 Allocation * aout,
38 const void * usr,
39 uint32_t usrLen,
40 const RsScriptCall *sc) override;
Chris Wailes4b3c34e2014-06-11 12:00:29 -070041
Matt Wala14ce0072015-07-30 17:30:25 -070042 void forEachKernelSetup(uint32_t slot, MTLaunchStructForEach * mtls) override;
Stephen Hinesc060f142015-05-13 19:26:09 -070043 void invokeInit() override;
44 void invokeFreeChildren() override;
Jason Sams709a0972012-11-15 18:18:04 -080045
Stephen Hinesc060f142015-05-13 19:26:09 -070046 void preLaunch(uint32_t slot, const Allocation ** ains,
47 uint32_t inLen, Allocation * aout, const void * usr,
48 uint32_t usrLen, const RsScriptCall * sc) override;
49 void postLaunch(uint32_t slot, const Allocation ** ains,
50 uint32_t inLen, Allocation * aout,
51 const void * usr, uint32_t usrLen,
52 const RsScriptCall * sc) override;
Jason Sams2282e282013-06-17 16:52:01 -070053
Stephen Hinesc060f142015-05-13 19:26:09 -070054 void setGlobalVar(uint32_t slot, const void * data, size_t dataLength) override;
55 void setGlobalVarWithElemDims(uint32_t slot, const void * data,
56 size_t dataLength, const Element * e,
57 const uint32_t * dims,
58 size_t dimLength) override;
59 void setGlobalBind(uint32_t slot, Allocation *data) override;
60 void setGlobalObj(uint32_t slot, ObjectBase *data) override;
Jason Sams709a0972012-11-15 18:18:04 -080061
Stephen Hinesc060f142015-05-13 19:26:09 -070062 ~RsdCpuScriptIntrinsic() override;
Chris Wailesf3712132014-07-16 15:18:30 -070063 RsdCpuScriptIntrinsic(RsdCpuReferenceImpl * ctx, const Script * s,
64 const Element * e, RsScriptIntrinsicID iid);
Jason Sams709a0972012-11-15 18:18:04 -080065
66protected:
67 RsScriptIntrinsicID mID;
Matt Wala14ce0072015-07-30 17:30:25 -070068 ForEachFunc_t mRootPtr;
Jason Samsc905efd2012-11-26 15:20:18 -080069 ObjectBaseRef<const Element> mElement;
Jason Sams709a0972012-11-15 18:18:04 -080070
71};
72
73
74
75}
76}
77
78#endif