Skip to content

Commit 5fe5608

Browse files
committed
[cudaaligner] Fix: set correct device in create_aligner
1 parent c84a30d commit 5fe5608

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cudaaligner/src/aligner.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ std::unique_ptr<Aligner> create_aligner(
5050
cudaStream_t stream, int32_t device_id, int64_t max_device_memory_allocator_caching_size)
5151
{
5252
GW_NVTX_RANGE(profiler, "create_aligner");
53+
scoped_device_switch device(device_id);
5354
if (max_device_memory_allocator_caching_size < -1)
5455
{
5556
throw std::invalid_argument("max_device_memory_allocator_caching_size has to be either -1 (=all available GPU memory) or greater or equal than 0.");
@@ -99,6 +100,7 @@ std::unique_ptr<FixedBandAligner> create_aligner(
99100
int64_t max_device_memory)
100101
{
101102
GW_NVTX_RANGE(profiler, "create_aligner");
103+
scoped_device_switch device(device_id);
102104
if (max_device_memory < -1)
103105
{
104106
throw std::invalid_argument("max_device_memory has to be either -1 (=all available GPU memory) or greater or equal than 0.");

0 commit comments

Comments
 (0)