1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 20:44:19 +00:00

Check the maximum allocable memory size per opencl device.

This commit is contained in:
Con Kolivas 2012-07-23 17:41:31 +10:00
parent 5087ff9069
commit 89eb1fa393
2 changed files with 9 additions and 0 deletions

View File

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

7
ocl.c
View File

@ -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); 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 /* Create binary filename based on parameters passed to opencl
* compiler to ensure we only load a binary that matches what would * compiler to ensure we only load a binary that matches what would
* have otherwise created. The filename is: * have otherwise created. The filename is: