mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
Add initial implementation of specialization constants
Related-To: NEO-2260 Change-Id: Ib722109039555a028eb4ec0862e9de72342f9730 Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
3a75c4fb71
commit
971eb7a1b4
@@ -131,7 +131,7 @@ cl_int CompilerInterface::build(
|
||||
if (!binaryLoaded) {
|
||||
auto igcTranslationCtx = createIgcTranslationCtx(device, intermediateCodeType, IGC::CodeType::oclGenBin);
|
||||
|
||||
auto igcOutput = translate(igcTranslationCtx.get(), intermediateRepresentation.get(),
|
||||
auto igcOutput = translate(igcTranslationCtx.get(), intermediateRepresentation.get(), program.getSpecConstIdsBuffer().get(), program.getSpecConstValuesBuffer().get(),
|
||||
fclOptions.get(), fclInternalOptions.get(), inputArgs.GTPinInput);
|
||||
|
||||
if (igcOutput == nullptr) {
|
||||
@@ -272,6 +272,27 @@ cl_int CompilerInterface::link(
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
||||
cl_int CompilerInterface::getSpecConstantsInfo(Program &program, const TranslationArgs &inputArgs) {
|
||||
if (false == isCompilerAvailable()) {
|
||||
return CL_COMPILER_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
auto igcTranslationCtx = createIgcTranslationCtx(program.getDevice(0), IGC::CodeType::spirV, IGC::CodeType::oclGenBin);
|
||||
|
||||
auto inSrc = CIF::Builtins::CreateConstBuffer(igcMain.get(), inputArgs.pInput, inputArgs.InputSize);
|
||||
program.getSpecConstIdsBuffer() = CIF::Builtins::CreateConstBuffer(igcMain.get(), nullptr, 0);
|
||||
program.getSpecConstSizesBuffer() = CIF::Builtins::CreateConstBuffer(igcMain.get(), nullptr, 0);
|
||||
program.getSpecConstValuesBuffer() = CIF::Builtins::CreateConstBuffer(igcMain.get(), nullptr, 0);
|
||||
|
||||
auto retVal = getSpecConstantsInfoImpl(igcTranslationCtx.get(), inSrc.get(), program.getSpecConstIdsBuffer().get(), program.getSpecConstSizesBuffer().get(), program.getSpecConstValuesBuffer().get());
|
||||
|
||||
if (!retVal) {
|
||||
return CL_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
||||
cl_int CompilerInterface::createLibrary(
|
||||
Program &program,
|
||||
const TranslationArgs &inputArgs) {
|
||||
|
||||
Reference in New Issue
Block a user