memory transfers used by a transformation kernel. With thrust::transform_reduce we can also apply kernel fusion to reduction kernels. Consider the following example which computes the norm of a vector. #include <thrust/transform_reduce.h> #include <thrust/functional.h> #include <thrust/device_vector.h> #include <thrust/host_vector.h> #include <cmath> // square<T> computes the square of a number f(x) -> x*x template