Merge pull request #1228 from lamblin/default_blas_flags

Test default blas flags before using them
Add acc_dtype member to CAReduceDtype

This dtype is to be used as accumulator, instead of self.dtype as was
previously the case. Then, the result is cast to self.dtype if needed.

Also implement the perform version using it.
Update C code to use acc_dtype if needed.

If acc_dtype == output.dtype, nothing changes.
Fixes to gradient.

Do not create a complex tensor with zeros, then cast it into floatX,
create the floatX zeros directly
Fix assertion
Add acc_dtype to the interface of prod/sum/mean
Add tests for new features and behaviour
Make the copy explicit