2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2018-11-23 17:19:46 +08:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "runtime/context/context.h"
|
|
|
|
#include "runtime/sharings/sharing_factory.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
#include <memory>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
class MockContext : public Context {
|
|
|
|
public:
|
2018-03-23 22:55:13 +08:00
|
|
|
using Context::sharingFunctions;
|
2019-06-26 22:21:45 +08:00
|
|
|
using Context::svmAllocsManager;
|
2017-12-21 07:45:38 +08:00
|
|
|
MockContext(Device *device, bool noSpecialQueue = false);
|
|
|
|
MockContext(
|
|
|
|
void(CL_CALLBACK *funcNotify)(const char *, const void *, size_t, void *),
|
|
|
|
void *data);
|
|
|
|
MockContext();
|
|
|
|
~MockContext();
|
|
|
|
|
|
|
|
void setMemoryManager(MemoryManager *mm) {
|
|
|
|
memoryManager = mm;
|
|
|
|
}
|
|
|
|
|
|
|
|
void clearSharingFunctions();
|
|
|
|
void setSharingFunctions(SharingFunctions *sharingFunctions);
|
2018-11-23 17:19:46 +08:00
|
|
|
void setContextType(ContextType contextType);
|
2017-12-21 07:45:38 +08:00
|
|
|
void releaseSharingFunctions(SharingType sharing);
|
2019-01-28 15:27:26 +08:00
|
|
|
void resetSharingFunctions(SharingType sharing);
|
2018-08-06 15:22:04 +08:00
|
|
|
void registerSharingWithId(SharingFunctions *sharing, SharingType sharingId);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
cl_bool peekPreferD3dSharedResources() { return preferD3dSharedResources; }
|
|
|
|
|
|
|
|
void forcePreferD3dSharedResources(cl_bool value) { preferD3dSharedResources = value; }
|
2018-03-02 20:39:22 +08:00
|
|
|
DriverDiagnostics *getDriverDiagnostics() { return this->driverDiagnostics; }
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
private:
|
2018-06-27 21:53:35 +08:00
|
|
|
Device *device;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|