2021-07-21 16:47:43 +08:00
|
|
|
/*
|
2022-06-15 19:49:38 +08:00
|
|
|
* Copyright (C) 2021-2022 Intel Corporation
|
2021-07-21 16:47:43 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "shared/source/ail/ail_configuration.h"
|
|
|
|
|
2022-06-15 19:49:38 +08:00
|
|
|
#include "shared/source/helpers/hash.h"
|
|
|
|
|
|
|
|
#include <string>
|
2021-07-21 16:47:43 +08:00
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
namespace NEO {
|
2022-06-15 19:49:38 +08:00
|
|
|
bool AILConfiguration::isKernelHashCorrect(const std::string &kernelsSources, uint64_t expectedHash) const {
|
|
|
|
const auto hash = Hash::hash(kernelsSources.c_str(), kernelsSources.length());
|
|
|
|
return hash == expectedHash;
|
2021-07-21 16:47:43 +08:00
|
|
|
}
|
|
|
|
|
2022-06-15 19:49:38 +08:00
|
|
|
bool AILConfiguration::sourcesContainKernel(const std::string &kernelsSources, std::string_view kernelName) const {
|
|
|
|
return (kernelsSources.find(kernelName) != std::string::npos);
|
2021-07-21 16:47:43 +08:00
|
|
|
}
|
2022-06-15 19:49:38 +08:00
|
|
|
} // namespace NEO
|