MCPcopy Create free account
hub / github.com/ccsb-scripps/AutoDock-GPU / getprogramBuildInfo

Function getprogramBuildInfo

wrapcl/src/Programs.cpp:237–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235
236#ifdef PROGRAM_BUILD_INFO_DISPLAY
237int getprogramBuildInfo(
238 cl_program program,
239 cl_device_id device
240 )
241{
242 cl_int err;
243
244 cl_build_status* program_build_status;
245 char* program_build_options;
246 char* program_build_log;
247
248 size_t sizeParam;
249
250 // ----------------------------------------------------------------------------
251 // Query Program build status
252 printf("\n-----------------------------------------------------------------------\n");
253 err = clGetProgramBuildInfo(program,device,CL_PROGRAM_BUILD_STATUS,0,NULL,&sizeParam);
254 if (err != CL_SUCCESS){
255 printf("Error: clGetProgramBuildInfo() %d\n",err);
256 fflush(stdout);
257 return EXIT_FAILURE;
258 }
259
260 program_build_status = (cl_build_status*) malloc(sizeof(cl_build_status) * sizeParam);
261 err = clGetProgramBuildInfo(program,device,CL_PROGRAM_BUILD_STATUS,sizeParam,program_build_status,NULL);
262 if (err != CL_SUCCESS){
263 printf("Error: clGetProgramBuildInfo() %d\n",err);
264 fflush(stdout);
265 return EXIT_FAILURE;
266 }
267
268 printf(" %-45s: %s \n", "CL_PROGRAM_BUILD_STATUS", (*program_build_status == 0)? "CL_BUILD_SUCCESS":(*program_build_status == -1)? "CL_BUILD_NONE":(*program_build_status == -2)? "CL_BUILD_ERROR":(*program_build_status == -3)? "CL_BUILD_IN_PROGRESS":"UNKNOWN");
269 free(program_build_status);
270
271 // ----------------------------------------------------------------------------
272 // Query Options used to configure the program
273
274 err = clGetProgramBuildInfo(program,device,CL_PROGRAM_BUILD_OPTIONS,0,NULL,&sizeParam);
275 if (err != CL_SUCCESS){
276 printf("Error: clGetProgramBuildInfo() %d\n",err);
277 fflush(stdout);
278 return EXIT_FAILURE;
279 }
280
281 program_build_options = (char*) malloc(sizeof(char) * sizeParam);
282 err = clGetProgramBuildInfo(program,device,CL_PROGRAM_BUILD_OPTIONS,sizeParam,program_build_options,NULL);
283 if (err != CL_SUCCESS){
284 printf("Error: clGetProgramBuildInfo() %d\n",err);
285 fflush(stdout);
286 return EXIT_FAILURE;
287 }
288
289 printf(" %-45s: %s \n", "CL_PROGRAM_BUILD_OPTIONS", program_build_options);
290 free(program_build_options);
291
292 // ----------------------------------------------------------------------------
293 // Query Build log - compiler's output
294

Callers 2

ImportSourceToProgramFunction · 0.85
ImportBinaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected