@@ -168,21 +168,6 @@ static float get_opencl_version(cl_device_id device)
168
168
return version ;
169
169
}
170
170
171
- static bool get_opencl_bit_align_support (cl_device_id * device )
172
- {
173
- char extensions [1024 ];
174
- const char * camo = "cl_amd_media_ops" ;
175
- char * find ;
176
- cl_int status ;
177
-
178
- status = clGetDeviceInfo (* device , CL_DEVICE_EXTENSIONS , 1024 , (void * )extensions , NULL );
179
- if (status != CL_SUCCESS ) {
180
- return false;
181
- }
182
- find = strstr (extensions , camo );
183
- return !!find ;
184
- }
185
-
186
171
static cl_int create_opencl_command_queue (cl_command_queue * command_queue , cl_context * context , cl_device_id * device , cl_command_queue_properties cq_properties )
187
172
{
188
173
cl_int status ;
@@ -262,8 +247,6 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize, algorithm_t *alg
262
247
return NULL ;
263
248
}
264
249
265
- clState -> hasBitAlign = get_opencl_bit_align_support (& devices [gpu ]);
266
-
267
250
status = clGetDeviceInfo (devices [gpu ], CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT , sizeof (cl_uint ), (void * )& preferred_vwidth , NULL );
268
251
if (status != CL_SUCCESS ) {
269
252
applog (LOG_ERR , "Error %d: Failed to clGetDeviceInfo when trying to get CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT" , status );
@@ -544,9 +527,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize, algorithm_t *alg
544
527
545
528
build_data -> kernel_path = (* opt_kernel_path ) ? opt_kernel_path : NULL ;
546
529
build_data -> work_size = clState -> wsize ;
547
- build_data -> has_bit_align = clState -> hasBitAlign ;
548
530
build_data -> opencl_version = get_opencl_version (devices [gpu ]);
549
- build_data -> patch_bfi = needs_bfi_patch (build_data );
550
531
551
532
strcpy (build_data -> binary_filename , filename );
552
533
build_data -> binary_filename [strlen (filename ) - 3 ] = 0x00 ; // And one NULL terminator, cutting off the .cl suffix.
@@ -572,23 +553,13 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize, algorithm_t *alg
572
553
return NULL ;
573
554
}
574
555
575
- if (save_opencl_kernel (build_data , clState -> program )) {
576
- /* Program needs to be rebuilt, because the binary was patched */
577
- if (build_data -> patch_bfi ) {
578
- clReleaseProgram (clState -> program );
579
- clState -> program = load_opencl_binary_kernel (build_data );
580
- }
581
- }
582
- else {
583
- if (build_data -> patch_bfi )
584
- quit (1 , "Could not save kernel to file, but it is necessary to apply BFI patch" );
585
- }
556
+ // If it doesn't work, oh well, build it again next run
557
+ save_opencl_kernel (build_data , clState -> program );
586
558
}
587
559
588
560
// Load kernels
589
- applog (LOG_NOTICE , "Initialising kernel %s with%s bitalign, %spatched BFI, nfactor %d, n %d" ,
590
- filename , clState -> hasBitAlign ? "" : "out" , build_data -> patch_bfi ? "" : "un" ,
591
- algorithm -> nfactor , algorithm -> n );
561
+ applog (LOG_NOTICE , "Initialising kernel %s with nfactor %d, n %d" ,
562
+ filename , algorithm -> nfactor , algorithm -> n );
592
563
593
564
/* get a kernel object handle for a kernel with the given name */
594
565
clState -> kernel = clCreateKernel (clState -> program , "search" , & status );
@@ -597,7 +568,6 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize, algorithm_t *alg
597
568
return NULL ;
598
569
}
599
570
600
-
601
571
clState -> n_extra_kernels = algorithm -> n_extra_kernels ;
602
572
if (clState -> n_extra_kernels > 0 ) {
603
573
unsigned int i ;
0 commit comments