diff options
author | Soumith Chintala <soumith@gmail.com> | 2015-12-19 11:20:14 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2015-12-19 11:20:14 +0300 |
commit | 045e9d443fd947880e4ce2e949abb2de1247d69f (patch) | |
tree | f1bead360bec6cfb785fb031c9332f16d81f27ab | |
parent | 4763122f55f3f950c548fb026fd4edb17d1cdb80 (diff) | |
parent | bb4e8787a2f3cac940839f83685f1851b74a92f9 (diff) |
Merge pull request #136 from jonathantompson/omp_warp
add openMP pragma to warp, hflip (non-inplace) and vflip (non-inplace).
-rwxr-xr-x | generic/image.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/generic/image.c b/generic/image.c index d63e751..c1d81ab 100755 --- a/generic/image.c +++ b/generic/image.c @@ -1507,6 +1507,7 @@ int image_(Main_vflip)(lua_State *L) { if (dst_data != src_data) { /* not in-place. * this branch could be removed by first duplicating the src into dst then doing inplace */ +#pragma omp parallel for private(k, x, y) for(k=0; k<channels; k++) { for (y=0; y<height; y++) { for (x=0; x<width; x++) { @@ -1554,6 +1555,7 @@ int image_(Main_hflip)(lua_State *L) { if (dst_data != src_data) { /* not in-place. * this branch could be removed by first duplicating the src into dst then doing inplace */ +#pragma omp parallel for private(k, x, y) for(k=0; k<channels; k++) { for (y=0; y<height; y++) { for (x=0; x<width; x++) { @@ -1722,6 +1724,7 @@ int image_(Main_warp)(lua_State *L) { // resample long k,x,y,v,u,i,j; +#pragma omp parallel for private(k, x, y, v, u, i, j) for (y=0; y<height; y++) { for (x=0; x<width; x++) { // subpixel position: |