diff --git a/Android.bp b/Android.bp index 798b1af302..ba547ac520 100644 --- a/Android.bp +++ b/Android.bp @@ -38,6 +38,8 @@ cc_defaults { shared_libs: [ "libgmm_umd", + "libcutils", + "liblog", ], static_libs: [ diff --git a/shared/source/compiler_interface/linux/os_compiler_cache_helper.cpp b/shared/source/compiler_interface/linux/os_compiler_cache_helper.cpp index f7ab23092a..1ae85a0271 100644 --- a/shared/source/compiler_interface/linux/os_compiler_cache_helper.cpp +++ b/shared/source/compiler_interface/linux/os_compiler_cache_helper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Intel Corporation + * Copyright (C) 2023-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,9 +13,13 @@ #include "shared/source/utilities/io_functions.h" #include "os_inc.h" +#include #include #include +#include +#define LOG_TAG "COMPUTE_RUNTIME" +#define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) namespace NEO { int64_t defaultCacheEnabled() { @@ -47,26 +51,40 @@ bool createCompilerCachePath(std::string &cacheDir) { bool checkDefaultCacheDirSettings(std::string &cacheDir, NEO::EnvironmentVariableReader &reader) { std::string emptyString = ""; cacheDir = reader.getSetting("XDG_CACHE_HOME", emptyString); +#ifdef ANDROID + ALOGE("Ratne1: %s: CacheDir for openCL", cacheDir.c_str()); +#endif if (cacheDir.empty()) { cacheDir = reader.getSetting("HOME", emptyString); if (cacheDir.empty()) { return false; } +#ifdef ANDROID + ALOGE("Ratne1: %s: CacheDir2 for openCL", cacheDir.c_str()); +#endif - // .cache might not exist on fresh installation cacheDir = joinPath(cacheDir, ".cache/"); - if (!NEO::SysCalls::pathExists(cacheDir)) { + if (!NEO::SysCalls::pathExists(cacheDir)) { NEO::SysCalls::mkdir(cacheDir); } +#ifdef ANDROID + ALOGE("Ratne1: %s: CacheDir3 for openCL", cacheDir.c_str()); +#endif - return createCompilerCachePath(cacheDir); + return createCompilerCachePath(cacheDir); } if (NEO::SysCalls::pathExists(cacheDir)) { +#ifdef ANDROID + ALOGE("Ratne1: %s: CacheDir4 for openCL", cacheDir.c_str()); +#endif return createCompilerCachePath(cacheDir); } +#ifdef ANDROID + ALOGE("Ratne1: %s: CacheDir5 for openCL", cacheDir.c_str()); +#endif return false; } @@ -85,4 +103,4 @@ size_t getFileSize(const std::string &path) { } return 0u; } -} // namespace NEO \ No newline at end of file +} // namespace NEO