Leonardo DiCaprio has “the inside track” on the lead role in the upcoming Alan Turing biopic, Nikki Finke's Deadline Hollywood reported.

Warner Brothers on Tuesday outbid half a dozen indie companies to acquire the rights to screenwriter Graham Moore's The Imitation Game, which is based on Andrew Hodges' 608-page biography Alan Turing: The Enigma. The studio reportedly paid 7 figures for the script.

The British mathematician who helped crack the German's Enigma machine code – a triumph of computer science and a turning point for the Allies in World War II – was also gay.

In 1952, Turing acknowledged a sexual relationship with Arnold Murray to detectives investigating a break in at Turing's Manchester home. Both were charged with gross indecency. Turing was convicted and given the choice of going to prison or submitting to a form of chemical castration via estrogen hormone injections. He chose the latter. The therapy left him impotent and he developed breasts.

It is widely believed that he committed suicide two years after his arrest by eating a cyanide-laced apple.

Three time Oscar nominee DiCaprio stars in next month's Clint Eastwood-directed J. Edgar, which is based on the life of FBI Director J. Edgar Hoover. Rumors that Hoover was gay persist to this day.

(Related: Leonardo DiCaprio, Clint Eastwood asked FBI whether J. Edgar Hoover was gay.)