I've been experimenting with writing gpu plugins but ive had problems with
getting and setting values from a multidimensional array that I pass in to
the CU file.
This snippet in cpp demonstrates the problem that Ive had with the gpu
implementation. I get errors when I try to get, set, or do anything with
the double array. Basically, Im trying to keep cuda and maya calls
separate. Maybe this is a mistake
For example, error c2109: subscript requires array or pointer type in the
cpp file
or if the same code is run from the CU file, error: expression must have a
pointer-to-object type
const int size = 100000;
double inputMeshPts_PROXY[size][4];
inputMeshPts.get(inputMeshPts_PROXY);
int lengthPts = inputMeshPts.length();
if (useCUDA == 1)
{
double *inputMeshPts_CUDA = &inputMeshPts_PROXY[size][4];
myArray(lengthPts, inputMeshPts_CUDA);
}
MStatus abjBlendShape::myArray(int length_CUDA, float weight_CUDA, double *
inputMeshPts_CUDA)
{
for (int i = 0; i < length_CUDA; i++)
{
for (int j = 0; j < 3; j++)
{
cout << inputMeshPts_CUDA[i][j] << endl;
// inputMeshPts_CUDA[i][j] += (sculptedMeshPts_PROXY[i][j] -
inputMeshPts_CUDA[i][j]); // WHAT I WANT, EVENTUALLY
}
}
}
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/8f853a4a-1f52-4977-b841-a4a976ed92f4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.