AMD's chief executive officer Hector Ruiz has resigned, after the company posted second quarter losses of almost $1.2 billion.