optimize topk op through limit SortTopK kernel entrance, test=develop (#30403)

test_model_benchmark_ci
jiangcheng 4 years ago committed by GitHub
parent bfb8a64234
commit 8f4ac6b525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -150,7 +150,8 @@ class TopkV2OpCUDAKernel : public framework::OpKernel<T> {
if (k > input_width) k = input_width;
if ((input_width <= 1024 || k >= 128 || k == input_width)) {
if (((input_width <= 1024 && input_height <= 2048) || k >= 128 ||
k == input_width)) {
if (SortTopk<T>(dev_ctx, &trans_input, input_width, input_height, k,
&trans_out, &trans_ind, largest)) {
// last step, tranpose back the indices and output

Loading…
Cancel
Save