| 8 | #include "custom_cuda_layers.h" |
| 9 | |
| 10 | torch::Tensor token_sort_(torch::Tensor& unsorted_token_ids, int64_t original_tokens) |
| 11 | { |
| 12 | const int layers = unsorted_token_ids.size(0); |
| 13 | const int batch_size = unsorted_token_ids.size(1); |
| 14 | const int reserved_tokens = unsorted_token_ids.size(2); |
| 15 | |
| 16 | launch_token_sort(unsorted_token_ids.data_ptr<int32_t>(), |
| 17 | layers, |
| 18 | batch_size, |
| 19 | reserved_tokens, |
| 20 | original_tokens, |
| 21 | c10::cuda::getCurrentCUDAStream()); |
| 22 | |
| 23 | return unsorted_token_ids; |
| 24 | } |
| 25 | |
| 26 | torch::Tensor token_gather(torch::Tensor& activations, |
| 27 | torch::Tensor& sorted_indices, |
nothing calls this directly
no test coverage detected