label kernels correctly

This commit is contained in:
Michael Melesse
2022-12-22 21:24:34 -06:00
parent 34f95bc7d9
commit 46357a92f2
3 changed files with 6 additions and 4 deletions

View File

@@ -87,11 +87,10 @@ struct FuncOpConversion : public FuncOpConversionBase {
auto ctx = funcOp->getContext();
#ifndef USE_ROCM
// 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",

View File

@@ -112,6 +112,9 @@ translateLLVMToLLVMIR(llvm::LLVMContext *llvmContext, mlir::ModuleOp module) {
return nullptr;
}
// Initialize LLVM targets.
// mlir::ExecutionEngine::setupTargetTriple(llvmModule.get());
auto optPipeline = mlir::makeOptimizingTransformer(
/*optLevel=*/3, /*sizeLevel=*/0,
/*targetMachine=*/nullptr);

View File

@@ -32,8 +32,8 @@ else
# pytest -rfs --verbose "python/tests/test_compiler.py" 2>&1 | tee $LOG_DIR/test_compiler.log
# pytest -rfs --verbose "python/tests/test_core_amd.py" 2>&1 | tee $LOG_DIR/test_core_amd.log
# pytest -rfs --verbose "python/tests/test_core_amd.py::test_empty_kernel" 2>&1 | tee $LOG_DIR/test_empty_kernel.log
pytest -rfs --verbose "python/tests/test_core_amd.py::test_empty_kernel[float32]" 2>&1 | tee $LOG_DIR/test_empty_kernel_float32.log
# pytest -rfs --verbose "python/tests/test_core_amd.py::test_bin_op[float32-float32-+]" 2>&1 | tee $LOG_DIR/test_bin_op_float32.log
# pytest -rfs --verbose "python/tests/test_core_amd.py::test_empty_kernel[float32]" 2>&1 | tee $LOG_DIR/test_empty_kernel_float32.log
pytest -rfs --verbose "python/tests/test_core_amd.py::test_bin_op[float32-float32-+]" 2>&1 | tee $LOG_DIR/test_bin_op_float32.log
# pytest -rfs --verbose "python/test/unit/language/test_core.py" 2>&1 | tee $LOG_DIR/test_core_amd.log
# pytest -rfs --verbose "python/tests/test_core.py" 2>&1 | tee $LOG_DIR/test_core.log
# pytest -rfs --verbose "python/tests/test_core.py::test_math_op" | tee $LOG_DIR/test_math_op.log