Hi,

I have a bit of a complicated problem

I have a class (Holder) with 4 arrays (arr1, arr2, arr3, arr4). Currently I have a class function which processes these arrays so I dont have to return anything since they are part of the class.

But I need to port my code to Brook+. Basically you write a function in Brook+ and compile it and it gives a cpp file which you can use in your program.

but the Brook + language doesnt allow classes, so I have to pass the 4 arrays individually. I have done this and have seen 600% performance increase using my Brook+ function (since it uses the GPU). but the problem is I need to return those values back to the class.

How do I go about doing this?

Recommended Answers

All 2 Replies

Well I am not able to get your problem exactly but from what I have got I think you can write a friend function which can read those arrays and write it conveniently to the place you want so that you have all the array values which is as good as returning all the four arrays.

Well I am not able to get your problem exactly but from what I have got I think you can write a friend function which can read those arrays and write it conveniently to the place you want so that you have all the array values which is as good as returning all the four arrays.

Oh I just wrote a long replay, but after I posted it i just got what you meant... Thanks, I got it now!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.