CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pyopencl

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

86

1.28x
Overview
Eval results
Files

task.mdevals/scenario-7/

GPU Image Processor

A Python utility that processes images using GPU acceleration for format conversion and basic manipulation operations.

Capabilities

Create GPU images from numpy arrays

  • Given a numpy array with shape (height, width, 3) and dtype uint8, create an OpenCL image object @test
  • Given a numpy array with shape (height, width, 4) and dtype uint8 containing RGBA data, create an OpenCL RGBA image @test

Read image data from GPU memory

  • After creating an image from a numpy array, read the data back and verify it matches the original array @test

Query supported image formats

  • Query and list all supported image formats for the GPU device @test

Implementation

@generates

API

def create_image_from_array(context, queue, array):
    """
    Create an OpenCL image from a numpy array.

    Args:
        context: OpenCL context
        queue: OpenCL command queue
        array: numpy array with shape (height, width, channels) where channels is 3 or 4

    Returns:
        OpenCL image object
    """
    pass

def read_image_to_array(queue, image, shape):
    """
    Read an OpenCL image back to a numpy array.

    Args:
        queue: OpenCL command queue
        image: OpenCL image object
        shape: tuple of (height, width, channels)

    Returns:
        numpy array with the image data
    """
    pass

def get_supported_image_formats(context):
    """
    Get all supported image formats for the context.

    Args:
        context: OpenCL context

    Returns:
        list of supported ImageFormat objects
    """
    pass

Dependencies { .dependencies }

pyopencl { .dependency }

Provides GPU image creation and manipulation capabilities.

Install with Tessl CLI

npx tessl i tessl/pypi-pyopencl

tile.json