This project is read-only.

Maximum number of kernel arguments

Mar 7, 2014 at 4: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 11: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 12:29 PM
Edited Mar 8, 2014 at 12:30 PM
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 1: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 2:31 PM
Thanks, I also posted a question on StackOverflow I will link it to your answer.