opencv/modules/gpu/misc/mark_nvidia.py

261 lines
8.9 KiB
Python
Raw Normal View History

#!/usr/bin/env python
2012-05-23 15:55:10 +02:00
import sys, re
spaces = '[\s]*'
2012-08-17 13:50:35 +02:00
symbols = '[\s\w\d,.:|]*'
2012-05-23 15:55:10 +02:00
def pattern1(prefix, test):
2012-08-17 13:50:35 +02:00
return re.compile(spaces + prefix + '_' + test + '::' + symbols + '::' + '\(' + symbols + '\)' + spaces)
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
def pattern2(prefix, test, param1):
return re.compile(spaces + prefix + '_' + test + '::' + symbols + '::' + '\(' + symbols + param1 + symbols + '\)' + spaces)
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
def pattern3(prefix, test, param1, param2):
return re.compile(spaces + prefix + '_' + test + '::' + symbols + '::' + '\(' + symbols + param1 + symbols + param2 + symbols + '\)' + spaces)
2012-08-17 13:50:35 +02:00
def pattern4(prefix, test, param1, param2, param3):
return re.compile(spaces + prefix + '_' + test + '::' + symbols + '::' + '\(' + symbols + param1 + symbols + param2 + symbols + param3 + symbols + '\)' + spaces)
def pattern5(prefix, test, param1, param2, param3, param5):
return re.compile(spaces + prefix + '_' + test + '::' + symbols + '::' + '\(' + symbols + param1 + symbols + param2 + symbols + param3 + symbols + param4 + symbols + '\)' + spaces)
2012-05-23 15:55:10 +02:00
npp_patterns = [
2012-08-24 17:01:13 +02:00
###############################################################
2012-05-23 15:55:10 +02:00
# Core
2012-08-17 13:50:35 +02:00
# Core_AddMat (CV_8U | CV_16U | CV_32F)
pattern2('Core', 'AddMat', '8U'),
pattern2('Core', 'AddMat', '16U'),
pattern2('Core', 'AddMat', '32F'),
# Core_AddScalar (CV_8U | CV_16U | CV_32F)
pattern2('Core', 'AddScalar', '8U'),
pattern2('Core', 'AddScalar', '16U'),
pattern2('Core', 'AddScalar', '32F'),
# Core_SubtractMat (CV_8U | CV_16U | CV_32F)
pattern2('Core', 'SubtractMat', '8U'),
pattern2('Core', 'SubtractMat', '16U'),
pattern2('Core', 'SubtractMat', '32F'),
# Core_SubtractScalar (CV_8U | CV_16U | CV_32F)
pattern2('Core', 'SubtractScalar', '8U'),
pattern2('Core', 'SubtractScalar', '16U'),
pattern2('Core', 'SubtractScalar', '32F'),
# Core_MultiplyMat (CV_8U | CV_16U | CV_32F)
pattern2('Core', 'MultiplyMat', '8U'),
pattern2('Core', 'MultiplyMat', '16U'),
pattern2('Core', 'MultiplyMat', '32F'),
# Core_MultiplyScalar (CV_8U | CV_16U | CV_32F)
pattern2('Core', 'MultiplyScalar', '8U'),
pattern2('Core', 'MultiplyScalar', '16U'),
pattern2('Core', 'MultiplyScalar', '32F'),
# Core_DivideMat (CV_8U | CV_16U | CV_32F)
pattern2('Core', 'DivideMat', '8U'),
pattern2('Core', 'DivideMat', '16U'),
pattern2('Core', 'DivideMat', '32F'),
# Core_Divide_Scalar (CV_8U | CV_16U | CV_32F)
pattern2('Core', 'DivideScalar', '8U'),
pattern2('Core', 'DivideScalar', '16U'),
pattern2('Core', 'DivideScalar', '32F'),
# Core_AbsDiff_Mat (CV_8U | CV_16U | CV_32F)
pattern2('Core', 'AbsDiffMat', '8U'),
pattern2('Core', 'AbsDiffMat', '16U'),
pattern2('Core', 'AbsDiffMat', '32F'),
# Core_AbsDiffScalar (CV_8U | CV_16U | CV_32F)
pattern2('Core', 'AbsDiffScalar', '8U'),
pattern2('Core', 'AbsDiffScalar', '16U'),
pattern2('Core', 'AbsDiffScalar', '32F'),
# Core_Abs
2012-05-23 15:55:10 +02:00
pattern1('Core', 'Abs'),
2012-08-17 13:50:35 +02:00
# Core_Sqr
2012-05-23 15:55:10 +02:00
pattern1('Core', 'Sqr'),
2012-08-17 13:50:35 +02:00
# Core_Sqrt
2012-05-23 15:55:10 +02:00
pattern1('Core', 'Sqrt'),
2012-08-17 13:50:35 +02:00
# Core_Log
2012-05-23 15:55:10 +02:00
pattern1('Core', 'Log'),
2012-08-17 13:50:35 +02:00
# Core_Exp
2012-05-23 15:55:10 +02:00
pattern1('Core', 'Exp'),
2012-08-17 13:50:35 +02:00
# Core_BitwiseAndScalar
pattern1('Core', 'BitwiseAndScalar'),
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
# Core_BitwiseOrScalar
pattern1('Core', 'BitwiseOrScalar'),
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
# Core_BitwiseXorScalar
pattern1('Core', 'BitwiseXorScalar'),
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
# Core_RShift
2012-05-23 15:55:10 +02:00
pattern1('Core', 'RShift'),
2012-08-17 13:50:35 +02:00
# Core_LShift
2012-05-23 15:55:10 +02:00
pattern1('Core', 'LShift'),
2012-08-17 13:50:35 +02:00
# Core_Transpose
2012-05-23 15:55:10 +02:00
pattern1('Core', 'Transpose'),
2012-08-17 13:50:35 +02:00
# Core_Flip
2012-05-23 15:55:10 +02:00
pattern1('Core', 'Flip'),
2012-08-17 13:50:35 +02:00
# Core_LutOneChannel
pattern1('Core', 'LutOneChannel'),
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
# Core_LutMultiChannel
pattern1('Core', 'LutMultiChannel'),
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
# Core_MagnitudeComplex
pattern1('Core', 'MagnitudeComplex'),
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
# Core_MagnitudeSqrComplex
pattern1('Core', 'MagnitudeSqrComplex'),
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
# Core_MeanStdDev
2012-05-23 15:55:10 +02:00
pattern1('Core', 'MeanStdDev'),
2012-08-17 13:50:35 +02:00
# Core_NormDiff
2012-05-23 15:55:10 +02:00
pattern1('Core', 'NormDiff'),
2012-08-17 13:50:35 +02:00
2012-05-23 15:55:10 +02:00
##############################################################
# Filters
2012-08-17 13:50:35 +02:00
# Filters_Blur
2012-05-23 15:55:10 +02:00
pattern1('Filters', 'Blur'),
2012-08-17 13:50:35 +02:00
# Filters_Erode
2012-05-23 15:55:10 +02:00
pattern1('Filters', 'Erode'),
2012-08-17 13:50:35 +02:00
# Filters_Dilate
2012-05-23 15:55:10 +02:00
pattern1('Filters', 'Dilate'),
2012-08-17 13:50:35 +02:00
# Filters_MorphologyEx
2012-05-23 15:55:10 +02:00
pattern1('Filters', 'MorphologyEx'),
2012-08-17 13:50:35 +02:00
2012-05-23 15:55:10 +02:00
##############################################################
# ImgProc
2012-08-17 13:50:35 +02:00
# ImgProc_Resize (8U, 1 | 4, INTER_NEAREST | INTER_LINEAR)
pattern4('ImgProc', 'Resize', '8U', '1', 'INTER_NEAREST'),
pattern4('ImgProc', 'Resize', '8U', '4', 'INTER_NEAREST'),
pattern4('ImgProc', 'Resize', '8U', '1', 'INTER_LINEAR'),
pattern4('ImgProc', 'Resize', '8U', '4', 'INTER_LINEAR'),
# ImgProc_Resize (8U, 4, INTER_CUBIC)
pattern4('ImgProc', 'Resize', '8U', '4', 'INTER_CUBIC'),
# ImgProc_WarpAffine (8U | 32F, INTER_NEAREST | INTER_LINEAR | INTER_CUBIC, BORDER_CONSTANT)
pattern4('ImgProc', 'WarpAffine', '8U' , 'INTER_NEAREST', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'WarpAffine', '8U' , 'INTER_LINEAR', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'WarpAffine', '8U' , 'INTER_CUBIC', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'WarpAffine', '32F', 'INTER_NEAREST', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'WarpAffine', '32F', 'INTER_LINEAR', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'WarpAffine', '32F', 'INTER_CUBIC', 'BORDER_CONSTANT'),
# ImgProc_WarpPerspective (8U | 32F, INTER_NEAREST | INTER_LINEAR | INTER_CUBIC, BORDER_CONSTANT)
pattern4('ImgProc', 'WarpPerspective', '8U' , 'INTER_NEAREST', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'WarpPerspective', '8U' , 'INTER_LINEAR', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'WarpPerspective', '8U' , 'INTER_CUBIC', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'WarpPerspective', '32F', 'INTER_NEAREST', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'WarpPerspective', '32F', 'INTER_LINEAR', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'WarpPerspective', '32F', 'INTER_CUBIC', 'BORDER_CONSTANT'),
# ImgProc_CopyMakeBorder (8UC1 | 8UC4 | 32SC1 | 32FC1, BORDER_CONSTANT)
pattern4('ImgProc', 'CopyMakeBorder', '8U' , '1', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'CopyMakeBorder', '8U' , '4', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'CopyMakeBorder', '32S', '1', 'BORDER_CONSTANT'),
pattern4('ImgProc', 'CopyMakeBorder', '32F', '1', 'BORDER_CONSTANT'),
# ImgProc_Threshold (32F, THRESH_TRUNC)
2012-05-23 15:55:10 +02:00
pattern3('ImgProc', 'Threshold', '32F', 'THRESH_TRUNC'),
2012-08-17 13:50:35 +02:00
# ImgProc_IntegralSqr
pattern1('ImgProc', 'IntegralSqr'),
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
# ImgProc_HistEven_OneChannel
pattern1('ImgProc', 'HistEvenOneChannel'),
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
# ImgProc_HistEven_FourChannel
pattern1('ImgProc', 'HistEvenFourChannel'),
2012-05-23 15:55:10 +02:00
2012-08-17 13:50:35 +02:00
# ImgProc_Rotate
2012-05-23 15:55:10 +02:00
pattern1('ImgProc', 'Rotate'),
2012-08-17 13:50:35 +02:00
# ImgProc_SwapChannels
2012-05-23 15:55:10 +02:00
pattern1('ImgProc', 'SwapChannels'),
2012-08-17 13:50:35 +02:00
# ImgProc_AlphaComp
2012-05-23 15:55:10 +02:00
pattern1('ImgProc', 'AlphaComp'),
2012-08-17 13:50:35 +02:00
# ImgProc_ImagePyramidBuild
pattern1('ImgProc', 'ImagePyramidBuild'),
# ImgProc_ImagePyramid_getLayer
pattern1('ImgProc', 'ImagePyramidGetLayer'),
2012-05-23 15:55:10 +02:00
##############################################################
# MatOp
2012-08-17 13:50:35 +02:00
# MatOp_SetTo (8UC4 | 16UC1 | 16UC4 | 32FC1 | 32FC4)
pattern3('MatOp', 'SetTo', '8U' , '4'),
pattern3('MatOp', 'SetTo', '16U', '1'),
pattern3('MatOp', 'SetTo', '16U', '4'),
pattern3('MatOp', 'SetTo', '32F', '1'),
pattern3('MatOp', 'SetTo', '32F', '4'),
# MatOp_SetToMasked (8UC4 | 16UC1 | 16UC4 | 32FC1 | 32FC4)
pattern3('MatOp', 'SetToMasked', '8U' , '4'),
pattern3('MatOp', 'SetToMasked', '16U', '1'),
pattern3('MatOp', 'SetToMasked', '16U', '4'),
pattern3('MatOp', 'SetToMasked', '32F', '1'),
pattern3('MatOp', 'SetToMasked', '32F', '4'),
# MatOp_CopyToMasked (8UC1 | 8UC3 |8UC4 | 16UC1 | 16UC3 | 16UC4 | 32FC1 | 32FC3 | 32FC4)
pattern3('MatOp', 'CopyToMasked', '8U' , '1'),
pattern3('MatOp', 'CopyToMasked', '8U' , '3'),
pattern3('MatOp', 'CopyToMasked', '8U' , '4'),
pattern3('MatOp', 'CopyToMasked', '16U', '1'),
pattern3('MatOp', 'CopyToMasked', '16U', '3'),
pattern3('MatOp', 'CopyToMasked', '16U', '4'),
pattern3('MatOp', 'CopyToMasked', '32F', '1'),
pattern3('MatOp', 'CopyToMasked', '32F', '3'),
pattern3('MatOp', 'CopyToMasked', '32F', '4'),
2012-05-23 15:55:10 +02:00
]
cublasPattern = pattern1('Core', 'GEMM')
cufftPattern = pattern1('ImgProc', 'Dft')
if __name__ == "__main__":
inputFile = open(sys.argv[1], 'r')
lines = inputFile.readlines()
inputFile.close()
2012-08-17 13:50:35 +02:00
2012-05-23 15:55:10 +02:00
for i in range(len(lines)):
if cublasPattern.match(lines[i]):
lines[i] = lines[i][:-1] + ' <font color=\"blue\">[CUBLAS]</font>\n'
else:
if cufftPattern.match(lines[i]):
lines[i] = lines[i][:-1] + ' <font color=\"blue\">[CUFFT]</font>\n'
else:
for p in npp_patterns:
if p.match(lines[i]):
lines[i] = lines[i][:-1] + ' <font color=\"blue\">[NPP]</font>\n'
outputFile = open(sys.argv[2], 'w')
outputFile.writelines(lines)
outputFile.close()