mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00

Updating files modified in 2018 only. Older files remain with old style copyright header Change-Id: Ic99f2e190ad74b4b7f2bd79dd7b9fa5fbe36ec92 Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
59 lines
1.6 KiB
C++
59 lines
1.6 KiB
C++
/*
|
|
* Copyright (C) 2017-2018 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "unit_tests/fixtures/program_fixture.h"
|
|
|
|
namespace OCLRT {
|
|
|
|
template <typename T>
|
|
void ProgramFixture::CreateProgramFromBinary(cl_context context,
|
|
cl_device_id *pDeviceList,
|
|
const std::string &binaryFileName,
|
|
cl_int &retVal,
|
|
const std::string &options) {
|
|
Cleanup();
|
|
retVal = CL_SUCCESS;
|
|
|
|
std::string testFile;
|
|
retrieveBinaryKernelFilename(testFile, binaryFileName + "_", ".bin", options);
|
|
|
|
knownSourceSize = loadDataFromFile(
|
|
testFile.c_str(),
|
|
knownSource);
|
|
|
|
ASSERT_NE(0u, knownSourceSize);
|
|
ASSERT_NE(nullptr, knownSource);
|
|
|
|
pProgram = Program::create<T>(
|
|
context,
|
|
1,
|
|
pDeviceList,
|
|
&knownSourceSize,
|
|
(const unsigned char **)&knownSource,
|
|
nullptr,
|
|
retVal);
|
|
}
|
|
|
|
template <typename T>
|
|
void ProgramFixture::CreateProgramFromBinary(cl_context pContext,
|
|
cl_device_id *pDeviceList,
|
|
const std::string &binaryFileName,
|
|
const std::string &options) {
|
|
Cleanup();
|
|
cl_int retVal = CL_SUCCESS;
|
|
CreateProgramFromBinary<T>(
|
|
pContext,
|
|
pDeviceList,
|
|
binaryFileName,
|
|
retVal,
|
|
options);
|
|
|
|
ASSERT_NE(nullptr, pProgram);
|
|
ASSERT_EQ(CL_SUCCESS, retVal);
|
|
}
|
|
} // namespace OCLRT
|