From 463573d6127c4b97567c1af0ebb58fb8ff47236b Mon Sep 17 00:00:00 2001 From: fireice-uk Date: Tue, 14 Feb 2017 18:55:29 +0000 Subject: [PATCH] Minor fixes --- amd_gpu/gpu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/amd_gpu/gpu.c b/amd_gpu/gpu.c index 929817b..6337640 100644 --- a/amd_gpu/gpu.c +++ b/amd_gpu/gpu.c @@ -386,7 +386,7 @@ size_t InitOpenCL(GpuContext* ctx, size_t num_gpus, size_t platform_idx) if((ret = clGetDeviceIDs(PlatformIDList[platform_idx], CL_DEVICE_TYPE_GPU, 0, NULL, &entries)) != CL_SUCCESS) { - printer_print_msg("Error %s when calling clGetDeviceIDs for number of devices.", ret); + printer_print_msg("Error %s when calling clGetDeviceIDs for number of devices.", err_to_str(ret)); return ERR_OCL_API; } @@ -431,6 +431,12 @@ size_t InitOpenCL(GpuContext* ctx, size_t num_gpus, size_t platform_idx) } char* source_code = LoadTextFile(sSourcePath); + if(source_code == NULL) + { + printer_print_msg("Couldn't locate GPU source code file at %s.", sSourcePath); + return ERR_STUPID_PARAMS; + } + for(int i = 0; i < num_gpus; ++i) { if((ret = InitOpenCLGpu(opencl_ctx, &ctx[i], source_code)) != ERR_SUCCESS)