| 3818 | */ |
| 3819 | |
| 3820 | void get_sampler_kernel_code(image_sampler_data *imageSampler, char *outLine) |
| 3821 | { |
| 3822 | const char *normalized; |
| 3823 | const char *addressMode; |
| 3824 | const char *filterMode; |
| 3825 | |
| 3826 | if (imageSampler->addressing_mode == CL_ADDRESS_CLAMP) |
| 3827 | addressMode = "CLK_ADDRESS_CLAMP"; |
| 3828 | else if (imageSampler->addressing_mode == CL_ADDRESS_CLAMP_TO_EDGE) |
| 3829 | addressMode = "CLK_ADDRESS_CLAMP_TO_EDGE"; |
| 3830 | else if (imageSampler->addressing_mode == CL_ADDRESS_REPEAT) |
| 3831 | addressMode = "CLK_ADDRESS_REPEAT"; |
| 3832 | else if (imageSampler->addressing_mode == CL_ADDRESS_MIRRORED_REPEAT) |
| 3833 | addressMode = "CLK_ADDRESS_MIRRORED_REPEAT"; |
| 3834 | else if (imageSampler->addressing_mode == CL_ADDRESS_NONE) |
| 3835 | addressMode = "CLK_ADDRESS_NONE"; |
| 3836 | else |
| 3837 | { |
| 3838 | log_error("**Error: Unknown addressing mode! Aborting...\n"); |
| 3839 | abort(); |
| 3840 | } |
| 3841 | |
| 3842 | if (imageSampler->normalized_coords) |
| 3843 | normalized = "CLK_NORMALIZED_COORDS_TRUE"; |
| 3844 | else |
| 3845 | normalized = "CLK_NORMALIZED_COORDS_FALSE"; |
| 3846 | |
| 3847 | if (imageSampler->filter_mode == CL_FILTER_LINEAR) |
| 3848 | filterMode = "CLK_FILTER_LINEAR"; |
| 3849 | else |
| 3850 | filterMode = "CLK_FILTER_NEAREST"; |
| 3851 | |
| 3852 | sprintf(outLine, " const sampler_t imageSampler = %s | %s | %s;\n", |
| 3853 | addressMode, filterMode, normalized); |
| 3854 | } |
| 3855 | |
| 3856 | void copy_image_data(image_descriptor *srcImageInfo, |
| 3857 | image_descriptor *dstImageInfo, void *imageValues, |
no outgoing calls