Poplar and PopLibs
CodeletFileType.hpp
1// Copyright (c) 2018 Graphcore Ltd. All rights reserved.
2
3#ifndef poplar_CodeletFileType_hpp
4#define poplar_CodeletFileType_hpp
5
6#include <string>
7
8namespace poplar {
9
10enum class CodeletFileType {
12 AsmSource,
13 CSource,
14 CppSource,
15 IrSource,
16 Object,
17 Auto
18};
19
20// Given a path to a file attempt to deduce the type.
21CodeletFileType getCodeletFileType(const char *path);
22
23// Given a type, return the extension a file that contains that type should have
24std::string getExtensionFromFileType(CodeletFileType type);
25
26// Get the language name for the compiler's -x <lang> option from the file type.
27// Note that the fileType cannot be Auto.
28std::string getLanguageOption(CodeletFileType type);
29
30} // namespace poplar
31
32#endif // poplar_CodeletFileType_hpp
Poplar classes and functions.
Definition: ArrayRef.hpp:14
CodeletFileType
Definition: CodeletFileType.hpp:10
@ Auto
Auto detect based on file name.
@ Object
A graph program object file.
@ CppSource
A graph C++ source file.
@ AsmSource
A graph assembly language file with preprocessor macros.
@ IrSource
A graph LLVM IR source file.
@ PreprocessedAsmSource
A graph assembly language source file.
@ CSource
A graph C source file.