Solution for https://github.com/ddemidov/vexcl/issues/21