Use of macro and functons in THC sources

Well, I am studying deep mechanism of pytorch. I notice that here, THCStorageCopy , writes:

#define TH_CUDA_STORAGE_IMPLEMENT_COPYTO(TYPEC)                             \
void TH_CONCAT_4(TH,TYPEC,Storage_copyCuda,Real)(THCState *state, TH##TYPEC##Storage *self, struct THCStorage *src) \
{                                                                           \
  TH##TYPEC##Tensor* selfTensor =                                           \
      TH##TYPEC##Tensor_newWithStorage1d(self, 0, self->size, 1);           \
  struct THCTensor* srcTensor =                                             \
      THCTensor_(newWithStorage1d)(state, src, 0, src->size, 1);            \
  TH_CONCAT_4(TH,TYPEC,Tensor_copyCuda,Real)(state, selfTensor, srcTensor); \
  THCTensor_(free)(state, srcTensor);                                       \
  TH##TYPEC##Tensor_free(selfTensor);                                   \
}

To my understanding it defines a macro that equals to a function named TH_CONCAT_4, but I am quite confused about the use of double parentheses in function. Or may it be some nested macro? I am searching but not clear yet.

Also, could someone be pleased to explain the meaning of TH_CONCAT_4(TH,TYPEC,Tensor_copyCuda,Real)(state, selfTensor, srcTensor) in void TH_CONCAT_4 defining?

Hi,

TH_CONCAT_4 is a macro, so TH_CONCAT_4(TH,TYPEC,Tensor_copyCuda,Real)(state, selfTensor, srcTensor) will become when you build for Real=Float and TYPEC=Float for example (so copy from cpu float to cuda float): THFloatTensor_copyCudaFloat(state, selfTensor, srcTensor).
So yes it is nested macros.