mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 08:07:19 +08:00
refactor: Remove globaly enabled cl_cache
Current behaviour will be detecd path existence Related-To: NEO-4262 Signed-off-by: Diedrich, Kamil <kamil.diedrich@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ef10c98497
commit
5149d74141
@@ -14,6 +14,7 @@
|
||||
#include <iostream>
|
||||
#include <poll.h>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <sys/file.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -25,6 +26,16 @@ namespace NEO {
|
||||
|
||||
namespace SysCalls {
|
||||
|
||||
bool pathExists(const std::string &path) {
|
||||
struct stat statbuf = {};
|
||||
|
||||
if (stat(path.c_str(), &statbuf) == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (statbuf.st_mode & S_IFDIR) != 0;
|
||||
}
|
||||
|
||||
void exit(int code) {
|
||||
std::exit(code);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
namespace SysCalls {
|
||||
@@ -17,6 +19,8 @@ unsigned long getNumThreads();
|
||||
|
||||
void exit(int code);
|
||||
|
||||
bool pathExists(const std::string &path);
|
||||
|
||||
} // namespace SysCalls
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "shared/source/os_interface/windows/sys_calls.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -39,6 +40,12 @@ unsigned long getNumThreads() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool pathExists(const std::string &path) {
|
||||
DWORD ret = GetFileAttributesA(path.c_str());
|
||||
|
||||
return ret == FILE_ATTRIBUTE_DIRECTORY;
|
||||
}
|
||||
|
||||
HANDLE createEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) {
|
||||
return CreateEventA(lpEventAttributes, bManualReset, bInitialState, lpName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user