  Diffraction calculations, such as the angular spectrum method, and Fresnel
diffractions, are used for calculating scalar light propagation. The
calculations are used in wide-ranging optics fields: for example, computer
generated holograms (CGHs), digital holography, diffractive optical elements,
microscopy, image encryption and decryption, three-dimensional analysis for
optical devices and so on. However, increasing demands made by large-scale
diffraction calculations have rendered the computational power of recent
computers insufficient. We have already developed a numerical library for
diffraction calculations using a graphic processing unit (GPU), which was named
the GWO library. However, this GWO library is not user-friendly, since it is
based on C language and was also run only on a GPU. In this paper, we develop a
new C++ class library for diffraction and CGH calculations, which is referred
as to a CWO++ library, running on a CPU and GPU. We also describe the
structure, performance, and usage examples of the CWO++ library.
