1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-04 11:04:26 +00:00

Bypass attempting to read and save binary files on OSX to avoid crashes on >1 GPU.

This commit is contained in:
Con Kolivas 2013-04-24 23:53:44 +10:00
parent d835ef75d1
commit 9aae2256d3

8
ocl.c
View File

@ -514,6 +514,11 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
if (!source)
return NULL;
/* OSX OpenCL breaks reading off binaries with >1 GPU so always build
* from source. */
#ifdef __APPLE__
goto build;
#endif
binary_sizes = calloc(sizeof(size_t) * MAX_GPUDEVICES * 4, 1);
if (unlikely(!binary_sizes)) {
applog(LOG_ERR, "Unable to calloc binary_sizes");
@ -662,6 +667,9 @@ build:
}
prog_built = true;
#ifdef __APPLE__
goto built;
#endif
status = clGetProgramInfo(clState->program, CL_PROGRAM_NUM_DEVICES, sizeof(cl_uint), &cpnd, NULL);
if (unlikely(status != CL_SUCCESS)) {