Skip to content

Include examples on how to use opencl3::memory::Image #65

@Dainerx

Description

@Dainerx

Hello,

I discovered this new crate recently, I couldn't find no examples online nor on this repository on how to work with images. A minimalist example that creates an opencl image using Image::create would be helpful enough.

I suggest an example that performs a simple copy given an opencl image as input and image buffer as output.

__kernel void copy_image(__read_only image2d_t input, __write_only image2d_t output) {
    int2 pos = (int2)(get_global_id(0), get_global_id(1));
    float4 pixel = read_imagef(input, CLK_NORMALIZED_COORDS_FALSE, pos);
    write_imagef(output, pos, pixel);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions