mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add refcount on MemObj in blocked scenarios.
- Prevents destruction of MemObj while it may still be in use. - Add UNRECOVERABLE to check whether object is deleted while having dependencies, fix all problems is tests due to that fact. - Fix special queue setting, clean interfaces. Change-Id: I2a467e80df00ea1650decdcfa6866acf10b441f8
This commit is contained in:

committed by
sys_ocldev

parent
c838a7dfc6
commit
b00819cafe
@ -87,11 +87,12 @@ CommandQueue *Context::getSpecialQueue() {
|
||||
|
||||
void Context::setSpecialQueue(CommandQueue *commandQueue) {
|
||||
specialQueue = commandQueue;
|
||||
if (commandQueue) {
|
||||
decRefInternal();
|
||||
} else {
|
||||
incRefInternal();
|
||||
}
|
||||
}
|
||||
void Context::overrideSpecialQueueAndDecrementRefCount(CommandQueue *commandQueue) {
|
||||
setSpecialQueue(commandQueue);
|
||||
commandQueue->setIsSpecialCommandQueue(true);
|
||||
//decrement ref count that special queue added
|
||||
this->decRefInternal();
|
||||
};
|
||||
|
||||
bool Context::isSpecialQueue(CommandQueue *commandQueue) {
|
||||
@ -179,8 +180,7 @@ bool Context::createImpl(const cl_context_properties *properties,
|
||||
|
||||
auto commandQueue = CommandQueue::create(this, devices[0], nullptr, errcodeRet);
|
||||
DEBUG_BREAK_IF(commandQueue == nullptr);
|
||||
|
||||
setSpecialQueue(commandQueue);
|
||||
overrideSpecialQueueAndDecrementRefCount(commandQueue);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -92,6 +92,7 @@ class Context : public BaseObject<_cl_context> {
|
||||
|
||||
CommandQueue *getSpecialQueue();
|
||||
void setSpecialQueue(CommandQueue *commandQueue);
|
||||
void overrideSpecialQueueAndDecrementRefCount(CommandQueue *commandQueue);
|
||||
bool isSpecialQueue(CommandQueue *commandQueue);
|
||||
void deleteSpecialQueue();
|
||||
|
||||
|
Reference in New Issue
Block a user