Files
compute-runtime/unit_tests/mocks/mock_context.h
Krzysztof Gibala 407c0213f1 Add clGetMemAllocInfoIntel
Related-To: NEO-3317
Change-Id: If46be932e170d45793fe143ebb54fcfb0cda9ccc
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
2019-07-01 09:45:31 +02:00

46 lines
1.3 KiB
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "runtime/context/context.h"
#include "runtime/sharings/sharing_factory.h"
#include <memory>
namespace NEO {
class MockContext : public Context {
public:
using Context::sharingFunctions;
using Context::svmAllocsManager;
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);
void setContextType(ContextType contextType);
void releaseSharingFunctions(SharingType sharing);
void resetSharingFunctions(SharingType sharing);
void registerSharingWithId(SharingFunctions *sharing, SharingType sharingId);
cl_bool peekPreferD3dSharedResources() { return preferD3dSharedResources; }
void forcePreferD3dSharedResources(cl_bool value) { preferD3dSharedResources = value; }
DriverDiagnostics *getDriverDiagnostics() { return this->driverDiagnostics; }
private:
Device *device;
};
} // namespace NEO