[Feature] Add CUDA-related constants and a util function to calculate block num.
[Refactor] Genralize the message type
update Makefile