aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/workloads/RefDebugWorkload.hpp
blob: 5a2a1cdf1b6d04402d33dccd028b70cdcbbeb844 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#pragma once

#include <armnn/TypesUtils.hpp>

#include <backendsCommon/Workload.hpp>

namespace armnn
{

template <armnn::DataType DataType>
class RefDebugWorkload : public TypedWorkload<DebugQueueDescriptor, DataType>
{
public:
    RefDebugWorkload(const DebugQueueDescriptor& descriptor, const WorkloadInfo& info)
    : TypedWorkload<DebugQueueDescriptor, DataType>(descriptor, info)
    , m_Callback(nullptr) {}

    static const std::string& GetName()
    {
        static const std::string name = std::string("RefDebug") + GetDataTypeName(DataType) + "Workload";
        return name;
    }

    using TypedWorkload<DebugQueueDescriptor, DataType>::m_Data;
    using TypedWorkload<DebugQueueDescriptor, DataType>::TypedWorkload;

    void Execute() const override;

    void RegisterDebugCallback(const DebugCallbackFunction& func) override;

private:
    DebugCallbackFunction m_Callback;
};

using RefDebugFloat16Workload   = RefDebugWorkload<DataType::Float16>;
using RefDebugFloat32Workload   = RefDebugWorkload<DataType::Float32>;
using RefDebugQAsymmU8Workload  = RefDebugWorkload<DataType::QAsymmU8>;
using RefDebugQAsymmS8Workload  = RefDebugWorkload<DataType::QAsymmS8>;
using RefDebugQSymmS16Workload  = RefDebugWorkload<DataType::QSymmS16>;
using RefDebugQSymmS8Workload   = RefDebugWorkload<DataType::QSymmS8>;
using RefDebugSigned32Workload  = RefDebugWorkload<DataType::Signed32>;

} // namespace armnn