diff options
Diffstat (limited to 'src/backends/cl/ClRegistryInitializer.cpp')
-rw-r--r-- | src/backends/cl/ClRegistryInitializer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backends/cl/ClRegistryInitializer.cpp b/src/backends/cl/ClRegistryInitializer.cpp index 8decd6f689..aadc14bd68 100644 --- a/src/backends/cl/ClRegistryInitializer.cpp +++ b/src/backends/cl/ClRegistryInitializer.cpp @@ -18,6 +18,14 @@ static BackendRegistry::StaticRegistryInitializer g_RegisterHelper ClBackend::GetIdStatic(), []() { + // Check if we have a CustomMemoryAllocator associated with the backend + // and if so register it with the backend. + auto customAllocators = BackendRegistryInstance().GetAllocators(); + auto allocatorIterator = customAllocators.find(ClBackend::GetIdStatic()); + if (allocatorIterator != customAllocators.end()) + { + return IBackendInternalUniquePtr(new ClBackend(allocatorIterator->second)); + } return IBackendInternalUniquePtr(new ClBackend); } }; |