Brainstorming: Noise optimization
#11
Yeah I know. I was trying to optimize getting a single noise valueTongue
Reply
Thanks given by:
#12
I'll have a go at this over the weekend. I want to learn sse and avx so it'l be useful for me even if turns out ten times slower. I'll write a benchmark as well as it would be useful to see how the speeds compare. Not sure how to write an interface that depending on compile settings can return an array or an array of ints, may have to resort to macros.
Reply
Thanks given by:
#13
There's an old noise tester in the source - in the tests folder if that's any use.
Reply
Thanks given by:
#14
The TestOldNoise function looks like it could be modified to do the benchmarking.
Reply
Thanks given by:
#15
Unfortunately the NoiseTest project uses clock() to measure time, which I have learnt later is no good measure for time in *nix. You may need to modify that, too. All in all, the code's badTongue
Reply
Thanks given by:
#16
Seems i suddenly put some activity in this thread, would be nice if we got something good out of it :p.
Reply
Thanks given by:
#17
Not sure, Its looking a lot harder than I expected. Writing vectorized code is not to difficult but writing efficient cross-platform vector code is much hard. AT the moment I'm looking a five options:
- Maintain four copy's of every vector function, single, double, triple and quad width for the different vector widths. (given that one of the functions I'm working on is in the ender generator I don't think this is an option)
- Do something horrendous with macros or template-metaprogramming (rewritting c++ syntax bad)
- Write a small function language compiler in lua that can do stream-fusion
- rewrite it in c and use OpenCL.
- Give up
Reply
Thanks given by:
#18
How about maintaining four copies of each functions using Lua to generate some of the code? Isn't that possible?

OpenCL is probably not a good idea, I don't think it's supported on all the platforms where we can compile MCServer, yet.
Reply
Thanks given by:
#19
That's option three. The problem is that pre-processor (in lua) needs to be able to understand the source enough to be able to preform stream-fusion or else the code ends up with large numbers of for loops(one per operation). This is not something that can be done with regexs. And it would be easier to write a small functional language parser than a c++ parser.

EDIT:
As for openCL the portableCL project is MIT licensed and supports anything clang does.
Reply
Thanks given by:
#20
Given that no ones objecting I've decided that a small functional language probably easiest to maintain long term. Only problem would be the provision of a lua interperater on windows, I thinking a syntax like:

Code:
@StartVectorCalc(width,iterationvar,resultvar)
     x = iterationvar * 3
     resultvar = x + 7
@EndVectorCalc
Reply
Thanks given by:




Users browsing this thread: 6 Guest(s)