Unfortunately, if you use an arbitrary mask, this won’t help in most cases, as unless your mask is very very sparse <1% nnz values, then it will be faster to do the full computation on the GPU then mask the result.