7 #include <cuda_runtime.h>
8 #include <thrust/device_ptr.h>
9 #include <thrust/reduce.h>
17 thrust::device_ptr<double> d_ptr(d_data);
20 double result = thrust::reduce(d_ptr, d_ptr + rows * cols);
double sum() const
Sums all elements in the matrix.
Defines the Matrix class for GPU-accelerated matrix operations.