@@ -122,7 +122,7 @@ def prepare_list_of_files(
122
122
The files beyond the first are considered additional files that may also contain tunable parameters
123
123
124
124
For each file beyond the first this function creates a temporary file with
125
- preprocessors statements inserted. Occurences of the original filenames in the
125
+ preprocessors statements inserted. Occurrences of the original filenames in the
126
126
first file are replaced with their temporary counterparts.
127
127
128
128
:param kernel_name: A string specifying the kernel name.
@@ -180,7 +180,7 @@ def prepare_list_of_files(
180
180
temp_file = util .get_temp_filename (suffix = "." + f .split ("." )[- 1 ])
181
181
temp_files [f ] = temp_file
182
182
util .write_file (temp_file , ks )
183
- # replace occurences of the additional file's name in the first kernel_string with the name of the temp file
183
+ # replace occurrences of the additional file's name in the first kernel_string with the name of the temp file
184
184
kernel_string = kernel_string .replace (f , temp_file )
185
185
186
186
return name , kernel_string , temp_files
@@ -511,7 +511,7 @@ def check_kernel_output(
511
511
# run the kernel
512
512
check = self .run_kernel (func , gpu_args , instance )
513
513
if not check :
514
- return # runtime failure occured that should be ignored, skip correctness check
514
+ return # runtime failure occurred that should be ignored, skip correctness check
515
515
516
516
# retrieve gpu results to host memory
517
517
result_host = []
@@ -595,7 +595,7 @@ def compile_and_benchmark(self, kernel_source, gpu_args, params, kernel_options,
595
595
if kernel_options .texmem_args is not None :
596
596
self .dev .copy_texture_memory_args (kernel_options .texmem_args )
597
597
598
- # stop compilation stopwatch and convert to miliseconds
598
+ # stop compilation stopwatch and convert to milliseconds
599
599
last_compilation_time = 1000 * (time .perf_counter () - start_compilation )
600
600
601
601
# test kernel for correctness
@@ -628,7 +628,7 @@ def compile_and_benchmark(self, kernel_source, gpu_args, params, kernel_options,
628
628
)
629
629
raise e
630
630
631
- # clean up any temporary files, if no error occured
631
+ # clean up any temporary files, if no error occurred
632
632
instance .delete_temp_files ()
633
633
634
634
result ["compile_time" ] = last_compilation_time or 0
@@ -905,7 +905,7 @@ def _flatten(a):
905
905
+ " detected during correctness check"
906
906
)
907
907
print (
908
- "this error occured when checking value of the %oth kernel argument"
908
+ "this error occurred when checking value of the %oth kernel argument"
909
909
% (i ,)
910
910
)
911
911
print (
@@ -934,7 +934,7 @@ def split_argument_list(argument_list):
934
934
match = re .match (regex , arg , re .S )
935
935
if not match :
936
936
raise ValueError ("error parsing templated kernel argument list" )
937
- type_list .append (re .sub (r"\s+" , " " , match .group (1 ).strip (), re .S ))
937
+ type_list .append (re .sub (r"\s+" , " " , match .group (1 ).strip (), flags = re .S ))
938
938
name_list .append (match .group (2 ).strip ())
939
939
return type_list , name_list
940
940
@@ -956,7 +956,7 @@ def replace_typename_token(matchobj):
956
956
# if the templated typename occurs as a token in the string, meaning that it is enclosed in
957
957
# beginning of string or whitespace, and end of string, whitespace or star
958
958
regex = r"(^|\s+)(" + k + r")($|\s+|\*)"
959
- sub = re .sub (regex , replace_typename_token , arg_type , re .S )
959
+ sub = re .sub (regex , replace_typename_token , arg_type , flags = re .S )
960
960
type_list [i ] = sub
961
961
962
962
0 commit comments