Arnaud, where in the key is the hash of the c code? It is not their to my
knowledge. It is on my possible thing to do to help Theano to have add
Op.c_code_cache_version add it by default, but it could slow things down.

The cache is done such that we can have multiple key generate the same c
code. In that case, we will reuse the same compiled code. But it don't
allow a unic key to generate different c code.


On Tue, Mar 11, 2014 at 12:21 PM, abergeron <notifications@github.com>wrote:

> In theano/sandbox/cuda/extra_ops.py:
>
> > +            cuda = theano.sandbox.cuda
> > +            device_id = cuda.use.device_number
> > +            if device_id is None:
> > +                cuda.use("gpu",
> > +                         force=False,
> > +                         default_to_move_computation_to_gpu=False,
> > +                         move_shared_float32_to_gpu=False,
> > +                         enable_cuda=False,
> > +                         test_driver=True)
> > +                device_id = cuda.use.device_number
> > +            cuda_ndarray = theano.sandbox.cuda.cuda_ndarray.cuda_ndarray
> > +            prop = cuda_ndarray.device_properties(device_id)
> > +            node_.op.max_threads_dim0 = prop['maxThreadsDim0']
> > +            node_.op.max_grid_size1 = prop['maxGridSize1']
> > +        return super(GpuCumsum, node_.op).make_thunk(node_, storage_map,
> > +                                                     compute_map, no_recycling)
>
> @nouiz <https://github.com/nouiz> It doesn't need to be explicitly in the
> key if it's in the hash of the C code. The cache will differentiate it
> anyway. (Which is also why it put quotes around key)
>
> Also, If you absolutely want this info before c_code(), then it should be
> fetched in the constructor. This wouldn't change anything since we just
> have make_thunk fetching it and adding it to the op instance anyway. Also,
> I'm pretty sure that *eq* and *hash* can be called before make_thunk
> which would crash since they can't access those attributes.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/Theano/Theano/pull/1760/files#r10481311>
> .
>