diff options
| author | tylov <[email protected]> | 2023-07-21 10:49:45 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-07-21 10:49:45 +0200 |
| commit | dbcc13635402bd466675f4f41e865d02abc6f918 (patch) | |
| tree | 269bbb8e641aaad34b0cca0bbd23c854faa3a960 /misc/examples/spans | |
| parent | 2d67f4040f6eecd41f1b864b43c62823ed75aff0 (diff) | |
| download | STC-modified-dbcc13635402bd466675f4f41e865d02abc6f918.tar.gz STC-modified-dbcc13635402bd466675f4f41e865d02abc6f918.zip | |
NB! Changed some coroutine API for consistency/simplicity: Added full task support.
Diffstat (limited to 'misc/examples/spans')
| -rw-r--r-- | misc/examples/spans/mdspan.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/misc/examples/spans/mdspan.c b/misc/examples/spans/mdspan.c index 4427299c..db601850 100644 --- a/misc/examples/spans/mdspan.c +++ b/misc/examples/spans/mdspan.c @@ -12,17 +12,17 @@ int main(void) { DSpan3 ms = cspan_md_order('F', data, nx, ny, nz); // Fortran, not 'C' int idx = 0; - c_forrange (i, ms.shape[0]) - c_forrange (j, ms.shape[1]) - c_forrange (k, ms.shape[2]) + for (int i = 0; i < ms.shape[0]; ++i) + for (int j = 0; j < ms.shape[1]; ++j) + for (int k = 0; k < ms.shape[2]; ++k) *cspan_at(&ms, i, j, k) = ++idx; cspan_transpose(&ms); printf(", transposed:\n\n"); - c_forrange (i, ms.shape[0]) { - c_forrange (j, ms.shape[1]) { - c_forrange (k, ms.shape[2]) + for (int i = 0; i < ms.shape[0]; ++i) { + for (int j = 0; j < ms.shape[1]; ++j) { + for (int k = 0; k < ms.shape[2]; ++k) printf(" %3g", *cspan_at(&ms, i, j, k)); puts(""); } |
