Auburn / FastNoise_CSharp

FastNoise C# Version
MIT License
368 stars 77 forks source link

Seems to be possible to convert into hardware implementation #7

Closed Piedone closed 4 years ago

Piedone commented 6 years ago

FastNoise seems to be almost completely possible to convert into an FPGA-based hardware implementation with our Hastlayer project. Hastlayer can automatically convert a subset of .NET into hardware implementations, providing significantly better performance in massively parallelizable compute-bound algorithms with lower power consumption.

The only issue is that it uses floats or doubles, which are not supported by Hastlayer. Nevertheless floating point will be soon with posits, which are more accurate. Also, fixed point computations are supported. Would this be sufficient?

Also, FPGAs are only feasibly if a high degree of parallelization is possible, which I don't yet see where would be possible here.

Furthermore, before anything a test suite and visualization would help a lot but I don't think there is one for this library (there is some visualization tool for FastNoise SIMD though, right?).

Would be quite cool. What do you think?

Auburn commented 6 years ago

FastNoise SIMD shows how it is possible to parallelise noise functions. FastNoise C# is a port of the C++ FastNoise which has a visualisation tool, the C# version will be seeded differently but apart from that they will give the same results.

Piedone commented 6 years ago

The visualization tool is not open source, right? Because I got a bit confused seeing it referred to but not finding it in the source.

While SIMD-like operation-level parallelism is useful what matters most with Hastlayer is Task-level parallelism, i.e. parallelizing bigger chunks with TPL Tasks. And I don't yet see how this fits with FastNoise. Typically independent loops with something non-trivial and at least a couple dozen executions are good candidates. Maybe the nested loops in SingleCellular()?

Auburn commented 6 years ago

A single point of noise is almost never useful, normally you would fill an array full of noise from a 2D/3D area in a loop. So like for FastNoise SIMD works it processes arrays of noise at a time instead of single points, this would allow you to parallelise each noise point in the array.

Piedone commented 6 years ago

OK, thanks! Could you address my other questions as well please?

Auburn commented 6 years ago

Fixed floating point is probably fine, most the calculations are between -1.0 and 1.0.

The visualisation tool is not open source currently.

Piedone commented 6 years ago

I see, thank you!