diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-08-25 15:22:40 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2017-08-25 15:49:34 +0300 |
commit | aa7dc5fa1df23f1a9079305cb362aab018e94848 (patch) | |
tree | 68c4825581e939b4dd8af5c7d1fa7ef848bf4fb8 /opencl/source/openclwrapper.cxx | |
parent | 407a126af45d93f83eb4dbdc358dd569bea4db6f (diff) |
Get rid of need to use initial :: for ::opencl to avoid clash with sc::opencl
Rename the global opencl namespace to openclwrapper. Its public API is
after all declared in a file called openclwrapper.hxx. The confusion
started when part of the OpenCL code was moved out from sc some years
ago.
Change-Id: I98ebd8498b2244804411e5de9169eb619f86070b
Diffstat (limited to 'opencl/source/openclwrapper.cxx')
-rw-r--r-- | opencl/source/openclwrapper.cxx | 70 |
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: */ |