mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Move OsContext id setting to constructor.
Change-Id: I1b809befc02536257800e3667307b8deabd5c95d
This commit is contained in:
committed by
sys_ocldev
parent
8e33ec04c5
commit
581805cc88
@@ -387,9 +387,12 @@ RequirementsStatus MemoryManager::checkAllocationsForOverlapping(AllocationRequi
|
||||
}
|
||||
|
||||
void MemoryManager::registerOsContext(OsContext *contextToRegister) {
|
||||
auto contextId = contextToRegister->getContextId();
|
||||
if (contextId + 1 > registeredOsContexts.size()) {
|
||||
registeredOsContexts.resize(contextId + 1);
|
||||
}
|
||||
contextToRegister->incRefInternal();
|
||||
contextToRegister->setContextId(static_cast<uint32_t>(registeredOsContexts.size()));
|
||||
registeredOsContexts.push_back(contextToRegister);
|
||||
registeredOsContexts[contextToRegister->getContextId()] = contextToRegister;
|
||||
}
|
||||
|
||||
bool MemoryManager::getAllocationData(AllocationData &allocationData, bool allocateMemory, const void *hostPtr, size_t size, GraphicsAllocation::AllocationType type) {
|
||||
|
||||
Reference in New Issue
Block a user