Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
liqiangxl committed Feb 17, 2024
1 parent 6fc67f9 commit 248429c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions csrc/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2298,6 +2298,8 @@ class CudaKernelGenerator : private kir::ConstIrVisitor {
ArgumentBuilder func_args;

// outputs
Val* out0 =output.get(0);
std::cout << "output: " << out0 << ", dtype: " << out0->dtype()<< std::endl;
func_args.arg(genVariableName(output.get(0)));
func_args.arg(genVariableName(output.get(1)));
func_args.arg(genVariableName(output.get(2)));
Expand Down Expand Up @@ -2792,11 +2794,18 @@ class CudaKernelGenerator : private kir::ConstIrVisitor {
if (alloc->alias() != nullptr) {
// Allocate alias another Allocate stmt
const auto alias_tv = alloc->alias()->buffer()->as<TensorView>();



if (alias_tv->getDataType() == tv->getDataType()) {
indent() << "// Alias Allocation - " << alloc->memoryType() << "\n";
indent() << "auto& " << genVariableName(tv) << " = "
<< genVariableName(alias_tv) << ";\n";
} else {

std::cout << "alias_tv getDataType - " << alias_tv->getDataType().value() << std::endl;
std::cout << "tv getDataType - " << tv->getDataType().value() << std::endl;

indent() << "// Alias Allocation (changing dtype) - "
<< alloc->memoryType() << "\n";
indent() << "auto " << genVariableName(tv)
Expand Down

0 comments on commit 248429c

Please sign in to comment.