Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
uditagarwal97 committed Dec 9, 2024
1 parent e129442 commit 6f151d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
13 changes: 7 additions & 6 deletions sycl/source/detail/os_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <sycl/detail/os_util.hpp>

#include <cassert>
#include <iostream>
#include <limits>
#if __GNUC__ && __GNUC__ < 8
// Don't include <filesystem> for GCC versions less than 8
Expand Down Expand Up @@ -284,12 +285,12 @@ size_t OSUtil::getDirectorySize(const std::string &Path) {
DirSizeVar = 0;
// Use ftw for Linux and darwin as they support posix.
#if defined(__SYCL_RT_OS_LINUX) || defined(__SYCL_RT_OS_DARWIN)
auto SumSize =
[](const char *Fpath, const struct stat *StatBuf, int TypeFlag) {
if (TypeFlag == FTW_F)
DirSizeVar += StatBuf->st_size;
return 0;
};
auto SumSize = []([[maybe_unused]] const char *Fpath,
const struct stat *StatBuf, [[maybe_unused]] int TypeFlag) {
if (TypeFlag == FTW_F)
DirSizeVar += StatBuf->st_size;
return 0;
};

if (ftw(Path.c_str(),SumSize, 1) == -1)
std::cerr << "Failed to get directory size: " << Path << std::endl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@ TEST_P(PersistentDeviceCodeCache, BasicEviction) {

// Get Cache size and size of each entry. Set eviction threshold so that
// just one item is evicted.
size_t CurrentCacheSize = 0;
size_t SizeOfOneEntry =
(size_t)(detail::OSUtil::getDirectorySize(CacheRoot)) + 10;

Expand Down

0 comments on commit 6f151d3

Please sign in to comment.