Skip to content

Commit

Permalink
Remove old f(void) function signatures (NVIDIA#1708)
Browse files Browse the repository at this point in the history
Function signatures of the form f(void) were necessary in C to express
"no parameters", but this is the default for f() in C++ and thus no
longer necessary.

Fixes: NVIDIA#1703
  • Loading branch information
bernhardmgruber committed May 6, 2024
1 parent 717366f commit f53f8dd
Show file tree
Hide file tree
Showing 196 changed files with 743 additions and 746 deletions.
2 changes: 1 addition & 1 deletion cub/cub/util_device.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct policy_wrapper_t : PolicyT
* \brief Empty kernel for querying PTX manifest metadata (e.g., version) for the current device
*/
template <typename T>
CUB_DETAIL_KERNEL_ATTRIBUTES void EmptyKernel(void)
CUB_DETAIL_KERNEL_ATTRIBUTES void EmptyKernel()
{}

#endif // DOXYGEN_SHOULD_SKIP_THIS
Expand Down
2 changes: 1 addition & 1 deletion cub/test/mersenne.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void init_by_array(unsigned int init_key[], int key_length)
}

/* generates a random number on [0,0xffffffff]-interval */
unsigned int genrand_int32(void)
unsigned int genrand_int32()
{
unsigned int y;
static unsigned int mag01[2] = {0x0, MATRIX_A};
Expand Down
4 changes: 2 additions & 2 deletions libcudacxx/include/cuda/std/detail/libcxx/include/cstdlib
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ long strtol (const char* restrict nptr, char** restrict endptr, i
long long strtoll (const char* restrict nptr, char** restrict endptr, int base); // C99
unsigned long strtoul (const char* restrict nptr, char** restrict endptr, int base);
unsigned long long strtoull(const char* restrict nptr, char** restrict endptr, int base); // C99
int rand(void);
int rand();
void srand(unsigned int seed);
void* calloc(size_t nmemb, size_t size);
void free(void* ptr);
void* malloc(size_t size);
void* realloc(void* ptr, size_t size);
void abort(void);
void abort();
int atexit(void (*func)(void));
void exit(int status);
void _Exit(int status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ typedef void (*FunctionPtr)();

int main(int, char**)
{
test_is_function<void(void)>();
test_is_function<void()>();
test_is_function<int(int)>();
test_is_function<int(int, double)>();
test_is_function<int(Abstract*)>();
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/arbitrary_transformation.cu
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct arbitrary_functor2
};
#endif // >= C++11

int main(void)
int main()
{
// allocate storage
thrust::device_vector<float> A(5);
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/basic_vector.cu
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <iostream>

int main(void)
int main()
{
// H has storage for 4 integers
thrust::host_vector<int> H(4);
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/bounding_box.cu
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct bbox_reduction : public thrust::binary_function<bbox, bbox, bbox>
}
};

int main(void)
int main()
{
const size_t N = 40;
thrust::default_random_engine rng;
Expand Down
4 changes: 2 additions & 2 deletions thrust/examples/bucket_sort2d.cu
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
typedef thrust::tuple<float, float> vec2;

// return a random vec2 in [0,1)^2
vec2 make_random_vec2(void)
vec2 make_random_vec2()
{
static thrust::default_random_engine rng;
static thrust::uniform_real_distribution<float> u01(0.0f, 1.0f);
Expand Down Expand Up @@ -45,7 +45,7 @@ struct point_to_bucket_index : public thrust::unary_function<vec2, unsigned int>
}
};

int main(void)
int main()
{
const size_t N = 1000000;

Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/constant_iterator.cu
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <iostream>
#include <iterator>

int main(void)
int main()
{
thrust::device_vector<int> data(4);
data[0] = 3;
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/counting_iterator.cu
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <iostream>
#include <iterator>

int main(void)
int main()
{
// this example computes indices for all the nonzero values in a sequence

Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/cpp_integration/host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// defines the function prototype
#include "device.h"

int main(void)
int main()
{
// generate 20 random numbers on the host
thrust::host_vector<int> h_vec(20);
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/cuda/unwrap_pointer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <thrust/device_ptr.h>
#include <thrust/device_vector.h>

int main(void)
int main()
{
size_t N = 10;

Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/cuda/wrap_pointer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <thrust/device_ptr.h>
#include <thrust/fill.h>

int main(void)
int main()
{
size_t N = 10;

Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/device_ptr.cu
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <cassert>
#include <iostream>

int main(void)
int main()
{
// allocate memory buffer to store 10 integers on the device
thrust::device_ptr<int> d_ptr = thrust::device_malloc<int>(10);
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/discrete_voronoi.cu
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void display_time(timer& t)
std::cout << " ( " << 1e3 * t.elapsed() << "ms )" << std::endl;
}

int main(void)
int main()
{
int m = 2048; // number of rows
int n = 2048; // number of columns
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/dot_products_with_zip.cu
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ thrust::host_vector<float> random_vector(const size_t N, unsigned int seed = thr
return temp;
}

int main(void)
int main()
{
// number of vectors
const size_t N = 1000;
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/expand.cu
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void print(const std::string& s, const Vector& v)
std::cout << std::endl;
}

int main(void)
int main()
{
int counts[] = {3, 5, 2, 0, 1, 3, 4, 2, 4};
int values[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/fill_copy_sequence.cu
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <iostream>

int main(void)
int main()
{
// initialize all ten integers of a device_vector to 1
thrust::device_vector<int> D(10, 1);
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/histogram.cu
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void sparse_histogram(const Vector1& input, Vector2& histogram_values, Vector3&
print_vector("histogram counts", histogram_counts);
}

int main(void)
int main()
{
thrust::default_random_engine rng;
thrust::uniform_int_distribution<int> dist(0, 9);
Expand Down
20 changes: 10 additions & 10 deletions thrust/examples/include/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@ struct timer
cudaEvent_t start;
cudaEvent_t end;

timer(void)
timer()
{
cuda_safe_call(cudaEventCreate(&start));
cuda_safe_call(cudaEventCreate(&end));
restart();
}

~timer(void)
~timer()
{
cuda_safe_call(cudaEventDestroy(start));
cuda_safe_call(cudaEventDestroy(end));
}

void restart(void)
void restart()
{
cuda_safe_call(cudaEventRecord(start, 0));
}

double elapsed(void)
double elapsed()
{
cuda_safe_call(cudaEventRecord(end, 0));
cuda_safe_call(cudaEventSynchronize(end));
Expand All @@ -69,7 +69,7 @@ struct timer
return ms_elapsed / 1e3;
}

double epsilon(void)
double epsilon()
{
return 0.5e-6;
}
Expand All @@ -85,26 +85,26 @@ struct timer
clock_t start;
clock_t end;

timer(void)
timer()
{
restart();
}

~timer(void) {}
~timer() {}

void restart(void)
void restart()
{
start = clock();
}

double elapsed(void)
double elapsed()
{
end = clock();

return static_cast<double>(end - start) / static_cast<double>(CLOCKS_PER_SEC);
}

double epsilon(void)
double epsilon()
{
return 1.0 / static_cast<double>(CLOCKS_PER_SEC);
}
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/lambda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct saxpy_functor : public thrust::binary_function<float, float, float>
}
};

int main(void)
int main()
{
// input data
float a = 2.0f;
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/lexicographical_sort.cu
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ thrust::host_vector<int> random_vector(size_t N)
return vec;
}

int main(void)
int main()
{
size_t N = 20;

Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/max_abs_diff.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct abs_diff : public thrust::binary_function<T, T, T>
}
};

int main(void)
int main()
{
thrust::device_vector<float> d_a(4);
thrust::device_vector<float> d_b(4);
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/minmax.cu
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct minmax_binary_op : public thrust::binary_function<minmax_pair<T>, minmax_
}
};

int main(void)
int main()
{
// input size
size_t N = 10;
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/mode.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//
// [1] http://en.wikipedia.org/wiki/Mode_(statistics)

int main(void)
int main()
{
const size_t N = 30;
const size_t M = 10;
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/monte_carlo.cu
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct estimate_pi : public thrust::unary_function<unsigned int, float>
}
};

int main(void)
int main()
{
// use 30K independent seeds
int M = 30000;
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/monte_carlo_disjoint_sequences.cu
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct estimate_pi : public thrust::unary_function<unsigned int, float>
}
};

int main(void)
int main()
{
// use 30K subsequences of random numbers
int M = 30000;
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/norm.cu
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct square
}
};

int main(void)
int main()
{
// initialize host array
float x[4] = {1.0, 2.0, 3.0, 4.0};
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/padded_grid_reduction.cu
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct reduce_tuple
}
};

int main(void)
int main()
{
int M = 10; // number of rows
int n = 11; // number of columns excluding padding
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/permutation_iterator.cu
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// this example fuses a gather operation with a reduction for
// greater efficiency than separate gather() and reduce() calls

int main(void)
int main()
{
// gather locations
thrust::device_vector<int> map(4);
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/raw_reference_cast.cu
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void print(const std::string& name, const Vector& v)
std::cout << "\n";
}

int main(void)
int main()
{
typedef thrust::device_vector<int> Vector;
typedef Vector::iterator Iterator;
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/remove_points2d.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct is_outside_circle
}
};

int main(void)
int main()
{
const size_t N = 20;

Expand Down
6 changes: 3 additions & 3 deletions thrust/examples/repeated_range.cu
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ public:
, repeats(repeats)
{}

iterator begin(void) const
iterator begin() const
{
return PermutationIterator(first, TransformIterator(CountingIterator(0), repeat_functor(repeats)));
}

iterator end(void) const
iterator end() const
{
return begin() + repeats * (last - first);
}
Expand All @@ -65,7 +65,7 @@ protected:
difference_type repeats;
};

int main(void)
int main()
{
thrust::device_vector<int> data(4);
data[0] = 10;
Expand Down
2 changes: 1 addition & 1 deletion thrust/examples/run_length_decoding.cu
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
// [1] http://en.wikipedia.org/wiki/Run-length_encoding

int main(void)
int main()
{
// allocate storage for compressed input and run lengths
thrust::device_vector<char> input(6);
Expand Down
Loading

0 comments on commit f53f8dd

Please sign in to comment.