Cloaking is commonly referred to as a black hat, or unethical, SEO practice. Cloaking consists of deceiving search engine crawlers by directing them to web pages that are not actually visible on the domain that the crawlers are trying to analyze. Usually, these false pages are loaded with keyword rich content and search engine optimization designed to boost the search results ranking of the web page.
When your site is open with www and without www, Then it's count as two different website by Google crawler. This is cloaking.