summaryrefslogtreecommitdiff
path: root/opencl/source/openclwrapper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'opencl/source/openclwrapper.cxx')
-rw-r--r--opencl/source/openclwrapper.cxx70
1 files changed, 35 insertions, 35 deletions
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index d59630c53981..73412e9fff58 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -61,7 +61,13 @@ if( status != CL_SUCCESS ) \
using namespace std;
-namespace opencl {
+namespace {
+
+bool bIsInited = false;
+
+}
+
+namespace openclwrapper {
GPUEnv gpuEnv;
sal_uInt64 kernelFailures = 0;
@@ -69,8 +75,6 @@ sal_uInt64 kernelFailures = 0;
namespace
{
-bool bIsInited = false;
-
OString generateMD5(const void* pData, size_t length)
{
sal_uInt8 pBuffer[RTL_DIGEST_LENGTH_MD5];
@@ -320,38 +324,6 @@ bool initOpenCLAttr( OpenCLEnv * env )
return false;
}
-}
-
-void releaseOpenCLEnv( GPUEnv *gpuInfo )
-{
- OpenCLZone zone;
-
- if ( !bIsInited )
- {
- return;
- }
-
- for (_cl_command_queue* & i : gpuEnv.mpCmdQueue)
- {
- if (i)
- {
- clReleaseCommandQueue(i);
- i = nullptr;
- }
- }
- gpuEnv.mnCmdQueuePos = 0;
-
- if ( gpuEnv.mpContext )
- {
- clReleaseContext( gpuEnv.mpContext );
- gpuEnv.mpContext = nullptr;
- }
- bIsInited = false;
- gpuInfo->mnIsUserCreated = 0;
-}
-
-namespace {
-
bool buildProgram(const char* buildOption, GPUEnv* gpuInfo, int idx)
{
cl_int clStatus;
@@ -958,4 +930,32 @@ bool GPUEnv::isOpenCLEnabled()
}
+void releaseOpenCLEnv( openclwrapper::GPUEnv *gpuInfo )
+{
+ OpenCLZone zone;
+
+ if ( !bIsInited )
+ {
+ return;
+ }
+
+ for (_cl_command_queue* & i : openclwrapper::gpuEnv.mpCmdQueue)
+ {
+ if (i)
+ {
+ clReleaseCommandQueue(i);
+ i = nullptr;
+ }
+ }
+ openclwrapper::gpuEnv.mnCmdQueuePos = 0;
+
+ if ( openclwrapper::gpuEnv.mpContext )
+ {
+ clReleaseContext( openclwrapper::gpuEnv.mpContext );
+ openclwrapper::gpuEnv.mpContext = nullptr;
+ }
+ bIsInited = false;
+ gpuInfo->mnIsUserCreated = 0;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */