Hey Brad,
On Montag 08 Dezember 2008, Brad Zima wrote:
> I noticed in the pycuda documentation that it is possible to pass
> command-line parameters to nvcc for compilation of source modules. My
> question is whether it is possible to use the -deviceemu flag to have a
> source module run in emulation mode? If so, what would be the syntax for
> the source module, maybe using this as an example:
>
> mod = drv.SourceModule("""
> __global__ void multiply_them(float *dest, float *a, float *b)
> {
> const int i = threadIdx.x;
> dest[i] = a[i] * b[i];
> }
> """)At present, there's no code to support emulation mode, and it'd be difficult to pull off. Device emulation works at the runtime API level, PyCuda works at the driver API level. Essentially, you'd have to rewrite PyCuda. It would be a very different animal, too. It would have to link to compile *host* (instead of device) code and dynamically link it into the Python interpreter. That's possible (see e.g. CodePy [1] or Weave.Blitz), but a lot more brittle (and a lot less cross-platform) than the techniques PyCuda uses at the moment. Andreas [1] http://git.tiker.net/?p=codepy.git
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ PyCuda mailing list [email protected] http://tiker.net/mailman/listinfo/pycuda_tiker.net
