AnsweredAssumed Answered

Passing structs as kernel arguments crashed using APP SDK 2.8

Question asked by peng on Feb 7, 2013
Latest reply on Feb 11, 2013 by himanshu.gautam



My kernel has many arguments which are grouped as two structs for convenience. Passing single struct as argument to kernel is OK, but passing two of them caused crash using APP SDK 2.8. It works using APP SDK 2.7. The develop environment is openSUSUE 12.2 64bit on Core i5-2500K.

The two argument structs in host codes are defined as follow

typedef struct {

        cl_float minX;

        cl_float maxX;

        cl_float minY;

        cl_float maxY;

        cl_float minZ;

        cl_float maxZ;

        cl_float initStepSize;

        cl_float maxStepSize;

        cl_float minStepSize;

        cl_float maxLength;

        cl_float terminationSpeed;

        cl_float adaptiveUpBound;

        cl_float adaptiveLowBound;

        cl_uint maxStepNum;

        cl_float fixedTimeStep;

} GenerationParameters;


    typedef struct {

        cl_float originX;

        cl_float originY;

        cl_float originZ;

        cl_uint extentMinX;

        cl_uint extentMinY;

        cl_uint extentMinZ;

        cl_uint extentMaxX;

        cl_uint extentMaxY;

        cl_uint extentMaxZ;

        cl_float spacingX;

        cl_float spacingY;

        cl_float spacingZ;

        cl_float reciprocalSpacingX;

        cl_float reciprocalSpacingY;

        cl_float reciprocalSpacingZ;

        cl_float reciprocalSpacingXY;

        cl_float reciprocalSpacingYZ;

        cl_float reciprocalSpacingZX;

        cl_float reciprocalSpacingXYZ;

  } UniformGridInfo;


And the structs defined in kernel

typedef struct {

          float minX;

          float maxX;

          float minY;

          float maxY;

          float minZ;

          float maxZ;

          float initStepSize;

          float maxStepSize;

          float minStepSize;

          float maxLength;

          float terminationSpeed;

          float adaptiveUpBound;

          float adaptiveLowBound;

          uint maxStepNum;

          float fixedTimeStep;

} GenerationParameters;

typedef struct {

          float originX;

          float originY;

          float originZ;

          uint extentMinX;

          uint extentMinY;

          uint extentMinZ;

          uint extentMaxX;

          uint extentMaxY;

          uint extentMaxZ;

          float spacingX;

          float spacingY;

          float spacingZ;

          float reciprocalSpacingX;

          float reciprocalSpacingY;

          float reciprocalSpacingZ;

          float reciprocalSpacingXY;

          float reciprocalSpacingYZ;

          float reciprocalSpacingZX;

          float reciprocalSpacingXYZ;

} UniformGridInfo;



The kernel function

__kernel void generateStreamlines (GenerationParameters generationParameters,UniformGridInfo gridInfo  ){



Thanks a lot!

Edited: Sorry for the incomplete post because of the problem of my browser. I have no idea it has been submitted.


Message was edited by: ZHAO PENG