pycuda icon indicating copy to clipboard operation
pycuda copied to clipboard

Hash collision.

Open seanprime7 opened this issue 10 years ago • 1 comments

In pycuda/pycuda/compiler.py, I see that the cache file name is created based on the md5 of the preprocesed output of the code. As far as I know, hash collisions can happen with md5, and I don't see any code that deals with hash collision in pycuda/pycuda/compiler.py. Am I misunderstanding something or is it assumed that hash collisions never happen with pycuda?

seanprime7 avatar Oct 26 '15 18:10 seanprime7

Doesn't look like there's a check for that. (There is one in PyOpenCL.) The right thing would probably be to port this over to use https://github.com/inducer/pytools/blob/master/pytools/persistent_dict.py -- I'd be happy to take a patch.

inducer avatar Oct 26 '15 19:10 inducer