Skip to content

Commit

Permalink
Oclgrind claims to have zero cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Dec 6, 2023
1 parent 4a9da07 commit 1eb5649
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rts/c/backends/opencl.h
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,12 @@ static void setup_opencl_with_command_queue(struct futhark_context *ctx,
cl_ulong cache_size;
OPENCL_SUCCEED_FATAL(clGetDeviceInfo(device_option.device, CL_DEVICE_GLOBAL_MEM_CACHE_SIZE,
sizeof(cache_size), &cache_size, NULL));

if (cache_size == 0) {
// Some code assumes nonzero cache.
cache_size = 1024*1024;
}

ctx->max_cache = cache_size;

ctx->max_registers = 1<<16; // I cannot find a way to query for this.
Expand Down

0 comments on commit 1eb5649

Please sign in to comment.