Skip to content

Commit

Permalink
add a unit test for token elision
Browse files Browse the repository at this point in the history
  • Loading branch information
caugonnet committed Jan 3, 2025
1 parent a49a2b3 commit e781f68
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cudax/include/cuda/experimental/stf.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,32 @@ UNITTEST("cuda stream place multi-gpu")
ctx.finalize();
};

// Ensure we can skip logical tokens
UNITTEST("logical token elision")
{
context ctx;

int buf[1024];

auto lA = ctx.logical_token();
auto lB = ctx.logical_token();
auto lC = ctx.logical_data(buf);

// with all arguments
ctx.task(lA.read(), lB.read(), lC.write())->*[](cudaStream_t, void_interface, void_interface, slice<int>) {};

// with argument elision
ctx.task(lA.read(), lB.read(), lC.write())->*[](cudaStream_t, slice<int>) {};

// with all arguments
ctx.host_launch(lA.read(), lB.read(), lC.write())->*[](cudaStream_t, void_interface, void_interface, slice<int>) {};

// with argument elision
ctx.host_launch(lA.read(), lB.read(), lC.write())->*[](cudaStream_t, slice<int>) {};

ctx.finalize();
};

#endif // UNITTESTED_FILE

/**
Expand Down

0 comments on commit e781f68

Please sign in to comment.