Support for clLink with spec constants

Resolves: NEO-4537

Change-Id: Ic9a9ea8a7d4a83e6a308735b653bdd334cb88bf9
Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
This commit is contained in:
Jaroslaw Chodor
2020-04-02 15:00:23 +02:00
committed by sys_ocldev
parent f096d71a75
commit 7fc44aa60e
4 changed files with 131 additions and 13 deletions

View File

@@ -76,7 +76,7 @@ enum SECTION_HEADER_TYPE : uint32_t {
SHT_NUM = 19, // number of defined types
SHT_LOOS = 0x60000000, // start of os-specifc
SHT_OPENCL_RESERVED_START = 0xff000000, // start of Intel OCL SHT_TYPES
SHT_OPENCL_RESERVED_END = 0xff00000a // end of Intel OCL SHT_TYPES
SHT_OPENCL_RESERVED_END = 0xff00000c // end of Intel OCL SHT_TYPES
};
enum SPECIAL_SECTION_HEADER_NUMBER : uint16_t {

View File

@@ -30,21 +30,23 @@ static_assert(static_cast<uint16_t>(ET_OPENCL_SOURCE) == static_cast<uint16_t>(E
static_assert(static_cast<uint16_t>(ET_OPENCL_DEBUG) == static_cast<uint16_t>(ET_OPENCL_RESERVED_END), "");
enum SHT_OPENCL : uint32_t {
SHT_OPENCL_SOURCE = 0xff000000, // CL source to link into LLVM binary
SHT_OPENCL_HEADER = 0xff000001, // CL header to link into LLVM binary
SHT_OPENCL_LLVM_TEXT = 0xff000002, // LLVM text
SHT_OPENCL_LLVM_BINARY = 0xff000003, // LLVM byte code
SHT_OPENCL_LLVM_ARCHIVE = 0xff000004, // LLVM archives(s)
SHT_OPENCL_DEV_BINARY = 0xff000005, // Device binary (coherent by default)
SHT_OPENCL_OPTIONS = 0xff000006, // CL Options
SHT_OPENCL_PCH = 0xff000007, // PCH (pre-compiled headers)
SHT_OPENCL_DEV_DEBUG = 0xff000008, // Device debug
SHT_OPENCL_SPIRV = 0xff000009, // SPIRV
SHT_NON_COHERENT_DEV_BINARY = 0xff00000a, // Non-coherent Device binary
SHT_OPENCL_SOURCE = 0xff000000, // CL source to link into LLVM binary
SHT_OPENCL_HEADER = 0xff000001, // CL header to link into LLVM binary
SHT_OPENCL_LLVM_TEXT = 0xff000002, // LLVM text
SHT_OPENCL_LLVM_BINARY = 0xff000003, // LLVM byte code
SHT_OPENCL_LLVM_ARCHIVE = 0xff000004, // LLVM archives(s)
SHT_OPENCL_DEV_BINARY = 0xff000005, // Device binary (coherent by default)
SHT_OPENCL_OPTIONS = 0xff000006, // CL Options
SHT_OPENCL_PCH = 0xff000007, // PCH (pre-compiled headers)
SHT_OPENCL_DEV_DEBUG = 0xff000008, // Device debug
SHT_OPENCL_SPIRV = 0xff000009, // SPIRV
SHT_OPENCL_NON_COHERENT_DEV_BINARY = 0xff00000a, // Non-coherent Device binary
SHT_OPENCL_SPIRV_SC_IDS = 0xff00000b, // Specialization Constants IDs
SHT_OPENCL_SPIRV_SC_VALUES = 0xff00000c // Specialization Constants values
};
static_assert(sizeof(SHT_OPENCL) == sizeof(SECTION_HEADER_TYPE), "");
static_assert(static_cast<uint32_t>(SHT_OPENCL_SOURCE) == static_cast<uint32_t>(SHT_OPENCL_RESERVED_START), "");
static_assert(static_cast<uint32_t>(SHT_NON_COHERENT_DEV_BINARY) == static_cast<uint32_t>(SHT_OPENCL_RESERVED_END), "");
static_assert(static_cast<uint32_t>(SHT_OPENCL_SPIRV_SC_VALUES) == static_cast<uint32_t>(SHT_OPENCL_RESERVED_END), "");
namespace SectionNamesOpenCl {
static constexpr ConstStringRef buildOptions = "BuildOptions";
@@ -52,6 +54,8 @@ static constexpr ConstStringRef spirvObject = "SPIRV Object";
static constexpr ConstStringRef llvmObject = "Intel(R) OpenCL LLVM Object";
static constexpr ConstStringRef deviceDebug = "Intel(R) OpenCL Device Debug";
static constexpr ConstStringRef deviceBinary = "Intel(R) OpenCL Device Binary";
static constexpr ConstStringRef spirvSpecConstIds = "SPIRV Specialization Constants Ids";
static constexpr ConstStringRef spirvSpecConstValues = "SPIRV Specialization Constants Values";
} // namespace SectionNamesOpenCl
} // namespace Elf