The fruits of several of the species are edible , such as H costaricensis , H. and H. undatus megalanthus commonly called pitahaya . They are berries up 7 to 14 cm long and 5 to 9 cm wide , with red and yellow epicarp or mucilaginous pulp , white or red consistency. Each fruit contains many small seeds shiny black . It can spread by seed or by layering . Its flavor is delicate and intensely sweet. Yellow species are most common in South America, and the red ( Hylocereus undatus ) is the largest production in Central America and Vietnam. Gender has difficulty cataloging the extent and variability of species. It is closely related to the genus Selenicereus .