You have to specify block size in CUDA, so make sure ARRAY_SIZE divides 1024
This commit is contained in:
parent
9da2cd6d09
commit
2c2dbf2c3f
@ -131,6 +131,16 @@ int main(int argc, char *argv[])
|
|||||||
<< "Version: " << VERSION_STRING << std::endl
|
<< "Version: " << VERSION_STRING << std::endl
|
||||||
<< "Implementation: CUDA" << std::endl << 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
|
try
|
||||||
{
|
{
|
||||||
parseArguments(argc, argv);
|
parseArguments(argc, argv);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user