Skip to content

Conversation

@vchuravy
Copy link
Member

@vchuravy vchuravy commented May 28, 2025

Might fix #999 and #1487

but was based on a reproducer provided by @Sophia755

@github-actions
Copy link
Contributor

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic main) to apply these changes.

Click here to view the suggested changes.
diff --git a/src/compiler.jl b/src/compiler.jl
index 692b09f..0f288cc 100644
--- a/src/compiler.jl
+++ b/src/compiler.jl
@@ -1003,7 +1003,7 @@ function julia_allocator(B::LLVM.IRBuilder, @nospecialize(LLVMType::LLVM.LLVMTyp
         TT = Compiler.tape_type(LLVMType)
         if esizeof(TT) != convert(Int, AlignedSize)
             GPUCompiler.@safe_error "Enzyme aligned size and Julia size disagree" AlignedSize =
-                convert(Int, AlignedSize) esizeof(TT) fieldtypes(TT) LLVMType=strip(string(LLVMType))
+                convert(Int, AlignedSize) esizeof(TT) fieldtypes(TT) LLVMType = strip(string(LLVMType))
             emit_error(B, nothing, "Enzyme: Tape allocation failed.") # TODO: Pick appropriate orig
             return LLVM.API.LLVMValueRef(LLVM.UndefValue(LLVMType).ref)
         end
diff --git a/src/typeutils/conversion.jl b/src/typeutils/conversion.jl
index 0461806..e2fdded 100644
--- a/src/typeutils/conversion.jl
+++ b/src/typeutils/conversion.jl
@@ -50,7 +50,7 @@ function to_tape_type(Type::LLVM.API.LLVMTypeRef)::Tuple{DataType,Bool}
         e = LLVM.API.LLVMGetElementType(Type)
         T, sub = to_tape_type(e)
         len = Int(LLVM.API.LLVMGetVectorSize(Type))
-        Tup = NTuple{len,Core.VecElement{T}}
+        Tup = NTuple{len, Core.VecElement{T}}
         if sub
             return NamedTuple{ntuple(Core.Symbol, Val(len)),Tup}, false
         else

@github-actions
Copy link
Contributor

github-actions bot commented May 28, 2025

Benchmark Results

main f1703ad... main / f1703ad...
basics/overhead 5.25 ± 0.92 ns 4.34 ± 0.91 ns 1.21 ± 0.33
time_to_load 1.36 ± 0.016 s 1.36 ± 0.015 s 1 ± 0.016

Benchmark Plots

A plot of the benchmark results has been uploaded as an artifact at https://github.com/EnzymeAD/Enzyme.jl/actions/runs/15299573915/artifacts/3212200784.

@vchuravy vchuravy merged commit b9b12e5 into main May 28, 2025
23 of 31 checks passed
@giordano giordano deleted the vc/vecelement branch July 4, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Understanding Error: Enzyme aligned size and Julia size disagree

3 participants