Skip to content

Commit

Permalink
renamed thrusttest->unittest
Browse files Browse the repository at this point in the history
--HG--
rename : testing/thrusttest/assertions.h => testing/unittest/assertions.h
rename : testing/thrusttest/exceptions.h => testing/unittest/exceptions.h
rename : testing/thrusttest/meta.h => testing/unittest/meta.h
rename : testing/thrusttest/random.h => testing/unittest/random.h
rename : testing/thrusttest/special_types.h => testing/unittest/special_types.h
rename : testing/thrusttest/system.h => testing/unittest/system.h
rename : testing/thrusttest/testframework.h => testing/unittest/testframework.h
rename : testing/thrusttest/unittest.h => testing/unittest/unittest.h
rename : testing/thrusttest/util.h => testing/unittest/util.h
  • Loading branch information
wnbell committed Apr 15, 2010
1 parent 2ae0e37 commit ff2597f
Show file tree
Hide file tree
Showing 97 changed files with 358 additions and 359 deletions.
2 changes: 1 addition & 1 deletion performance/adjacent_difference.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize);
thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize);
thrust::device_vector<$InputType> d_input = h_input;

thrust::host_vector<$InputType> h_output($InputSize);
Expand Down
4 changes: 2 additions & 2 deletions performance/axpy.test
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ INITIALIZE = \
"""
//cublasInit();

thrust::host_vector<$InputType> h_x = thrusttest::random_samples<$InputType>($InputSize);
thrust::host_vector<$InputType> h_y = thrusttest::random_samples<$InputType>($InputSize);
thrust::host_vector<$InputType> h_x = unittest::random_samples<$InputType>($InputSize);
thrust::host_vector<$InputType> h_y = unittest::random_samples<$InputType>($InputSize);
thrust::device_vector<$InputType> d_x = h_x;
thrust::device_vector<$InputType> d_y = h_y;

Expand Down
4 changes: 2 additions & 2 deletions performance/binary_search.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_keys = h_keys;

thrust::sort(h_keys.begin(), h_keys.end());
thrust::sort(d_keys.begin(), d_keys.end());

ASSERT_EQUAL(d_keys, h_keys);

thrust::host_vector<$KeyType> h_search = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_search = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_search = h_search;

thrust::host_vector<unsigned int> h_output($InputSize);
Expand Down
2 changes: 1 addition & 1 deletion performance/build/perftest.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <thrusttest/unittest.h>
#include <unittest/unittest.h>
#include <cuda_runtime.h>
#include <cuda.h>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion performance/build/test_function_template.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void $FUNCTION(void)
catch (std::bad_alloc) {
RECORD_TEST_FAILURE("std::bad_alloc");
}
catch (thrusttest::UnitTestException e) {
catch (unittest::UnitTestException e) {
RECORD_TEST_FAILURE(e);
}

Expand Down
2 changes: 1 addition & 1 deletion performance/build/test_program_template.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <thrusttest/unittest.h>
#include <unittest/unittest.h>

/*********** BEGIN PREAMBLE SECTION ***********/
$PREAMBLE
Expand Down
6 changes: 3 additions & 3 deletions performance/float3_optimization.test
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$InputType> h_x = thrusttest::random_samples<$InputType>($InputSize);
thrust::host_vector<$InputType> h_y = thrusttest::random_samples<$InputType>($InputSize);
thrust::host_vector<$InputType> h_z = thrusttest::random_samples<$InputType>($InputSize);
thrust::host_vector<$InputType> h_x = unittest::random_samples<$InputType>($InputSize);
thrust::host_vector<$InputType> h_y = unittest::random_samples<$InputType>($InputSize);
thrust::host_vector<$InputType> h_z = unittest::random_samples<$InputType>($InputSize);
thrust::device_vector<$InputType> d_x = h_x;
thrust::device_vector<$InputType> d_y = h_y;
thrust::device_vector<$InputType> d_z = h_z;
Expand Down
2 changes: 1 addition & 1 deletion performance/host_sort.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys_copy(h_keys);

// test sort
Expand Down
2 changes: 1 addition & 1 deletion performance/host_sort_by_key.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys_copy(h_keys);
thrust::host_vector<$KeyType> h_values($InputSize);

Expand Down
2 changes: 1 addition & 1 deletion performance/inclusive_scan.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize);
thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize);
thrust::device_vector<$InputType> d_input = h_input;

thrust::host_vector<$InputType> h_output($InputSize);
Expand Down
2 changes: 1 addition & 1 deletion performance/inclusive_segmented_scan.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize);
thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize);
thrust::device_vector<$InputType> d_input = h_input;

thrust::host_vector<$InputType> h_output($InputSize);
Expand Down
4 changes: 2 additions & 2 deletions performance/inner_product.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$InputType> h_input1 = thrusttest::random_integers<$InputType>($InputSize);
thrust::host_vector<$InputType> h_input2 = thrusttest::random_integers<$InputType>($InputSize);
thrust::host_vector<$InputType> h_input1 = unittest::random_integers<$InputType>($InputSize);
thrust::host_vector<$InputType> h_input2 = unittest::random_integers<$InputType>($InputSize);
thrust::device_vector<$InputType> d_input1 = h_input1;
thrust::device_vector<$InputType> d_input2 = h_input2;

Expand Down
2 changes: 1 addition & 1 deletion performance/merge_sort.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_keys = h_keys;
thrust::device_vector<$KeyType> d_keys_copy = d_keys;

Expand Down
2 changes: 1 addition & 1 deletion performance/merge_sort_by_key.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_keys = h_keys;

thrust::host_vector<$ValueType> h_values($InputSize);
Expand Down
2 changes: 1 addition & 1 deletion performance/nrm2.test
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$InputType> h_input = thrusttest::random_integers<bool>($InputSize);
thrust::host_vector<$InputType> h_input = unittest::random_integers<bool>($InputSize);
thrust::device_vector<$InputType> d_input = h_input;

$InputType h_result = $Method(h_input);
Expand Down
2 changes: 1 addition & 1 deletion performance/omp_merge_sort.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_keys = h_keys;
thrust::device_vector<$KeyType> d_keys_copy = d_keys;

Expand Down
2 changes: 1 addition & 1 deletion performance/radix_sort.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_keys = h_keys;
thrust::device_vector<$KeyType> d_keys_copy = d_keys;

Expand Down
2 changes: 1 addition & 1 deletion performance/radix_sort_bits.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PREAMBLE = \
INITIALIZE = \
"""
const size_t InputSize = 1 << 24;
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>(InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>(InputSize);

// set upper bits to zero
for(size_t i = 0; i < InputSize; i++)
Expand Down
2 changes: 1 addition & 1 deletion performance/radix_sort_by_key.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_keys = h_keys;

thrust::host_vector<$ValueType> h_values($InputSize);
Expand Down
2 changes: 1 addition & 1 deletion performance/reduce.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize);
thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize);
thrust::device_vector<$InputType> d_input = h_input;

$InputType init = 13;
Expand Down
2 changes: 1 addition & 1 deletion performance/reduce_float.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$InputType> h_input = thrusttest::random_samples<$InputType>($InputSize);
thrust::host_vector<$InputType> h_input = unittest::random_samples<$InputType>($InputSize);
thrust::device_vector<$InputType> d_input = h_input;

$InputType init = 13;
Expand Down
2 changes: 1 addition & 1 deletion performance/sort.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_keys = h_keys;
thrust::device_vector<$KeyType> d_keys_copy = d_keys;

Expand Down
2 changes: 1 addition & 1 deletion performance/sort_by_key.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_keys = h_keys;

thrust::host_vector<$ValueType> h_values($InputSize);
Expand Down
2 changes: 1 addition & 1 deletion performance/sort_large.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::device_vector<$KeyType> d_keys = h_keys;
thrust::device_vector<$KeyType> d_keys_copy = d_keys;

Expand Down
2 changes: 1 addition & 1 deletion performance/stl_sort.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$KeyType> h_keys = thrusttest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys = unittest::random_integers<$KeyType>($InputSize);
thrust::host_vector<$KeyType> h_keys_copy = h_keys;
"""

Expand Down
2 changes: 1 addition & 1 deletion performance/unique.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREAMBLE = \

INITIALIZE = \
"""
thrust::host_vector<$InputType> h_input = thrusttest::random_integers<$InputType>($InputSize);
thrust::host_vector<$InputType> h_input = unittest::random_integers<$InputType>($InputSize);

// increase likelihood of equal consecutive elements
for(size_t i = 0; i < $InputSize; i++)
Expand Down
4 changes: 2 additions & 2 deletions testing/adjacent_difference.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <thrusttest/unittest.h>
#include <unittest/unittest.h>
#include <thrust/adjacent_difference.h>

template <class Vector>
Expand Down Expand Up @@ -40,7 +40,7 @@ DECLARE_VECTOR_UNITTEST(TestAjacentDifferenceSimple);
template <typename T>
void TestAjacentDifference(const size_t n)
{
thrust::host_vector<T> h_input = thrusttest::random_samples<T>(n);
thrust::host_vector<T> h_input = unittest::random_samples<T>(n);
thrust::device_vector<T> d_input = h_input;

thrust::host_vector<T> h_output(n);
Expand Down
2 changes: 1 addition & 1 deletion testing/advance.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <thrusttest/unittest.h>
#include <unittest/unittest.h>
#include <thrust/advance.h>
#include <thrust/sequence.h>

Expand Down
2 changes: 1 addition & 1 deletion testing/arch.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <thrusttest/unittest.h>
#include <unittest/unittest.h>

#if defined(__CUDACC__)

Expand Down
14 changes: 7 additions & 7 deletions testing/binary_search.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <thrusttest/unittest.h>
#include <unittest/unittest.h>
#include <thrust/binary_search.h>

#include <thrust/sequence.h>
Expand Down Expand Up @@ -316,13 +316,13 @@ struct TestVectorLowerBound
#if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC) && (THRUST_DEVICE_BACKEND == THRUST_DEVICE_BACKEND_OMP)
KNOWN_FAILURE;
#else
thrust::host_vector<T> h_vec = thrusttest::random_integers<T>(n);
thrust::host_vector<T> h_vec = unittest::random_integers<T>(n);
thrust::device_vector<T> d_vec = h_vec;

thrust::sort(h_vec.begin(), h_vec.end());
thrust::sort(d_vec.begin(), d_vec.end());

thrust::host_vector<T> h_input = thrusttest::random_integers<T>(4*n);
thrust::host_vector<T> h_input = unittest::random_integers<T>(4*n);
thrust::device_vector<T> d_input = h_input;

thrust::host_vector<int> h_output(4*n);
Expand All @@ -348,13 +348,13 @@ struct TestVectorUpperBound
#if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC) && (THRUST_DEVICE_BACKEND == THRUST_DEVICE_BACKEND_OMP)
KNOWN_FAILURE;
#else
thrust::host_vector<T> h_vec = thrusttest::random_integers<T>(n);
thrust::host_vector<T> h_vec = unittest::random_integers<T>(n);
thrust::device_vector<T> d_vec = h_vec;

thrust::sort(h_vec.begin(), h_vec.end());
thrust::sort(d_vec.begin(), d_vec.end());

thrust::host_vector<T> h_input = thrusttest::random_integers<T>(4*n);
thrust::host_vector<T> h_input = unittest::random_integers<T>(4*n);
thrust::device_vector<T> d_input = h_input;

thrust::host_vector<int> h_output(4*n);
Expand All @@ -379,13 +379,13 @@ struct TestVectorBinarySearch
#if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC) && (THRUST_DEVICE_BACKEND == THRUST_DEVICE_BACKEND_OMP)
KNOWN_FAILURE;
#else
thrust::host_vector<T> h_vec = thrusttest::random_integers<T>(n);
thrust::host_vector<T> h_vec = unittest::random_integers<T>(n);
thrust::device_vector<T> d_vec = h_vec;

thrust::sort(h_vec.begin(), h_vec.end());
thrust::sort(d_vec.begin(), d_vec.end());

thrust::host_vector<T> h_input = thrusttest::random_integers<T>(4*n);
thrust::host_vector<T> h_input = unittest::random_integers<T>(4*n);
thrust::device_vector<T> d_input = h_input;

thrust::host_vector<int> h_output(4*n);
Expand Down
2 changes: 1 addition & 1 deletion testing/constant_iterator.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <thrusttest/unittest.h>
#include <unittest/unittest.h>
#include <thrust/iterator/constant_iterator.h>
#include <thrust/copy.h>
#include <thrust/transform.h>
Expand Down
10 changes: 5 additions & 5 deletions testing/copy.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <thrusttest/unittest.h>
#include <unittest/unittest.h>
#include <thrust/copy.h>

#include <list>
Expand Down Expand Up @@ -223,7 +223,7 @@ DECLARE_VECTOR_UNITTEST(TestCopyIfSimple);
template <typename T>
void TestCopyIf(const size_t n)
{
thrust::host_vector<T> h_data = thrusttest::random_samples<T>(n);
thrust::host_vector<T> h_data = unittest::random_samples<T>(n);
thrust::device_vector<T> d_data = h_data;

thrust::host_vector<T> h_result(n);
Expand Down Expand Up @@ -268,11 +268,11 @@ DECLARE_VECTOR_UNITTEST(TestCopyIfStencilSimple);
template <typename T>
void TestCopyIfStencil(const size_t n)
{
thrust::host_vector<T> h_data = thrusttest::random_samples<T>(n);
thrust::host_vector<T> h_data = unittest::random_samples<T>(n);
thrust::device_vector<T> d_data = h_data;

thrust::host_vector<T> h_stencil = thrusttest::random_samples<T>(n);
thrust::device_vector<T> d_stencil = thrusttest::random_samples<T>(n);
thrust::host_vector<T> h_stencil = unittest::random_samples<T>(n);
thrust::device_vector<T> d_stencil = unittest::random_samples<T>(n);

thrust::host_vector<T> h_result(n);
thrust::device_vector<T> d_result(n);
Expand Down
6 changes: 3 additions & 3 deletions testing/count.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <thrusttest/unittest.h>
#include <unittest/unittest.h>
#include <thrust/count.h>

template <class Vector>
Expand All @@ -18,7 +18,7 @@ DECLARE_VECTOR_UNITTEST(TestCountSimple);
template <typename T>
void TestCount(const size_t n)
{
thrust::host_vector<T> h_data = thrusttest::random_samples<T>(n);
thrust::host_vector<T> h_data = unittest::random_samples<T>(n);
thrust::device_vector<T> d_data = h_data;

size_t cpu_result = thrust::count(h_data.begin(), h_data.end(), T(5));
Expand Down Expand Up @@ -53,7 +53,7 @@ DECLARE_VECTOR_UNITTEST(TestCountIfSimple);
template <typename T>
void TestCountIf(const size_t n)
{
thrust::host_vector<T> h_data = thrusttest::random_samples<T>(n);
thrust::host_vector<T> h_data = unittest::random_samples<T>(n);
thrust::device_vector<T> d_data = h_data;

size_t cpu_result = thrust::count_if(h_data.begin(), h_data.end(), greater_than_five<T>());
Expand Down
Loading

0 comments on commit ff2597f

Please sign in to comment.