Skip to content

Commit

Permalink
Use rmm::device_async_resource_ref in multi_stream_allocation bench…
Browse files Browse the repository at this point in the history
…mark (#1482)

We want to move away from using raw `device_memory_resource*` in code, so adapt the code to use `rmm::device_async_resource_ref`.

Fixes #1481

Authors:
  - Michael Schellenberger Costa (https://github.com/miscco)

Approvers:
  - Mark Harris (https://github.com/harrism)

URL: #1482
  • Loading branch information
miscco authored Feb 27, 2024
1 parent 1226ef0 commit 23fa632
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <rmm/mr/device/owning_wrapper.hpp>
#include <rmm/mr/device/per_device_resource.hpp>
#include <rmm/mr/device/pool_memory_resource.hpp>
#include <rmm/resource_ref.hpp>

#include <cuda_runtime_api.h>

Expand All @@ -50,7 +51,7 @@ __global__ void compute_bound_kernel(int64_t* out)

using MRFactoryFunc = std::function<std::shared_ptr<rmm::mr::device_memory_resource>()>;

static void run_prewarm(rmm::cuda_stream_pool& stream_pool, rmm::mr::device_memory_resource* mr)
static void run_prewarm(rmm::cuda_stream_pool& stream_pool, rmm::device_async_resource_ref mr)
{
auto buffers = std::vector<rmm::device_uvector<int64_t>>();
for (int32_t i = 0; i < stream_pool.get_pool_size(); i++) {
Expand All @@ -61,7 +62,7 @@ static void run_prewarm(rmm::cuda_stream_pool& stream_pool, rmm::mr::device_memo

static void run_test(std::size_t num_kernels,
rmm::cuda_stream_pool& stream_pool,
rmm::mr::device_memory_resource* mr)
rmm::device_async_resource_ref mr)
{
for (int32_t i = 0; i < num_kernels; i++) {
auto stream = stream_pool.get_stream(i);
Expand Down

0 comments on commit 23fa632

Please sign in to comment.