Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PointKernel committed Aug 29, 2024
1 parent a080f30 commit 8100656
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function(ConfigureTest TEST_NAME)
set_target_properties(${TEST_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests")
target_compile_options(${TEST_NAME} PRIVATE --compiler-options=-Wall --compiler-options=-Wextra
--expt-extended-lambda --expt-relaxed-constexpr -Xcompiler -Wno-subobject-linkage)
--expt-extended-lambda -Xcompiler -Wno-subobject-linkage)
catch_discover_tests(${TEST_NAME} EXTRA_ARGS --allow-running-no-tests)
endfunction(ConfigureTest)

Expand Down
2 changes: 1 addition & 1 deletion tests/static_map/custom_type_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ TEMPLATE_TEST_CASE_SIG("User defined key and value type",
insert_values.end(),
found_values.begin(),
cuda::proclaim_return_type<bool>([] __device__(Value lhs, Value rhs) {
return std::tie(lhs.f, lhs.s) == std::tie(rhs.f, rhs.s);
return cuda::std::tie(lhs.f, lhs.s) == cuda::std::tie(rhs.f, rhs.s);
})));
}

Expand Down
8 changes: 3 additions & 5 deletions tests/static_multimap/custom_type_test.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,19 +18,17 @@

#include <cuco/static_multimap.cuh>

#include <cuda/std/tuple>
#include <thrust/device_vector.h>
#include <thrust/execution_policy.h>
#include <thrust/functional.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/sort.h>
#include <thrust/transform.h>
#include <thrust/tuple.h>

#include <catch2/catch_template_test_macros.hpp>

#include <tuple>

// User-defined key type
struct key_pair {
int32_t a;
Expand All @@ -48,7 +46,7 @@ struct hash_key_pair {
struct key_pair_equals {
__device__ bool operator()(const key_pair& lhs, const key_pair& rhs)
{
return std::tie(lhs.a, lhs.b) == std::tie(rhs.a, rhs.b);
return cuda::std::tie(lhs.a, lhs.b) == cuda::std::tie(rhs.a, rhs.b);
}
};

Expand Down
18 changes: 10 additions & 8 deletions tests/utility/hash_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <cuco/hash_functions.cuh>

#include <cuda/std/cstddef>
#include <cuda/std/limits>
#include <thrust/device_vector.h>

#include <catch2/catch_template_test_macros.hpp>
Expand Down Expand Up @@ -55,15 +56,15 @@ __global__ void check_identity_hash_result_kernel(OutputIter result)

result[i++] = check_hash_result<cuco::identity_hash<signed char>>(0, 0);
result[i++] = check_hash_result<cuco::identity_hash<signed char>>(
std::numeric_limits<signed char>::max(), std::numeric_limits<signed char>::max());
cuda::std::numeric_limits<signed char>::max(), cuda::std::numeric_limits<signed char>::max());

result[i++] = check_hash_result<cuco::identity_hash<int32_t>>(0, 0);
result[i++] = check_hash_result<cuco::identity_hash<int32_t>>(
std::numeric_limits<int32_t>::max(), std::numeric_limits<int32_t>::max());
cuda::std::numeric_limits<int32_t>::max(), cuda::std::numeric_limits<int32_t>::max());

result[i++] = check_hash_result<cuco::identity_hash<int64_t>>(0, 0);
result[i++] = check_hash_result<cuco::identity_hash<int64_t>>(
std::numeric_limits<int64_t>::max(), std::numeric_limits<int64_t>::max());
cuda::std::numeric_limits<int64_t>::max(), cuda::std::numeric_limits<int64_t>::max());
}

TEST_CASE("Test cuco::identity_hash", "")
Expand All @@ -72,15 +73,16 @@ TEST_CASE("Test cuco::identity_hash", "")
{
CHECK(check_hash_result<cuco::identity_hash<signed char>>(0, 0));
CHECK(check_hash_result<cuco::identity_hash<signed char>>(
std::numeric_limits<signed char>::max(), std::numeric_limits<signed char>::max()));
cuda::std::numeric_limits<signed char>::max(),
cuda::std::numeric_limits<signed char>::max()));

CHECK(check_hash_result<cuco::identity_hash<int32_t>>(0, 0));
CHECK(check_hash_result<cuco::identity_hash<int32_t>>(std::numeric_limits<int32_t>::max(),
std::numeric_limits<int32_t>::max()));
CHECK(check_hash_result<cuco::identity_hash<int32_t>>(
cuda::std::numeric_limits<int32_t>::max(), cuda::std::numeric_limits<int32_t>::max()));

CHECK(check_hash_result<cuco::identity_hash<int64_t>>(0, 0));
CHECK(check_hash_result<cuco::identity_hash<int64_t>>(std::numeric_limits<int64_t>::max(),
std::numeric_limits<int64_t>::max()));
CHECK(check_hash_result<cuco::identity_hash<int64_t>>(
cuda::std::numeric_limits<int64_t>::max(), cuda::std::numeric_limits<int64_t>::max()));
}
SECTION("Check if device-generated hash values match the identity function.")
{
Expand Down

0 comments on commit 8100656

Please sign in to comment.