Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,14 @@ class AuxiliaryBranchHandle : public HandleTest
{
};

TEST_F(AuxiliaryBranchHandle, default_stream_is_default)
{
hipStream_t default_stream{};
hipStream_t stream = reinterpret_cast<hipStream_t>(0x1);
EXPECT_EQ(rocsparse_get_stream(handle, &stream), rocsparse_status_success);
EXPECT_EQ(default_stream, stream);
}

TEST_F(AuxiliaryBranchHandle, stream_get_set_roundtrip)
{
hipStream_t stream = nullptr;
Expand Down
10 changes: 3 additions & 7 deletions projects/rocsparse/library/src/common/rocsparse_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <hip/hip_runtime.h>

ROCSPARSE_KERNEL(1) void init_kernel(){};
static hipStream_t main_stream{};

/*******************************************************************************
* constructor
*
Expand Down Expand Up @@ -85,7 +85,7 @@ _rocsparse_handle::_rocsparse_handle(hipStream_t user_stream)

size_t coomv_size = (((sizeof(rocsparse_int) + 16) * nblocks - 1) / 256 + 1) * 256;

// Allocate device buffer stream-ordered so handle creation never blocks
// Allocate device buffer -- stream-ordered so handle creation never blocks
// streams other than the one passed by the caller.
buffer_size = (coomv_size > 1024 * 1024) ? coomv_size : 1024 * 1024;
THROW_IF_HIP_ERROR(rocsparse_hipMallocAsync(&buffer, buffer_size, this->stream));
Expand Down Expand Up @@ -194,11 +194,7 @@ _rocsparse_handle::_rocsparse_handle()

// Shared memory per block opt-in
shared_mem_per_block_optin = properties.sharedMemPerBlockOptin;
if(main_stream == nullptr)
{
std::ignore = hipStreamCreate(&main_stream);
}
stream = main_stream;

#if HIP_VERSION >= 307
// ASIC revision
asic_rev = properties.asicRevision;
Expand Down
Loading