Marmaduke Woodman <wdmn(a)protonmail.ch> writes:
Moving GitHub issue #85 (https://github.com/inducer/loopy/issues/85
) to mailing list:
> @maedoc wrote:
> I'd like to start working on a target for C augmented with Openmp or OpenACC
> pragmas. This is more a question than an issue: would it be reasonable to
> start by overriding behavior of CASTBuilder.emit_sewuential_loop based on
> iname tags? Or is there a better place to start?
FWIW, while I'm not opposed to the idea of
having such targets in loopy, they
don't expose vectorization as explicitly as ISPC or CL or CUDA, and so
they're less of a natural fit. Personally, I think using ISPC results in more
control over program performance.
I would surely like to use ISPC on any AVX CPU. Intel's CL driver is really
great too but not supported for KNL. Anyway, for ISPC on a ppc64le system,
it needs to be compiled from source and even then might not support POWER8
vector instructions. Someone on their mailing list reported getting it to
work on POWER8 through the general vector header approach but never shared
OIC--yeah, for POWER8, that option may not realistically exist.
What I have in mind at least for OpenMP is pretty
simple actually: adding a
`#pragma omp parallel for` pragma around the outermost g.N tag, and a
`#pragma omp simd` around the l.N tag.
That makes sense and should be reasonably easy. That said, you'll
probably want a way to pipe through some extra OpenMP directives,
regarding, e.g., scheduling.
OpenACC OTOH I am unfamiliar with but will spend some
time week after next in
a GPU hackathon in Juelich, so I figured it was worth considering as well. But
if it turns out to be easier to target CUDA directly, so much the better.
I'm fairly sure you'll be better off with just the CUDA backend. OpenACC
trying to psychoanalyze and second-guess your already-optimized code is
unlikely to be very fun...
I won't be able to contribute a PR for a few
weeks, so if you prefer to close the
issue, that's fine with me too.
Happy to have it stay open, even if it ends up being a while. And do ask
if you run into questions or issues.