-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[type] Support bit-level read and write in Python-scope #2029
[type] Support bit-level read and write in Python-scope #2029
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2029 +/- ##
==========================================
+ Coverage 43.52% 43.54% +0.02%
==========================================
Files 45 45
Lines 6270 6267 -3
Branches 1110 1110
==========================================
Hits 2729 2729
+ Misses 3369 3366 -3
Partials 172 172
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This mostly LGTM. Feel free to merge after the comments are resolved. TaichiLLVMContext::get_data_type
should not be modified.
taichi/program/kernel.cpp
Outdated
} else if (auto cit = dt->cast<CustomIntType>()) { | ||
if (cit->get_is_signed()) | ||
return (int64)get_current_program().fetch_result<int32>(i); | ||
else | ||
return (uint64)get_current_program().fetch_result<uint32>(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are good for now, but sometime in the future we may need to use i64
.
taichi/llvm/llvm_context.cpp
Outdated
} else if (dt->is<CustomIntType>()) { | ||
return llvm::Type::getInt32Ty(*ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this branch belongs here. CustomIntType
should not be exposed to LLVM. It makes more sense to do the branching on the caller side of this function.
Co-authored-by: Yuanming Hu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and I verified @yuanming-hu's suggestions have been applied.
Related issue = #1905 #1996
In this pr, we tried to support reading/writing
bit_struct
in python scope.The key change is : support
CustomIntType
inget_data_type
,get_ret_int
andget_ret_int
[Click here for the format server]