summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--expt_0510.cu14
1 files changed, 7 insertions, 7 deletions
diff --git a/expt_0510.cu b/expt_0510.cu
index 063c6ba..17e104d 100644
--- a/expt_0510.cu
+++ b/expt_0510.cu
@@ -52,8 +52,7 @@ __global__ void initNormalSample(key_type *normal_sample) {
cudaNormalSampleItem = normal_sample;
}
-__global__ void kernel(unsigned long step, const double slice_size,
- const unsigned long split_size) {
+__global__ void kernel(unsigned long step, const double slice_size) {
auto custom_sort = CustomSort(cuda_sample_length, sizeof(key_type) * 8);
// printf("kernel1 step: %ld\n", step);
for (int i = 0; i < step; i++) {
@@ -119,7 +118,7 @@ void initCustomSampleCPU() {
delete[] tmp;
}
-void run_kernel(size_t test_size, bool normal = true) {
+void run_kernel(size_t test_size, bool custom = true) {
dim3 grid_dim = 32, block_dim = 32;
unsigned long step = test_size / (grid_dim.x * block_dim.x);
auto scale = 2;
@@ -129,8 +128,8 @@ void run_kernel(size_t test_size, bool normal = true) {
cudaEventCreate(&start);
cudaEventCreate(&stop);
cudaEventRecord(start, nullptr);
- if (normal) {
- kernel<<<grid_dim, block_dim>>>(step, slice_size, split_size);
+ if (custom) {
+ kernel<<<grid_dim, block_dim>>>(step, slice_size);
} else {
kernel2<<<grid_dim, block_dim>>>(step, slice_size);
}
@@ -145,7 +144,7 @@ void run_kernel(size_t test_size, bool normal = true) {
if (time == 0) {
// printf("last error: %u\n", cudaGetLastError());
}
- printf("time: %lf\n", time);
+ printf("%stime: %lf ", custom ? "custom " : "", time);
cudaDeviceSynchronize();
print_function<<<1, 1>>>();
@@ -199,7 +198,7 @@ int main(int argc, char const *argv[]) {
read_file("normal_distribution.txt", test_size);
- printf("population: %zu, test size: %zu, sample length: %zu\n",
+ printf("population: %zu, test size: %zu, sample length: %zu | ",
population_vector.size(), test_size, sample_length);
sample_vector = std::vector<key_type>(
@@ -248,6 +247,7 @@ int main(int argc, char const *argv[]) {
run_kernel(test_size, false);
// check_items<<<1, 1>>>();
// cudaDeviceSynchronize();
+ puts("");
freeStorageStage2<<<1, 1>>>();
cudaDeviceSynchronize();