Files
compute-runtime/opencl/test/unit_test/mocks/mock_program.cpp
Warchulski, Jaroslaw aed890a219 Move files between shared/test/unit_test and /common (fixtures, helpers, mocks)
unit_test/fixtures/mock_aub_center_fixture.h -> common/fixtures
unit_test/helpers/raii_hw_helper.h -> common/helpers
unit_test/helpers/static_size3.h -> common/helpers
unit_test/helpers/ult_limits.h -> common/helpers
unit_test/memory_manager/mock_prefetch_manager.h -> common/memory_manager
common/mocks/mock_aub_stream.h -> unit_test/mocks
common/mocks/mock_csr_simulated_common_hw.h -> unit_test/mocks
common/mocks/mock_direct_submission_diagnostic_collector.h -> unit_test/mocks
common/mocks/mock_lrca_helper.h -> unit_test/mocks
common/mocks/mock_tbx_stream.h -> unit_test/mocks
common/mocks/linux/mock_os_context_linux.h -> unit_test/mocks/linux
common/mocks/windows/mock_wddm_direct_submission.h -> unit_test/mocks/windows

Related-To: NEO-6524
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2022-08-11 12:53:19 +02:00

44 lines
1.6 KiB
C++

/*
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/test/unit_test/mocks/mock_program.h"
#include "shared/source/compiler_interface/compiler_cache.h"
#include "shared/source/device_binary_format/patchtokens_decoder.h"
#include "shared/source/helpers/hash.h"
#include "shared/source/program/program_info_from_patchtokens.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/helpers/ult_limits.h"
#include "shared/test/common/mocks/mock_compiler_interface.h"
#include "shared/test/common/mocks/mock_compilers.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "opencl/source/context/context.h"
#include "opencl/source/program/create.inl"
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
namespace NEO {
ClDeviceVector toClDeviceVector(ClDevice &clDevice) {
ClDeviceVector deviceVector;
deviceVector.push_back(&clDevice);
return deviceVector;
}
int MockProgram::getInternalOptionsCalled = 0;
std::string MockProgram::getCachedFileName() const {
CompilerCache cache(CompilerCacheConfig{});
auto hwInfo = this->context->getDevice(0)->getHardwareInfo();
auto input = ArrayRef<const char>(this->sourceCode.c_str(), this->sourceCode.size());
auto opts = ArrayRef<const char>(this->options.c_str(), this->options.size());
auto internalOptions = getInternalOptions();
auto internalOpts = ArrayRef<const char>(internalOptions.c_str(), internalOptions.size());
return cache.getCachedFileName(hwInfo, input, opts, internalOpts);
}
} // namespace NEO