Skip to content

Commit

Permalink
More descriptive name.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaycedowell committed Mar 25, 2022
1 parent 8851fb7 commit 3547518
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/bifrost/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ extern "C" {
#define BF_GPU_MAX_ARCH @GPU_MAX_ARCH@
#define BF_GPU_SHAREDMEM @GPU_SHAREDMEM@
#define BF_GPU_MANAGEDMEM @GPU_PASCAL_MANAGEDMEM@
#define BF_GPU_MAP_CACHE @HAVE_MAP_CACHE@
#define BF_GPU_MAP_CACHE_VERSION (1000*@PACKAGE_VERSION_MAJOR@ + 10*@PACKAGE_VERSION_MINOR@)
#define BF_MAP_KERNEL_DISK_CACHE @HAVE_MAP_CACHE@
#define BF_MAP_KERNEL_DISK_CACHE_VERSION (1000*@PACKAGE_VERSION_MAJOR@ + 10*@PACKAGE_VERSION_MINOR@)

// Features
#define BF_FLOAT128_ENABLED @HAVE_FLOAT128@
Expand Down
12 changes: 6 additions & 6 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ BFstatus build_map_kernel(int* external_ndim,
return BF_STATUS_SUCCESS;
}

#if defined(BF_GPU_MAP_CACHE) && BF_GPU_MAP_CACHE
#if defined(BF_MAP_KERNEL_DISK_CACHE) && BF_MAP_KERNEL_DISK_CACHE
class DiskCacheMgr {
std::string _cachedir;
std::string _indexfile;
Expand All @@ -420,7 +420,7 @@ class DiskCacheMgr {
if( !file_exists(_cachedir + "cache.version") ) {
try {
info.open(_cachedir + "cache.version", std::ios::out);
info << BF_GPU_MAP_CACHE_VERSION << " " << rt << " " << drv << endl;
info << BF_MAP_KERNEL_DISK_CACHE_VERSION << " " << rt << " " << drv << endl;
info.close();
} catch( std::exception ) {}
}
Expand All @@ -447,7 +447,7 @@ class DiskCacheMgr {
cached_mc = cached_rt = cached_drv = -1;
}

if( BF_GPU_MAP_CACHE_VERSION != cached_mc || rt != cached_rt || drv != cached_drv ) {
if( BF_MAP_KERNEL_DISK_CACHE_VERSION != cached_mc || rt != cached_rt || drv != cached_drv ) {
status = false;
}

Expand Down Expand Up @@ -692,7 +692,7 @@ BFstatus bfMap(int ndim,
}
std::string cache_key = cache_key_ss.str();

#if defined(BF_GPU_MAP_CACHE) && BF_GPU_MAP_CACHE
#if defined(BF_MAP_KERNEL_DISK_CACHE) && BF_MAP_KERNEL_DISK_CACHE
DiskCacheMgr::get().load(&kernel_cache);
#endif

Expand Down Expand Up @@ -723,7 +723,7 @@ BFstatus bfMap(int ndim,
BF_TRY(kernel.set(kernel_name.c_str(), ptx.c_str()));
kernel_cache.insert(cache_key,
std::make_pair(kernel, basic_indexing_only));
#if defined(BF_GPU_MAP_CACHE) && BF_GPU_MAP_CACHE
#if defined(BF_MAP_KERNEL_DISK_CACHE) && BF_MAP_KERNEL_DISK_CACHE
DiskCacheMgr::get().save(cache_key, kernel_name, ptx, basic_indexing_only);
#endif
}
Expand Down Expand Up @@ -789,7 +789,7 @@ BFstatus bfMap(int ndim,
}

BFstatus bfMapClearCache() {
#if defined(BF_GPU_MAP_CACHE) && BF_GPU_MAP_CACHE
#if defined(BF_MAP_KERNEL_DISK_CACHE) && BF_MAP_KERNEL_DISK_CACHE
DiskCacheMgr::get().clear();
#endif
return BF_STATUS_SUCCESS;
Expand Down

0 comments on commit 3547518

Please sign in to comment.