@@ -27,19 +27,6 @@ namespace ROCDL {
27
27
// / 5. Returns an empty string.
28
28
StringRef getROCMPath ();
29
29
30
- // / Helper enum for specifying the AMD GCN device libraries required for
31
- // / compilation.
32
- enum class AMDGCNLibraries : uint32_t {
33
- None = 0 ,
34
- Ockl = 1 ,
35
- Ocml = 2 ,
36
- OpenCL = 4 ,
37
- Hip = 8 ,
38
- LastLib = Hip,
39
- LLVM_MARK_AS_BITMASK_ENUM (LastLib),
40
- All = (LastLib << 1 ) - 1
41
- };
42
-
43
30
// / Base class for all ROCDL serializations from GPU modules into binary
44
31
// / strings. By default this class serializes into LLVM bitcode.
45
32
class SerializeGPUModuleBase : public LLVM ::ModuleToObject {
@@ -62,8 +49,8 @@ class SerializeGPUModuleBase : public LLVM::ModuleToObject {
62
49
// / Returns the bitcode files to be loaded.
63
50
ArrayRef<std::string> getFileList () const ;
64
51
65
- // / Appends standard ROCm device libraries to `fileList` .
66
- LogicalResult appendStandardLibs (AMDGCNLibraries libs );
52
+ // / Appends standard ROCm device libraries like `ocml.bc`, `ockl.bc`, etc .
53
+ LogicalResult appendStandardLibs ();
67
54
68
55
// / Loads the bitcode files in `fileList`.
69
56
virtual std::optional<SmallVector<std::unique_ptr<llvm::Module>>>
@@ -76,20 +63,15 @@ class SerializeGPUModuleBase : public LLVM::ModuleToObject {
76
63
LogicalResult handleBitcodeFile (llvm::Module &module) override ;
77
64
78
65
protected:
79
- // / Adds `oclc` control variables to the LLVM module.
80
- void addControlVariables (llvm::Module &module, AMDGCNLibraries libs,
81
- bool wave64, bool daz, bool finiteOnly,
82
- bool unsafeMath, bool fastMath, bool correctSqrt,
83
- StringRef abiVer);
66
+ // / Appends the paths of common ROCm device libraries to `libs`.
67
+ LogicalResult getCommonBitcodeLibs (llvm::SmallVector<std::string> &libs,
68
+ SmallVector<char , 256 > &libPath,
69
+ StringRef isaVersion);
84
70
85
- // / Compiles assembly to a binary.
86
- virtual std::optional<SmallVector<char , 0 >>
87
- compileToBinary (const std::string &serializedISA);
88
-
89
- // / Default implementation of `ModuleToObject::moduleToObject`.
90
- std::optional<SmallVector<char , 0 >>
91
- moduleToObjectImpl (const gpu::TargetOptions &targetOptions,
92
- llvm::Module &llvmModule);
71
+ // / Adds `oclc` control variables to the LLVM module.
72
+ void addControlVariables (llvm::Module &module, bool wave64, bool daz,
73
+ bool finiteOnly, bool unsafeMath, bool fastMath,
74
+ bool correctSqrt, StringRef abiVer);
93
75
94
76
// / Returns the assembled ISA.
95
77
std::optional<SmallVector<char , 0 >> assembleIsa (StringRef isa);
@@ -102,9 +84,6 @@ class SerializeGPUModuleBase : public LLVM::ModuleToObject {
102
84
103
85
// / List of LLVM bitcode files to link to.
104
86
SmallVector<std::string> fileList;
105
-
106
- // / AMD GCN libraries to use when linking, the default is using none.
107
- AMDGCNLibraries deviceLibs = AMDGCNLibraries::None;
108
87
};
109
88
} // namespace ROCDL
110
89
} // namespace mlir
0 commit comments