* Financials, tech drive TSX gains

* US CPI rises 0.2% in July

* Algonquin Power & Utilities falls on plans of business sale

Aug 10 (Reuters) - Toronto stocks closed higher on Thursday as financials and technology stocks rose after U.S. inflation data fanned hopes that the Federal Reserve was nearing the end of its rate-hike cycle.

The Toronto Stock Exchange's S&P/TSX composite index closed up 67.61 points, or 0.33%, at 20,342.88, after giving up some midday gains.

Data showed U.S. consumer prices increased moderately by 0.2% in July, matching the gain in June. On an annual basis, prices advanced 3.2% in July, while economists polled by Reuters forecast a 3.3% rise.

"Over the past several days there was some negative response to the economic data coming out of China ... on the positive side, what you saw today was the inflation data," said Matt Manara, portfolio manager at Avenue Investment Management.

"It looks like it's (inflation) coming down and it's helping perpetuate this soft landing narrative. It was a welcomed data point."

However, the main index gave up some gains earlier in the day, tracking Wall Street, as investors worried about the U.S. economy's longer-term prospects and whether stocks had further room to run.

Rate-sensitive technology stocks rose 1.2%, while heavyweight financials sector gained 0.8%. Consumer staples sector rose 1.4%.

Gold prices also firmed, further supporting the materials index.

Shares of Canada's Algonquin Power & Utilities closed 0.13% lower after the company said it was considering a sale of its renewable energy business to reduce debt.

Among corporate results, Canadian Tire reported a drop in quarterly revenue, sending its shares down over 7.89%. Stock was among top losers on the benchmark index.

Shares of Manulife Financial gained nearly 0.36% after Canada's largest insurer reported better-than-expected quarterly profit on Wednesday, while Canopy Growth closed lower after the cannabis producer raised going concern doubts.

(Reporting by Siddarth S in Bengaluru and Nivedita Balu in Toronto; Editing by Arun Koyyur and Matthew Lewis)