const Array in functor THRUST

Hi everybody,

i would like to write a thrust functor where a tuple of three real values x,y,z (saved as three vectors) is multiplied by a matrix which is constant for the whole for_each call. So i write a functor that looks like the following;

struct my_functor : thrust::unary_function<thrust::tuple<Real,Real,Real,Real,Real,Real> >
     const Real m11,m12,m13,m21,m22,m23,m31,m32,m33;
   //  Real  mm[9] ; !DOES NOT WORK
   my_functor(	      Real m11_,Real m12_,Real m13_,
		      Real m21_,Real m22_,Real m23_,
		      Real m31_,Real m32_,Real m33_,):
  __host__  __device__
  Real operator()( const thrust::tuple<Real,Real,Real,Real,Real,Real>t)

and the for each call is


So this works. But as indicated above i was wondering if there is a chance to do the same thing without having to declare single values of the matrix and instead have an array as the member of the functor?
I found some stuff on the internet about this but i havent really found an answer (i think).
I dont care if the matrix is saved as a const array, array, some kind of vector, device_vector or whatever. Obviously a solution that uses the fact that the matrix is constant for the call is preffered. I intend to make even more matrix operations in the functor so i would like to ease the programming up here.

Maybe i should add what i have tried allready. Itried to make a const Real mm[9] but htere i have the biggest problems to initialize the array when calling the functor.

best regards


best regards

Ever figure this out? I’m struggling with a similar problem. I only want to run my functor on the device and declared operator() a device function. I’m storing a reference to a passed-in thrust::device_vector<> as state.