mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-23 11:03:02 +08:00
Add AIL functionality
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ab73b61b77
commit
2afb785bba
34
shared/source/ail/linux/ail_configuration_linux.cpp
Normal file
34
shared/source/ail/linux/ail_configuration_linux.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/ail/ail_configuration.h"
|
||||
#include "shared/source/os_interface/linux/sys_calls.h"
|
||||
|
||||
#include <string_view>
|
||||
|
||||
namespace NEO {
|
||||
bool AILConfiguration::initProcessExecutableName() {
|
||||
char path[512] = {0};
|
||||
int result = SysCalls::readlink("/proc/self/exe", path, sizeof(path) - 1);
|
||||
|
||||
if (result == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
path[result] = '\0';
|
||||
std::string_view pathView(path);
|
||||
|
||||
auto lastPosition = pathView.find_last_of("/");
|
||||
|
||||
pathView.remove_prefix(lastPosition + 1u);
|
||||
|
||||
processName = pathView;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user