Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions paddle/cinn/backends/codegen_cuda_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using cinn::common::float16;

const int kArgsArrayMaxLen = 20;

llvm::Value* CodeGenCudaHost::LowerGPUKernelLauncher(
llvm::Value* CodeGenGpuHost::LowerGPUKernelLauncher(
const ir::_LoweredFunc_* func) {
auto body = func->body;
auto* call_ir = body.As<ir::Call>();
Expand Down Expand Up @@ -202,7 +202,7 @@ llvm::Value* CodeGenCudaHost::LowerGPUKernelLauncher(
return function;
}

llvm::Value* CodeGenCudaHost::LowerGPUKernelCall(const ir::Call* call_ir) {
llvm::Value* CodeGenGpuHost::LowerGPUKernelCall(const ir::Call* call_ir) {
std::vector<llvm::Value*> ll_function_args;
std::transform(f_->arg_begin(),
f_->arg_end(),
Expand Down
14 changes: 7 additions & 7 deletions paddle/cinn/backends/codegen_cuda_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ namespace cinn {
namespace backends {

/**
* CodeGenCudaHost takes a CINN Module with CUDA host functions and output a
* CodeGenGpuHost takes a CINN Module with CUDA/HIP host functions and output a
* LLVM module.
*/
class CodeGenCudaHost : public CodeGenHost {
class CodeGenGpuHost : public CodeGenHost {
public:
explicit CodeGenCudaHost(llvm::Module *m,
llvm::IRBuilder<> *b,
const std::shared_ptr<SymbolTable> &vars = nullptr)
explicit CodeGenGpuHost(llvm::Module *m,
llvm::IRBuilder<> *b,
const std::shared_ptr<SymbolTable> &vars = nullptr)
: CodeGenHost(m, b, vars) {}

// TODO(Hongqing-work): remove this after we clear some old codes.
Expand Down Expand Up @@ -65,9 +65,9 @@ class CodeGenCudaHost : public CodeGenHost {

private:
/**
* Lower a CUDA kernel launcher.
* Lower a CUDA/HIP kernel launcher.
*
* We launch a CUDA kernel in the following way:
* We launch a CUDA/HIP kernel in the following way:
*
* 1. a GPU function (called fn) will compiled to PTX and lower by CUDA driver
* to a function pointer, which we store as a `void*` type global variable
Expand Down
4 changes: 2 additions & 2 deletions paddle/cinn/backends/compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ void Compiler::CompileCudaModule(const Module& module,
std::string kernel_fn_name = fn->name;
device_fn_name_.emplace_back(kernel_fn_name);
}
engine_->Link<CodeGenCudaHost>(host_module);
engine_->Link<CodeGenGpuHost>(host_module);

#else
CINN_NOT_IMPLEMENTED
Expand Down Expand Up @@ -460,7 +460,7 @@ void Compiler::CompileHipModule(const Module& module, const std::string& code) {
std::string kernel_fn_name = fn->name;
device_fn_name_.emplace_back(kernel_fn_name);
}
engine_->Link<CodeGenCUDA_Host>(host_module);
engine_->Link<CodeGenGpuHost>(host_module);
#else
CINN_NOT_IMPLEMENTED
#endif
Expand Down
2 changes: 1 addition & 1 deletion paddle/cinn/backends/llvm/execution_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void ExecutionEngine::RegisterGlobalRuntimeSymbols() {

template void ExecutionEngine::Link<CodeGenLLVM>(const ir::Module &module);
template void ExecutionEngine::Link<CodeGenX86>(const ir::Module &module);
template void ExecutionEngine::Link<CodeGenCudaHost>(const ir::Module &module);
template void ExecutionEngine::Link<CodeGenGpuHost>(const ir::Module &module);
template void ExecutionEngine::Link<CodeGenSwitchHost>(
const ir::Module &module);

Expand Down
3 changes: 1 addition & 2 deletions paddle/cinn/backends/llvm/simple_jit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ void SimpleJIT::Link(ir::Module module, bool optimize) {
}

template void SimpleJIT::Link<CodeGenLLVM>(ir::Module module, bool optimize);
template void SimpleJIT::Link<CodeGenCudaHost>(ir::Module module,
bool optimize);
template void SimpleJIT::Link<CodeGenGpuHost>(ir::Module module, bool optimize);

} // namespace backends

Expand Down
2 changes: 1 addition & 1 deletion paddle/cinn/common/cuda_test_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void CudaModuleTester::Compile(const ir::Module& m,
jit_ = backends::SimpleJIT::Create();

// compile host module
jit_->Link<backends::CodeGenCudaHost>(host_module, false);
jit_->Link<backends::CodeGenGpuHost>(host_module, false);
}

void* CudaModuleTester::CreateDeviceBuffer(const cinn_buffer_t* host_buffer) {
Expand Down