CUDA bug: ARRAY_SIZE on CLI not being resized
The ARRAY_SIZE was being resized before the CLI args were read
This commit is contained in:
parent
a74e7cee4c
commit
ec9d73b8d5
@ -150,22 +150,22 @@ 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);
|
||||
|
||||
if (NTIMES < 2) throw badntimes();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// Check device index is in range
|
||||
int count;
|
||||
cudaGetDeviceCount(&count);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user