Skip to content

Commit

Permalink
fix segment coo indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s committed Nov 23, 2020
1 parent 4c4a2e6 commit 2693efc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion csrc/cuda/segment_coo_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ __global__ void segment_coo_broadcast_kernel(

int D = index_info.sizes[index_info.dims - 1];
int E_1 = E / D;
int E_2 = D + TB - (D % TB);
int E_2 = (D - 1) + TB - ((D - 1) % TB);

int row_idx = blockIdx.x * blockDim.y + threadIdx.y;
int col_idx = blockIdx.y * blockDim.x + threadIdx.x;
Expand Down Expand Up @@ -215,6 +215,12 @@ segment_coo_cuda(torch::Tensor src, torch::Tensor index,
auto N = out.size(dim);
auto avg_len = (float)E_2 / (float)N;

std::cout << "E " << E << std::endl;
std::cout << "E2 " << E_2 << std::endl;
std::cout << "E1 " << E_1 << std::endl;
std::cout << "K " << K << std::endl;
std::cout << "N " << N << std::endl;

auto index_info = at::cuda::detail::getTensorInfo<int64_t, int>(index);
auto stream = at::cuda::getCurrentCUDAStream();
AT_DISPATCH_ALL_TYPES(src.scalar_type(), "segment_coo_kernel", [&] {
Expand Down

0 comments on commit 2693efc

Please sign in to comment.