Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gpucache_new
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianxing wang
gpucache_new
Commits
0e313a92
Commit
0e313a92
authored
May 13, 2024
by
tianxing wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug where cache would never be allocated at the specified device_id
parent
164a18c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
src/cache.cuh
+4
-0
test/cache_test.cu
+2
-2
No files found.
src/cache.cuh
View file @
0e313a92
...
...
@@ -14,6 +14,10 @@ namespace gpucache {
// printf("Cache: keySize: %lu, valueSize: %u, dim: %u, capacity: %lu, "
// "maxQueryNum: %u, deviceId: %u\n",
// sizeof(KeyType), value_size, dim, capacity, max_query_num, device_id);
int device_count;
CUDA_CHECK(cudaGetDeviceCount(&device_count));
assert(device_id < device_count && "device_id should less than total device num");
CUDA_CHECK(cudaSetDevice(device_id));
CUDA_CHECK(cudaMalloc((void **) &keys, capacity * key_size));
CUDA_CHECK(cudaMalloc((void **) &values, capacity * value_size));
CUDA_CHECK(cudaMalloc((void **) ×tamps, capacity * sizeof(uint8_t)));
...
...
test/cache_test.cu
View file @
0e313a92
...
...
@@ -231,7 +231,7 @@ namespace gpucache{
cfg.capacity = 4096 * 2;
cfg.key_size = 4;
cfg.max_query_num = 2048;
cfg.device_id =
0
;
cfg.device_id =
1
;
cfg.dim = 172;
FIFOCache<int32_t,uint32_t> *cache = NewFIFOCache<int32_t,uint32_t>(cfg);
...
...
@@ -247,7 +247,7 @@ namespace gpucache{
cfg.capacity = 4096 * 2;
cfg.key_size = 4;
cfg.max_query_num = 2048;
cfg.device_id =
0
;
cfg.device_id =
2
;
cfg.dim = 172;
LFUCache<int32_t,uint32_t> *cache = NewLFUCache<int32_t,uint32_t>(cfg);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment