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

Method prepare

src/tests/performance/perf-tpmv.cpp:190–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190template <typename ElemType> int
191TpmvPerformanceTest<ElemType>::prepare(void)
192{
193 size_t lenX, n;
194 n = params_.N;
195 lenX = 1 + (n-1) * abs(params_.incx);
196
197
198 int creationFlags = 0;
199 creationFlags = creationFlags | RANDOM_INIT | PACKED_MATRIX;
200
201 // Default is Column-Major
202 creationFlags = ( (this-> params_.order) == clblasRowMajor)? (creationFlags | ROW_MAJOR_ORDER) : (creationFlags);
203 creationFlags = ( (this-> params_.uplo) == clblasLower)? (creationFlags | LOWER_HALF_ONLY) : (creationFlags | UPPER_HALF_ONLY);
204 BlasRoutineID BlasFn = CLBLAS_TRMV;
205
206 populate( (AP_ + params_.offa), n, n, 0, BlasFn, creationFlags);
207 populate( X_ , lenX + params_.offBX, 1, lenX + params_.offBX, BlasFn);
208 memcpy(backX_, X_, ((1 + (params_.N-1) * abs(params_.incx))+ params_.offBX )* sizeof(ElemType));
209
210
211 mobjAP_ = base_->createEnqueueBuffer(AP_,( (( n *( n + 1 ) )/2 ) + params_.offa)* sizeof(*AP_), 0, CL_MEM_READ_ONLY);
212 mobjX_ = base_->createEnqueueBuffer(X_, (lenX + params_.offBX )* sizeof(*X_), 0, CL_MEM_WRITE_ONLY);
213 scratchBuff = base_->createEnqueueBuffer(NULL , lenX * sizeof(*X_), 0, CL_MEM_READ_ONLY);
214
215 return ( (mobjAP_ != NULL) && (mobjX_ != NULL) && (scratchBuff != NULL) ) ? 0 : -1;
216}
217
218template <typename ElemType> nano_time_t
219TpmvPerformanceTest<ElemType>::etalonPerfSingle(void)

Callers

nothing calls this directly

Calls 2

populateFunction · 0.85
createEnqueueBufferMethod · 0.80

Tested by

no test coverage detected