lambdaclass / concrete

Concrete is a simple programming language specifically crafted for creating highly scalable systems that are reliable, efficient, and easy to maintain.
Apache License 2.0
123 stars 11 forks source link

Add array cast to pointer #131

Closed edg-l closed 4 months ago

edg-l commented 4 months ago

Also fixes some GEPs that were not entirely correct, it now uses the gep using the array type and not the array element type.

mod Main {
    pub extern fn puts(data: *mut char) -> i32;

    pub fn main() -> i32 {
        let x: [char; 13] = ['h','e','l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '!', '\0'];
        let z: *mut char = x as *mut char;
        puts(z);
        return 0;
    }
}
github-actions[bot] commented 4 months ago

Benchmarking factorial

Compiling factorial (factorial.con) Finished release in 29.313253ms Running 5000000 iterations Using input value: 20 Concrete Result = 2432902008176640000 Time taken : 59.25 ms Rust Result = 2432902008176640000 Time taken : 60.13 ms

Benchmarking fib

Compiling fib (fib.con) Finished release in 26.030158ms Running 5000 iterations Using input value: 20 Concrete Result = 6765 Time taken : 137.29 ms Rust Result = 6765 Time taken : 85.25 ms

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 79.03226% with 26 lines in your changes are missing coverage. Please review.

Project coverage is 61.97%. Comparing base (56a8221) to head (a849920). Report is 6 commits behind head on main.

Files Patch % Lines
crates/concrete_codegen_mlir/src/codegen.rs 78.99% 25 Missing :warning:
crates/concrete_ir/src/lib.rs 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #131 +/- ## ========================================== + Coverage 61.71% 61.97% +0.25% ========================================== Files 25 25 Lines 4532 4610 +78 ========================================== + Hits 2797 2857 +60 - Misses 1735 1753 +18 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.