Skip to content

How do I convert the following code to managedCuda code #119

@williamlzw

Description

@williamlzw
__global__ void image_crop(float* image_float, cudaTextureObject_t texture_object, int map_y0, int map_x0)
{
    int cropped_y = blockIdx.x;
    int cropped_x = threadIdx.x;
    int cropped_width = blockDim.x;

    float map_y = float(map_y0 + cropped_y);
    float map_x = float(map_x0 + cropped_x);

    float map_value = tex2D<float>(texture_object, map_x + 0.5, map_y + 0.5);
    image_float[cropped_y * cropped_width + cropped_x] = (map_value - 0.5) / 0.225;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions