This paper presents a generalized and efficient wall boundary treatment in the smoothed particle hydrodynamics (SPH) method for 3-D complex and arbitrary geometries with single- and multi-phase flows to be executed on graphics processing units (GPUs). Using a force balance between the wall and fluid particles with a novel penalty method, a pressure boundary condition is applied on the wall dummy particles which effectively prevents non-physical particle penetration into the wall also in highly violent impacts and multi-phase flows with high density ratios. A new density reinitialization scheme is also presented to enhance the accuracy and robustness. The proposed method is simple in comparison with previous wall boundary formulations on GPUs and enforces no additional memory caching and thus is well suited for massively parallel architecture of GPUs. The method is validated in various test cases involving inviscid violent single- and multi-phase flows, demonstrating very good robustness, accuracy and performance. The new wall boundary treatment is able to improve the high accuracy of its previous version by Adami et al. [1] also in 3-D and multi-phase problems, while it is efficiently executable on GPUs. Therefore, the method can be a reliable solution for the long-lasting wall boundary condition challenge in SPH for a broad range of problems.