You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/08/23 18:42:16 UTC
[GitHub] [incubator-mxnet] drivanov commented on a change in pull request
#15560: Add fp16 support for topk
drivanov commented on a change in pull request #15560: Add fp16 support for topk
URL: https://github.com/apache/incubator-mxnet/pull/15560#discussion_r317257895
##########
File path: src/operator/tensor/sort_op-inl.cuh
##########
@@ -227,18 +251,18 @@ SortByKeyImpl(mshadow::Tensor<gpu, 1, KDType> keys,
CHECK_EQ(values.CheckContiguous(), true);
#if CUDA_VERSION >= 9000
cudaStream_t stream = mshadow::Stream<gpu>::GetStream(keys.stream_);
- thrust::device_ptr<half> key_iter = thrust::device_pointer_cast(
- reinterpret_cast<half*>(keys.dptr_));
- thrust::device_ptr<half> value_iter = thrust::device_pointer_cast(
- reinterpret_cast<half*>(values.dptr_));
+ thrust::device_ptr<__half> key_iter = thrust::device_pointer_cast(
+ reinterpret_cast<__half*>(keys.dptr_));
+ thrust::device_ptr<__half> value_iter = thrust::device_pointer_cast(
+ reinterpret_cast<__half*>(values.dptr_));
if (is_ascend) {
thrust::stable_sort_by_key(
thrust::cuda::par.on(stream),
- key_iter, key_iter + (keys.size(0)), value_iter, cuda::less_half<half>());
+ key_iter, key_iter + (keys.size(0)), value_iter.get(), cuda::less_half<__half>());
Review comment:
My experiments shows that without `.get()` it is not working
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services