@@ -27,7 +27,7 @@ namespace o2
2727namespace benchmark
2828{
2929
30- template <class chunk_type >
30+ template <class chunk_t >
3131class GPUbenchmark final
3232{
3333 public:
@@ -41,13 +41,22 @@ class GPUbenchmark final
4141
4242 // Single stream synchronous (sequential kernels) execution
4343 template <typename ... T>
44- float benchmarkSync (void (*kernel)(T...),
45- int nLaunches, int blocks, int threads, T&... args);
44+ float runSequential (void (*kernel)(chunk_t *, size_t , T...),
45+ std::pair<int, int>& chunkRanges,
46+ int nLaunches,
47+ int dimGrid,
48+ int dimBlock,
49+ T&... args);
4650
4751 // Multi-streams asynchronous executions on whole memory
4852 template <typename ... T>
49- std::vector<float > benchmarkAsync (void (*kernel)(int , T...),
50- int nStreams, int nLaunches, int blocks, int threads, T&... args);
53+ std::vector<float > runConcurrent (void (*kernel)(chunk_t *, size_t , T...),
54+ std::vector<std::pair<int, int>>& chunkRanges,
55+ int nLaunches,
56+ int dimStreams,
57+ int nBlocks,
58+ int nThreads,
59+ T&... args);
5160
5261 // Main interface
5362 void globalInit (); // Allocate scratch buffers and compute runtime parameters
@@ -56,27 +65,14 @@ class GPUbenchmark final
5665 void printDevices (); // Dump info
5766
5867 // Initializations/Finalizations of tests. Not to be measured, in principle used for report
59- void readInit ( );
60- void readFinalize ( );
68+ void initTest (Test );
69+ void finalizeTest (Test );
6170
62- void writeInit ();
63- void writeFinalize ();
64-
65- void copyInit ();
66- void copyFinalize ();
67-
68- // Kernel calling wrappers
69- void readSequential (SplitLevel sl);
70- void readConcurrent (SplitLevel sl, int nRegions = 2 );
71-
72- void writeSequential (SplitLevel sl);
73- void writeConcurrent (SplitLevel sl, int nRegions = 2 );
74-
75- void copySequential (SplitLevel sl);
76- void copyConcurrent (SplitLevel sl, int nRegions = 2 );
71+ // Kernel calling wrapper
72+ void runTest (Test, Mode, KernelConfig);
7773
7874 private:
79- gpuState<chunk_type > mState ;
75+ gpuState<chunk_t > mState ;
8076 std::shared_ptr<ResultWriter> mResultWriter ;
8177 benchmarkOpts mOptions ;
8278};
0 commit comments