SAMD is a family of ARM-based processors that are available on certain boards in the Arduino Ecosystem.
Those lines are pre-processor directives that define the “SERIAL” macro to different values depending on the processor in use. Techniques like this are used to allow the same application code to be compiled for different processors.