It's always best practice to connect anything thst draws high current directly to the battery. Yes you can connect the power supply of the carpc to the same power cable that connects the amp to the battery just make sure
- Your power cable is big enough for all the loads
- You use a fuse on all power connections to that line
- the main line is fused properly at the battery
You could power the carpc off the headunit powerline but make sure to connect to the correct lines. Most head units have both a switched and unswitched 12 volt line and you have to make sure the carpc main power is connected to the unswitched line. Also make sure that the headunit line is capable of supporting the current the carpc will need. If it doesn't then I'd run a seperate power line for the carpc with the correct size fuse to protect things.