Skip to content

Commit

Permalink
[skip-tests] Make cub pass with MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Sep 22, 2023
1 parent f81b2e2 commit 7749a7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions cub/cub/agent/agent_three_way_partition.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,17 @@ struct accumulator_pack_base_t<OffsetT, typename cuda::std::enable_if<sizeof(Off
template <class OffsetT>
struct accumulator_pack_t : accumulator_pack_base_t<OffsetT>
{
using typename accumulator_pack_base_t<OffsetT>::pack_t;
using base = accumulator_pack_base_t<OffsetT>;
using typename base::pack_t;

__device__ static void subtract(pack_t &packed, OffsetT val)
{
packed = pack(first(packed) - val, second(packed) - val);
packed = base::pack( base::first(packed) - val, base::second(packed) - val);
}

__device__ static OffsetT sum(pack_t &packed)
{
return first(packed) + second(packed);
return base::first(packed) + base::second(packed);
}

__device__ static pack_t zero()
Expand All @@ -131,7 +132,7 @@ struct AgentThreeWayPartitionPolicy
constexpr static CacheLoadModifier LOAD_MODIFIER = _LOAD_MODIFIER;
constexpr static BlockScanAlgorithm SCAN_ALGORITHM = _SCAN_ALGORITHM;

struct detail
struct detail
{
using delay_constructor_t = DelayConstructorT;
};
Expand Down
1 change: 1 addition & 0 deletions cub/test/catch2_test_debug.cu
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ TEST_CASE("CubDebug resets last error", "[debug][utils]")
cub::EmptyKernel<int><<<0, 0>>>();
cudaError error = cudaPeekAtLastError();

REQUIRE( error != cudaSuccess );
REQUIRE( CubDebug(cudaSuccess) != cudaSuccess );
REQUIRE( CubDebug(cudaSuccess) == cudaSuccess );
}
4 changes: 2 additions & 2 deletions cub/test/catch2_test_device_scan_iterators.cu
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ CUB_TEST("Device scan works complex accumulator types", "[scan][device]")

custom_accumulator_t init{};

thrust::device_vector<custom_input_t> d_input(num_items, custom_input_t{1});
thrust::device_vector<custom_output_t> d_output{num_items, custom_output_t{nullptr, 0}};
thrust::device_vector<custom_input_t> d_input(static_cast<size_t>(num_items), custom_input_t{1});
thrust::device_vector<custom_output_t> d_output{static_cast<size_t>(num_items), custom_output_t{nullptr, 0}};
thrust::device_vector<int> d_ok_count(1);

auto index_it = thrust::make_counting_iterator(0);
Expand Down

0 comments on commit 7749a7d

Please sign in to comment.