2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2022-05-06 00:52:25 +08:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2019-02-27 18:39:32 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-09-29 22:36:48 +08:00
|
|
|
#include <cstdint>
|
|
|
|
#include <memory>
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-09-29 22:36:48 +08:00
|
|
|
class CommandStreamReceiver;
|
|
|
|
class Kernel;
|
|
|
|
class GraphicsAllocation;
|
|
|
|
class Device;
|
2017-12-21 07:45:38 +08:00
|
|
|
struct MultiDispatchInfo;
|
|
|
|
|
|
|
|
class PrintfHandler {
|
|
|
|
public:
|
2022-09-29 22:36:48 +08:00
|
|
|
static PrintfHandler *create(const MultiDispatchInfo &multiDispatchInfo, Device &deviceArg);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-05-06 00:52:25 +08:00
|
|
|
MOCKABLE_VIRTUAL ~PrintfHandler();
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
void prepareDispatch(const MultiDispatchInfo &multiDispatchInfo);
|
|
|
|
void makeResident(CommandStreamReceiver &commandStreamReceiver);
|
2022-05-06 00:52:25 +08:00
|
|
|
MOCKABLE_VIRTUAL bool printEnqueueOutput();
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
GraphicsAllocation *getSurface() {
|
|
|
|
return printfSurface;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2022-09-29 22:36:48 +08:00
|
|
|
PrintfHandler(Device &device);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2021-09-01 08:34:29 +08:00
|
|
|
std::unique_ptr<uint32_t> printfSurfaceInitialDataSizePtr;
|
2022-09-29 22:36:48 +08:00
|
|
|
Device &device;
|
2017-12-21 07:45:38 +08:00
|
|
|
Kernel *kernel = nullptr;
|
|
|
|
GraphicsAllocation *printfSurface = nullptr;
|
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|