Canada's main stock index rose on Thursday as gains for energy companies and some miners offset a pullback in marijuana producers and a fall in Shaw Communications Inc after its quarterly earnings disappointed.

The Toronto Stock Exchange's S&P/TSX composite index finished up 38.99 points, or 0.24 per cent, at 16,286.94.

Half of its 10 main sectors were in positive territory and advancing issues and decliners were evenly balanced overall.

The energy group climbed 1.4 per cent, even as crude oil prices retreated from big gains, with Cenovus Energy Inc (CVE.TO) up 4.4 per cent at $13.69. Tourmaline Oil Corp (TOU.TO) gained 5.7 per cent to $21.96 after providing a business update.

The most influential weights on the index included Shaw Communications (SJRb.TO), which ended down 2.8 per cent to $27.16 after reporting quarterly earnings that missed expectations.

Marijuana producers, a volatile but broadly rising sector, also weighed, with Canopy Growth Corp (WEED.TO) slumping 10.4 per cent to $37.56 and Aphria Inc (APH.TO) down nine per cent at $20.55.

The materials group, which includes precious and base metals miners and fertilizer companies, added 0.8 per cent, with Nutrien Ltd (NTR.TO) gaining 2.3 per cent to $66.63.

Alamos Gold (AGI.TO) fell 6.9 per cent to $7.39 while Yamana Gold Inc (YRI.TO) rose 4.8 per cent to $4.19 after each miner provided a business update to investors.