diff options
author | Eric Engestrom <eric.engestrom@intel.com> | 2019-11-19 15:05:40 +0000 |
---|---|---|
committer | Eric Engestrom <eric.engestrom@intel.com> | 2019-11-19 21:00:12 +0000 |
commit | 1b1c6968e6215dca274106723b879cb0bd49f106 (patch) | |
tree | 0241142722bd5b8fc8aa41a3930712d003c9a102 | |
parent | 051d3da5d37029b0393b4b3091b344920ce8f125 (diff) |
generated_tests: more python fixes
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pwnbakers.com>
-rw-r--r-- | generated_tests/gen_cl_int_builtins.py | 4 | ||||
-rw-r--r-- | generated_tests/genclbuiltins.py | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/generated_tests/gen_cl_int_builtins.py b/generated_tests/gen_cl_int_builtins.py index 28c441ee6..6d750ae5e 100644 --- a/generated_tests/gen_cl_int_builtins.py +++ b/generated_tests/gen_cl_int_builtins.py @@ -564,8 +564,8 @@ def main(): for dataType in DATA_TYPES: for fnName in functions: - if (fnName is 'upsample' and - (dataType is 'long' or dataType is 'ulong')): + if (fnName == 'upsample' and + (dataType == 'long' or dataType == 'ulong')): continue # Merge all of the generic/signed/unsigned/custom test definitions testDefs[(dataType, fnName)] = mergedTestDefinition(dataType, fnName) diff --git a/generated_tests/genclbuiltins.py b/generated_tests/genclbuiltins.py index c5ebaeb0a..2aaad1851 100644 --- a/generated_tests/genclbuiltins.py +++ b/generated_tests/genclbuiltins.py @@ -222,7 +222,7 @@ def generate_kernels(f, dataType, fnName, fnDef): gen_kernel_1_arg(f, fnName, argTypes[1], [argTypes[0]]) return - if (len(argTypes) == 3 and not fnName is 'upsample'): + if (len(argTypes) == 3 and fnName != 'upsample'): if (getNumOutArgs(fnDef) == 2): gen_kernel_1_arg(f, fnName, argTypes[2], [argTypes[0], argTypes[1]], 'private') @@ -233,7 +233,7 @@ def generate_kernels(f, dataType, fnName, fnDef): else: gen_kernel_2_arg_same_size(f, fnName, [argTypes[1], argTypes[2]], [argTypes[0]]) - if (fnDef['function_type'] is 'tss'): + if (fnDef['function_type'] == 'tss'): gen_kernel_2_arg_mixed_size(f, fnName, [argTypes[1], argTypes[2]], [argTypes[0]]) return @@ -249,15 +249,15 @@ def generate_kernels(f, dataType, fnName, fnDef): else: gen_kernel_3_arg_same_type(f, fnName, [argTypes[1], argTypes[2], argTypes[3]], [argTypes[0]]) - if (fnDef['function_type'] is 'tss'): + if (fnDef['function_type'] == 'tss'): gen_kernel_3_arg_mixed_size_tss(f, fnName, [argTypes[1], argTypes[2], argTypes[3]], [argTypes[0]]) - if (fnDef['function_type'] is 'tts'): + if (fnDef['function_type'] == 'tts'): gen_kernel_3_arg_mixed_size_tts(f, fnName, [argTypes[1], argTypes[2], argTypes[3]], [argTypes[0]]) return - if (fnName is 'upsample'): + if (fnName == 'upsample'): gen_kernel_2_arg_mixed_sign(f, fnName, [argTypes[1], argTypes[2]], [argTypes[0]]) @@ -359,17 +359,17 @@ def isOutArg(functionDef, argIdx): def print_test(f, fnName, argType, functionDef, tests, numTests, vecSize, fntype): # If the test allows mixed vector/scalar arguments, handle the case with # only vector arguments through a recursive call. - if (fntype is 'tss' or fntype is 'tts'): + if (fntype == 'tss' or fntype == 'tts'): print_test(f, fnName, argType, functionDef, tests, numTests, vecSize, 'ttt') # The tss && vecSize==1 case is handled in the non-tss case. - if ((not fntype is 'ttt') and vecSize == 1): + if ((fntype != 'ttt') and vecSize == 1): return # If we're handling mixed vector/scalar input widths, the kernels have # different names than when the vector widths match - tssStr = fntype + '_' if (not fntype is 'ttt') else '' + tssStr = fntype + '_' if (fntype != 'ttt') else '' argTypes = getArgTypes(argType, functionDef['arg_types']) argCount = len(argTypes) @@ -394,7 +394,7 @@ def print_test(f, fnName, argType, functionDef, tests, numTests, vecSize, fntype # The output argument and first tss argument are vectors, any that # follow are scalar. If !tss, then everything has a matching vector # width - if (fntype is 'ttt' or (arg < 2 and fntype is 'tss') or (arg < 3 and fntype is 'tts')): + if (fntype == 'ttt' or (arg < 2 and fntype == 'tss') or (arg < 3 and fntype == 'tts')): f.write(argInOut + str(arg) + ' buffer ' + argTypes[arg] + '[' + str(numTests * vecSize) + '] ' + ''.join(map(lambda x: (x + ' ') * vecSize, argVal.split())) |