Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
rnburn committed May 21, 2024
1 parent a56f553 commit 3368e5c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions sxt/multiexp/pippenger2/in_memory_partition_table_accessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class in_memory_partition_table_accessor final : public partition_table_accessor
explicit in_memory_partition_table_accessor(memmg::managed_array<T>&& table) noexcept
: table_{std::move(table)} {}

void async_copy_precomputed_sums_to_device(basct::span<T> dest, bast::raw_stream_t stream,
unsigned first) const noexcept override {
void async_copy_to_device(basct::span<T> dest, bast::raw_stream_t stream,
unsigned first) const noexcept override {
static unsigned num_entries = 1u << 16u;
SXT_DEBUG_ASSERT(
// clang-format off
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TEST_CASE("we can provide access to precomputed partition sums stored on disk")
temp_file.stream().close();
in_memory_partition_table_accessor<E> accessor{temp_file.name()};
memmg::managed_array<E> v_dev{1, memr::get_device_resource()};
accessor.async_copy_precomputed_sums_to_device(v_dev, stream, 0);
accessor.async_copy_to_device(v_dev, stream, 0);
std::vector<E> v(1);
basdv::async_copy_device_to_host(v, v_dev, stream);
basdv::synchronize_stream(stream);
Expand All @@ -56,7 +56,7 @@ TEST_CASE("we can provide access to precomputed partition sums stored on disk")
temp_file.stream().close();
in_memory_partition_table_accessor<E> accessor{temp_file.name()};
memmg::managed_array<E> v_dev{1, memr::get_device_resource()};
accessor.async_copy_precomputed_sums_to_device(v_dev, stream, 1);
accessor.async_copy_to_device(v_dev, stream, 1);
std::vector<E> v(1);
basdv::async_copy_device_to_host(v, v_dev, stream);
basdv::synchronize_stream(stream);
Expand All @@ -75,7 +75,7 @@ TEST_CASE("we can provide access to precomputed partition sums stored on disk")
accessor.write_to_file(temp_file.name());
in_memory_partition_table_accessor<E> accessor_p{temp_file.name()};
memmg::managed_array<E> data_dev{data.size(), memr::get_device_resource()};
accessor_p.async_copy_precomputed_sums_to_device(data_dev, stream, 0);
accessor_p.async_copy_to_device(data_dev, stream, 0);
memmg::managed_array<E> data_p(data.size());
basdv::async_copy_device_to_host(data_p, data_dev, stream);
basdv::synchronize_stream(stream);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TEST_CASE("we can create a partition table accessor from given generators") {

SECTION("we can create an accessor from a single generators") {
auto accessor = make_in_memory_partition_table_accessor<E>(basct::subspan(generators, 0, 1));
accessor->async_copy_precomputed_sums_to_device(table_dev, stream, 0);
accessor->async_copy_to_device(table_dev, stream, 0);
basdv::async_copy_device_to_host(table, table_dev, stream);
basdv::synchronize_stream(stream);
REQUIRE(table[1] == generators[0]);
Expand All @@ -53,7 +53,7 @@ TEST_CASE("we can create a partition table accessor from given generators") {

SECTION("we can create an accessor from multiple generators") {
auto accessor = make_in_memory_partition_table_accessor<E>(generators);
accessor->async_copy_precomputed_sums_to_device(table_dev, stream, 0);
accessor->async_copy_to_device(table_dev, stream, 0);
basdv::async_copy_device_to_host(table, table_dev, stream);
basdv::synchronize_stream(stream);
REQUIRE(table[1] == generators[0]);
Expand Down
2 changes: 1 addition & 1 deletion sxt/multiexp/pippenger2/partition_product.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ xena::future<> async_partition_product(basct::span<T> products,
basdv::stream stream;
memr::async_device_resource resource{stream};
memmg::managed_array<T> partition_table{num_partitions * num_table_entries, &resource};
accessor.async_copy_precomputed_sums_to_device(partition_table, stream, offset / 16u);
accessor.async_copy_to_device(partition_table, stream, offset / 16u);
co_await std::move(scalars_fut);

// product
Expand Down
4 changes: 2 additions & 2 deletions sxt/multiexp/pippenger2/partition_table_accessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ namespace sxt::mtxpp2 {
//--------------------------------------------------------------------------------------------------
template <bascrv::element T> class partition_table_accessor : public partition_table_accessor_base {
public:
virtual void async_copy_precomputed_sums_to_device(basct::span<T> dest, bast::raw_stream_t stream,
unsigned first) const noexcept = 0;
virtual void async_copy_to_device(basct::span<T> dest, bast::raw_stream_t stream,
unsigned first) const noexcept = 0;

virtual basct::cspan<T> host_view(std::pmr::polymorphic_allocator<> alloc, unsigned first,
unsigned n) const noexcept = 0;
Expand Down

0 comments on commit 3368e5c

Please sign in to comment.