@@ -27,19 +27,6 @@ namespace ROCDL {
2727// / 5. Returns an empty string.
2828StringRef getROCMPath ();
2929
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-
4330// / Base class for all ROCDL serializations from GPU modules into binary
4431// / strings. By default this class serializes into LLVM bitcode.
4532class SerializeGPUModuleBase : public LLVM ::ModuleToObject {
@@ -62,8 +49,8 @@ class SerializeGPUModuleBase : public LLVM::ModuleToObject {
6249 // / Returns the bitcode files to be loaded.
6350 ArrayRef<std::string> getFileList () const ;
6451
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 ();
6754
6855 // / Loads the bitcode files in `fileList`.
6956 virtual std::optional<SmallVector<std::unique_ptr<llvm::Module>>>
@@ -76,20 +63,15 @@ class SerializeGPUModuleBase : public LLVM::ModuleToObject {
7663 LogicalResult handleBitcodeFile (llvm::Module &module ) override ;
7764
7865protected:
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);
8470
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);
9375
9476 // / Returns the assembled ISA.
9577 std::optional<SmallVector<char , 0 >> assembleIsa (StringRef isa);
@@ -102,9 +84,6 @@ class SerializeGPUModuleBase : public LLVM::ModuleToObject {
10284
10385 // / List of LLVM bitcode files to link to.
10486 SmallVector<std::string> fileList;
105-
106- // / AMD GCN libraries to use when linking, the default is using none.
107- AMDGCNLibraries deviceLibs = AMDGCNLibraries::None;
10887};
10988} // namespace ROCDL
11089} // namespace mlir
0 commit comments