-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from clEsperanto/add-execute-function
ADD: execute function for running custom `opencl.cl` files
- Loading branch information
Showing
7 changed files
with
518 additions
and
178 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
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,14 @@ | ||
__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | | ||
CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST; | ||
|
||
__kernel void add_image_and_scalar(IMAGE_src_TYPE src, IMAGE_dst_TYPE dst, | ||
const float scalar) { | ||
const int x = get_global_id(0); | ||
const int y = get_global_id(1); | ||
const int z = get_global_id(2); | ||
|
||
const float value = | ||
(float)READ_IMAGE(src, sampler, POS_src_INSTANCE(x, y, z, 0)).x; | ||
WRITE_IMAGE(dst, POS_dst_INSTANCE(x, y, z, 0), | ||
CONVERT_dst_PIXEL_TYPE(value + scalar)); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
) | ||
from ._functionalities import ( | ||
imshow, | ||
execute, | ||
) | ||
from ._tier1 import ( | ||
add_image_and_scalar, | ||
|
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
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
Large diffs are not rendered by default.
Oops, something went wrong.