8. Function
$$
f(x)=\left\{\begin{array}{ll}
\sin \pi x^{2}, & -1<x<0 ; \\
\mathrm{e}^{x-1}, & x \geqslant 0
\end{array}\right.
$$

satisfies $f(1)+f(a)=2$. Then the possible values of $a$ are ( ).
(A) 1 or $-\frac{\sqrt{2}}{2}$
(B) $-\frac{\sqrt{2}}{2}$
(C) 1
(D) 1 or $\frac{\sqrt{2}}{2}$
8. A