================
@@ -6,24 +6,55 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements classes required for offloading to CUDA devices.
+// This file implements classes required for offloading to HIP and CUDA
devices.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_LIB_INTERPRETER_DEVICE_OFFLOAD_H
#define LLVM_CLANG_LIB_INTERPRETER_DEVICE_OFFLOAD_H
#include "IncrementalParser.h"
-#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/VirtualFileSystem.h"
+#include <memory>
+
+namespace llvm {
+class TargetMachine;
+} // namespace llvm
+
namespace clang {
struct PartialTranslationUnit;
class CompilerInstance;
class CodeGenOptions;
class TargetOptions;
class IncrementalAction;
+class IncrementalHIPDeviceParser : public IncrementalParser {
+
+public:
+ IncrementalHIPDeviceParser(
+ CompilerInstance &DeviceInstance, CompilerInstance &HostInstance,
+ IncrementalAction *DeviceAct,
+ llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> VFS,
+ llvm::Error &Err, std::list<PartialTranslationUnit> &PTUs);
+
+ llvm::Expected<TranslationUnitDecl *> Parse(llvm::StringRef Input) override;
+
+ llvm::Expected<llvm::StringRef> GenerateHSACO();
----------------
AdityaSinha149 wrote:
Added an interface called `IncrementalDeviceParser` and both the CUDA and HIP
device parsers now implement it.
https://github.com/llvm/llvm-project/pull/218337
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits