vpiStreamCreateWrapperCUDA Leaks?

It seems to me there is a GPU memory leak when using vpiStreamCreateWrapperCUDA. Every handful of iterations (~4) GPU memory increases by 2097152 bytes. I can’t really tell if there’s any other clean-up I’m meant to do from the documentation other than a normal vpiStreamDestroy which works fine when using a normal vpiStreamCreate method (the cuda stream is destroyed separately). I interleave other custom cuda kernels and NPPI operations with VPI so I am purportedly doing the right thing by using vpiStreamCreateWrapperCUDA for this interleaved work stream (I’m careful to do manual syncs as well).

VPI Version: 3.2.4

I’m evaluating this on a x86 host.

#include <cstdint>
#include <cuda_runtime.h>
#include <fmt/format.h>
#include <vpi/CUDAInterop.h>
#include <vpi/Stream.h>

void create_and_destroy()
{
    cudaStream_t c_stream = nullptr;
    auto c_err = cudaStreamCreate(&c_stream);
    if (c_err != cudaSuccess)
    {
        fmt::println("CUDA ERROR");
    }
    VPIStream v_stream = nullptr;
    const auto flags = VPI_BACKEND_CPU | VPI_BACKEND_CUDA;
    auto v_err = vpiStreamCreateWrapperCUDA(c_stream, flags, &v_stream);
    // auto v_err = vpiStreamCreate(flags, &v_stream);
    if (v_err != VPI_SUCCESS)
    {
        fmt::println("VPI ERROR");
    }
    vpiStreamSync(v_stream);
    vpiStreamDestroy(v_stream);
    c_err = cudaStreamDestroy(c_stream);
    if (c_err != cudaSuccess)
    {
        fmt::println("CUDA ERROR");
    }
}

int main()
{
    const int num_it = 1000;
    size_t free_start, free_it, free_before;
    cudaMemGetInfo(&free_start, nullptr);
    for (int i = 0; i < num_it; ++i)
    {
        cudaMemGetInfo(&free_before, nullptr);
        create_and_destroy();
        cudaMemGetInfo(&free_it, nullptr);
        auto diff = static_cast<int64_t>(free_before) - static_cast<int64_t>(free_it);
        fmt::println("Memory change: {}", diff);
    }

    auto diff = static_cast<int64_t>(free_start) - static_cast<int64_t>(free_it);
    fmt::println("Change total: {}, per it: {}", diff, diff / static_cast<float>(num_it));
}