Ctrl + k

or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pyopencl@2025.2.x
tile.json

tessl/pypi-pyopencl

tessl install tessl/pypi-pyopencl@2025.2.0

Python wrapper for OpenCL enabling GPU and parallel computing with comprehensive array operations and mathematical functions

Agent Success

Agent success rate when using this tile

86%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.28x

Baseline

Agent success rate without this tile

67%

task.mdevals/scenario-6/

Image Region Copier

A GPU-accelerated utility for copying rectangular regions between 2D images efficiently.

Capabilities

Copy rectangular region from one image to another

Implement a function that copies a rectangular region from a source image to a destination image at a specified target position.

  • Copying a 100x100 region starting at (50, 50) from a 512x512 source image to position (200, 200) in a 1024x1024 destination image succeeds and the copied region matches the source. @test
  • Copying a 64x64 region from the top-left corner (0, 0) of a 256x256 source to the center (96, 96) of a 256x256 destination succeeds. @test

Extract rectangular sub-region from image to buffer

Implement a function that extracts a rectangular sub-region from an image and stores it in a buffer as a packed array.

  • Extracting a 50x50 region starting at (100, 100) from a 400x400 image to a buffer succeeds and contains the correct 2500 pixel values in row-major order. @test
  • Extracting a 32x32 region from position (0, 0) of a 128x128 grayscale image to a buffer produces a correctly packed 1024-element array. @test

Upload rectangular region from buffer to image

Implement a function that uploads a rectangular region from a buffer to a specific position in an image.

  • Uploading a 60x60 packed buffer to position (70, 70) in a 256x256 image succeeds and the image region matches the buffer data. @test
  • Uploading a 128x64 buffer to the bottom-right corner at (128, 192) of a 256x256 image succeeds. @test

Implementation

@generates

API

def copy_image_region(queue, src_image, dst_image, src_origin, dst_origin, region):
    """
    Copy a rectangular region from source image to destination image.

    Args:
        queue: OpenCL command queue
        src_image: Source OpenCL image
        dst_image: Destination OpenCL image
        src_origin: Tuple (x, y) specifying the source origin
        dst_origin: Tuple (x, y) specifying the destination origin
        region: Tuple (width, height) specifying the region size

    Returns:
        Event object for the copy operation
    """
    pass

def extract_image_region_to_buffer(queue, src_image, buffer, origin, region):
    """
    Extract a rectangular region from an image to a buffer.

    Args:
        queue: OpenCL command queue
        src_image: Source OpenCL image
        buffer: Destination OpenCL buffer
        origin: Tuple (x, y) specifying the region origin
        region: Tuple (width, height) specifying the region size

    Returns:
        Event object for the copy operation
    """
    pass

def upload_buffer_to_image_region(queue, buffer, dst_image, origin, region):
    """
    Upload a buffer to a rectangular region in an image.

    Args:
        queue: OpenCL command queue
        buffer: Source OpenCL buffer containing packed pixel data
        dst_image: Destination OpenCL image
        origin: Tuple (x, y) specifying the destination origin
        region: Tuple (width, height) specifying the region size

    Returns:
        Event object for the copy operation
    """
    pass

Dependencies { .dependencies }

pyopencl { .dependency }

Provides GPU computing and OpenCL support for rectangular image and buffer transfers.

@satisfied-by