2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2018-09-18 15:11:08 +08:00
|
|
|
* Copyright (C) 2017-2018 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-07-30 23:04:50 +08:00
|
|
|
#include "runtime/helpers/file_io.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
#include "test_files.h"
|
2018-06-11 22:15:11 +08:00
|
|
|
#include "config.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-06-11 22:15:11 +08:00
|
|
|
std::string testFiles("test_files/" NEO_ARCH "/");
|
2017-12-21 07:45:38 +08:00
|
|
|
std::string clFiles("test_files/");
|
2018-04-24 19:06:49 +08:00
|
|
|
std::string binaryNameSuffix("");
|
|
|
|
|
|
|
|
void retrieveBinaryKernelFilename(std::string &outputFilename, const std::string &kernelName, const std::string &extension, const std::string &options) {
|
|
|
|
if (outputFilename.length() > 0) {
|
|
|
|
outputFilename.clear();
|
|
|
|
}
|
|
|
|
outputFilename.reserve(2 * testFiles.length());
|
|
|
|
outputFilename.append(testFiles);
|
|
|
|
outputFilename.append(kernelName);
|
|
|
|
outputFilename.append(binaryNameSuffix);
|
|
|
|
outputFilename.append(extension);
|
|
|
|
outputFilename.append(options);
|
2018-07-30 23:04:50 +08:00
|
|
|
|
|
|
|
if (!fileExists(outputFilename) && (extension == ".bc")) {
|
|
|
|
retrieveBinaryKernelFilename(outputFilename, kernelName, ".spv", options);
|
|
|
|
}
|
|
|
|
}
|