Skip to content

Conversation

@michaelborkowski
Copy link
Owner

Draft, do not merge yet

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI has to be fixed but otherwise it's a good progress, thanks a lot!


{-# INLINE free #-}
free :: HasPrim a => Array a -. ()
free :: Array a -. ()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little surpriced you don't need the HasPrim context for all configurations to typecheck.

-. Array srcs -. Array dsts
allocScratch i a f arr =
let
!(dst, tmp) = f arr (makeArray i a)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alloc above has two implementations that use different versions of make (filling and non-filling, low-level one). Probably, this place should do the same. But duplicationg CPP doesn't look nice. I'd rather we have two implementations of one make function, which we can call anywhere (inside TCB, of course) and not think about the different implementations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth renaming the 4-version into this. I always felt like 4 looks weird. Although, it may feel natural for algorithms people. But we're not submitting to an algorithms venue (at the moment).

Comment on lines +45 to +47
let (Ur n, xs1) = A.size2 xs in
if n == 0 then xs1
else quickSortBtw 0 n xs1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the formatting is a little unconventional :-) but I'm not too stressed about it in functions as little as this one.

then truncate((18820.2738 / (exp ((log (fromIntegral len)) * 0.5) )) :: Float)
else 28) src' (A.makeArray len anyVal) in
case A.free _tmp of !() -> src''
let !(Ur len, src') = A.size2 src -- below expression is always in the interval [28, 708] (interval changed from meeting doc).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for future: these horrible constants should be acknowledged somewhere.

Comment on lines +213 to +217
isort_tmp :: A.Array a -. A.Array a -. (A.Array a, A.Array a)
isort_tmp src tmp =
let !(old_arr, tmp_arr) = A.copy2 0 0 n src tmp
in (isort 0 (tmp_arr ? lem_equal_slice_bag src tmp 0 n), old_arr)
? lem_copy_equal_slice src 0 tmp 0 n -- there's an issue with using !()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally not a big fan of leaving behind screenfulls of commented code. But I'm not dying on this hill!

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.

4 participants