THCGrid.cu 741 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
#ifndef THC_GENERIC_FILE
rusty1s's avatar
typo  
rusty1s committed
2
#define THC_GENERIC_FILE "generic/THCGrid.cu"
rusty1s's avatar
rusty1s committed
3
4
5
6
#else

void THCGrid_(THCState *state, THCudaLongTensor *cluster, THCTensor *pos, THCTensor *size,
              THCudaLongTensor *count) {
rusty1s's avatar
rusty1s committed
7
8
9
10
11
12
13
14
15
16
  THC_assertSameGPU(state, 4, cluster, pos, size, count);

  int64_t *clusterData = THCudaLongTensor_data(state, cluster);
  TensorInfo<real> posInfo = THC_(getTensorInfo)(state, pos);
  real *sizeData = THCTensor_(data)(state, size);
  int64_t *countData = THCudaLongTensor_data(state, count);

  const int nNodes = THCudaLongTensor_nElement(state, cluster);
  const int dims = THCTensor_(nElement)(size);
  FIXED_DIM_KERNEL_RUN(gridKernel, nNodes, dims, clusterData, posInfo, sizeData, countData);
rusty1s's avatar
rusty1s committed
17
18
19
}

#endif  // THC_GENERIC_FILE