Breve, C++ and CUDA

Hi, i just found Breve a few days ago and i think it can be useful for me, but i'm not sure.

I'm developing an "end of course" project which consists in genetic algorithm to optimize the weights of a neural network (also known as evolutionary neural networks). I need problems to solve with my system and Breve could be a nice way to create such problems (the problems would be "realistic" as Breve use a physics motor and the results would be "easy to show" without implementing a GUI, programming openGL or anything like that).

My system is developed in C++, but also 8086 assembly (to use XMM co-processor) and CUDA (to use Nvidia chips). I made the algorithms for calculating the output of a neural networks parallel so it get faster. This is very important because i'll call this function/method A LOT of times:

For everyGeneration
For everyIndividual
For numberOfTestForIndividual
For everyActionInATest
neuralNetwork->calculateOutput()

That's why i need it to be really fast.

I imagine the interface between my system and Breve like this:

1) My system calls runSimulation (or something like that) a number of times for each network i want to evaluate and somehow the system gets a fitness value at the end of the simulation.
2) The Breve simulation calls

currentNetwork->setInputs()
currentNetwork->calculateOutput()
currentNetwork->getOuput()

(or a function that mades the three things)
every time one of my agents can/must act.

My first question is:

(A) Is this going to be too difficult?
Is there any example available about merging C/C++ and Breve code?
Maybe it's just as simple as merging Python and C/C++ code although i neither know how to do that.
I mean communicate both systems.

The other important stuff is related directly with CUDA and maybe it'd be better to ask it in the CUDA forum. Since the openGL part of Breve is going to use the graphic card and the CUDA code too,
(B)can it cause a bottleneck or make the performance worse than using C++ instead of the CUDA code?

The third question is a very simple one. as a beginner,
(C) should i learn "steve" or Python?
I guess the answer is Python since it's better known and Breve won't have new development for "steve" anymore.

Any suggestion or comment will be appreciated.

(a) There is a C++ plugin

(a) There is a C++ plugin API which lets you call C++ code from breve, but it sounds like you want to call breve from other code. In general when people do this, they do it by outputting some simulation data and running command-line breve as a secondary process.

(b) Not sure I understand the question...

(c) Though Python is a more widely used language (and probably more worth learning for that reason), breve's main language is steve and thus the support is better there.

- jon

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.