Files
compute-runtime/unit_tests/fixtures/program_fixture.inl
Kamil Diedrich e1eab521e7 use release for cl-objects instead of delete
- fix for data race in events
- modification of the addition child event

Change-Id: I6ea3a413f13f13a91d37d20d8b9fad37d0ffafb9
2019-02-05 14:09:32 +01:00

58 lines
1.6 KiB
C++

/*
* Copyright (C) 2017-2019 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) {
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