GPU code
#11
Possibly. The main problem I see is that one of the main goals of my library design is to chain functions so that they can be compiled to a single kernel or executed in a single loop. If your library doesn't follow the monadic template pattern then it will cause problems. Also your 2D and 3D array classes sound like they might lead to duplication as I've come round to the idea that my library needs them as well. Maybe I should post my code (though Ive only got some of the C++ and SSE backends done.) as well as my plans.

So with the monadic patten the pesudocode would look like:
Code:
auto PerlinNoise = GeneratePerlin<4, 4, 17, 17>(...);
auto Multiplier = GeneratePerlin<4, 4, 17, 17>(...);
auto Multiplied = Multiply(Values, Multiplier);
auto Values = AddConstant(MultiplyByConstant(Clamp(Multiplied,0,1),80),40).Calculate();
// Values are calculated in a 4x smaller version first (5*5 numbers),
// and the final results are then linearly upscaled to the full dimension (17*17 numbers)

An Important thing to note is the computation is encoded in the type so partial values are effectively immutable.
Reply
Thanks given by:


Messages In This Thread
GPU code - by worktycho - 06-05-2014, 08:18 PM
RE: GPU code - by xoft - 06-05-2014, 08:27 PM
RE: GPU code - by worktycho - 06-05-2014, 08:40 PM
RE: GPU code - by worktycho - 06-06-2014, 02:54 AM
RE: GPU code - by tigerw - 06-06-2014, 03:03 AM
RE: GPU code - by xoft - 06-06-2014, 03:25 AM
RE: GPU code - by worktycho - 06-06-2014, 03:38 AM
RE: GPU code - by xoft - 06-06-2014, 05:33 AM
RE: GPU code - by worktycho - 06-06-2014, 05:49 AM
RE: GPU code - by xoft - 06-09-2014, 05:39 AM
RE: GPU code - by worktycho - 06-09-2014, 06:05 AM
RE: GPU code - by xoft - 06-09-2014, 06:09 AM
RE: GPU code - by worktycho - 06-09-2014, 07:21 AM
RE: GPU code - by worktycho - 06-09-2014, 08:46 PM
RE: GPU code - by NiLSPACE - 06-12-2014, 02:00 AM
RE: GPU code - by xoft - 06-12-2014, 02:17 AM
RE: GPU code - by worktycho - 06-12-2014, 02:55 AM
RE: GPU code - by worktycho - 06-13-2014, 02:19 AM
RE: GPU code - by bearbin - 06-13-2014, 02:38 AM
RE: GPU code - by worktycho - 06-13-2014, 02:42 AM
RE: GPU code - by LO1ZB - 06-13-2014, 04:12 AM
RE: GPU code - by tigerw - 06-13-2014, 04:33 AM
RE: GPU code - by worktycho - 06-13-2014, 04:43 AM
RE: GPU code - by tigerw - 06-13-2014, 05:09 AM
RE: GPU code - by worktycho - 06-13-2014, 05:14 AM
RE: GPU code - by bearbin - 06-13-2014, 06:09 AM
RE: GPU code - by worktycho - 06-15-2014, 04:21 AM
RE: GPU code - by xoft - 06-15-2014, 04:39 AM
RE: GPU code - by worktycho - 06-15-2014, 04:43 AM
RE: GPU code - by xoft - 06-15-2014, 05:01 AM
RE: GPU code - by bearbin - 06-15-2014, 06:36 AM
RE: GPU code - by worktycho - 06-15-2014, 06:36 AM
RE: GPU code - by xoft - 06-15-2014, 06:42 AM
RE: GPU code - by worktycho - 06-15-2014, 06:55 AM
RE: GPU code - by xoft - 06-15-2014, 11:08 PM
RE: GPU code - by worktycho - 06-18-2014, 12:57 AM
RE: GPU code - by worktycho - 06-18-2014, 01:12 AM
RE: GPU code - by NiLSPACE - 06-18-2014, 01:17 AM
RE: GPU code - by worktycho - 06-18-2014, 01:21 AM
RE: GPU code - by NiLSPACE - 06-18-2014, 01:30 AM
RE: GPU code - by worktycho - 06-18-2014, 01:34 AM
RE: GPU code - by NiLSPACE - 06-18-2014, 01:35 AM
RE: GPU code - by worktycho - 06-18-2014, 01:36 AM
RE: GPU code - by worktycho - 06-18-2014, 05:27 AM
RE: GPU code - by bearbin - 06-18-2014, 05:41 AM
RE: GPU code - by worktycho - 06-18-2014, 06:03 AM
RE: GPU code - by worktycho - 06-19-2014, 05:39 AM
RE: GPU code - by LO1ZB - 06-19-2014, 09:12 AM
RE: GPU code - by NiLSPACE - 06-19-2014, 05:50 AM
RE: GPU code - by LO1ZB - 06-19-2014, 05:59 AM
RE: GPU code - by worktycho - 06-19-2014, 06:27 AM
RE: GPU code - by LO1ZB - 06-19-2014, 07:11 AM
RE: GPU code - by worktycho - 06-19-2014, 07:28 AM
RE: GPU code - by LO1ZB - 06-19-2014, 07:35 AM
RE: GPU code - by worktycho - 06-19-2014, 07:51 AM
RE: GPU code - by xoft - 06-19-2014, 04:33 PM
RE: GPU code - by worktycho - 06-19-2014, 10:07 PM
RE: GPU code - by xoft - 06-20-2014, 12:43 AM
RE: GPU code - by worktycho - 06-20-2014, 01:01 AM
RE: GPU code - by xoft - 06-20-2014, 01:06 AM
RE: GPU code - by worktycho - 06-20-2014, 01:10 AM
RE: GPU code - by xoft - 06-20-2014, 02:24 AM
RE: GPU code - by worktycho - 06-20-2014, 02:32 AM
RE: GPU code - by Schwertspize - 10-30-2015, 03:50 AM
RE: GPU code - by worktycho - 10-30-2015, 07:39 AM
RE: GPU code - by DiamondToaster - 10-30-2015, 10:04 AM



Users browsing this thread: 9 Guest(s)