Welcome! Share code as fast as possible.

import cupy as cp

a = cp.array([[1, 0, 0],
              [0, 2, 0],
              [0, 0, 3]])

nonzero_indices = cp.array(cp.where(a != 0)).T
print(nonzero_indices)