source: icGREP/icgrep-devel/icgrep/kernels/random_stream.h

Last change on this file was 6120, checked in by cameron, 12 months ago

Random value streams

File size: 788 bytes
Line 
1#ifndef RANDOM_STREAM_H
2#define RANDOM_STREAM_H
3
4#include "kernel.h"
5namespace kernel { class KernelBuilder; }
6
7namespace kernel {
8
9class RandomStreamKernel final : public SegmentOrientedKernel {
10public:
11    RandomStreamKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, unsigned seed, unsigned valueWidth, size_t streamLength);
12    bool isCachable() const override { return true; }
13    bool hasSignature() const override { return false; }
14    void generateInitializeMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
15    void generateDoSegmentMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
16protected:
17    const unsigned mSeed;
18    const unsigned mValueWidth;
19    const size_t mStreamLength;
20};
21
22}
23
24#endif // RANDOM_STREAM_H
Note: See TracBrowser for help on using the repository browser.