mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 12:34:27 +00:00
Check the maximum allocable memory size per opencl device.
This commit is contained in:
parent
5087ff9069
commit
89eb1fa393
2
miner.h
2
miner.h
@ -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
7
ocl.c
@ -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…
x
Reference in New Issue
Block a user