Kaydet (Commit) 3d160b1f authored tarafından Noel Grandin's avatar Noel Grandin

convert int flag OpenclDevice::isInited to bool

Change-Id: I3283be819e1686b70a85aa05844deaaca17db0db
üst f9c68a3c
...@@ -44,7 +44,7 @@ using namespace std; ...@@ -44,7 +44,7 @@ using namespace std;
namespace sc { namespace opencl { namespace sc { namespace opencl {
GPUEnv OpenclDevice::gpuEnv; GPUEnv OpenclDevice::gpuEnv;
int OpenclDevice::isInited =0; bool OpenclDevice::bIsInited = false;
namespace { namespace {
...@@ -310,7 +310,7 @@ bool OpenclDevice::initOpenclAttr( OpenCLEnv * env ) ...@@ -310,7 +310,7 @@ bool OpenclDevice::initOpenclAttr( OpenCLEnv * env )
void OpenclDevice::releaseOpenclEnv( GPUEnv *gpuInfo ) void OpenclDevice::releaseOpenclEnv( GPUEnv *gpuInfo )
{ {
if ( !isInited ) if ( !bIsInited )
{ {
return; return;
} }
...@@ -325,7 +325,7 @@ void OpenclDevice::releaseOpenclEnv( GPUEnv *gpuInfo ) ...@@ -325,7 +325,7 @@ void OpenclDevice::releaseOpenclEnv( GPUEnv *gpuInfo )
clReleaseContext( gpuEnv.mpContext ); clReleaseContext( gpuEnv.mpContext );
gpuEnv.mpContext = NULL; gpuEnv.mpContext = NULL;
} }
isInited = 0; bIsInited = false;
gpuInfo->mnIsUserCreated = 0; gpuInfo->mnIsUserCreated = 0;
free( gpuInfo->mpArryDevsID ); free( gpuInfo->mpArryDevsID );
...@@ -479,7 +479,7 @@ bool OpenclDevice::initOpenclRunEnv( int argc ) ...@@ -479,7 +479,7 @@ bool OpenclDevice::initOpenclRunEnv( int argc )
if ( ( argc > MAX_CLFILE_NUM ) || ( argc < 0 ) ) if ( ( argc > MAX_CLFILE_NUM ) || ( argc < 0 ) )
return true; return true;
if ( !isInited ) if ( !bIsInited )
{ {
registOpenclKernel(); registOpenclKernel();
//initialize devices, context, command_queue //initialize devices, context, command_queue
...@@ -506,7 +506,7 @@ bool OpenclDevice::initOpenclRunEnv( int argc ) ...@@ -506,7 +506,7 @@ bool OpenclDevice::initOpenclRunEnv( int argc )
{ {
SAL_INFO("sc.opencl", "USE float type"); SAL_INFO("sc.opencl", "USE float type");
} }
isInited = 1; bIsInited = true;
} }
return false; return false;
} }
......
...@@ -151,7 +151,7 @@ class OpenclDevice ...@@ -151,7 +151,7 @@ class OpenclDevice
{ {
public: public:
static GPUEnv gpuEnv; static GPUEnv gpuEnv;
static int isInited; static bool bIsInited;
static OString maCacheFolder; static OString maCacheFolder;
static void registOpenclKernel(); static void registOpenclKernel();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment