Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
20 changes: 20 additions & 0 deletions projects/rocthrust/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,31 @@ Documentation for rocThrust available at
* Updated the required version of Google Benchmark from 1.8.0 to 1.9.0.
* Drop `c++14` support for rocthrust.
* Renamed `cpp14_required.h` to `cpp_version_check.h`
* Refactored `test_header.hpp` into separte modules `test_param_fixtures.hpp`, `test_real_assertions.hpp`, `test_imag_assertions.hpp`, and `test_utils.hpp`.
* This is done to prevent unit tests from having access to modules that they're not testing. This will improve the accuracy of code coverage reports.

### Added
* Additional unit tests for:
* binary_search
* complex
* c99math
* catrig
* ccosh
* cexp
* clog
* csin
* csqrt
* ctan
* Added `test_param_fixtures.hpp` to store all the paramaeters for typed test suites.
Comment thread
NguyenNhuDi marked this conversation as resolved.
Outdated
* Added `test_real_assertions.hpp` to handle unit tests assertions for real numbers.
Comment thread
NguyenNhuDi marked this conversation as resolved.
Outdated
* Added `test_imag_assertions.hpp` to handle unit tests assertions for imaginary numbers.
Comment thread
NguyenNhuDi marked this conversation as resolved.
Outdated

### Removed

* `device_malloc_allocator.h` has been removed. This header file was unused and should not impact users.
* Removed C++14 support, only C++17 is supported.
* `test_header.hpp` was removed for a more de-coupled headers. HIP_CHECK, the test and inter_run_bwr namespace was moved to `test_utils.hpp`.
Comment thread
NguyenNhuDi marked this conversation as resolved.
Outdated
* `test_assertions.hpp` was split up into `test_real_assertions.hpp` and `test_imag_assertions.hpp`.
Comment thread
NguyenNhuDi marked this conversation as resolved.
Outdated

### Upcoming changes

Expand Down
2 changes: 2 additions & 0 deletions projects/rocthrust/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ if(BUILD_TEST)
add_rocthrust_test("allocator")
add_rocthrust_test("allocator_aware_policies")
add_rocthrust_test("async_copy")
add_rocthrust_test("async_for_each")
add_rocthrust_test("async_reduce")
add_rocthrust_test("async_scan")
add_rocthrust_test("async_sort")
Expand All @@ -145,6 +146,7 @@ if(BUILD_TEST)
add_rocthrust_test("binary_search_vector_descending")
add_rocthrust_test("complex")
add_rocthrust_test("complex_transform")
add_rocthrust_test("complex_various")
add_rocthrust_test("constant_iterator")
add_rocthrust_test("copy")
add_rocthrust_test("copy_n")
Expand Down
4 changes: 3 additions & 1 deletion projects/rocthrust/test/test_adjacent_difference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#include <thrust/iterator/discard_iterator.h>
#include <thrust/iterator/retag.h>

#include "test_header.hpp"
#include "test_real_assertions.hpp"
#include "test_param_fixtures.hpp"
#include "test_utils.hpp"

#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_HIP

Expand Down
4 changes: 3 additions & 1 deletion projects/rocthrust/test/test_advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
#include <thrust/advance.h>
#include <thrust/sequence.h>

#include "test_header.hpp"
#include "test_real_assertions.hpp"
#include "test_param_fixtures.hpp"
#include "test_utils.hpp"

TESTS_DEFINE(AdvanceVectorTests, VectorSignedIntegerTestsParams);

Expand Down
3 changes: 2 additions & 1 deletion projects/rocthrust/test/test_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#include <cstddef>
#include <memory>

#include "test_header.hpp"
#include "test_param_fixtures.hpp"
#include "test_utils.hpp"

// The `thrust::device_malloc_allocator` is deprecated, considered removed and is only
// here for compatibility, once it is removed, the `THRUST_SUPPRESS_DEPRECATED_PUSH`
Expand Down
3 changes: 2 additions & 1 deletion projects/rocthrust/test/test_allocator_aware_policies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#include <thrust/system/omp/detail/par.h>
#include <thrust/system/tbb/detail/par.h>

#include "test_header.hpp"
#include "test_param_fixtures.hpp"
#include "test_utils.hpp"

template <typename T>
struct test_allocator_t
Expand Down
3 changes: 2 additions & 1 deletion projects/rocthrust/test/test_async_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
#include <thrust/host_vector.h>
#include <thrust/limits.h>

#include "test_header.hpp"
#include "test_param_fixtures.hpp"
#include "test_utils.hpp"

TESTS_DEFINE(AsyncCopyTests, NumericalTestsParams);

Expand Down
8 changes: 4 additions & 4 deletions projects/rocthrust/test/test_async_for_each.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>

#include "test_header.hpp"
#include "test_param_fixtures.hpp"
#include "test_utils.hpp"

#define DEFINE_ASYNC_FOR_EACH_CALLABLE(name, ...) \
struct THRUST_PP_CAT2(name, _fn) \
Expand Down Expand Up @@ -58,10 +59,9 @@ void test_async_for_each()
for (auto size : get_sizes())
{
SCOPED_TRACE(testing::Message() << "with size = " << size);
for (size_t seed_index = 0; seed_index < random_seeds_count + seed_size; seed_index++)
for (auto seed : get_seeds())
{
unsigned int seed_value = seed_index < random_seeds_count ? rand() : seeds[seed_index - random_seeds_count];
thrust::host_vector<T> h0_data = get_random_data<T>(size, T(-1000), T(1000), seed_value);
thrust::host_vector<T> h0_data = get_random_data<T>(size, T(-1000), T(1000), seed);
thrust::device_vector<T> d0_data(h0_data);

thrust::for_each(h0_data.begin(), h0_data.end(), UnaryFunction{});
Expand Down
4 changes: 3 additions & 1 deletion projects/rocthrust/test/test_async_reduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>

#include "test_header.hpp"
#include "test_real_assertions.hpp"
#include "test_param_fixtures.hpp"
#include "test_utils.hpp"

TESTS_DEFINE(AsyncReduceTests, NumericalTestsParams);

Expand Down
3 changes: 2 additions & 1 deletion projects/rocthrust/test/test_async_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>

#include "test_header.hpp"
#include "test_param_fixtures.hpp"
#include "test_utils.hpp"

TESTS_DEFINE(AsyncScanTests, NumericalTestsParams)

Expand Down
3 changes: 2 additions & 1 deletion projects/rocthrust/test/test_async_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>

#include "test_header.hpp"
#include "test_param_fixtures.hpp"
#include "test_utils.hpp"

TESTS_DEFINE(AsyncSortTests, NumericalTestsParams);

Expand Down
4 changes: 3 additions & 1 deletion projects/rocthrust/test/test_async_transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>

#include "test_header.hpp"
#include "test_real_assertions.hpp"
#include "test_param_fixtures.hpp"
#include "test_utils.hpp"

template <typename T>
struct divide_by_2
Expand Down
Loading
Loading