Browse Source

Check the maximum allocable memory size per opencl device.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
89eb1fa393
  1. 2
      miner.h
  2. 7
      ocl.c

2
miner.h

@ -356,9 +356,11 @@ struct cgpu_info { @@ -356,9 +356,11 @@ struct cgpu_info {
int virtual_adl;
int intensity;
bool dynamic;
cl_uint vwidth;
size_t work_size;
enum cl_kernels kernel;
cl_ulong max_alloc;
#ifdef USE_SCRYPT
int lookup_gap;

7
ocl.c

@ -363,6 +363,13 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) @@ -363,6 +363,13 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
}
applog(LOG_DEBUG, "Max work group size reported %d", clState->max_work_size);
status = clGetDeviceInfo(devices[gpu], CL_DEVICE_MAX_MEM_ALLOC_SIZE , sizeof(cl_ulong), (void *)&gpus[gpu].max_alloc, NULL);
if (status != CL_SUCCESS) {
applog(LOG_ERR, "Error %d: Failed to clGetDeviceInfo when trying to get CL_DEVICE_MAX_MEM_ALLOC_SIZE", status);
return NULL;
}
applog(LOG_DEBUG, "Max mem alloc size is %u", gpus[gpu].max_alloc);
/* Create binary filename based on parameters passed to opencl
* compiler to ensure we only load a binary that matches what would
* have otherwise created. The filename is:

Loading…
Cancel
Save