Paper | Title | Words |
---|---|---|
P2300R10 | std::execution | 47495 |
P3325R5 | A Utility for Creating Execution Environments | 2168 |
P3396R1 | std::execution wording fixes | 3061 |
P2079R10 | Parallel scheduler | 9383 |
P3149R11 | async_scope - Creating scopes for non-sequential concurrency | 16255 |
P3284R4 | write_env and unstoppable Sender Adaptors | 1346 |
P3433R1 | Allocator Support for Operation States | 827 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cassert> | |
#include <stop_token> | |
#include <utility> | |
#include <print> | |
// https://github.com/NVIDIA/stdexec/ | |
#include <stdexec/execution.hpp> | |
namespace exec = stdexec; | |
namespace std { | |
using exec::get_stop_token, exec::sync_wait; | |
using exec::inplace_stop_source, exec::stoppable_token; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <coroutine> | |
#include <print> | |
// https://github.com/NVIDIA/stdexec/ | |
#include <stdexec/execution.hpp> | |
namespace ex = stdexec; | |
template<typename T> | |
class Lazy { | |
public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cassert> | |
#include <concepts> | |
#include <span> | |
#include <tuple> | |
#include <utility> | |
#include <ranges> | |
#if 1 | |
#include <https://raw.githubusercontent.com/kokkos/mdspan/single-header/mdspan.hpp> | |
#else | |
#include <mdspan> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cassert> | |
#include <bit> | |
#include <iostream> | |
#include <utility> | |
#if 1 | |
#include <https://raw.githubusercontent.com/kokkos/mdspan/single-header/mdspan.hpp> | |
using std::experimental::mdspan; | |
using std::experimental::dextents; | |
#else | |
#include <mdspan> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cassert> | |
#include <array> | |
#include <span> | |
#include <type_traits> | |
#if 0 | |
#include <mdspan> | |
#else | |
#include <https://raw.githubusercontent.com/kokkos/mdspan/single-header/mdspan.hpp> | |
#endif | |
using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://groups.google.com/g/golang-nuts/c/Gze1TRtdLdc/m/RoD2AxssDgAJ | |
// http://svr-pes20-cppmem.cl.cam.ac.uk/cppmem/ | |
int main() { | |
int x = 0; | |
atomic_int int y = 0; | |
{{{ { x = 1; | |
y.store(1); | |
x = 1; | |
y.store(1); } | |
||| { y.load().readsvalue(0); |
Full barrier
P: =p0=\ /----\ /=p1=\ /----\ /=
* * * *
C: ----/ \=c0=/ \----/ \=c1=/ \-
Half barrier
P: p0=\--------/=p1=\--------/=
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctime> | |
#include <chrono> | |
#include <iostream> | |
#include <iomanip> | |
namespace std { | |
// https://timsong-cpp.github.io/cppwp/n4868/time.cal.ymd.nonmembers#14 | |
// "yyyy-mm-dd" | |
inline ostream& operator<<(ostream& os, const chrono::year_month_day& ymd) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// requires C++23 or later | |
#include <bit> | |
#include <concepts> | |
template <std::integral T> | |
constexpr T hton(T value) noexcept | |
{ | |
if constexpr (std::endian::native == std::endian::little) { | |
return std::byteswap(value); | |
} else { |
NewerOlder