check transfer
0.1
Check data transfer for SDAccell OpenCL application
|
check data transfer from host to device More...
#include <tf_checktransferin.h>
Public Member Functions | |
void | CheckBuffer (cl_uint *ptr) |
check data in the buffer More... | |
virtual void | CleanupInThread () |
Free any resource. More... | |
virtual void | GetResultInThread () |
Show results of test. More... | |
void | GetStatus (void) |
Read status information from device. More... | |
virtual void | PrepareInThread () |
Prepare test. More... | |
virtual void | Run () |
Main body of test. More... | |
void | SetBuffer (cl_uint *ptr) |
set test data in buffer buffer More... | |
void | StartCalculateBuf (cl::Buffer *pDevice, cl::Event &event) |
Start kernel for buffer. More... | |
void | StartReadBuf (cl::Buffer *pDevice, cl_uint *pHost, cl::Event &event) |
Start data transfer. More... | |
virtual void | StepTable () |
Show table during test executing. More... | |
TF_CheckTransferIn (TableEngine *pTable, TF_Device *pDevice, int argc, char **argv) | |
Constructor. More... | |
void | WaitForCalculateComplete (cl::Event &event) |
Wait for complete calculate. More... | |
void | WaitForTransferBufComplete (cl::Event &event) |
Wait for complete data transfer. More... | |
~TF_CheckTransferIn () | |
Destructor. More... | |
Public Member Functions inherited from TF_TestThread | |
void * | Execute () |
virtual void | GetResult () |
Show result of test. More... | |
virtual int | isComplete () |
Return 1 when test is complete. More... | |
virtual int | Prepare (int cnt) |
Prepare test. More... | |
virtual void | Start () |
Start of test. More... | |
virtual void | Stop () |
Stop of test. More... | |
TF_TestThread (TableEngine *pTable, int argc, char **argv) | |
virtual | ~TF_TestThread () |
Public Member Functions inherited from TF_Test | |
virtual void | StepMainThread () |
Don't use. Reserve for future. More... | |
TF_Test (TableEngine *pTable) | |
Public Attributes | |
TF_CheckTransferIn_task_data * | td |
< Internal data for TF_CheckTransferIn More... | |
Public Attributes inherited from TF_TestThread | |
pthread_attr_t | m_attrThread |
int | m_CycleCnt |
pthread_t | m_hThread |
int | m_isComplete |
int | m_isException |
int | m_isPrepareComplete |
int | m_isTerminate |
pthread_mutex_t | m_ResultCompleteMutex |
pthread_mutex_t | m_ResultStartMutex |
pthread_mutex_t | m_StartMutex |
pthread_mutex_t | m_ThreadExitMutex |
Public Attributes inherited from TF_Test | |
TableEngine * | m_pTemplateEngine |
Additional Inherited Members | |
Static Public Member Functions inherited from TF_TestThread | |
static void * | ThreadFunc (void *lpvThreadParm) |
check data transfer from host to device
Definition at line 19 of file tf_checktransferin.h.
TF_CheckTransferIn::TF_CheckTransferIn | ( | TableEngine * | pTable, |
TF_Device * | pDevice, | ||
int | argc, | ||
char ** | argv | ||
) |
Constructor.
argc | Number of arguments argv Pointer of argumnts |
arguments of command line: -size <n> : size block of kilobytes, default 64 -metric <n> : 0 - binary: 1MB=2^10=1024*1024=1048576 bytes, 1 - decimal: 1MB=10^6=1000*1000=1000000 bytes, default 0
Definition at line 133 of file tf_checktransferin.cpp.
References GetFromCommnadLine(), TF_CheckTransferIn_task_data::mbSize, TF_CheckTransferIn_task_data::metricMode, TF_CheckTransferIn_task_data::pDevice, TF_CheckTransferIn_task_data::sizeBlock, and td.
TF_CheckTransferIn::~TF_CheckTransferIn | ( | ) |
Destructor.
Definition at line 150 of file tf_checktransferin.cpp.
References TF_CheckTransferIn_task_data::dpStatus, TF_CheckTransferIn_task_data::pBuffer, TF_CheckTransferIn_task_data::pBufOut, TF_CheckTransferIn_task_data::pStatus, and td.
void TF_CheckTransferIn::CheckBuffer | ( | cl_uint * | ptr | ) |
check data in the buffer
Definition at line 597 of file tf_checktransferin.cpp.
References TF_CheckTransferIn_task_data::BlockError, TF_CheckTransferIn_task_data::BlockOk, TF_CheckTransferIn_task_data::dataExpect, TF_CheckTransferIn_task_data::sizeBlock, and td.
Referenced by Run().
|
virtual |
Free any resource.
Implements TF_TestThread.
Definition at line 323 of file tf_checktransferin.cpp.
References TF_CheckTransferIn_task_data::q0, TF_CheckTransferIn_task_data::q1, and td.
|
virtual |
Show results of test.
Implements TF_TestThread.
Definition at line 334 of file tf_checktransferin.cpp.
References TF_CheckTransferIn_task_data::BlockError, TF_CheckTransferIn_task_data::BlockOk, TF_CheckTransferIn_task_data::BlockRd, TF_CheckTransferIn_task_data::BlockWr, TF_CheckTransferIn_task_data::metricMode, TF_CheckTransferIn_task_data::Sig, TF_CheckTransferIn_task_data::sizeBlock, td, TF_CheckTransferIn_task_data::testTime, TF_CheckTransferIn_task_data::VelocityAverage, TF_CheckTransferIn_task_data::VelocityCurMax, and TF_CheckTransferIn_task_data::VelocityCurMin.
void TF_CheckTransferIn::GetStatus | ( | void | ) |
Read status information from device.
Definition at line 623 of file tf_checktransferin.cpp.
References TF_CheckTransferIn_task_data::BlockWr, TF_CheckTransferIn_task_data::dpStatus, TF_CheckTransferIn_task_data::pStatus, TF_CheckTransferIn_task_data::q0, TF_CheckTransferIn_task_data::Sig, and td.
Referenced by Run().
|
virtual |
Prepare test.
This function executed before main body of test.
Implements TF_TestThread.
Definition at line 172 of file tf_checktransferin.cpp.
References TF_Device::context, TF_CheckTransferIn_task_data::dataOut, TF_Device::device, TF_CheckTransferIn_task_data::dpStatus, except_info(), TF_CheckTransferIn_task_data::krnl_calculate, TF_CheckTransferIn_task_data::pBuffer, TF_CheckTransferIn_task_data::pBufOut, TF_CheckTransferIn_task_data::pDevice, TF_Device::program, TF_CheckTransferIn_task_data::pStatus, TF_CheckTransferIn_task_data::q0, TF_CheckTransferIn_task_data::q1, TF_CheckTransferIn_task_data::sizeBlock, TF_CheckTransferIn_task_data::sizeOfuint16, and td.
|
virtual |
Main body of test.
Implements TF_TestThread.
Definition at line 454 of file tf_checktransferin.cpp.
References TableEngine::AddRowTable(), TF_CheckTransferIn_task_data::BlockRd, CheckBuffer(), TF_CheckTransferIn_task_data::flagGetStatus, GetStatus(), TF_CheckTransferIn_task_data::lastBlock, TF_CheckTransferIn_task_data::lastTime, TF_TestThread::m_isTerminate, TF_Test::m_pTemplateEngine, TF_CheckTransferIn_task_data::mbSize, TF_CheckTransferIn_task_data::pBuffer, TF_CheckTransferIn_task_data::pBufOut, TF_CheckTransferIn_task_data::RowNumber, TF_CheckTransferIn_task_data::sizeBlock, StartCalculateBuf(), StartReadBuf(), TF_CheckTransferIn_task_data::startTime, td, TF_CheckTransferIn_task_data::testTime, TF_CheckTransferIn_task_data::VelocityAverage, TF_CheckTransferIn_task_data::VelocityCurMax, TF_CheckTransferIn_task_data::VelocityCurMin, TF_CheckTransferIn_task_data::VelocityCurrent, WaitForCalculateComplete(), and WaitForTransferBufComplete().
void TF_CheckTransferIn::SetBuffer | ( | cl_uint * | ptr | ) |
set test data in buffer buffer
set test data in buffer
Definition at line 569 of file tf_checktransferin.cpp.
References TF_CheckTransferIn_task_data::dataOut, TF_CheckTransferIn_task_data::sizeBlock, and td.
void TF_CheckTransferIn::StartCalculateBuf | ( | cl::Buffer * | pDevice, |
cl::Event & | event | ||
) |
Start kernel for buffer.
Definition at line 423 of file tf_checktransferin.cpp.
References TF_CheckTransferIn_task_data::dpStatus, TF_CheckTransferIn_task_data::krnl_calculate, TF_CheckTransferIn_task_data::q1, TF_CheckTransferIn_task_data::sizeOfuint16, and td.
Referenced by Run().
void TF_CheckTransferIn::StartReadBuf | ( | cl::Buffer * | pDevice, |
cl_uint * | pHost, | ||
cl::Event & | event | ||
) |
Start data transfer.
Definition at line 407 of file tf_checktransferin.cpp.
References TF_CheckTransferIn_task_data::BlockRd, TF_CheckTransferIn_task_data::q0, TF_CheckTransferIn_task_data::sizeBlock, and td.
Referenced by Run().
|
virtual |
Show table during test executing.
Implements TF_TestThread.
Definition at line 383 of file tf_checktransferin.cpp.
References TF_CheckTransferIn_task_data::BlockError, TF_CheckTransferIn_task_data::BlockOk, TF_CheckTransferIn_task_data::BlockRd, TF_CheckTransferIn_task_data::BlockWr, TF_CheckTransferIn_task_data::flagGetStatus, TF_Test::m_pTemplateEngine, TF_CheckTransferIn_task_data::RowNumber, TableEngine::SetValueTable(), td, TF_CheckTransferIn_task_data::testTime, TF_CheckTransferIn_task_data::VelocityAverage, and TF_CheckTransferIn_task_data::VelocityCurrent.
void TF_CheckTransferIn::WaitForCalculateComplete | ( | cl::Event & | event | ) |
Wait for complete calculate.
Definition at line 447 of file tf_checktransferin.cpp.
Referenced by Run().
void TF_CheckTransferIn::WaitForTransferBufComplete | ( | cl::Event & | event | ) |
Wait for complete data transfer.
Definition at line 401 of file tf_checktransferin.cpp.
Referenced by Run().
TF_CheckTransferIn_task_data* TF_CheckTransferIn::td |
< Internal data for TF_CheckTransferIn
Definition at line 24 of file tf_checktransferin.h.
Referenced by CheckBuffer(), CleanupInThread(), GetResultInThread(), GetStatus(), PrepareInThread(), Run(), SetBuffer(), StartCalculateBuf(), StartReadBuf(), StepTable(), TF_CheckTransferIn(), and ~TF_CheckTransferIn().