AVX2Backend.hpp 927 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // AVX2Backend.hpp
  3. // MNN
  4. //
  5. // Created by MNN on 2021/05/16.
  6. // Copyright © 2018, Alibaba Group Holding Limited
  7. //
  8. #ifndef AVX2Backend_hpp
  9. #define AVX2Backend_hpp
  10. #include "backend/cpu/CPUBackend.hpp"
  11. #include "core/Macro.h"
  12. #include "core/TensorUtils.hpp"
  13. namespace MNN {
  14. class AVX2Backend : public CPUBackend {
  15. public:
  16. virtual ~AVX2Backend();
  17. AVX2Backend(const CPURuntime* runtime, size_t flags);
  18. virtual Execution* onCreate(const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs,
  19. const MNN::Op* op) override;
  20. virtual bool onAcquireBuffer(const Tensor* nativeTensor, StorageType storageType) override;
  21. virtual void onCopyBuffer(const Tensor* srcTensor, const Tensor* dstTensor) const override;
  22. int numberThread() const {
  23. return threadNumber();
  24. }
  25. static bool isValid();
  26. };
  27. } // namespace MNN
  28. #endif /* AVX2Backend_hpp */