-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add optimization 5 that unrolls the 1D wavelet kernel and avoids regi…
…ster spills.
- Loading branch information
Showing
7 changed files
with
855 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Write bx * by * bz blocks each of dimension nx * ny * nz | ||
void init_y(float*& out, int nx, int ny, int nz, int bx, int by, int bz) { | ||
|
||
size_t block = nx * ny * nz; | ||
out = (float*)malloc(sizeof(float) * block * bx * by * bz); | ||
|
||
// Number of blocks | ||
for (int jz = 0; jz < bz; ++jz) | ||
for (int jy = 0; jy < by; ++jy) | ||
for (int jx = 0; jx < bx; ++jx) { | ||
// Block dimension | ||
for (int iz = 0; iz < nz; ++iz) | ||
for (int iy = 0; iy < ny; ++iy) | ||
for (int ix = 0; ix < nx; ++ix) { | ||
size_t pos_block = ix + nx * (iy + ny * iz); | ||
size_t pos = pos_block + block * (jx + bx * (jy + by * jz)); | ||
out[pos] = iy; | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.