diff --git a/runtime/hsa-runtime/core/util/utils.h b/runtime/hsa-runtime/core/util/utils.h index aab828ee50..69c7c4a26b 100644 --- a/runtime/hsa-runtime/core/util/utils.h +++ b/runtime/hsa-runtime/core/util/utils.h @@ -359,7 +359,11 @@ inline void FlushCpuCache(const void* base, size_t offset, size_t len) { static long cacheline_size = 0; if (!cacheline_size) { - long sz = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); +#ifdef _SC_LEVEL1_DCACHE_LINESIZE + long sz = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); +#else + long sz = 0; +#endif if (sz <= 0) return; cacheline_size = sz; }