Extended the CPU/GPU selection mechanism in performance tests.

Now it allows choosing between arbitrary implementation variants.
Made perf tests record module name, selected implementation and number of threads.
Added an option to print available implementation variants.
Disabled the cuda variant when CUDA is not available.
Changed the impls argument to be an array name.

Turns out, you can't use preprocessor directives inside macro arguments.
Who'd have thought?
Merge pull request #1030 from SpecLad:ts-impl-variants