Results 1 to 2 of 2

Thread: Arrays of Variable Length

  1. #1
    Junior Member
    Join Date
    Oct 2009

    Arrays of Variable Length

    I'm working on a port of Paul Bourke's Marching Cubes ... olygonise/
    code to OpenCL, but I'm now wondering if I might be about to hit an insurmountable obstacle. The code requires an array or triangle vertices to be calculated, but this array will not be of a fixed length (it will vary according to the input, as the plan is to generate geometry slab-wise from pairs of z-axis slices through a 3D volume texture). Looking through the OpenCL Reference card, there don't seem to be any array-manipulation functions, and a quick search of this forum suggests arrays of variable length are not supported. Is this in fact the case, and if so, is there any workaround to get this to work?

    Sorry if this is a stupid question.


  2. #2
    Senior Member
    Join Date
    Jul 2009
    Northern Europe

    Re: Arrays of Variable Length

    Buffers' sizes are fixed at creation. To simulate a variable length array you need to create one at the maximum size and then pass in a variable that tells the kernel how much of it to use.

Similar Threads

  1. Passing variable length structure to kernel
    By kungen85 in forum OpenCL
    Replies: 4
    Last Post: 10-08-2009, 12:47 AM
  2. Replies: 1
    Last Post: 10-06-2009, 11:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean