Topics that relate to development (and problems) using Brahma. Make sure you’ve read the FAQ and searched the forums before posting a question here. This forum is not for feature/bug requests, use the Features/Bugs forum instead. I will also welcome any offers to help with samples and benchmarks on particular configurations, you may offer them here.

Hi.
Can you help me with my problem – I can’t find the method to multiple the matrix NxN by vector N.
Here is my query for N=2:
CompiledQuery multiplyMatrixByVector2 = computationProvider.Compile<DataParallelArray2D, DataParallelArray>(
(d1, d2) => from v1 in d1
from v2 in d2
select d1[output.CurrentX, output.CurrentY] * d2[output.Current] + d1[output.CurrentX + 1, output.CurrentY] * d2[output.Current]
);
It works ok, but I need something like an enumerator inside the query to implement for custom N. As I know I can’t do that inside the Func. Maybe you know how it can be solved in other way?
Thanks.
A matrix multiply sample is now checked in.
Hiya,
I’ve been playing around with Brahma.OpenGL, and can’t figure out how to do an nbody simulation.
The situation I want is for each body, to calculate the force by using an aggregation operation (sum distance from other bodies), and then iterate the bodies positions.
For a start, I can’t figure out how to do the summation – I’m guessing it’s somehow around provider.Loop, but I can’t quite figure out the syntax.
Also, I want to have a nested outer loop (for each body), and then an inner loop where it compares to all other bodies, and build up an array, all on the card.
I’ve done something similar using Accelerator (with not great results: http://taumuon-jabuka.blogspot.com/2011/04/gpgpuplaying-with-microsoft-accelerator.html ) and wanted to see how I got on with Brahma. I can send you a work-in-progress project if you want to take a look?
Thanks,
Gary
Interesting! Would it be possible to contribute a sample when it’s done? Also, I do not have any OpenGL interop bindings done with OpenCL.Net yet, so if you’d like to help me with that too, I’d be glad to.
Please look here (http://brahma.codeplex.com/SourceControl/changeset/view/86658#1697339) for a sample of using Provider.Loop.
I am trying to run the MatrixMultiply example under Mono 2.10.1. My program output is as follows:
http://pastebin.com/sEGkZKPJ
You will notice that I added a line to the Visitor that prints the expression being visited for debugging purposes:
protected virtual Expression Visit(Expression exp)
{
if (exp == null)
return exp;
Console.WriteLine(exp.ToString());
switch (exp.NodeType)
The problem seems to be that this line is hit at runtime:
throw new InvalidOperationException(“Cannot access methods/properties inside a kernel!”);
I am assuming that the inner workings of Mono Linq is different to that of .NET and therefore the line is hit.
Any suggestions?
Riaan