THCGrid.cu 709 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
#else

rusty1s's avatar
rusty1s committed
5
6
7
void THCTensor_(grid)(THCState *state, THCudaLongTensor *self, THCTensor *pos, THCTensor *size,
                      THCudaLongTensor *count) {
  THCAssertSameGPU(THCTensor_(checkGPU)(state, 4, self, pos, size, count));
rusty1s's avatar
rusty1s committed
8

rusty1s's avatar
rusty1s committed
9
10
  ptrdiff_t nNodes = THCudaLongTensor_nElement(state, self);

rusty1s's avatar
rusty1s committed
11
  int64_t *selfData = THCudaLongTensor_data(state, self);
rusty1s's avatar
rusty1s committed
12
  TensorInfo<real> posInfo = THCTensor_(getTensorInfo)(state, pos);
rusty1s's avatar
rusty1s committed
13
14
15
  real *sizeData = THCTensor_(data)(state, size);
  int64_t *countData = THCudaLongTensor_data(state, count);

rusty1s's avatar
rusty1s committed
16
  KERNEL_REAL_RUN(gridKernel, nNodes, selfData, posInfo, sizeData, countData);
rusty1s's avatar
rusty1s committed
17
18
19
}

#endif  // THC_GENERIC_FILE