-
Notifications
You must be signed in to change notification settings - Fork 216
Fix non-release kernel builds via CudaBuilder #322
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,10 +228,16 @@ impl<'ll, 'tcx> BaseTypeCodegenMethods for CodegenCx<'ll, 'tcx> { | |
|
|
||
| fn float_width(&self, ty: &'ll Type) -> usize { | ||
| match self.type_kind(ty) { | ||
| TypeKind::Half => 16, | ||
| TypeKind::Float => 32, | ||
| TypeKind::Double => 64, | ||
| TypeKind::X86_FP80 => 80, | ||
| TypeKind::FP128 | TypeKind::PPC_FP128 => 128, | ||
| TypeKind::BFloat => 16, | ||
| TypeKind::Vector | TypeKind::ScalableVector => { | ||
| // Recurse on element type for vector floats | ||
| self.float_width(self.element_type(ty)) | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are all of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need at least |
||
| _ => bug!("llvm_float_width called on a non-float type"), | ||
| } | ||
| } | ||
|
|
||
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.
This looks wrong. https://docs.nvidia.com/cuda/nvvm-ir-spec/index.html has this:
Not sure about the signed/unsigned mismatches, but the return value is definitely 32-bits.
Aside: The
match_all_{32,64}functions below don't havelink_nameattributes the way thematch_any_{32,64}functions do. Not sure if this is valid. I suspect these functions aren't tested at all!Anyway, I think this change should be reverted.
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.
Oh, hm. Ok, will revert.