Improve bounds check elision in indexing
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- rust
- Ambito
- performance
Direzione di ricerca
Begin with the unchecked test1d case and compare it with the completed test1d_single and test2d cases referenced in #350. Examine the generated code for the indexing loops; done means test1d compiles without extra bounds checks, as required by the example.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Note: We encourage higher level functionality including map, Zip, azip!() and so on before resorting indexing.
Still, it is a good benchmark to consider bounds check elision in the most trivial cases — assuming it will improve it in some less trivial cases too.
Set the goal that the following examples compile without extra bounds checks, because their loop counters are already in bounds.
pub fn test1d(a: &Array1<f64>) -> f64 {
let mut sum = 0.;
for i in 0..a.len() {
sum += a[i];
}
sum
}
pub fn test2d(a: &Array2<f64>) -> f64 {
let mut sum = 0.;
for i in 0..a.rows() {
for j in 0..a.cols() {
sum += a[[i, j]];
}
}
sum
}
- test1d_single #350
- test1d
- test2d #350
- Lingua principale
- Rust
- Stelle
- 4.3k
- Fork
- 391
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-ndarray/ndarray
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
rust-ndarray/ndarray#1612 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-ndarray/ndarray#1617 · 1 commento ·
-
Stack overflow in `triu` Apertabug good first issue
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
rust-ndarray/ndarray#1615 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-ndarray/ndarray#1610 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
rust-ndarray/ndarray#1609 ·