diff --git a/cuda-stream.cu b/cuda-stream.cu index 3549774..684e0ed 100644 --- a/cuda-stream.cu +++ b/cuda-stream.cu @@ -40,13 +40,6 @@ struct badntimes : public std::exception } }; -size_t sizes[4] = { - 2 * DATATYPE_SIZE * ARRAY_SIZE, - 2 * DATATYPE_SIZE * ARRAY_SIZE, - 3 * DATATYPE_SIZE * ARRAY_SIZE, - 3 * DATATYPE_SIZE * ARRAY_SIZE -}; - void check_solution(void* a, void* b, void* c) { // Generate correct solution @@ -279,6 +272,12 @@ int main(int argc, char *argv[]) check_solution(h_a, h_b, h_c); // Crunch results + size_t sizes[4] = { + 2 * DATATYPE_SIZE * ARRAY_SIZE, + 2 * DATATYPE_SIZE * ARRAY_SIZE, + 3 * DATATYPE_SIZE * ARRAY_SIZE, + 3 * DATATYPE_SIZE * ARRAY_SIZE + }; double min[4] = {DBL_MAX, DBL_MAX, DBL_MAX, DBL_MAX}; double max[4] = {0.0, 0.0, 0.0, 0.0}; double avg[4] = {0.0, 0.0, 0.0, 0.0}; diff --git a/ocl-stream.cpp b/ocl-stream.cpp index 1a2d80a..a4e7a67 100644 --- a/ocl-stream.cpp +++ b/ocl-stream.cpp @@ -49,12 +49,6 @@ struct badntimes : public std::exception } }; -size_t sizes[4] = { - 2 * DATATYPE_SIZE * ARRAY_SIZE, - 2 * DATATYPE_SIZE * ARRAY_SIZE, - 3 * DATATYPE_SIZE * ARRAY_SIZE, - 3 * DATATYPE_SIZE * ARRAY_SIZE -}; void check_solution(void* a, void* b, void* c) { @@ -288,6 +282,12 @@ int main(int argc, char *argv[]) check_solution(h_a, h_b, h_c); // Crunch results + size_t sizes[4] = { + 2 * DATATYPE_SIZE * ARRAY_SIZE, + 2 * DATATYPE_SIZE * ARRAY_SIZE, + 3 * DATATYPE_SIZE * ARRAY_SIZE, + 3 * DATATYPE_SIZE * ARRAY_SIZE + }; double min[4] = {DBL_MAX, DBL_MAX, DBL_MAX, DBL_MAX}; double max[4] = {0.0, 0.0, 0.0, 0.0}; double avg[4] = {0.0, 0.0, 0.0, 0.0};