MCPcopy Create free account
hub / github.com/apache/tvm / mergepath

Function mergepath

python/tvm/topi/gpu/sort.py:315–381  ·  view source on GitHub ↗
(
        source,
        dest,
        source_idx,
        dest_idx,
        base_idx,
        aCount,
        bCount,
        aStart,
        bStart,
        kStart,
        tx,
        step_count,
        even,
    )

Source from the content-addressed store, hash-verified

313 j_buf[0] = j_buf[0] + 1
314
315 def mergepath(
316 source,
317 dest,
318 source_idx,
319 dest_idx,
320 base_idx,
321 aCount,
322 bCount,
323 aStart,
324 bStart,
325 kStart,
326 tx,
327 step_count,
328 even,
329 ):
330 first_buf = T.decl_buffer([1], target_dtype, scope="local")
331 last_buf = T.decl_buffer([1], target_dtype, scope="local")
332 i_buf_buf = T.decl_buffer([1], target_dtype, scope="local")
333 j_buf_buf = T.decl_buffer([1], target_dtype, scope="local")
334 first = T.buffer_proxy(first_buf)
335 last = T.buffer_proxy(last_buf)
336 i_buf = T.buffer_proxy(i_buf_buf)
337 j_buf = T.buffer_proxy(j_buf_buf)
338
339 diag = tx * step_count
340 with T.If(even):
341 with T.Then():
342 get_merge_begin(source, base_idx, aCount, bCount, aStart, bStart, diag, first, last)
343 serial_merge(
344 source,
345 dest,
346 source_idx,
347 dest_idx,
348 base_idx,
349 aCount,
350 bCount,
351 aStart,
352 bStart,
353 kStart,
354 diag,
355 step_count,
356 first,
357 last,
358 i_buf,
359 j_buf,
360 )
361 with T.Else():
362 get_merge_begin(dest, base_idx, aCount, bCount, aStart, bStart, diag, first, last)
363 # Intentionally swap source/dest for reverse direction merge
364 serial_merge( # pylint: disable=arguments-out-of-order
365 dest,
366 source,
367 dest_idx,
368 source_idx,
369 base_idx,
370 aCount,
371 bCount,
372 aStart,

Callers 1

_sort_commonFunction · 0.85

Calls 2

get_merge_beginFunction · 0.85
serial_mergeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…