Skip to content

Commit a95f7ba

Browse files
committed
mdspan cleanup
1 parent 471215e commit a95f7ba

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

labs/lab2_mdspan/mdspan.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@
148148
"void initial_condition(grid_t u_new, grid_t u_old) {\n",
149149
" std::fill_n(std::execution::par, u_old.data_handle(), u_old.size(), 0.0);\n",
150150
" std::fill_n(std::execution::par, u_new.data_handle(), u_new.size(), 0.0);\n",
151-
"}```\n",
151+
"}\n",
152+
"```\n",
152153
"\n",
153154
"Notice that we have dropped the function argument `n`, and that we continue to use `fill_n` by writing directly to the data behind the `mdspan`.\n",
154155
"For containers like `std::vector`, a handle to the data can be obtained by just calling the `vec.data()` member function.\n",
@@ -166,7 +167,8 @@
166167
"// Finite-difference stencil\n",
167168
"double stencil(grid_t u_new, grid_t u_old, long x, long y, parameters p) {\n",
168169
" // Update the content\n",
169-
"}```\n",
170+
"}\n",
171+
"```\n",
170172
"\n",
171173
"Until now, we've been accessing elements with:\n",
172174
"\n",

0 commit comments

Comments
 (0)