Define variable with binary name suffix

use this variable in tests as it is set once in main.cpp
create function to get binary kernel filename

Change-Id: Ibf7b4c2d390caefda4a5d7fc4667006e7f2edde8
This commit is contained in:
Mateusz Jablonski
2018-04-24 13:06:49 +02:00
committed by sys_ocldev
parent 103fe670bd
commit 180de340d8
25 changed files with 124 additions and 259 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -23,8 +23,6 @@
#include "cl_api_tests.h"
#include "runtime/context/context.h"
#include "runtime/helpers/file_io.h"
#include "runtime/helpers/hw_info.h"
#include "runtime/helpers/options.h"
#include "unit_tests/helpers/test_files.h"
#include "unit_tests/mocks/mock_program.h"
@ -40,11 +38,8 @@ TEST_F(clCreateKernelTests, returnsSuccess) {
cl_int binaryStatus = CL_SUCCESS;
void *pBinary = nullptr;
size_t binarySize = 0;
std::string testFile(testFiles);
testFile.append("CopyBuffer_simd8_");
testFile.append(hardwarePrefix[platformDevices[0]->pPlatform->eProductFamily]);
testFile.append(".bin");
std::string testFile;
retrieveBinaryKernelFilename(testFile, "CopyBuffer_simd8_", ".bin");
binarySize = loadDataFromFile(
testFile.c_str(),
@ -118,11 +113,8 @@ TEST_F(clCreateKernelTests, invalidParams) {
cl_int binaryStatus = CL_SUCCESS;
void *pBinary = nullptr;
size_t binarySize = 0;
std::string testFile(testFiles);
testFile.append("CopyBuffer_simd8_");
testFile.append(hardwarePrefix[platformDevices[0]->pPlatform->eProductFamily]);
testFile.append(".bin");
std::string testFile;
retrieveBinaryKernelFilename(testFile, "CopyBuffer_simd8_", ".bin");
binarySize = loadDataFromFile(
testFile.c_str(),