tux3 / Evolve

Image vectorizer throught evolution

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add opencl acceleration

infoburp opened this issue · comments

add opencl acceleration for comparisons, renders and mutations.

commented

Fitness calculation is already paralellized.
The problem of rendering is that it's inherently sequential : drawing polygons on top of each other.
I'd have to separate the polygons into "piles" that don't overlap and feed each one to a different core, but I'm not convinced it'd be faster than directly drawing.
Mutation have the same problem. I could compute two mutations in parallel, and find two mutations that each increase the fitness, but I can't guarantee that the sum of the two mutations will increase the fitness.

I'll try to make the algorithms more paralellizable first, then maybe add OpenCL support.

Wouldn't this be a non-issue if autofocus is enabled though? Each square would handle it's own sequential loop. Also couldn't you have the GPU just generate as the mutations and only take the most beneficial one? It'd definitely improve quality quicker, but I'm not sure about any speed improvements though.

commented

Yes, but with the new Alsing-ish mutations it's even less parelellizable, polygons seem to hate staying in a small square, there are more large polygons that cover a big part of the image, so the autofocus is kind of moot at the moment.