2021-07-21 16:47:43 +08:00
|
|
|
/*
|
2023-01-12 00:46:43 +08:00
|
|
|
* Copyright (C) 2021-2023 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"
|
2022-11-23 19:29:58 +08:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2022-06-15 19:49:38 +08:00
|
|
|
|
2022-11-23 19:29:58 +08:00
|
|
|
#include <map>
|
2022-06-15 19:49:38 +08:00
|
|
|
#include <string>
|
2021-07-21 16:47:43 +08:00
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
namespace NEO {
|
2023-09-12 05:29:01 +08:00
|
|
|
|
|
|
|
const char legacyPlatformName[] = "Intel(R) OpenCL";
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-01-12 00:46:43 +08:00
|
|
|
bool AILConfiguration::sourcesContain(const std::string &sources, std::string_view contentToFind) const {
|
|
|
|
return (sources.find(contentToFind) != std::string::npos);
|
2021-07-21 16:47:43 +08:00
|
|
|
}
|
2022-11-23 19:29:58 +08:00
|
|
|
|
2022-06-15 19:49:38 +08:00
|
|
|
} // namespace NEO
|