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

Last change on this file was 6193, checked in by nmedfort, 9 months ago

Check-in of partially implemented DirectorySearch? kernel

File size: 1.4 KB
Line 
1#ifndef DIRECTORYSEARCH_H
2#define DIRECTORYSEARCH_H
3
4#include "kernel.h"
5
6namespace kernel { class KernelBuilder; }
7
8namespace kernel {
9
10class DirectorySearch final : public SegmentOrientedKernel {
11public:
12    DirectorySearch(const std::unique_ptr<kernel::KernelBuilder> & iBuilder,
13                    Scalar * const rootPath,
14                    StreamSet * const directoryNameStream, StreamSet * const fileDirectoryStream, StreamSet * const fileNameStream,
15                    const unsigned filesPerSegment = 1024, const bool recursive = true, const bool includeHidden = false);
16
17    bool isCachable() const override { return true; }
18
19    bool hasSignature() const override { return false; }
20
21    void linkExternalMethods(const std::unique_ptr<kernel::KernelBuilder> & b) override;
22
23    void generateInitializeMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
24
25    void generateDoSegmentMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
26
27    void generateFinalizeMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
28private:
29
30    void addToOutputStream(const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Value * const name, llvm::Value * const nameLength, llvm::StringRef field, llvm::Value * const consumed);
31
32private:
33    const bool mRecursive;
34    const bool mIncludeHidden;
35    llvm::Function * fOpen;
36    llvm::Function * fSysCall;
37};
38
39}
40
41#endif // DIRECTORYSEARCH_H
Note: See TracBrowser for help on using the repository browser.