rsCpuScriptGroup.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  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. #ifndef RSD_SCRIPT_GROUP_H
  17. #define RSD_SCRIPT_GROUP_H
  18. #include "rsd_cpu.h"
  19. namespace android {
  20. namespace renderscript {
  21. class CpuScriptGroupImpl : public RsdCpuReference::CpuScriptGroup {
  22. public:
  23. void setInput(const ScriptKernelID *kid, Allocation *) override;
  24. void setOutput(const ScriptKernelID *kid, Allocation *) override;
  25. void execute() override;
  26. ~CpuScriptGroupImpl() override;
  27. CpuScriptGroupImpl(RsdCpuReferenceImpl *ctx, const ScriptGroupBase *sg);
  28. bool init();
  29. static void scriptGroupRoot(const RsExpandKernelDriverInfo *info,
  30. uint32_t xstart, uint32_t xend,
  31. uint32_t outstep);
  32. protected:
  33. struct ScriptList {
  34. size_t count;
  35. Allocation *const* ins;
  36. uint8_t const* inExts;
  37. Allocation *const* outs;
  38. uint8_t const* outExts;
  39. const void *const* usrPtrs;
  40. size_t const *usrSizes;
  41. uint32_t const *sigs;
  42. const void *const* fnPtrs;
  43. const ScriptKernelID *const* kernels;
  44. };
  45. ScriptList mSl;
  46. const ScriptGroup *mSG;
  47. RsdCpuReferenceImpl *mCtx;
  48. };
  49. } // namespace renderscript
  50. } // namespace android
  51. #endif // RSD_SCRIPT_GROUP_H