Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 23 | namespace android { |
| 24 | namespace renderscript { |
| 25 | |
| 26 | |
| 27 | class RsdCpuScriptIntrinsic : public RsdCpuScriptImpl { |
| 28 | public: |
Stephen Hines | c060f14 | 2015-05-13 19:26:09 -0700 | [diff] [blame] | 29 | void populateScript(Script *) override = 0; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 30 | |
Stephen Hines | c060f14 | 2015-05-13 19:26:09 -0700 | [diff] [blame] | 31 | void invokeFunction(uint32_t slot, const void * params, size_t paramLength) override; |
| 32 | int invokeRoot() override; |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 33 | |
Stephen Hines | c060f14 | 2015-05-13 19:26:09 -0700 | [diff] [blame] | 34 | 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 Wailes | 4b3c34e | 2014-06-11 12:00:29 -0700 | [diff] [blame] | 41 | |
Matt Wala | 14ce007 | 2015-07-30 17:30:25 -0700 | [diff] [blame] | 42 | void forEachKernelSetup(uint32_t slot, MTLaunchStructForEach * mtls) override; |
Stephen Hines | c060f14 | 2015-05-13 19:26:09 -0700 | [diff] [blame] | 43 | void invokeInit() override; |
| 44 | void invokeFreeChildren() override; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 45 | |
Stephen Hines | c060f14 | 2015-05-13 19:26:09 -0700 | [diff] [blame] | 46 | 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 Sams | 2282e28 | 2013-06-17 16:52:01 -0700 | [diff] [blame] | 53 | |
Stephen Hines | c060f14 | 2015-05-13 19:26:09 -0700 | [diff] [blame] | 54 | 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 Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 61 | |
Stephen Hines | c060f14 | 2015-05-13 19:26:09 -0700 | [diff] [blame] | 62 | ~RsdCpuScriptIntrinsic() override; |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 63 | RsdCpuScriptIntrinsic(RsdCpuReferenceImpl * ctx, const Script * s, |
| 64 | const Element * e, RsScriptIntrinsicID iid); |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 65 | |
| 66 | protected: |
| 67 | RsScriptIntrinsicID mID; |
Matt Wala | 14ce007 | 2015-07-30 17:30:25 -0700 | [diff] [blame] | 68 | ForEachFunc_t mRootPtr; |
Jason Sams | c905efd | 2012-11-26 15:20:18 -0800 | [diff] [blame] | 69 | ObjectBaseRef<const Element> mElement; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 70 | |
| 71 | }; |
| 72 | |
| 73 | |
| 74 | |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | #endif |