mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 02:18:05 +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
@@ -5,13 +5,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "unit_tests/mocks/mock_compilers.h"
|
||||
#include "mock_compilers.h"
|
||||
|
||||
#include "runtime/helpers/file_io.h"
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/helpers/options.h"
|
||||
#include "runtime/os_interface/os_inc_base.h"
|
||||
#include "unit_tests/helpers/test_files.h"
|
||||
#include "unit_tests/mocks/mock_compilers.h"
|
||||
#include "unit_tests/mocks/mock_sip.h"
|
||||
|
||||
#include "cif/macros/enable.h"
|
||||
@@ -491,6 +492,28 @@ IGC::OclTranslationOutputBase *MockIgcOclTranslationCtx::TranslateImpl(
|
||||
return out;
|
||||
}
|
||||
|
||||
bool MockIgcOclTranslationCtx::GetSpecConstantsInfoImpl(
|
||||
CIF::Builtins::BufferSimple *src,
|
||||
CIF::Builtins::BufferSimple *outSpecConstantsIds,
|
||||
CIF::Builtins::BufferSimple *outSpecConstantsSizes) {
|
||||
return true;
|
||||
}
|
||||
|
||||
IGC::OclTranslationOutputBase *MockIgcOclTranslationCtx::TranslateImpl(
|
||||
CIF::Version_t outVersion,
|
||||
CIF::Builtins::BufferSimple *src,
|
||||
CIF::Builtins::BufferSimple *specConstantsIds,
|
||||
CIF::Builtins::BufferSimple *specConstantsValues,
|
||||
CIF::Builtins::BufferSimple *options,
|
||||
CIF::Builtins::BufferSimple *internalOptions,
|
||||
CIF::Builtins::BufferSimple *tracingOptions,
|
||||
uint32_t tracingOptionsCount,
|
||||
void *gtPinInput) {
|
||||
auto out = new MockOclTranslationOutput();
|
||||
translate(true, src, options, internalOptions, out);
|
||||
return out;
|
||||
}
|
||||
|
||||
MockOclTranslationOutput::MockOclTranslationOutput() {
|
||||
this->log = new MockCIFBuffer();
|
||||
this->output = new MockCIFBuffer();
|
||||
|
||||
@@ -136,6 +136,22 @@ struct MockIgcOclTranslationCtx : MockCIF<IGC::IgcOclTranslationCtxTagOCL> {
|
||||
CIF::Builtins::BufferSimple *tracingOptions,
|
||||
uint32_t tracingOptionsCount,
|
||||
void *gtpinInput) override;
|
||||
|
||||
bool GetSpecConstantsInfoImpl(
|
||||
CIF::Builtins::BufferSimple *src,
|
||||
CIF::Builtins::BufferSimple *outSpecConstantsIds,
|
||||
CIF::Builtins::BufferSimple *outSpecConstantsSizes) override;
|
||||
|
||||
IGC::OclTranslationOutputBase *TranslateImpl(
|
||||
CIF::Version_t outVersion,
|
||||
CIF::Builtins::BufferSimple *src,
|
||||
CIF::Builtins::BufferSimple *specConstantsIds,
|
||||
CIF::Builtins::BufferSimple *specConstantsValues,
|
||||
CIF::Builtins::BufferSimple *options,
|
||||
CIF::Builtins::BufferSimple *internalOptions,
|
||||
CIF::Builtins::BufferSimple *tracingOptions,
|
||||
uint32_t tracingOptionsCount,
|
||||
void *gtPinInput) override;
|
||||
};
|
||||
|
||||
struct MockOclTranslationOutput : MockCIF<IGC::OclTranslationOutputTagOCL> {
|
||||
|
||||
@@ -31,6 +31,7 @@ class MockProgram : public Program {
|
||||
using Program::resolveProgramBinary;
|
||||
using Program::updateNonUniformFlag;
|
||||
|
||||
using Program::areSpecializationConstantsInitialized;
|
||||
using Program::elfBinary;
|
||||
using Program::elfBinarySize;
|
||||
using Program::genBinary;
|
||||
@@ -40,6 +41,9 @@ class MockProgram : public Program {
|
||||
using Program::isProgramBinaryResolved;
|
||||
using Program::isSpirV;
|
||||
using Program::programBinaryType;
|
||||
using Program::specConstantsIds;
|
||||
using Program::specConstantsSizes;
|
||||
using Program::specConstantsValues;
|
||||
|
||||
using Program::sourceCode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user