|
|
@ -5160,10 +5160,15 @@ public: |
|
|
|
MatAllocator* matStdAllocator; |
|
|
|
MatAllocator* matStdAllocator; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// This line should not force OpenCL runtime initialization! (don't put "new OpenCLAllocator()" here)
|
|
|
|
|
|
|
|
static MatAllocator *ocl_allocator = NULL; |
|
|
|
MatAllocator* getOpenCLAllocator() |
|
|
|
MatAllocator* getOpenCLAllocator() |
|
|
|
{ |
|
|
|
{ |
|
|
|
static MatAllocator * allocator = new OpenCLAllocator(); |
|
|
|
if (ocl_allocator == NULL) |
|
|
|
return allocator; |
|
|
|
{ |
|
|
|
|
|
|
|
ocl_allocator = new OpenCLAllocator(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return ocl_allocator; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////// Utility functions /////////////////////////////////////////////////
|
|
|
|
///////////////////////////////////////////// Utility functions /////////////////////////////////////////////////
|
|
|
|