Call thrust::inclusive_scan or thrust::exclusive_scan instead of a for loop