It won't be in the key, as it don't contain a hash of the c code. That is
why we did it like that in GpuConv.

The key is genereted before we generate the c code, to also cache the c
code generation.


On Tue, Mar 11, 2014 at 11:32 AM, 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)
>
> It will be in the "key" anyway since the literal values are embedded in
> the C code. Therefore if those change, the hash of the code will change.
>
> Also adding those before the c_code() method, will lead to trouble when
> you unpickle the graph on a different machine with a different GPU that
> does not have the same limits.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/Theano/Theano/pull/1760/files#r10478569>
> .
>