The quantization of mirror curves to toric Calabi--Yau threefolds leads to trace class operators, and it has been conjectured that the spectral properties of these operators provide a non-perturbative realization of topological string theory on these backgrounds. In this paper, we find an explicit form for the integral kernel of the trace class operator in the case of local P1xP1, in terms of Faddeev's quantum dilogarithm. The matrix model associated to this integral kernel is an O(2) model, which generalizes the ABJ(M) matrix model. We find its exact planar limit, and we provide detailed evidence that its 1/N expansion captures the all genus topological string free energy on local P1xP1