2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2018-09-18 15:11:08 +08:00
|
|
|
* Copyright (C) 2017-2018 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
|
2018-04-06 20:25:22 +08:00
|
|
|
#include "runtime/helpers/hw_info.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
#include <cinttypes>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace OCLRT {
|
|
|
|
|
|
|
|
class Device;
|
2018-03-08 22:52:08 +08:00
|
|
|
class Program;
|
2018-03-09 18:52:14 +08:00
|
|
|
class GraphicsAllocation;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
enum class SipKernelType : std::uint32_t {
|
|
|
|
Csr = 0,
|
2018-03-06 22:33:34 +08:00
|
|
|
DbgCsr,
|
|
|
|
DbgCsrLocal,
|
2017-12-21 07:45:38 +08:00
|
|
|
COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
const char *getSipKernelCompilerInternalOptions(SipKernelType kernel);
|
|
|
|
|
|
|
|
const char *getSipLlSrc(const Device &device);
|
|
|
|
|
|
|
|
class SipKernel {
|
|
|
|
public:
|
2018-03-06 22:29:06 +08:00
|
|
|
SipKernel(SipKernelType type, Program *sipProgram);
|
2017-12-21 07:45:38 +08:00
|
|
|
SipKernel(const SipKernel &) = delete;
|
|
|
|
SipKernel &operator=(const SipKernel &) = delete;
|
|
|
|
SipKernel(SipKernel &&) = default;
|
|
|
|
SipKernel &operator=(SipKernel &&) = default;
|
2018-05-14 17:25:18 +08:00
|
|
|
~SipKernel();
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-03-08 22:52:08 +08:00
|
|
|
const char *getBinary() const;
|
2018-01-08 10:25:27 +08:00
|
|
|
|
2018-03-08 22:52:08 +08:00
|
|
|
size_t getBinarySize() const;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-01-08 10:25:27 +08:00
|
|
|
SipKernelType getType() const {
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
2018-03-09 21:40:31 +08:00
|
|
|
static const size_t maxDbgSurfaceSize;
|
|
|
|
|
2018-03-09 18:52:14 +08:00
|
|
|
GraphicsAllocation *getSipAllocation() const;
|
2018-04-06 20:25:22 +08:00
|
|
|
static SipKernelType getSipKernelType(GFXCORE_FAMILY family, bool debuggingActive);
|
2018-03-09 18:52:14 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
protected:
|
|
|
|
SipKernelType type = SipKernelType::COUNT;
|
2018-05-14 17:25:18 +08:00
|
|
|
Program *program = nullptr;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
2018-03-19 17:11:30 +08:00
|
|
|
} // namespace OCLRT
|