fix issues

This commit is contained in:
Rahul Batra
2023-04-07 14:40:59 -05:00
parent a27b388df5
commit 3d71a6a034
4 changed files with 6 additions and 6 deletions

View File

@@ -135,7 +135,7 @@ struct LoadOpConversion
builder.create<mlir::scf::YieldOp>(loc, ValueRange({loadVal}));
},
[&](OpBuilder &builder, Location loc){
Value zeroVal = bitcast(int_val(valueElemNbits, 0), IntegerType::get(getContext(), width));
Value zeroVal = bitcast(int_val(valueElemNBits, 0), IntegerType::get(getContext(), width));
Value otherVal;
if (other) {
auto vecTy = LLVM::getFixedVectorType(valueElemTy, wordNElems);

View File

@@ -48,6 +48,7 @@ public:
addLegalDialect<LLVM::LLVMDialect>();
if (isROCM) {
addLegalDialect<ROCDL::ROCDLDialect>();
addLegalDialect<mlir::scf::SCFDialect>();
} else {
addLegalDialect<NVVM::NVVMDialect>();
}
@@ -98,11 +99,10 @@ struct FuncOpConversion : public FuncOpConversionBase {
// Set an attribute to indicate this function is a kernel entry.
newFuncOp->setAttr("nvvm.kernel",
rewriter.getIntegerAttr(type::u1Ty(ctx), 1));
#ifndef USE_ROCM
// Set an attribute for maxntidx, it could be used in latter LLVM codegen
// for `nvvm.annotation` metadata.
newFuncOp->setAttr("nvvm.maxntid", rewriter.getI32ArrayAttr(32 * numWarps));
#endif
rewriter.eraseOp(funcOp);
return success();
@@ -119,6 +119,7 @@ public:
addLegalDialect<LLVM::LLVMDialect>();
if (isROCM) {
addLegalDialect<ROCDL::ROCDLDialect>();
addLegalDialect<mlir::scf::SCFDialect>();
} else {
addLegalDialect<NVVM::NVVMDialect>();
}

View File

@@ -240,7 +240,6 @@ static bool linkExternLib(llvm::Module &module, llvm::StringRef name,
assert(false && "unknown extern lib: ");
}
}
#endif
return false;
}

View File

@@ -19,9 +19,9 @@ sh scripts/amd/clean.sh
# UNIT_TEST="python/test/unit/language/test_core_amd.py"
# UNIT_TEST="python/test/unit/language/test_core.py::test_empty_kernel[float32]"
# UNIT_TEST="python/test/unit/language/test_core.py::test_bin_op"
# UNIT_TEST="python/test/unit/language/test_core.py::test_bin_op[float32-float32-+]"
UNIT_TEST="python/test/unit/language/test_core.py::test_bin_op[float32-float32-+]"
# UNIT_TEST="python/test/unit/language/test_core.py::test_bin_op[int8-float16-%]"
UNIT_TEST="python/test/unit/language/test_elementwise.py"
# UNIT_TEST="python/test/unit/language/test_elementwise.py"
# check for backtrace
if [ "$1" == "backtrace" ]; then