Browse Source

Do not perform bfi int patching for opencl1.2 or later.

nfactor-troky
Con Kolivas 11 years ago
parent
commit
578fabe07c
  1. 12
      ocl.c
  2. 1
      ocl.h

12
ocl.c

@ -342,6 +342,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
/* Check for OpenCL >= 1.0 support, needed for global offset parameter usage. */ /* Check for OpenCL >= 1.0 support, needed for global offset parameter usage. */
char * devoclver = malloc(1024); char * devoclver = malloc(1024);
const char * ocl10 = "OpenCL 1.0"; const char * ocl10 = "OpenCL 1.0";
const char * ocl11 = "OpenCL 1.1";
status = clGetDeviceInfo(devices[gpu], CL_DEVICE_VERSION, 1024, (void *)devoclver, NULL); status = clGetDeviceInfo(devices[gpu], CL_DEVICE_VERSION, 1024, (void *)devoclver, NULL);
if (status != CL_SUCCESS) { if (status != CL_SUCCESS) {
@ -349,8 +350,12 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
return NULL; return NULL;
} }
find = strstr(devoclver, ocl10); find = strstr(devoclver, ocl10);
if (!find) if (!find) {
clState->hasOpenCL11plus = true; clState->hasOpenCL11plus = true;
find = strstr(devoclver, ocl11);
if (!find)
clState->hasOpenCL12plus = true;
}
status = clGetDeviceInfo(devices[gpu], CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, sizeof(cl_uint), (void *)&preferred_vwidth, NULL); status = clGetDeviceInfo(devices[gpu], CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, sizeof(cl_uint), (void *)&preferred_vwidth, NULL);
if (status != CL_SUCCESS) { if (status != CL_SUCCESS) {
@ -618,7 +623,8 @@ build:
if (clState->hasBitAlign) { if (clState->hasBitAlign) {
strcat(CompilerOptions, " -D BITALIGN"); strcat(CompilerOptions, " -D BITALIGN");
applog(LOG_DEBUG, "cl_amd_media_ops found, setting BITALIGN"); applog(LOG_DEBUG, "cl_amd_media_ops found, setting BITALIGN");
if (strstr(name, "Cedar") || if (!clState->hasOpenCL12plus &&
(strstr(name, "Cedar") ||
strstr(name, "Redwood") || strstr(name, "Redwood") ||
strstr(name, "Juniper") || strstr(name, "Juniper") ||
strstr(name, "Cypress" ) || strstr(name, "Cypress" ) ||
@ -630,7 +636,7 @@ build:
strstr(name, "Antilles" ) || strstr(name, "Antilles" ) ||
strstr(name, "Wrestler" ) || strstr(name, "Wrestler" ) ||
strstr(name, "Zacate" ) || strstr(name, "Zacate" ) ||
strstr(name, "WinterPark" )) strstr(name, "WinterPark" )))
patchbfi = true; patchbfi = true;
} else } else
applog(LOG_DEBUG, "cl_amd_media_ops not found, will not set BITALIGN"); applog(LOG_DEBUG, "cl_amd_media_ops not found, will not set BITALIGN");

1
ocl.h

@ -27,6 +27,7 @@ typedef struct {
#endif #endif
bool hasBitAlign; bool hasBitAlign;
bool hasOpenCL11plus; bool hasOpenCL11plus;
bool hasOpenCL12plus;
bool goffset; bool goffset;
cl_uint vwidth; cl_uint vwidth;
size_t max_work_size; size_t max_work_size;

Loading…
Cancel
Save