source: icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_generate_deposit_stream.cpp @ 6020

Last change on this file since 6020 was 6020, checked in by xwa163, 3 months ago
  1. New version of lz4_swizzled_match_copy kernel with higher performance
  2. Adjust related pipeline code
  3. Remove legacy comments
File size: 1.2 KB
Line 
1
2#include <pablo/builder.hpp>
3#include "lz4_generate_deposit_stream.h"
4#include <kernels/kernel_builder.h>
5
6using namespace llvm;
7using namespace kernel;
8using namespace std;
9using namespace pablo;
10
11namespace kernel {
12    void LZ4GenerateDepositStreamKernel::generatePabloMethod() {
13        PabloBuilder pb(getEntryScope());
14
15        Var* m0Marker = getInputStreamVar("m0");
16        PabloAST* v = pb.createExtract(m0Marker, 0);
17
18        Var* dMarker = getOutputStreamVar("deposit");
19
20        // d_marker = ~(M0_marker | pablo.Advance(M0_marker))
21        PabloAST* value = pb.createAdvance(v, 1);
22        value = pb.createOr(v, value);
23        value = pb.createNot(value);
24
25        pb.createAssign(pb.createExtract(dMarker, 0), value);
26    }
27
28    LZ4GenerateDepositStreamKernel::LZ4GenerateDepositStreamKernel (const std::unique_ptr<kernel::KernelBuilder> & b)
29            :
30            PabloKernel(
31                    b,
32                    "lz4_genereate_deposit_stream_kernel",
33                    {// Stream Input
34                            {b->getStreamSetTy(1), "m0"}
35                    },
36                    {// Stream Output
37                            {b->getStreamSetTy(1), "deposit"}
38                    }){
39
40    }
41}
Note: See TracBrowser for help on using the repository browser.