#include "stdafx.h"
#include "private.h"
#include "repo.h"
#include "../include/sharedLibrary.h"
#include "../statTimer/statisticalTimer.extern.h"
clfftStatus clfftSetup( const clfftSetupData* sData )
{
scopedLock sLock( FFTRepo::lockRepo, _T( "FFTRepo::getInstance" ) );
FFTRepo& fftRepo = FFTRepo::getInstance( );
clfftInitRequestLibNoMemAlloc();
clfftInitBinaryCache();
fftRepo.timerHandle = LoadSharedLibrary( "lib", "StatTimer", true );
if( fftRepo.timerHandle )
{
PFGETSTATTIMER pfGetStatTimer = reinterpret_cast< PFGETSTATTIMER > ( LoadFunctionAddr( fftRepo.timerHandle, "getStatTimer" ) );
if( pfGetStatTimer )
{
fftRepo.pStatTimer = reinterpret_cast< GpuStatTimer* > ( pfGetStatTimer( CLFFT_GPU ) );
}
}
if( sData == NULL )
return CLFFT_SUCCESS;
fftRepo.setupData = *sData;
return CLFFT_SUCCESS;
}
clfftStatus clfftTeardown( )
{
FFTRepo& fftRepo = FFTRepo::getInstance( );
fftRepo.releaseResources( );
FreeSharedLibrary( fftRepo.timerHandle );
return CLFFT_SUCCESS;
}
clfftStatus clfftGetVersion( cl_uint* major, cl_uint* minor, cl_uint* patch )
{
*major = clfftVersionMajor;
*minor = clfftVersionMinor;
*patch = clfftVersionPatch;
return CLFFT_SUCCESS;
}