tqchen commented on a change in pull request #8366:
URL: https://github.com/apache/tvm/pull/8366#discussion_r664543379
##########
File path: src/tir/ir/buffer.cc
##########
@@ -45,12 +45,27 @@ Array<PrimExpr> SimplifyArray(arith::Analyzer* ana,
Array<PrimExpr> array) {
return array;
}
-Buffer decl_buffer(Array<PrimExpr> shape, DataType dtype, String name, Span
span) {
+Buffer decl_buffer(Array<PrimExpr> shape, DataType dtype, String name, String
storage_scope,
+ Span span) {
DataType storage_dtype = (dtype == DataType::Bool() ? DataType::Int(8) :
dtype);
- return Buffer(Var(name, PointerType(PrimType(storage_dtype)), span), dtype,
shape,
+ return Buffer(Var(name, PointerType(PrimType(storage_dtype), storage_scope),
span), dtype, shape,
Array<PrimExpr>(), PrimExpr(), name, "", 0, 0, kDefault, span);
}
+String GetStorageScope(Var buffer_var) {
Review comment:
Consider to the caller side since directly exposing the function is more
informative.
GetPtrStorageScope
##########
File path: src/tir/ir/buffer.cc
##########
@@ -45,12 +45,27 @@ Array<PrimExpr> SimplifyArray(arith::Analyzer* ana,
Array<PrimExpr> array) {
return array;
}
-Buffer decl_buffer(Array<PrimExpr> shape, DataType dtype, String name, Span
span) {
+Buffer decl_buffer(Array<PrimExpr> shape, DataType dtype, String name, String
storage_scope,
+ Span span) {
DataType storage_dtype = (dtype == DataType::Bool() ? DataType::Int(8) :
dtype);
- return Buffer(Var(name, PointerType(PrimType(storage_dtype)), span), dtype,
shape,
+ return Buffer(Var(name, PointerType(PrimType(storage_dtype), storage_scope),
span), dtype, shape,
Array<PrimExpr>(), PrimExpr(), name, "", 0, 0, kDefault, span);
}
+String GetStorageScope(Var buffer_var) {
+ auto type = buffer_var->type_annotation;
+ const auto* ptr_type = type.as<PointerTypeNode>();
+ ICHECK(ptr_type) << "The provided variable is not of pointer type";
+ return ptr_type->storage_scope;
+}
+
+Var UpdateStorageScope(Var buffer_var, String storage_scope) {
Review comment:
Move this to the caller side since this is a quick convenient function.
Consider rename to WithStorageScope
##########
File path: src/target/llvm/codegen_llvm.cc
##########
@@ -498,11 +498,12 @@ void CodeGenLLVM::AddAliasInfo(llvm::Instruction* inst,
const VarNode* buffer, P
void CodeGenLLVM::GetAlignment(DataType t, const VarNode* buf_var, const
PrimExpr& index,
int* p_alignment, int* p_native_bits) {
int max_align_bits = t.bits();
- auto it = alloc_storage_info_.find(buf_var);
- if (it != alloc_storage_info_.end()) {
- const StorageInfo& info = it->second;
Review comment:
Let us keep the original data structure info for now, in case we need to
add more information later
##########
File path: Jenkinsfile
##########
@@ -282,7 +282,6 @@ stage('Unit Test') {
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} ${ci_arm} ./tests/scripts/task_ci_setup.sh"
sh "${docker_run} ${ci_arm} ./tests/scripts/task_python_unittest.sh"
- sh "${docker_run} ${ci_arm}
./tests/scripts/task_python_arm_compute_library.sh"
Review comment:
should not be part of the PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]