mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 19:32:25 +08:00
WA Passing function pointers to gtpin
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
beb04bd2f8
commit
c0853b95ec
@@ -22,6 +22,21 @@ bool isGTPinInitialized = false;
|
||||
gtpin::ocl::gtpin_events_t GTPinCallbacks = {0};
|
||||
} // namespace NEO
|
||||
|
||||
// Do not change this code, needed to avoid compiler optimization that breaks GTPin_Init
|
||||
// Beginning
|
||||
void passCreateBuffer(BufferAllocateFPTR src, BufferAllocateFPTR &dst) {
|
||||
dst = src;
|
||||
}
|
||||
void passFreeBuffer(BufferDeallocateFPTR src, BufferDeallocateFPTR &dst) {
|
||||
dst = src;
|
||||
}
|
||||
void passMapBuffer(BufferMapFPTR src, BufferMapFPTR &dst) {
|
||||
dst = src;
|
||||
}
|
||||
void passUnMapBuffer(BufferUnMapFPTR src, BufferUnMapFPTR &dst) {
|
||||
dst = src;
|
||||
}
|
||||
// End of WA
|
||||
GTPIN_DI_STATUS GTPin_Init(gtpin::ocl::gtpin_events_t *pGtpinEvents, driver_services_t *pDriverServices,
|
||||
interface_version_t *pDriverVersion) {
|
||||
if (isGTPinInitialized) {
|
||||
@@ -48,11 +63,18 @@ GTPIN_DI_STATUS GTPin_Init(gtpin::ocl::gtpin_events_t *pGtpinEvents, driver_serv
|
||||
return GTPIN_DI_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
pDriverServices->bufferAllocate = NEO::gtpinCreateBuffer;
|
||||
pDriverServices->bufferDeallocate = NEO::gtpinFreeBuffer;
|
||||
pDriverServices->bufferMap = NEO::gtpinMapBuffer;
|
||||
pDriverServices->bufferUnMap = NEO::gtpinUnmapBuffer;
|
||||
// Do not change this code, needed to avoid compiler optimization that breaks GTPin_Init
|
||||
// Beginning
|
||||
auto createBuffer = NEO::gtpinCreateBuffer;
|
||||
auto freeBuffer = NEO::gtpinFreeBuffer;
|
||||
auto mapBuffer = NEO::gtpinMapBuffer;
|
||||
auto unMapBuffer = NEO::gtpinUnmapBuffer;
|
||||
|
||||
passCreateBuffer(createBuffer, pDriverServices->bufferAllocate);
|
||||
passFreeBuffer(freeBuffer, pDriverServices->bufferDeallocate);
|
||||
passMapBuffer(mapBuffer, pDriverServices->bufferMap);
|
||||
passUnMapBuffer(unMapBuffer, pDriverServices->bufferUnMap);
|
||||
// End of WA
|
||||
GTPinCallbacks = *pGtpinEvents;
|
||||
isGTPinInitialized = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user