Skip to content

Commit 2aedb24

Browse files
committed
Fix wrong kernel picking
1 parent 06c0ddf commit 2aedb24

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

GPU/GPUbenchmark/benchmark.cxx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/// \author mconcas@cern.ch
1414
///
1515
#include "Shared/Kernels.h"
16+
#define VERSION "version 0.1-latest-#6773"
1617

1718
bool parseArgs(o2::benchmark::benchmarkOpts& conf, int argc, const char* argv[])
1819
{
@@ -21,11 +22,12 @@ bool parseArgs(o2::benchmark::benchmarkOpts& conf, int argc, const char* argv[])
2122
bpo::options_description options("Benchmark options");
2223
options.add_options()(
2324
"help,h", "Print help message.")(
25+
"version,v", "print version")(
2426
"device,d", bpo::value<int>()->default_value(0), "Id of the device to run test on, EPN targeted.")(
25-
"test,t", bpo::value<std::vector<std::string>>()->multitoken()->default_value(std::vector<std::string>{"read", "write", "copy"}, "read, write, copy"), "Tests to be performed.")(
26-
"kind,k", bpo::value<std::vector<std::string>>()->multitoken()->default_value(std::vector<std::string>{"char", "int", "ulong"}, "char, int, ulong"), "Test data type to be used.")(
27-
"mode,m", bpo::value<std::vector<std::string>>()->multitoken()->default_value(std::vector<std::string>{"seq", "con"}, "seq, con"), "Mode: sequential or concurrent.")(
28-
"pool,p", bpo::value<std::vector<std::string>>()->multitoken()->default_value(std::vector<std::string>{"sb", "mb"}, "sb, mb"), "Pool strategy: single or multi blocks.")(
27+
"test,t", bpo::value<std::vector<std::string>>()->multitoken()->default_value(std::vector<std::string>{"read", "write", "copy"}, "read write copy"), "Tests to be performed.")(
28+
"kind,k", bpo::value<std::vector<std::string>>()->multitoken()->default_value(std::vector<std::string>{"char", "int", "ulong"}, "char int ulong"), "Test data type to be used.")(
29+
"mode,m", bpo::value<std::vector<std::string>>()->multitoken()->default_value(std::vector<std::string>{"seq", "con"}, "seq con"), "Mode: sequential or concurrent.")(
30+
"pool,p", bpo::value<std::vector<std::string>>()->multitoken()->default_value(std::vector<std::string>{"sb", "mb"}, "sb mb"), "Pool strategy: single or multi blocks.")(
2931
"chunkSize,c", bpo::value<float>()->default_value(1.f), "Size of scratch partitions (GB).")(
3032
"freeMemFraction,f", bpo::value<float>()->default_value(0.95f), "Fraction of free memory to be allocated (min: 0.f, max: 1.f).")(
3133
"launches,l", bpo::value<int>()->default_value(10), "Number of iterations in reading kernels.")(
@@ -39,6 +41,11 @@ bool parseArgs(o2::benchmark::benchmarkOpts& conf, int argc, const char* argv[])
3941
return false;
4042
}
4143

44+
if (vm.count("version")) {
45+
std::cout << VERSION << std::endl;
46+
return false;
47+
}
48+
4249
bpo::notify(vm);
4350
} catch (const bpo::error& e) {
4451
std::cerr << e.what() << "\n\n";

GPU/GPUbenchmark/cuda/Kernels.cu

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,15 @@ void GPUbenchmark<chunk_t>::runTest(Test test, Mode mode, KernelConfig config)
391391
switch (test) {
392392
case Test::Read: {
393393
kernel = (config == KernelConfig::Single) ? &gpu::readChunkSBKernel<chunk_t> : &gpu::readChunkMBKernel<chunk_t>;
394+
break;
394395
}
395396
case Test::Write: {
396397
kernel = (config == KernelConfig::Single) ? &gpu::writeChunkSBKernel<chunk_t> : &gpu::writeChunkMBKernel<chunk_t>;
398+
break;
397399
}
398400
case Test::Copy: {
399401
kernel = (config == KernelConfig::Single) ? &gpu::copyChunkSBKernel<chunk_t> : &gpu::copyChunkMBKernel<chunk_t>;
402+
break;
400403
}
401404
}
402405

@@ -472,5 +475,4 @@ template class GPUbenchmark<int>;
472475
// template class GPUbenchmark<int4>;
473476

474477
} // namespace benchmark
475-
} // namespace o2
476-
void readConcurrent(KernelConfig config);
478+
} // namespace o2

0 commit comments

Comments
 (0)