3. Let $f(x)=\cos \omega x$ have the smallest positive period of 6. Then the value of $\sum_{i=1}^{2018} f(i)$ is $(\quad)$.
(A) 0
(B) 1
(C) $\frac{1}{2}$
(D) $\frac{\sqrt{3}}{2}$
3. A.

Given the smallest positive period is 6
$$
\Rightarrow 6 \omega=2 \pi \Rightarrow \omega=\frac{\pi}{3} \text {. }
$$

Thus, when $k$ is an integer,
$$
\sum_{i=1}^{6} f(6 k+i)=0 \text {, }
$$

which means the sum of the six function values in each complete period is zero.
Notice that, $2018=6 \times 336+2$.
Therefore, the original expression $=f(1)+f(2)=\cos \frac{\pi}{3}+\cos \frac{2 \pi}{3}=0$.