eyalroz / gpu-kernel-runner

Runs a single CUDA/OpenCL kernel, taking its source from a file and arguments from the command-line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drop two-phase command-line parsing

eyalroz opened this issue · comments

We currently parse our command-line in two phases: One kernel-inspecific, then another that's kernel-specific, where the arguments and required preprocessor definitions can be passed as command-line arguments.

Benefits:

  1. We get a necessary argument and define listing "for free"
  2. Can keep the initial parsing entirely independent of which kernel we want to run

Detriments:

  1. More code.
  2. More complex, non-C++-idiomatic code.
  3. Kernel parameter names can clash with basic command-line argument names
  4. One-char kernel parameters need to be handled differently than multi-char.

Now, actually, in hindsight, we can achieve benefit (2.) and take the kernel arguments, by passing --argument name=val 's. So, let's drop the existing scheme and just do that instead.