Implement scheduler APIs

Add logic to implement following scheduler APIs
-zetSysmanSchedulerGetCurrentMode
-zetSysmanSchedulerGetTimeoutModeProperties
-zetSysmanSchedulerGetTimesliceModeProperties
-zetSysmanSchedulerSetTimeoutMode
-zetSysmanSchedulerSetTimesliceMode
-zetSysmanSchedulerSetExclusiveMode

Change-Id: I134b200ffd6b13bc50b1f38e955dd584455b4b38
Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
This commit is contained in:
Jitendra Sharma
2020-04-15 13:16:36 +05:30
parent 49f2a5157a
commit 5374a0ffc1
12 changed files with 312 additions and 41 deletions

View File

@@ -360,6 +360,24 @@ ze_result_t SysfsAccess::read(const std::string file, double &val) {
return ZE_RESULT_SUCCESS;
}
ze_result_t SysfsAccess::read(const std::string file, uint64_t &val) {
std::string str;
ze_result_t result;
result = FsAccess::read(fullPath(file), str);
if (ZE_RESULT_SUCCESS != result) {
return result;
}
std::istringstream stream(str);
stream >> val;
if (stream.fail()) {
return ZE_RESULT_ERROR_UNKNOWN;
}
return ZE_RESULT_SUCCESS;
}
ze_result_t SysfsAccess::read(const std::string file, std::vector<std::string> &val) {
// Prepend sysfs directory path and call the base read
return FsAccess::read(fullPath(file), val);
@@ -390,6 +408,16 @@ ze_result_t SysfsAccess::write(const std::string file, const double val) {
return FsAccess::write(fullPath(file), stream.str());
}
ze_result_t SysfsAccess::write(const std::string file, const uint64_t val) {
std::ostringstream stream;
stream << val;
if (stream.fail()) {
return ZE_RESULT_ERROR_UNKNOWN;
}
return FsAccess::write(fullPath(file), stream.str());
}
ze_result_t SysfsAccess::readSymLink(const std::string path, std::string &val) {
// Prepend sysfs directory path and call the base readSymLink
return FsAccess::readSymLink(fullPath(path).c_str(), val);