  We formulate a first-principles approach for calculating the topological Hall
effect (THE) in magnets with noncollinear nanoscale spin textures. We employ a
modeling method to determine the effective magnetic field induced by the spin
texture, thereby circumventing the computational challenges associated with
superlattice calculations. Based on these results, we construct a Wannier
tight-binding Hamiltonian to characterize the electronic states and calculate
the Hall conductivity. Applying this approach to the skyrmion material $\rm
Gd_2PdSi_3$ shows good agreement with experimental data. Our analysis in
momentum space further reveals that the dominant contribution to the THE arises
from the crossing points between the folded bands along high-symmetry lines in
the Brillouin zone. This work advances numerical techniques for simulating
general magnetic system, examplified by but not restricted to skyrmion lattice,
and its result offering insights into the complex interplay between spin
textures and electronic transport.
