File size: 668 Bytes
3fd1a35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#pragma once

#include "ling3/gdn_step.h"
#include "ling3/model_package.h"
#include "ling3/w4_linear.h"

#include <array>
#include <cstdint>
#include <memory>
#include <span>

namespace ling3 {

struct Layer0Timings {
    double attention_ms = 0.0;
    double dense_ffn_ms = 0.0;
    double total_ms = 0.0;
};

class Layer0 {
public:
    explicit Layer0(const ModelPackage & package);
    ~Layer0();

    Layer0(const Layer0 &) = delete;
    Layer0 & operator=(const Layer0 &) = delete;

    void Reset();
    Layer0Timings DecodeToken(std::uint32_t token, std::span<float> output);

private:
    struct Impl;
    std::unique_ptr<Impl> impl_;
};

} // namespace ling3