On Dienstag 02 März 2010, Fabrizio Milo aka misto wrote: > Hi, > > In attachment some patches I made while reading the pycuda code for the > git. These are just minor / esthetic fixes. > > Some comments while reading the code: > > in pycuda/driver.py > What is the motivation to do from _driver import * ? > > I would propose to eliminate the _add_functionality patcher and > subclass directly the _driver.Device > something like [snip] > > maybe this can't be done? I am missing something?
Most instances of these classes are created from C++ and hence wouldn't benefit from addition-by-inheritance. I agree that it's not super-pretty, but it's necessary. > I would like also to understand the motivation behind all those white > spaces :) Habit. If you feel you need to 'fix' coding style, there's a matter of principle here: Either fix the entire code base, or leave it alone. :) > And why many modules get imported inside the functions instead > of > global scope (for performances maybe ?) Habit again. Performance-wise, I'm not sure it matters. I like it because it keeps the global scope free of litter and avoids long.dotted.names.in.functions. Regarding your indiviual patches: 1: pure esthetics, meh. reg super: http://fuhm.net/super-harmful/ 2: applied 3: applied, minus style changes 4: you introduced a bug here--do you test your patches? applied, minus bug 5,6: nope 7: nope, I try to keep the order the same as in the CUDA header, for easy updating. 8,9: nope Thanks for your patches. Andreas
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ PyCUDA mailing list pyc...@host304.hostmonster.com http://host304.hostmonster.com/mailman/listinfo/pycuda_tiker.net