diff --git a/cuda-stream.cu b/cuda-stream.cu index cb2edfb..bf3d5af 100644 --- a/cuda-stream.cu +++ b/cuda-stream.cu @@ -131,6 +131,16 @@ int main(int argc, char *argv[]) << "Version: " << VERSION_STRING << std::endl << "Implementation: CUDA" << std::endl << std::endl; + if (ARRAY_SIZE % 1024 != 0) + { + unsigned int OLD_ARRAY_SIZE = ARRAY_SIZE; + ARRAY_SIZE -= ARRAY_SIZE % 1024; + std::cout + << "Warning: array size must divide 1024" << std::endl + << "Resizing array from " << OLD_ARRAY_SIZE + << " to " << ARRAY_SIZE << std::endl; + } + try { parseArguments(argc, argv);