access2rohit commented on a change in pull request #18239:
URL: https://github.com/apache/incubator-mxnet/pull/18239#discussion_r420262458



##########
File path: src/operator/tensor/ordering_op-inl.h
##########
@@ -284,29 +285,29 @@ MSHADOW_XINLINE void MergeTopK(index_t K, DType *val1, 
index_t *ind1, DType *val
   }
 }
 
-template<typename DType>
-__global__ void PartialSortSmallK(index_t K, index_t N, DType *val, index_t 
*ind, bool is_ascend) {
+template<typename DType, typename IDXType = int32_t>
+__global__ void PartialSortSmallK(IDXType K, IDXType N, DType *val, IDXType 
*ind, bool is_ascend) {
   // Buffer for pairwise reduction.
-  extern __shared__ index_t buff[];
+  extern __shared__ int32_t buff[];
   // Start of buffer sections associated with this thread.
-  const index_t offset(threadIdx.x*K);
-  index_t *ind_buff = &buff[offset];
+  const IDXType offset(threadIdx.x*K);
+  int32_t *ind_buff = &buff[offset];

Review comment:
       Since buff had to harfcoded to be int32 then this had to be done else 
error will be raised when compiler keeps IDXType=int64_t which raises an 
attempt to cast int32_t* to int64_t* (w/o explicit reinterpret_cast)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to