mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user