Maximum number of kernel arguments

Mar 7, 2014 at 3:43 PM
The maximum number of kernel arguments/inputs appears to be capped at 14. Unfortunately, I require around 30 inputs, most of which are arrays of floating point numbers.

For the moment I have created one master array, alongside an index to locate which one of a 30 sub-arrays I need.

Any suggestions or code samples to let me pass more than 14 inputs or how to deploy a struct containing all arrays would be appreciated.
Mar 8, 2014 at 10:08 AM
Having so many arguments is usually a hint that your software should be redesigned. Consider using structs and constant memory.
Mar 8, 2014 at 11:29 AM
Edited Mar 8, 2014 at 11:30 AM
Agreed, then can you suggest how to use structs? The example in
makes use of fixed size arrays only. I am looking for something that permits something more dynamic such as:
public struct myStructTwo
    public float[] value_x;
    public float[] value_y;
    public float[] value_z;
public struct myStructTwo
    public IntPtr value_x;
    public IntPtr value_y;
    public IntPtr value_z;
I know was able to do something with reflection, but is there a more direct approach within Cudafy itself?

Thanks, and keep up the great work on Cudafy!
Mar 8, 2014 at 12:51 PM
Only arrays of fixed size in structs are possible. Joe Moorhouse has done some excellent work on permitting use of classes within Cudafy. You can find samples of this in the CudafyExamples project.
Marked as answer by Rithim on 3/8/2014 at 6:37 AM
Mar 8, 2014 at 1:31 PM
Thanks, I also posted a question on StackOverflow I will link it to your answer.