libunifex icon indicating copy to clipboard operation
libunifex copied to clipboard

Make most/all algorithms customisable

Open lewissbaker opened this issue 4 years ago • 1 comments

One of the design goals is to allow algorithms to be customised when invoked with certain types to allow more efficient implementations of that algorithm to be used. One of the key use-cases for this is to allow efficient fusing of composed operations for certain execution enivronments.

eg. so that two chained gpu-tasks can be chained gpu-side without needing to bounce back off the CPU, or similarly so that two I/O operations can be chained kernel-side so that we don't need a kernel transition to start a subsequent operation.

While some of the algorithms have already been turned into customisation points, there are still a large number of algorithms which have not.

The following algorithms are not currently CPOs:

  • delay(scheduler, duration)
  • just(values...)
  • let(predecessor, successorFactory)
  • next_adapt_stream(stream, nextAdapter)
  • adapt_stream(stream, nextAdapter, cleanupAdapter)
  • adapt_stream(stream, nextAndCleanupAdapter)
  • on_stream(scheduler, stream)
  • on(predecessor, successor)
  • reduce_stream(stream, initialState, reduceFunc)
  • single(sender) -> stream
  • stop_immediately(stream)
  • sync_wait(sender, stopToken)
  • sync_wait_r<R>(sender, stopToken)
  • take_until(source, trigger)
  • then_execute(scheduler, predecessor, func)
  • transform_stream(stream, func)
  • transform(pred, func)
  • type_erase<Ts...>(stream)
  • typed_via_stream(scheduler, stream)
  • typed_via(successor, predecessor)
  • via_stream(scheduler, stream)
  • via(successor, predecessor)
  • when_all(senders...)
  • with_allocator(sender, allocator)
  • with_query_value(sender, cpo, value)

lewissbaker avatar Nov 12 '19 19:11 lewissbaker

  • indexed_for

I did in https://github.com/facebookexperimental/libunifex/pull/51 but we should probably be consistent in the way we customise them.

LeeHowes avatar Jan 21 '20 02:01 LeeHowes