Wells Fargo Securities is now a big believer in Nvidia's prospects.

In a rare move, the firm raised its rating two notches to outperform from underperform for Nvidia shares, citing the strength of its artificial intelligence and cloud computing markets. It also raised its per-share price target to $315 from $140, representing 20.5 percent upside to Tuesday's close.

"We are positive on NVIDIA's competitive positioning for gaming and expanding growth opportunities in data center, HPC, and emerging / expanding AI opportunities (autonomous vehicles, healthcare, robotics, etc.)," analyst Aaron Rakers said in a note to clients Tuesday. "NVIDIA is well positioned to continue to leverage / expand its platform story."

The company's stock is up 35 percent this year through Tuesday versus the S&P 500's 6 percent gain. It closed down 0.9 percent Wednesday.

The analyst is optimistic on Nvidia's new eighth-generation Turing graphics architecture, which was announced Monday at a conference in Vancouver.

"Turing is NVIDIA's most important innovation in computer graphics in more than a decade," Nvidia CEO and founder Jensen Huang said at the SIGGRAPH conference, according to a company release.

Nvidia said Quadro professional workstation graphics cards with Turing technology will be available in the fourth quarter.

The company delivers its July quarter earnings report Thursday.