Skip to content
Snippets Groups Projects
Commit 88c6ceca authored by Georgiana Mania's avatar Georgiana Mania
Browse files

rewrite if statement

parent 064f5166
No related branches found
No related tags found
1 merge request!72Draft: Compute devices lecture
......@@ -248,19 +248,23 @@ c = a + b; // flow dependence
:::
:::{.fragment .fade-in fragment-index=3}
* Control dependence - the order of the execution is defined at runtime
* Control dependence - execution order decided at runtime
:::
:::{.fragment .fade-in-then-semi-out fragment-index=4}
```c++
for (int i = 1; i < n ; i++) {
a[i] = (a[i-1] > a[i]) ? a[i] + 1 : 1;
if (a[i-1] > a[i]) {
a[i] = a[i] + 1;
} else {
a[i] = 0;
}
}
```
:::
:::{.fragment .fade-in fragment-index=5}
* Resource dependence - the instructions share the same resource
* Resource dependence - share the same resource
:::
:::{.fragment .fade-in-then-semi-out fragment-index=6}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment