I have some working code and **I'm experimenting** with using pointers and 
slices to achieve the same results.

Here's what I conceptually want to do.
    
    
      parallel:
        for bytn in 0..bprg-1:
          .....
          var seg_r: seq[uint8] = seg[bytn*Ks..byt*Ks+Ks-1]
          spawn residue_sieve(n_row, seg_r, Kmax, Ks, bytn)
      sync()t
    
    

I want to pass `seg_r` as a slice, but the compiler squawks with this (it never 
asked me if I can verify its all good  ), even when I compile with 
`--boundChecks:on|off`.
    
    
    ssozp13x1d7bparnew512.nim(192, 40) Error: cannot prove: bytn * Ks <= 
len(seg) + -1 (bounds check)
    

So I have `seg` a `seq[uint8](m * Ks)` array, and I'm processing each of the `m 
rows` in parallel.

When I pass in `let row_i = bytn * Ks` it r/w fine doing `seg[row_i + k]` 
inside `residue_sieve`.

I'm trying to understand how to do the following cases:

1) define `seg_r` as a slice in `seg` I can read/write each element to as 
`seg_r[k]` in `residue_sieve`.

2) define `seg_r` as pointer to start of slice at `seg[bytn*Ks]` and r/w as 
`seg_r[k]` in `residue_sieve`.

3) define `seg_r` as pointer to slice `seg[bytn*Ks..bytn*Ks+Ks-1]` and r/w as 
....

I'm doing this to compare timing differences between them in my code (want 
fastest).

Reply via email to