@@ -423,7 +423,7 @@ static void load_opencl_environment()
423423 num_platforms = 0 ;
424424
425425 if (num_platforms < 1 && options .verbosity > VERB_LEGACY )
426- fprintf (stderr , "%u: No OpenCL platforms were found: %s\n" ,
426+ fprintf (stderr , "%u: OpenCL: No platforms were found: %s\n" ,
427427 NODE , get_error_name (ret ));
428428
429429 for (i = 0 ; i < num_platforms ; i ++ ) {
@@ -439,7 +439,7 @@ static void load_opencl_environment()
439439
440440 if (num_devices < 1 && options .verbosity > VERB_LEGACY )
441441 fprintf (stderr ,
442- "%u: No OpenCL devices were found on platform #%d: %s\n" ,
442+ "%u: OpenCL: No devices were found on platform #%d: %s\n" ,
443443 NODE , i , get_error_name (ret ));
444444
445445 // Save platform and devices information
@@ -562,7 +562,7 @@ static int start_opencl_device(int sequential_id, int *err_type)
562562 & devices [sequential_id ], NULL , NULL , & ret_code );
563563
564564 if (ret_code != CL_SUCCESS ) {
565- fprintf (stderr , "%u: Error creating context for device %d "
565+ fprintf (stderr , "%u: Error creating OpenCL context for device %d "
566566 "(%d:%d): %s\n" ,
567567 NODE , sequential_id + 1 ,
568568 get_platform_id (sequential_id ),
@@ -575,7 +575,7 @@ static int start_opencl_device(int sequential_id, int *err_type)
575575 devices [sequential_id ], 0 , & ret_code );
576576
577577 if (ret_code != CL_SUCCESS ) {
578- fprintf (stderr , "%u: Error creating command queue for "
578+ fprintf (stderr , "%u: Error creating OpenCL command queue for "
579579 "device %d (%d:%d): %s\n" , NODE ,
580580 sequential_id + 1 , get_platform_id (sequential_id ),
581581 get_device_id (sequential_id ), get_error_name (ret_code ));
@@ -620,7 +620,7 @@ static void add_device_to_list(int sequential_id)
620620 if (options .fork )
621621 fprintf (stderr , "%u: " , options .node_min );
622622#endif
623- fprintf (stderr , "Device id %d not working correctly,"
623+ fprintf (stderr , "OpenCL device id %d not working correctly,"
624624 " skipping.\n" , sequential_id + 1 );
625625 return ;
626626 }
@@ -1123,7 +1123,7 @@ static void print_device_info(int sequential_id)
11231123 "" , "" ,
11241124#endif
11251125 device_name , board_name );
1126- log_event ("Device %d: %s%s" , sequential_id + 1 , device_name , board_name );
1126+ log_event ("OpenCL: Device %d: %s%s" , sequential_id + 1 , device_name , board_name );
11271127}
11281128
11291129static char * get_build_opts (int sequential_id , const char * opts )
@@ -1267,7 +1267,7 @@ void opencl_build(int sequential_id, const char *opts, int save, const char *fil
12671267 "clGetProgramBuildInfo II" );
12681268
12691269 uint64_t end = john_get_nano ();
1270- log_event ("- build time: %ss" , ns2string (end - start ));
1270+ log_event ("OpenCL: Kernel build time: %ss" , ns2string (end - start ));
12711271
12721272 char * cleaned_log = build_log ;
12731273 if (cfg_get_bool (SECTION_OPTIONS , SUBSECTION_OPENCL , "MuteBogusWarnings" , 1 ) &&
@@ -1380,9 +1380,9 @@ cl_int opencl_build_from_binary(int sequential_id, cl_program *program, const ch
13801380 }
13811381 // Nvidia may return a single '\n' that we ignore
13821382 else if (options .verbosity >= LOG_VERB && strlen (build_log ) > 1 )
1383- fprintf (stderr , "Binary Build log: %s\n" , build_log );
1383+ fprintf (stderr , "Binary build log: %s\n" , build_log );
13841384
1385- log_event ("- build time: %ss" , ns2string (end - start ));
1385+ log_event ("OpenCL: Kernel build time: %ss" , ns2string (end - start ));
13861386 if (options .verbosity >= VERB_MAX )
13871387 fprintf (stderr , "Build time: %ss\n" , ns2string (end - start ));
13881388 MEM_FREE (build_log );
@@ -2185,7 +2185,7 @@ size_t opencl_read_source(const char *kernel_filename, char **kernel_source)
21852185 read_size = fread (* kernel_source , sizeof (char ), source_size , fp );
21862186 if (read_size != source_size )
21872187 fprintf (stderr ,
2188- "Error reading source: expected " Zu ", got " Zu " bytes (%s).\n" ,
2188+ "OpenCL error reading kernel source: expected " Zu ", got " Zu " bytes (%s).\n" ,
21892189 source_size , read_size ,
21902190 feof (fp ) ? "EOF" : strerror (errno ));
21912191 fclose (fp );
@@ -2285,38 +2285,38 @@ void opencl_build_kernel(const char *kernel_filename, int sequential_id, const c
22852285 */
22862286 if (gpu_nvidia (device_info [sequential_id ]) && !platform_apple (get_platform_id (sequential_id ))) {
22872287 if (john_main_process || !cfg_get_bool (SECTION_OPTIONS , SUBSECTION_MPI , "MPIAllGPUsSame" , 0 ))
2288- log_event ( "- Kernel binary caching disabled for this platform/device" );
2288+ LOG_ONCE ( "OpenCL: Kernel binary caching disabled for this platform/device" );
22892289 use_cache = 0 ;
22902290 } else
22912291#endif
22922292 if (getenv ("DUMP_BINARY" )) {
2293- log_event ( "- DUMP_BINARY is set, ignoring cached kernel" );
2293+ LOG_ONCE ( "OpenCL: DUMP_BINARY is set, ignoring cached kernel" );
22942294 use_cache = 0 ;
22952295 } else {
22962296 use_cache = !stat (path_expand (bin_name ), & bin_stat );
22972297
22982298 if (use_cache && !stat (path_expand (kernel_filename ), & source_stat ) &&
22992299 source_stat .st_mtime > bin_stat .st_mtime ) {
23002300 use_cache = 0 ;
2301- log_event ("- cached kernel may be stale, ignoring" );
2301+ log_event ("OpenCL: Cached kernel may be stale, ignoring" );
23022302 }
23032303 }
23042304
23052305 // Select the kernel to run.
23062306 if (use_cache ) {
23072307 size_t program_size = opencl_read_source (bin_name , & kernel_source );
23082308
2309- log_event ("- Building kernel from cached binary" );
2309+ log_event ("OpenCL: Building kernel from cached binary" );
23102310 ret_code = opencl_build_from_binary (sequential_id , & program [sequential_id ], kernel_source , program_size );
23112311 if (ret_code != CL_SUCCESS )
2312- log_event ("- Build from cached binary failed" );
2312+ log_event ("OpenCL: Build from cached binary failed" );
23132313 }
23142314
23152315 if (!use_cache || ret_code != CL_SUCCESS ) {
2316- log_event ("- Building kernel from source and caching binary" );
2316+ log_event ("OpenCL: Building kernel from source and caching binary" );
23172317 if (warn && options .verbosity > VERB_DEFAULT ) {
23182318 fflush (stdout );
2319- fprintf (stderr , "Building the kernel, this could take a while\n" );
2319+ fprintf (stderr , "Building the OpenCL kernel, this could take a while\n" );
23202320 }
23212321 opencl_read_source (kernel_filename , & kernel_source );
23222322 opencl_build (sequential_id , opts , 1 , bin_name , & program [sequential_id ], kernel_filename , kernel_source );
@@ -2374,14 +2374,9 @@ int opencl_prepare_dev(int sequential_id)
23742374 if (gpu_nvidia (device_info [sequential_id ])) {
23752375 opencl_avoid_busy_wait [sequential_id ] = cfg_get_bool (SECTION_OPTIONS , SUBSECTION_GPU ,
23762376 "AvoidBusyWait" , 1 );
2377- static int warned ;
2378-
23792377 /* Remove next line once (nearly) all formats has got the macros */
23802378 if (!opencl_avoid_busy_wait [sequential_id ])
2381- if (!warned ) {
2382- warned = 1 ;
2383- log_event ("- Busy-wait reduction %sabled" , opencl_avoid_busy_wait [sequential_id ] ? "en" : "dis" );
2384- }
2379+ LOG_ONCE ("OpenCL: Busy-wait reduction %sabled" , opencl_avoid_busy_wait [sequential_id ] ? "en" : "dis" );
23852380 }
23862381#endif
23872382
@@ -2900,8 +2895,7 @@ void opencl_list_devices(void)
29002895 ret = clGetPlatformIDs (MAX_PLATFORMS , platform_list , & num_platforms );
29012896
29022897 if (!num_platforms )
2903- fprintf (stderr , "Error: No OpenCL-capable platforms were detected"
2904- " by the installed OpenCL driver.\n" );
2898+ fprintf (stderr , "Error: No platforms were detected by the installed OpenCL driver.\n" );
29052899
29062900 if (ret != CL_SUCCESS && options .verbosity > VERB_LEGACY )
29072901 fprintf (stderr , "Throw clError: clGetPlatformIDs() = %s\n" ,
@@ -2940,8 +2934,7 @@ void opencl_list_devices(void)
29402934 printf (" Platform extensions: %s\n" , dname );
29412935 }
29422936 }
2943- fprintf (stderr , "Error: No OpenCL-capable devices were detected"
2944- " by the installed OpenCL driver.\n\n" );
2937+ fprintf (stderr , "Error: No devices were detected by the installed OpenCL driver.\n\n" );
29452938 return ;
29462939 }
29472940 /* Initialize OpenCL environment */
0 commit comments