|
|
@@ -175,18 +175,22 @@ bool validator(DataT& data) { |
|
|
|
void init(int* argc, char*** argv) { |
|
|
|
|
|
|
|
// Get device configuration |
|
|
|
if (cudaGetDeviceProperties(&device, 0) != cudaSuccess) |
|
|
|
throw std::runtime_error("[CUDA] - Can not read GPU"); |
|
|
|
|
|
|
|
config.blockSize = static_cast<size_t>(device.maxThreadsPerBlock); |
|
|
|
if (cudaGetDeviceProperties(&device, 0) == cudaSuccess){ |
|
|
|
config.blockSize = static_cast<size_t>(device.maxThreadsPerBlock); |
|
|
|
|
|
|
|
// try to read command line |
|
|
|
if (!get_options(*argc, *argv)) |
|
|
|
exit(1); |
|
|
|
// try to read command line |
|
|
|
if (!get_options(*argc, *argv)) |
|
|
|
exit(1); |
|
|
|
|
|
|
|
// Prepare vector and timing data |
|
|
|
Data.resize(config.arraySize); |
|
|
|
measurements_init(); |
|
|
|
// Prepare vector and timing data |
|
|
|
Data.resize(config.arraySize); |
|
|
|
measurements_init(); |
|
|
|
} |
|
|
|
else { |
|
|
|
// try to read command line for -h or --version |
|
|
|
get_options(*argc, *argv); |
|
|
|
throw std::runtime_error("[CUDA] - Can not read GPU"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#if !defined TESTING |
|
|
|