Skip to content

Commit

Permalink
Fix memory leak in catch2_test_vsmem.
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper committed Jun 21, 2024
1 parent 5d75f39 commit 85706f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cub/test/catch2_test_vsmem.cu
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ CUB_TEST("Virtual shared memory works within algorithms", "[util][vsmem]", type_
// Setup vsmem test
launch_config_test_info_t* launch_config_info = nullptr;
cudaMallocHost(&launch_config_info, sizeof(launch_config_test_info_t));

c2h::device_vector<kernel_test_info_t> device_kernel_test_info(1);
dummy_algorithm(
in_ptr, out_ptr, num_items, thrust::raw_pointer_cast(device_kernel_test_info.data()), launch_config_info);
Expand All @@ -474,4 +475,6 @@ CUB_TEST("Virtual shared memory works within algorithms", "[util][vsmem]", type_
// The virtual shared memory helper pads vsmem to a multiple of a line size, hence the range check
REQUIRE(launch_config_info->config_vsmem_per_block >= expected_vsmem_per_block);
}

cudaFreeHost(launch_config_info);
}

0 comments on commit 85706f6

Please sign in to comment.