MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / SwapPerformanceTest

Method SwapPerformanceTest

src/tests/performance/perf-swap.cpp:115–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113
114template <typename ElemType>
115SwapPerformanceTest<ElemType>::SwapPerformanceTest(
116 BlasFunction fn,
117 TestParams *params) : PerformanceTest(fn,(problem_size_t) ( (4 * params->N) * sizeof(ElemType) ) ), params_(*params), mobjX_(NULL), mobjY_(NULL)
118{
119
120 X_ = blasX_ = NULL;
121 Y_ = blasY_ = NULL;
122 lengthX = 1 + (params->N - 1) * abs(params_.incx);
123 lengthY = 1 + (params->N - 1) * abs(params_.incy);
124
125 try
126 {
127 X_ = new ElemType[lengthX + params_.offBX];
128 blasX_ = new ElemType[lengthX + params_.offBX];
129 Y_ = new ElemType[lengthY + params_.offCY];
130 blasY_ = new ElemType[lengthY + params_.offCY];
131 }
132 catch(bad_alloc& ba) {
133 X_ = Y_ = blasX_ = blasY_ = NULL; // areResourcesSufficient() will handle the rest and return
134 mobjX_= mobjY_ = NULL;
135 ba = ba;
136 }
137
138 base_ = ::clMath::BlasBase::getInstance();
139}
140
141template <typename ElemType>
142SwapPerformanceTest<ElemType>::~SwapPerformanceTest()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected