Evaluating expressions consisting of elementwise matrix operations in Thrust

I would like to use Thrust to evaluate expressions consisting of elementwise matrix operations. To make it clear, let us consider an expression like:

D=AB+3sin©

where A, B, C and D are matrices, of course of the same size.

The Thrust Quick Start Guide provides the saxpy example for which y is used both as input and as output, while in my case the output argument is different from the input ones which, by the way, are more than two. At Element-by-element vector multiplication with CUDA, the case of output different than the input, but of only two inputs, is considered.

Could anyone provide some suggestions (and possibly the rationale behind) on how using Thrust to implement the expression above (output matrix different from the inputs and more than two inputs)?
Thanks.

This topic has been discussed at

http://stackoverflow.com/questions/17487322/evaluating-expressions-consisting-of-elementwise-matrix-operations-in-thrust/17533389?noredirect=1#comment25505424_17533389