Friday 29 May 2015

Week 1 - onwards to Milestone 1

I'm halfway through the deadline of Milestone 1, which requires me to be able to create an image, pass it to a kernel and query its attributes by June 8. These are the steps I've done towards these requirements this week:
  • Image support capability queries now return true. This makes it possible to call clCreateImage*.
  • Added dummy get_image_width to libclc for 2d images, which now always returns 42.
  • Enabled PIPE_BIND_COMPUTE_RESOURCE usage in the evergreen_is_format_supported function. Currently it returns true to any input (TODO: find out if this is correct).
  • Depth value is now 1 instead of 0, because libdrm requires it (see first comment).

This is the kernel I'm testing with right now, my first goal is to be able to run this, and get back 42 in the output buffer.

__kernel void imgtest(__read_only image2d_t in, __global int * out)
{
    if (get_global_id(0) == 0) {
        *out = get_image_width(in);
    }
}

What remains to be done next week:
  • Allow kernel launch to set dummy compute sampler views (currently an assert prevents that).
  • Pass the image attributes to the kernel as hidden parameters, and actually use them in libclc.