diff
stringlengths 41
2.03M
| msg
stringlengths 1
1.5k
⌀ | repo
stringlengths 5
40
| sha
stringlengths 40
40
| time
stringlengths 20
20
|
---|---|---|---|---|
mmm a / src / common / math_util . h <nl> ppp b / src / common / math_util . h <nl> inline bool IntervalsIntersect ( unsigned start0 , unsigned length0 , unsigned start <nl> <nl> template < class T > <nl> struct Rectangle { <nl> - T left ; <nl> - T top ; <nl> - T right ; <nl> - T bottom ; <nl> + T left { } ; <nl> + T top { } ; <nl> + T right { } ; <nl> + T bottom { } ; <nl> <nl> - Rectangle ( ) { } <nl> + Rectangle ( ) = default ; <nl> <nl> Rectangle ( T left , T top , T right , T bottom ) <nl> : left ( left ) , top ( top ) , right ( right ) , bottom ( bottom ) { } <nl>
|
math_util : Always initialize members of Rectangle
|
yuzu-emu/yuzu
|
f2a03468b17a2c3b7ffc328e4693ea9250a38a61
|
2018-08-02T14:47:34Z
|
mmm a / modules / calib3d / src / stereobm . cpp <nl> ppp b / modules / calib3d / src / stereobm . cpp <nl> class StereoBMImpl : public StereoBM <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " minDisparity " < < params . minDisparity <nl> < < " numDisparities " < < params . numDisparities <nl> mmm a / modules / calib3d / src / stereosgbm . cpp <nl> ppp b / modules / calib3d / src / stereosgbm . cpp <nl> class StereoSGBMImpl : public StereoSGBM <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " minDisparity " < < params . minDisparity <nl> < < " numDisparities " < < params . numDisparities <nl> mmm a / modules / core / include / opencv2 / core . hpp <nl> ppp b / modules / core / include / opencv2 / core . hpp <nl> class CV_EXPORTS_W Algorithm <nl> / * * Returns the algorithm string identifier . <nl> This string is used as top level xml / yml node tag when the object is saved to a file or string . * / <nl> CV_WRAP virtual String getDefaultName ( ) const ; <nl> + <nl> + protected : <nl> + void writeFormat ( FileStorage & fs ) const ; <nl> } ; <nl> <nl> struct Param { <nl> mmm a / modules / core / src / algorithm . cpp <nl> ppp b / modules / core / src / algorithm . cpp <nl> void Algorithm : : save ( const String & filename ) const <nl> { <nl> FileStorage fs ( filename , FileStorage : : WRITE ) ; <nl> fs < < getDefaultName ( ) < < " { " ; <nl> - fs < < " format " < < ( int ) 3 ; <nl> write ( fs ) ; <nl> fs < < " } " ; <nl> } <nl> String Algorithm : : getDefaultName ( ) const <nl> return String ( " my_object " ) ; <nl> } <nl> <nl> + void Algorithm : : writeFormat ( FileStorage & fs ) const <nl> + { <nl> + fs < < " format " < < ( int ) 3 ; <nl> + } <nl> + <nl> } <nl> <nl> / * End of file . * / <nl> mmm a / modules / cudaimgproc / src / canny . cpp <nl> ppp b / modules / cudaimgproc / src / canny . cpp <nl> namespace <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < " Canny_CUDA " <nl> < < " low_thresh " < < low_thresh_ <nl> < < " high_thresh " < < high_thresh_ <nl> mmm a / modules / cudaimgproc / src / hough_circles . cpp <nl> ppp b / modules / cudaimgproc / src / hough_circles . cpp <nl> namespace <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < " HoughCirclesDetector_CUDA " <nl> < < " dp " < < dp_ <nl> < < " minDist " < < minDist_ <nl> mmm a / modules / cudaimgproc / src / hough_lines . cpp <nl> ppp b / modules / cudaimgproc / src / hough_lines . cpp <nl> namespace <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < " HoughLinesDetector_CUDA " <nl> < < " rho " < < rho_ <nl> < < " theta " < < theta_ <nl> mmm a / modules / cudaimgproc / src / hough_segments . cpp <nl> ppp b / modules / cudaimgproc / src / hough_segments . cpp <nl> namespace <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < " PHoughLinesDetector_CUDA " <nl> < < " rho " < < rho_ <nl> < < " theta " < < theta_ <nl> mmm a / modules / features2d / src / akaze . cpp <nl> ppp b / modules / features2d / src / akaze . cpp <nl> namespace cv <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " descriptor " < < descriptor ; <nl> fs < < " descriptor_channels " < < descriptor_channels ; <nl> fs < < " descriptor_size " < < descriptor_size ; <nl> mmm a / modules / features2d / src / blobdetector . cpp <nl> ppp b / modules / features2d / src / blobdetector . cpp <nl> void SimpleBlobDetectorImpl : : read ( const cv : : FileNode & fn ) <nl> <nl> void SimpleBlobDetectorImpl : : write ( cv : : FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> params . write ( fs ) ; <nl> } <nl> <nl> mmm a / modules / features2d / src / kaze . cpp <nl> ppp b / modules / features2d / src / kaze . cpp <nl> namespace cv <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " extended " < < ( int ) extended ; <nl> fs < < " upright " < < ( int ) upright ; <nl> fs < < " threshold " < < threshold ; <nl> mmm a / modules / features2d / src / matchers . cpp <nl> ppp b / modules / features2d / src / matchers . cpp <nl> void FlannBasedMatcher : : read ( const FileNode & fn ) <nl> <nl> void FlannBasedMatcher : : write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " indexParams " < < " [ " ; <nl> <nl> if ( indexParams ) <nl> mmm a / modules / ml / src / ann_mlp . cpp <nl> ppp b / modules / ml / src / ann_mlp . cpp <nl> class ANN_MLPImpl : public ANN_MLP <nl> return ; <nl> int i , l_count = layer_count ( ) ; <nl> <nl> + writeFormat ( fs ) ; <nl> fs < < " layer_sizes " < < layer_sizes ; <nl> <nl> write_params ( fs ) ; <nl> mmm a / modules / ml / src / boost . cpp <nl> ppp b / modules / ml / src / boost . cpp <nl> class DTreesImplForBoost : public DTreesImpl <nl> if ( roots . empty ( ) ) <nl> CV_Error ( CV_StsBadArg , " RTrees have not been trained " ) ; <nl> <nl> + writeFormat ( fs ) ; <nl> writeParams ( fs ) ; <nl> <nl> int k , ntrees = ( int ) roots . size ( ) ; <nl> mmm a / modules / ml / src / em . cpp <nl> ppp b / modules / ml / src / em . cpp <nl> class CV_EXPORTS EMImpl : public EM <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " training_params " < < " { " ; <nl> write_params ( fs ) ; <nl> fs < < " } " ; <nl> mmm a / modules / ml / src / knearest . cpp <nl> ppp b / modules / ml / src / knearest . cpp <nl> class KNearestImpl : public KNearest <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> impl - > write ( fs ) ; <nl> } <nl> <nl> mmm a / modules / ml / src / lr . cpp <nl> ppp b / modules / ml / src / lr . cpp <nl> void LogisticRegressionImpl : : write ( FileStorage & fs ) const <nl> { <nl> CV_Error ( CV_StsBadArg , " file can ' t open . Check file path " ) ; <nl> } <nl> + writeFormat ( fs ) ; <nl> string desc = " Logisitic Regression Classifier " ; <nl> fs < < " classifier " < < desc . c_str ( ) ; <nl> fs < < " alpha " < < this - > params . alpha ; <nl> mmm a / modules / ml / src / nbayes . cpp <nl> ppp b / modules / ml / src / nbayes . cpp <nl> class NormalBayesClassifierImpl : public NormalBayesClassifier <nl> { <nl> int nclasses = ( int ) cls_labels . total ( ) , i ; <nl> <nl> + writeFormat ( fs ) ; <nl> fs < < " var_count " < < ( var_idx . empty ( ) ? nallvars : ( int ) var_idx . total ( ) ) ; <nl> fs < < " var_all " < < nallvars ; <nl> <nl> mmm a / modules / ml / src / rtrees . cpp <nl> ppp b / modules / ml / src / rtrees . cpp <nl> class DTreesImplForRTrees : public DTreesImpl <nl> if ( roots . empty ( ) ) <nl> CV_Error ( CV_StsBadArg , " RTrees have not been trained " ) ; <nl> <nl> + writeFormat ( fs ) ; <nl> writeParams ( fs ) ; <nl> <nl> fs < < " oob_error " < < oobError ; <nl> mmm a / modules / ml / src / svm . cpp <nl> ppp b / modules / ml / src / svm . cpp <nl> class SVMImpl : public SVM <nl> if ( ! isTrained ( ) ) <nl> CV_Error ( CV_StsParseError , " SVM model data is invalid , check sv_count , var_ * and class_count tags " ) ; <nl> <nl> + writeFormat ( fs ) ; <nl> write_params ( fs ) ; <nl> <nl> fs < < " var_count " < < var_count ; <nl> mmm a / modules / ml / src / svmsgd . cpp <nl> ppp b / modules / ml / src / svmsgd . cpp <nl> void SVMSGDImpl : : write ( FileStorage & fs ) const <nl> if ( ! isTrained ( ) ) <nl> CV_Error ( CV_StsParseError , " SVMSGD model data is invalid , it hasn ' t been trained " ) ; <nl> <nl> + writeFormat ( fs ) ; <nl> writeParams ( fs ) ; <nl> <nl> fs < < " weights " < < weights_ ; <nl> mmm a / modules / ml / src / tree . cpp <nl> ppp b / modules / ml / src / tree . cpp <nl> void DTreesImpl : : writeTree ( FileStorage & fs , int root ) const <nl> <nl> void DTreesImpl : : write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> writeParams ( fs ) ; <nl> writeTree ( fs , roots [ 0 ] ) ; <nl> } <nl> mmm a / modules / photo / src / align . cpp <nl> ppp b / modules / photo / src / align . cpp <nl> class AlignMTBImpl : public AlignMTB <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name <nl> < < " max_bits " < < max_bits <nl> < < " exclude_range " < < exclude_range <nl> mmm a / modules / photo / src / calibrate . cpp <nl> ppp b / modules / photo / src / calibrate . cpp <nl> class CalibrateDebevecImpl : public CalibrateDebevec <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name <nl> < < " samples " < < samples <nl> < < " lambda " < < lambda <nl> class CalibrateRobertsonImpl : public CalibrateRobertson <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name <nl> < < " max_iter " < < max_iter <nl> < < " threshold " < < threshold ; <nl> mmm a / modules / photo / src / merge . cpp <nl> ppp b / modules / photo / src / merge . cpp <nl> class MergeMertensImpl : public MergeMertens <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name <nl> < < " contrast_weight " < < wcon <nl> < < " saturation_weight " < < wsat <nl> mmm a / modules / photo / src / tonemap . cpp <nl> ppp b / modules / photo / src / tonemap . cpp <nl> class TonemapImpl : public Tonemap <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name <nl> < < " gamma " < < gamma ; <nl> } <nl> class TonemapDragoImpl : public TonemapDrago <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name <nl> < < " gamma " < < gamma <nl> < < " bias " < < bias <nl> class TonemapDurandImpl : public TonemapDurand <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name <nl> < < " gamma " < < gamma <nl> < < " contrast " < < contrast <nl> class TonemapReinhardImpl : public TonemapReinhard <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name <nl> < < " gamma " < < gamma <nl> < < " intensity " < < intensity <nl> class TonemapMantiukImpl : public TonemapMantiuk <nl> <nl> void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name <nl> < < " gamma " < < gamma <nl> < < " scale " < < scale <nl> mmm a / modules / shape / src / aff_trans . cpp <nl> ppp b / modules / shape / src / aff_trans . cpp <nl> class AffineTransformerImpl : public AffineTransformer <nl> / / ! write / read <nl> virtual void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " affine_type " < < int ( fullAffine ) ; <nl> } <nl> mmm a / modules / shape / src / haus_dis . cpp <nl> ppp b / modules / shape / src / haus_dis . cpp <nl> class HausdorffDistanceExtractorImpl : public HausdorffDistanceExtractor <nl> / / ! write / read <nl> virtual void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " distance " < < distanceFlag <nl> < < " rank " < < rankProportion ; <nl> mmm a / modules / shape / src / hist_cost . cpp <nl> ppp b / modules / shape / src / hist_cost . cpp <nl> class NormHistogramCostExtractorImpl : public NormHistogramCostExtractor <nl> / / ! write / read <nl> virtual void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " flag " < < flag <nl> < < " dummies " < < nDummies <nl> class EMDHistogramCostExtractorImpl : public EMDHistogramCostExtractor <nl> / / ! write / read <nl> virtual void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " flag " < < flag <nl> < < " dummies " < < nDummies <nl> class ChiHistogramCostExtractorImpl : public ChiHistogramCostExtractor <nl> / / ! write / read <nl> virtual void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " dummies " < < nDummies <nl> < < " default " < < defaultCost ; <nl> class EMDL1HistogramCostExtractorImpl : public EMDL1HistogramCostExtractor <nl> / / ! write / read <nl> virtual void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " dummies " < < nDummies <nl> < < " default " < < defaultCost ; <nl> mmm a / modules / shape / src / sc_dis . cpp <nl> ppp b / modules / shape / src / sc_dis . cpp <nl> class ShapeContextDistanceExtractorImpl : public ShapeContextDistanceExtractor <nl> / / ! write / read <nl> virtual void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " nRads " < < nRadialBins <nl> < < " nAngs " < < nAngularBins <nl> mmm a / modules / shape / src / tps_trans . cpp <nl> ppp b / modules / shape / src / tps_trans . cpp <nl> class ThinPlateSplineShapeTransformerImpl : public ThinPlateSplineShapeTransform <nl> / / ! write / read <nl> virtual void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " regularization " < < regularizationParameter ; <nl> } <nl> mmm a / modules / video / src / bgfg_KNN . cpp <nl> ppp b / modules / video / src / bgfg_KNN . cpp <nl> class BackgroundSubtractorKNNImpl : public BackgroundSubtractorKNN <nl> <nl> virtual void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " history " < < history <nl> < < " nsamples " < < nN <nl> mmm a / modules / video / src / bgfg_gaussmix2 . cpp <nl> ppp b / modules / video / src / bgfg_gaussmix2 . cpp <nl> class BackgroundSubtractorMOG2Impl : public BackgroundSubtractorMOG2 <nl> <nl> virtual void write ( FileStorage & fs ) const <nl> { <nl> + writeFormat ( fs ) ; <nl> fs < < " name " < < name_ <nl> < < " history " < < history <nl> < < " nmixtures " < < nmixtures <nl>
|
Merge pull request from mvukad : bugfix_dtreeswrite
|
opencv/opencv
|
1307bb1d033af3baeb55afb63c3989d3d6791c80
|
2016-04-12T13:26:25Z
|
mmm a / lib / SILOptimizer / SILCombiner / SILCombinerCastVisitors . cpp <nl> ppp b / lib / SILOptimizer / SILCombiner / SILCombinerCastVisitors . cpp <nl> SILCombiner : : visitThickToObjCMetatypeInst ( ThickToObjCMetatypeInst * TTOCMI ) { <nl> if ( CastOpt . optimizeMetatypeConversion ( TTOCMI , MetatypeRepresentation : : Thick ) ) <nl> MadeChange = true ; <nl> <nl> - if ( auto * OCTTMI = dyn_cast < ObjCToThickMetatypeInst > ( TTOCMI - > getOperand ( ) ) ) { <nl> - TTOCMI - > replaceAllUsesWith ( OCTTMI - > getOperand ( ) ) ; <nl> - return eraseInstFromFunction ( * TTOCMI ) ; <nl> - } <nl> return nullptr ; <nl> } <nl> <nl> SILCombiner : : visitObjCToThickMetatypeInst ( ObjCToThickMetatypeInst * OCTTMI ) { <nl> if ( CastOpt . optimizeMetatypeConversion ( OCTTMI , MetatypeRepresentation : : ObjC ) ) <nl> MadeChange = true ; <nl> <nl> - if ( auto * TTOCMI = dyn_cast < ThickToObjCMetatypeInst > ( OCTTMI - > getOperand ( ) ) ) { <nl> - OCTTMI - > replaceAllUsesWith ( TTOCMI - > getOperand ( ) ) ; <nl> - return eraseInstFromFunction ( * OCTTMI ) ; <nl> - } <nl> return nullptr ; <nl> } <nl> <nl> mmm a / test / SILOptimizer / peephole_thick_to_objc_metatype . sil <nl> ppp b / test / SILOptimizer / peephole_thick_to_objc_metatype . sil <nl> import Builtin <nl> import Swift <nl> import SwiftShims <nl> <nl> - import Foundation <nl> - <nl> @ objc ( XX ) protocol X { <nl> } <nl> <nl> bb0 ( % 0 : $ T ) : <nl> strong_release % 0 : $ T <nl> return % 3 : $ @ thick T . Type <nl> } <nl> - <nl> - / / CHECK - LABEL : sil @ $ test_peephole_objc_to_thick_to_objc : <nl> - / / CHECK : [ [ T : % . * ] ] = apply <nl> - / / CHECK - NOT : objc_to_thick_metatype <nl> - / / CHECK - NOT : thick_to_objc_metatype <nl> - / / CHECK : enum $ Optional < @ objc_metatype AnyObject . Type > , # Optional . some ! enumelt , [ [ T ] ] : $ @ objc_metatype AnyObject . Type <nl> - / / CHECK : } / / end sil function ' $ test_peephole_objc_to_thick_to_objc ' <nl> - <nl> - sil @ $ test_peephole_objc_to_thick_to_objc : $ @ convention ( thin ) ( @ guaranteed NSObject ) - > Optional < UnsafeMutablePointer < OpaquePointer > > { <nl> - / / % 0 " obj " / / users : % 3 , % 2 , % 1 <nl> - bb0 ( % 0 : $ NSObject ) : <nl> - debug_value % 0 : $ NSObject , let , name " obj " , argno 1 / / id : % 1 <nl> - % 2 = objc_method % 0 : $ NSObject , # NSObject . classForCoder ! getter . foreign : ( NSObject ) - > ( ) - > AnyObject . Type , $ @ convention ( objc_method ) ( NSObject ) - > @ objc_metatype AnyObject . Type / / user : % 3 <nl> - % 3 = apply % 2 ( % 0 ) : $ @ convention ( objc_method ) ( NSObject ) - > @ objc_metatype AnyObject . Type / / user : % 4 <nl> - % 4 = objc_to_thick_metatype % 3 : $ @ objc_metatype AnyObject . Type to $ @ thick AnyObject . Type / / users : % 6 , % 5 <nl> - debug_value % 4 : $ @ thick AnyObject . Type , let , name " c " / / id : % 5 <nl> - % 6 = thick_to_objc_metatype % 4 : $ @ thick AnyObject . Type to $ @ objc_metatype AnyObject . Type / / user : % 7 <nl> - % 7 = enum $ Optional < @ objc_metatype AnyObject . Type > , # Optional . some ! enumelt , % 6 : $ @ objc_metatype AnyObject . Type / / user : % 10 <nl> - % 8 = enum $ Optional < UnsafeMutablePointer < UInt32 > > , # Optional . none ! enumelt / / user : % 10 <nl> - / / function_ref class_copyMethodList <nl> - % 9 = function_ref @ class_copyMethodList : $ @ convention ( c ) ( Optional < @ objc_metatype AnyObject . Type > , Optional < UnsafeMutablePointer < UInt32 > > ) - > Optional < UnsafeMutablePointer < OpaquePointer > > / / user : % 10 <nl> - % 10 = apply % 9 ( % 7 , % 8 ) : $ @ convention ( c ) ( Optional < @ objc_metatype AnyObject . Type > , Optional < UnsafeMutablePointer < UInt32 > > ) - > Optional < UnsafeMutablePointer < OpaquePointer > > / / users : % 12 , % 11 <nl> - debug_value % 10 : $ Optional < UnsafeMutablePointer < OpaquePointer > > , let , name " l " / / id : % 11 <nl> - return % 10 : $ Optional < UnsafeMutablePointer < OpaquePointer > > / / id : % 12 <nl> - } <nl> - <nl> - / / CHECK - LABEL : sil @ $ test_peephole_thick_to_objc_to_thick : <nl> - / / CHECK : [ [ T : % . * ] ] = apply <nl> - / / CHECK - NOT : thick_to_objc_metatype <nl> - / / CHECK - NOT : objc_to_thick_metatype <nl> - / / CHECK : return [ [ T ] ] <nl> - / / CHECK : } / / end sil function ' $ test_peephole_thick_to_objc_to_thick ' <nl> - <nl> - sil @ $ test_peephole_thick_to_objc_to_thick : $ @ convention ( thin ) ( @ guaranteed AnyObject ) - > @ thick AnyObject . Type { <nl> - bb0 ( % 0 : $ AnyObject ) : <nl> - % func = function_ref @ foo : $ @ convention ( thin ) ( @ guaranteed AnyObject ) - > @ thick AnyObject . Type <nl> - % res = apply % func ( % 0 ) : $ @ convention ( thin ) ( @ guaranteed AnyObject ) - > @ thick AnyObject . Type <nl> - % objctype = thick_to_objc_metatype % res : $ @ thick AnyObject . Type to $ @ objc_metatype AnyObject . Type <nl> - % thicktype = objc_to_thick_metatype % objctype : $ @ objc_metatype AnyObject . Type to $ @ thick AnyObject . Type <nl> - return % thicktype : $ @ thick AnyObject . Type <nl> - } <nl> - <nl> - / / class_copyMethodList <nl> - sil [ serializable ] [ clang class_copyMethodList ] @ class_copyMethodList : $ @ convention ( c ) ( Optional < @ objc_metatype AnyObject . Type > , Optional < UnsafeMutablePointer < UInt32 > > ) - > Optional < UnsafeMutablePointer < OpaquePointer > > <nl> - sil [ serializable ] @ foo : $ @ convention ( thin ) ( @ guaranteed AnyObject ) - > @ thick AnyObject . Type <nl>
|
Revert " Add new pattern in SILCombine to optimize redundant thick to objc metatype conversions ( ) "
|
apple/swift
|
7ce30d7fd096ddd1d8c56ad78d126c9d16593416
|
2020-05-12T14:07:53Z
|
mmm a / src / code - stubs . cc <nl> ppp b / src / code - stubs . cc <nl> InternalArrayConstructorStub : : InternalArrayConstructorStub ( <nl> <nl> <nl> Representation RepresentationFromType ( Type * type ) { <nl> - if ( type - > Is ( Type : : UntaggedSigned ( ) ) | | type - > Is ( Type : : UntaggedUnsigned ( ) ) ) { <nl> + if ( type - > Is ( Type : : UntaggedIntegral ( ) ) ) { <nl> return Representation : : Integer32 ( ) ; <nl> } <nl> <nl> Representation RepresentationFromType ( Type * type ) { <nl> DCHECK ( ! type - > Is ( Type : : Untagged ( ) ) ) ; <nl> return Representation : : Tagged ( ) ; <nl> } <nl> + <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / compiler / typer . cc <nl> ppp b / src / compiler / typer . cc <nl> Type * Typer : : Visitor : : TypeOsrValue ( Node * node ) { return Type : : Any ( ) ; } <nl> Type * Typer : : Visitor : : TypeInt32Constant ( Node * node ) { <nl> double number = OpParameter < int32_t > ( node ) ; <nl> return Type : : Intersect ( Type : : Range ( number , number , zone ( ) ) , <nl> - Type : : UntaggedSigned32 ( ) , zone ( ) ) ; <nl> + Type : : UntaggedIntegral32 ( ) , zone ( ) ) ; <nl> } <nl> <nl> <nl> Type * ChangeRepresentation ( Type * type , Type * rep , Zone * zone ) { <nl> Type * Typer : : Visitor : : TypeChangeTaggedToInt32 ( Node * node ) { <nl> Type * arg = Operand ( node , 0 ) ; <nl> / / TODO ( neis ) : DCHECK ( arg - > Is ( Type : : Signed32 ( ) ) ) ; <nl> - return ChangeRepresentation ( arg , Type : : UntaggedSigned32 ( ) , zone ( ) ) ; <nl> + return ChangeRepresentation ( arg , Type : : UntaggedIntegral32 ( ) , zone ( ) ) ; <nl> } <nl> <nl> <nl> Type * Typer : : Visitor : : TypeChangeTaggedToUint32 ( Node * node ) { <nl> Type * arg = Operand ( node , 0 ) ; <nl> / / TODO ( neis ) : DCHECK ( arg - > Is ( Type : : Unsigned32 ( ) ) ) ; <nl> - return ChangeRepresentation ( arg , Type : : UntaggedUnsigned32 ( ) , zone ( ) ) ; <nl> + return ChangeRepresentation ( arg , Type : : UntaggedIntegral32 ( ) , zone ( ) ) ; <nl> } <nl> <nl> <nl> Type * Typer : : Visitor : : TypeChangeFloat32ToFloat64 ( Node * node ) { <nl> <nl> <nl> Type * Typer : : Visitor : : TypeChangeFloat64ToInt32 ( Node * node ) { <nl> - return Type : : Intersect ( Type : : Signed32 ( ) , Type : : UntaggedSigned32 ( ) , zone ( ) ) ; <nl> + return Type : : Intersect ( Type : : Signed32 ( ) , Type : : UntaggedIntegral32 ( ) , zone ( ) ) ; <nl> } <nl> <nl> <nl> Type * Typer : : Visitor : : TypeChangeFloat64ToUint32 ( Node * node ) { <nl> - return Type : : Intersect ( Type : : Unsigned32 ( ) , Type : : UntaggedUnsigned32 ( ) , <nl> + return Type : : Intersect ( Type : : Unsigned32 ( ) , Type : : UntaggedIntegral32 ( ) , <nl> zone ( ) ) ; <nl> } <nl> <nl> Type * Typer : : Visitor : : TypeTruncateFloat64ToFloat32 ( Node * node ) { <nl> <nl> <nl> Type * Typer : : Visitor : : TypeTruncateFloat64ToInt32 ( Node * node ) { <nl> - return Type : : Intersect ( Type : : Signed32 ( ) , Type : : UntaggedSigned32 ( ) , zone ( ) ) ; <nl> + return Type : : Intersect ( Type : : Signed32 ( ) , Type : : UntaggedIntegral32 ( ) , zone ( ) ) ; <nl> } <nl> <nl> <nl> Type * Typer : : Visitor : : TypeTruncateInt64ToInt32 ( Node * node ) { <nl> - return Type : : Intersect ( Type : : Signed32 ( ) , Type : : UntaggedSigned32 ( ) , zone ( ) ) ; <nl> + return Type : : Intersect ( Type : : Signed32 ( ) , Type : : UntaggedIntegral32 ( ) , zone ( ) ) ; <nl> } <nl> <nl> <nl> mmm a / src / interface - descriptors . cc <nl> ppp b / src / interface - descriptors . cc <nl> Type * SmiType ( Zone * zone ) { <nl> } <nl> <nl> <nl> - Type * UntaggedSigned32 ( Zone * zone ) { <nl> - return Type : : Intersect ( Type : : Signed32 ( ) , Type : : UntaggedSigned32 ( ) , zone ) ; <nl> + Type * UntaggedIntegral32 ( Zone * zone ) { <nl> + return Type : : Intersect ( Type : : Signed32 ( ) , Type : : UntaggedIntegral32 ( ) , zone ) ; <nl> } <nl> <nl> <nl> LoadGlobalViaContextDescriptor : : BuildCallInterfaceDescriptorFunctionType ( <nl> Zone * zone = isolate - > interface_descriptor_zone ( ) ; <nl> Type : : FunctionType * function = <nl> Type : : FunctionType : : New ( AnyTagged ( zone ) , Type : : Undefined ( ) , 1 , zone ) ; <nl> - function - > InitParameter ( 0 , UntaggedSigned32 ( zone ) ) ; <nl> + function - > InitParameter ( 0 , UntaggedIntegral32 ( zone ) ) ; <nl> return function ; <nl> } <nl> <nl> StoreGlobalViaContextDescriptor : : BuildCallInterfaceDescriptorFunctionType ( <nl> Zone * zone = isolate - > interface_descriptor_zone ( ) ; <nl> Type : : FunctionType * function = <nl> Type : : FunctionType : : New ( AnyTagged ( zone ) , Type : : Undefined ( ) , 2 , zone ) ; <nl> - function - > InitParameter ( 0 , UntaggedSigned32 ( zone ) ) ; <nl> + function - > InitParameter ( 0 , UntaggedIntegral32 ( zone ) ) ; <nl> function - > InitParameter ( 1 , AnyTagged ( zone ) ) ; <nl> return function ; <nl> } <nl> CallTrampolineDescriptor : : BuildCallInterfaceDescriptorFunctionType ( <nl> Type : : FunctionType : : New ( AnyTagged ( zone ) , Type : : Undefined ( ) , 2 , zone ) ; <nl> function - > InitParameter ( 0 , AnyTagged ( zone ) ) ; / / target <nl> function - > InitParameter ( <nl> - 1 , UntaggedSigned32 ( zone ) ) ; / / actual number of arguments <nl> + 1 , UntaggedIntegral32 ( zone ) ) ; / / actual number of arguments <nl> return function ; <nl> } <nl> <nl> ArrayConstructorDescriptor : : BuildCallInterfaceDescriptorFunctionType ( <nl> Type : : FunctionType : : New ( AnyTagged ( zone ) , Type : : Undefined ( ) , 3 , zone ) ; <nl> function - > InitParameter ( 0 , Type : : Receiver ( ) ) ; / / JSFunction <nl> function - > InitParameter ( 1 , AnyTagged ( zone ) ) ; <nl> - function - > InitParameter ( 2 , UntaggedSigned32 ( zone ) ) ; <nl> + function - > InitParameter ( 2 , UntaggedIntegral32 ( zone ) ) ; <nl> return function ; <nl> } <nl> <nl> InternalArrayConstructorDescriptor : : BuildCallInterfaceDescriptorFunctionType ( <nl> Type : : FunctionType * function = <nl> Type : : FunctionType : : New ( AnyTagged ( zone ) , Type : : Undefined ( ) , 2 , zone ) ; <nl> function - > InitParameter ( 0 , Type : : Receiver ( ) ) ; / / JSFunction <nl> - function - > InitParameter ( 1 , UntaggedSigned32 ( zone ) ) ; <nl> + function - > InitParameter ( 1 , UntaggedIntegral32 ( zone ) ) ; <nl> return function ; <nl> } <nl> <nl> ArgumentAdaptorDescriptor : : BuildCallInterfaceDescriptorFunctionType ( <nl> Type : : FunctionType : : New ( AnyTagged ( zone ) , Type : : Undefined ( ) , 3 , zone ) ; <nl> function - > InitParameter ( 0 , Type : : Receiver ( ) ) ; / / JSFunction <nl> function - > InitParameter ( <nl> - 1 , UntaggedSigned32 ( zone ) ) ; / / actual number of arguments <nl> + 1 , UntaggedIntegral32 ( zone ) ) ; / / actual number of arguments <nl> function - > InitParameter ( <nl> 2 , <nl> - UntaggedSigned32 ( zone ) ) ; / / expected number of arguments <nl> + UntaggedIntegral32 ( zone ) ) ; / / expected number of arguments <nl> return function ; <nl> } <nl> <nl> ApiFunctionDescriptor : : BuildCallInterfaceDescriptorFunctionType ( <nl> function - > InitParameter ( 2 , AnyTagged ( zone ) ) ; / / holder <nl> function - > InitParameter ( 3 , ExternalPointer ( zone ) ) ; / / api_function_address <nl> function - > InitParameter ( <nl> - 4 , UntaggedSigned32 ( zone ) ) ; / / actual number of arguments <nl> + 4 , UntaggedIntegral32 ( zone ) ) ; / / actual number of arguments <nl> return function ; <nl> } <nl> <nl> mmm a / src / type - cache . h <nl> ppp b / src / type - cache . h <nl> class TypeCache final { <nl> TypeCache ( ) = default ; <nl> <nl> Type * const kInt8 = <nl> - CreateNative ( CreateRange < int8_t > ( ) , Type : : UntaggedSigned8 ( ) ) ; <nl> + CreateNative ( CreateRange < int8_t > ( ) , Type : : UntaggedIntegral8 ( ) ) ; <nl> Type * const kUint8 = <nl> - CreateNative ( CreateRange < uint8_t > ( ) , Type : : UntaggedUnsigned8 ( ) ) ; <nl> + CreateNative ( CreateRange < uint8_t > ( ) , Type : : UntaggedIntegral8 ( ) ) ; <nl> Type * const kUint8Clamped = kUint8 ; <nl> Type * const kInt16 = <nl> - CreateNative ( CreateRange < int16_t > ( ) , Type : : UntaggedSigned16 ( ) ) ; <nl> + CreateNative ( CreateRange < int16_t > ( ) , Type : : UntaggedIntegral16 ( ) ) ; <nl> Type * const kUint16 = <nl> - CreateNative ( CreateRange < uint16_t > ( ) , Type : : UntaggedUnsigned16 ( ) ) ; <nl> - Type * const kInt32 = CreateNative ( Type : : Signed32 ( ) , Type : : UntaggedSigned32 ( ) ) ; <nl> + CreateNative ( CreateRange < uint16_t > ( ) , Type : : UntaggedIntegral16 ( ) ) ; <nl> + Type * const kInt32 = <nl> + CreateNative ( Type : : Signed32 ( ) , Type : : UntaggedIntegral32 ( ) ) ; <nl> Type * const kUint32 = <nl> - CreateNative ( Type : : Unsigned32 ( ) , Type : : UntaggedUnsigned32 ( ) ) ; <nl> + CreateNative ( Type : : Unsigned32 ( ) , Type : : UntaggedIntegral32 ( ) ) ; <nl> Type * const kFloat32 = CreateNative ( Type : : Number ( ) , Type : : UntaggedFloat32 ( ) ) ; <nl> Type * const kFloat64 = CreateNative ( Type : : Number ( ) , Type : : UntaggedFloat64 ( ) ) ; <nl> <nl> mmm a / src / types . h <nl> ppp b / src / types . h <nl> namespace internal { <nl> <nl> # define REPRESENTATION_BITSET_TYPE_LIST ( V ) \ <nl> V ( None , 0 ) \ <nl> - V ( UntaggedBit , 1u < < 20 | kSemantic ) \ <nl> - V ( UntaggedSigned8 , 1u < < 21 | kSemantic ) \ <nl> - V ( UntaggedSigned16 , 1u < < 22 | kSemantic ) \ <nl> - V ( UntaggedSigned32 , 1u < < 23 | kSemantic ) \ <nl> - V ( UntaggedUnsigned8 , 1u < < 24 | kSemantic ) \ <nl> - V ( UntaggedUnsigned16 , 1u < < 25 | kSemantic ) \ <nl> - V ( UntaggedUnsigned32 , 1u < < 26 | kSemantic ) \ <nl> + V ( UntaggedBit , 1u < < 23 | kSemantic ) \ <nl> + V ( UntaggedIntegral8 , 1u < < 24 | kSemantic ) \ <nl> + V ( UntaggedIntegral16 , 1u < < 25 | kSemantic ) \ <nl> + V ( UntaggedIntegral32 , 1u < < 26 | kSemantic ) \ <nl> V ( UntaggedFloat32 , 1u < < 27 | kSemantic ) \ <nl> V ( UntaggedFloat64 , 1u < < 28 | kSemantic ) \ <nl> V ( UntaggedPointer , 1u < < 29 | kSemantic ) \ <nl> V ( TaggedSigned , 1u < < 30 | kSemantic ) \ <nl> V ( TaggedPointer , 1u < < 31 | kSemantic ) \ <nl> \ <nl> - V ( UntaggedSigned , kUntaggedSigned8 | kUntaggedSigned16 | \ <nl> - kUntaggedSigned32 ) \ <nl> - V ( UntaggedUnsigned , kUntaggedUnsigned8 | kUntaggedUnsigned16 | \ <nl> - kUntaggedUnsigned32 ) \ <nl> - V ( UntaggedIntegral8 , kUntaggedSigned8 | kUntaggedUnsigned8 ) \ <nl> - V ( UntaggedIntegral16 , kUntaggedSigned16 | kUntaggedUnsigned16 ) \ <nl> - V ( UntaggedIntegral32 , kUntaggedSigned32 | kUntaggedUnsigned32 ) \ <nl> - V ( UntaggedIntegral , kUntaggedBit | kUntaggedSigned | kUntaggedUnsigned ) \ <nl> - V ( UntaggedFloat , kUntaggedFloat32 | kUntaggedFloat64 ) \ <nl> - V ( UntaggedNumber , kUntaggedIntegral | kUntaggedFloat ) \ <nl> - V ( Untagged , kUntaggedNumber | kUntaggedPointer ) \ <nl> + V ( UntaggedIntegral , kUntaggedBit | kUntaggedIntegral8 | \ <nl> + kUntaggedIntegral16 | kUntaggedIntegral32 ) \ <nl> + V ( UntaggedFloat , kUntaggedFloat32 | kUntaggedFloat64 ) \ <nl> + V ( UntaggedNumber , kUntaggedIntegral | kUntaggedFloat ) \ <nl> + V ( Untagged , kUntaggedNumber | kUntaggedPointer ) \ <nl> V ( Tagged , kTaggedSigned | kTaggedPointer ) <nl> <nl> # define INTERNAL_BITSET_TYPE_LIST ( V ) \ <nl>
|
[ types ] Use unified integral representation bits .
|
v8/v8
|
6471fbf72ce07b54f154d550724ac063862294c3
|
2015-11-04T08:06:16Z
|
mmm a / editor / import / scene_importer_mesh . cpp <nl> ppp b / editor / import / scene_importer_mesh . cpp <nl> void EditorSceneImporterMesh : : add_surface ( Mesh : : PrimitiveType p_primitive , const <nl> s . arrays = p_arrays ; <nl> s . name = p_name ; <nl> <nl> + Vector < Vector3 > vertex_array = p_arrays [ Mesh : : ARRAY_VERTEX ] ; <nl> + int vertex_count = vertex_array . size ( ) ; <nl> + ERR_FAIL_COND ( vertex_count = = 0 ) ; <nl> + <nl> for ( int i = 0 ; i < blend_shapes . size ( ) ; i + + ) { <nl> Array bsdata = p_blend_shapes [ i ] ; <nl> ERR_FAIL_COND ( bsdata . size ( ) ! = Mesh : : ARRAY_MAX ) ; <nl> + Vector < Vector3 > vertex_data = bsdata [ Mesh : : ARRAY_VERTEX ] ; <nl> + ERR_FAIL_COND ( vertex_data . size ( ) ! = vertex_count ) ; <nl> Surface : : BlendShape bs ; <nl> bs . arrays = bsdata ; <nl> s . blend_shape_data . push_back ( bs ) ; <nl> mmm a / servers / rendering / renderer_rd / renderer_storage_rd . cpp <nl> ppp b / servers / rendering / renderer_rd / renderer_storage_rd . cpp <nl> void RendererStorageRD : : mesh_add_surface ( RID p_mesh , const RS : : SurfaceData & p_su <nl> Mesh * mesh = mesh_owner . getornull ( p_mesh ) ; <nl> ERR_FAIL_COND ( ! mesh ) ; <nl> <nl> - / / ensure blend shape consistency <nl> - ERR_FAIL_COND ( mesh - > blend_shape_count & & p_surface . bone_aabbs . size ( ) ! = mesh - > bone_aabbs . size ( ) ) ; <nl> - <nl> # ifdef DEBUG_ENABLED <nl> / / do a validation , to catch errors first <nl> { <nl> void RendererStorageRD : : mesh_add_surface ( RID p_mesh , const RS : : SurfaceData & p_su <nl> mesh - > bone_aabbs = p_surface . bone_aabbs ; <nl> mesh - > aabb = p_surface . aabb ; <nl> } else { <nl> + if ( mesh - > bone_aabbs . size ( ) < p_surface . bone_aabbs . size ( ) ) { <nl> + / / ArrayMesh : : _surface_set_data only allocates bone_aabbs up to max_bone <nl> + / / Each surface may affect different numbers of bones . <nl> + mesh - > bone_aabbs . resize ( p_surface . bone_aabbs . size ( ) ) ; <nl> + } <nl> for ( int i = 0 ; i < p_surface . bone_aabbs . size ( ) ; i + + ) { <nl> mesh - > bone_aabbs . write [ i ] . merge_with ( p_surface . bone_aabbs [ i ] ) ; <nl> } <nl>
|
Merge pull request from lyuma / bone_aabb_blendshapes
|
godotengine/godot
|
ecda989c85e953ced7c19f161b38c6b054d3acec
|
2020-12-24T16:20:07Z
|
mmm a / example / speech - demo / README . md <nl> ppp b / example / speech - demo / README . md <nl> export LD_LIBRARY_PATH = . . / . . / lib : $ LD_LIBRARY_PATH <nl> python lstm_bucketing . py TIMIT <nl> ` ` ` <nl> <nl> + ` ` ` <nl> Example output for TIMIT : <nl> Summary of dataset = = = = = = = = = = = = = = = = = = <nl> bucket of len 100 : 3 samples <nl> bucket of len 200 : 346 samples <nl> bucket of len 300 : 1496 samples <nl> bucket of len 400 : 974 samples <nl> bucket of len 500 : 420 samples <nl> + bucket of len 600 : 90 samples <nl> + bucket of len 700 : 11 samples <nl> + bucket of len 800 : 2 samples <nl> Summary of dataset = = = = = = = = = = = = = = = = = = <nl> bucket of len 100 : 0 samples <nl> bucket of len 200 : 28 samples <nl> bucket of len 300 : 169 samples <nl> bucket of len 400 : 107 samples <nl> bucket of len 500 : 41 samples <nl> - 2016 - 04 - 18 17 : 32 : 52 , 060 Start training with [ gpu ( 3 ) ] <nl> - 2016 - 04 - 18 17 : 33 : 50 , 466 Epoch [ 0 ] Resetting Data Iterator <nl> - 2016 - 04 - 18 17 : 33 : 50 , 466 Epoch [ 0 ] Train - Accuracy = 0 . 262495 <nl> - 2016 - 04 - 18 17 : 33 : 50 , 466 Epoch [ 0 ] Time cost = 57 . 966 <nl> - 2016 - 04 - 18 17 : 33 : 56 , 911 Epoch [ 0 ] Validation - Accuracy = 0 . 389623 <nl> - 2016 - 04 - 18 17 : 34 : 52 , 226 Epoch [ 1 ] Resetting Data Iterator <nl> - 2016 - 04 - 18 17 : 34 : 52 , 226 Epoch [ 1 ] Train - Accuracy = 0 . 460667 <nl> - 2016 - 04 - 18 17 : 34 : 52 , 226 Epoch [ 1 ] Time cost = 55 . 315 <nl> - 2016 - 04 - 18 17 : 34 : 58 , 703 Epoch [ 1 ] Validation - Accuracy = 0 . 466534 <nl> + bucket of len 600 : 6 samples <nl> + bucket of len 700 : 3 samples <nl> + bucket of len 800 : 0 samples <nl> + 2016 - 04 - 21 20 : 02 : 40 , 904 Epoch [ 0 ] Train - Acc_exlude_padding = 0 . 154763 <nl> + 2016 - 04 - 21 20 : 02 : 40 , 904 Epoch [ 0 ] Time cost = 91 . 574 <nl> + 2016 - 04 - 21 20 : 02 : 44 , 419 Epoch [ 0 ] Validation - Acc_exlude_padding = 0 . 353552 <nl> + 2016 - 04 - 21 20 : 04 : 17 , 290 Epoch [ 1 ] Train - Acc_exlude_padding = 0 . 447318 <nl> + 2016 - 04 - 21 20 : 04 : 17 , 290 Epoch [ 1 ] Time cost = 92 . 870 <nl> + 2016 - 04 - 21 20 : 04 : 20 , 738 Epoch [ 1 ] Validation - Acc_exlude_padding = 0 . 506458 <nl> + 2016 - 04 - 21 20 : 05 : 53 , 127 Epoch [ 2 ] Train - Acc_exlude_padding = 0 . 557543 <nl> + 2016 - 04 - 21 20 : 05 : 53 , 128 Epoch [ 2 ] Time cost = 92 . 390 <nl> + 2016 - 04 - 21 20 : 05 : 56 , 568 Epoch [ 2 ] Validation - Acc_exlude_padding = 0 . 548100 <nl> + ` ` ` <nl> + <nl> + The final frame accuracy was around 62 % . <nl> mmm a / example / speech - demo / lstm_bucketing . py <nl> ppp b / example / speech - demo / lstm_bucketing . py <nl> def provide_data ( self ) : <nl> def provide_label ( self ) : <nl> return [ ( n , x . shape ) for n , x in zip ( self . label_names , self . label ) ] <nl> <nl> - class Accuracy2 ( mx . metric . EvalMetric ) : <nl> - " " " Calculate accuracy " " " <nl> - <nl> - def __init__ ( self ) : <nl> - super ( Accuracy2 , self ) . __init__ ( ' Accuracy ' ) <nl> - <nl> - def update ( self , labels , preds ) : <nl> - mx . metric . check_label_shapes ( labels , preds ) <nl> - <nl> - for i in range ( len ( labels ) ) : <nl> - pred_label = ndarray . argmax_channel ( preds [ i ] ) . asnumpy ( ) . astype ( ' int32 ' ) <nl> - label = labels [ i ] . asnumpy ( ) . astype ( ' int32 ' ) <nl> - <nl> - mx . metric . check_label_shapes ( label , pred_label ) <nl> + def Acc_exlude_padding ( labels , preds ) : <nl> + labels = labels . T . reshape ( ( - 1 , ) ) <nl> + sum_metric = 0 <nl> + num_inst = 0 <nl> + for i in range ( preds . shape [ 0 ] ) : <nl> + pred_label = np . argmax ( preds [ i ] , axis = 0 ) <nl> + label = labels [ i ] <nl> <nl> - ind = np . nonzero ( label . flat ) <nl> - pred_label_real = pred_label . flat [ ind ] <nl> - # print label , pred_label , ind <nl> - label_real = label . flat [ ind ] <nl> - self . sum_metric + = ( pred_label_real = = label_real ) . sum ( ) <nl> - self . num_inst + = len ( pred_label_real ) <nl> + ind = np . nonzero ( label . flat ) <nl> + pred_label_real = pred_label . flat [ ind ] <nl> + # print label , pred_label , ind <nl> + label_real = label . flat [ ind ] <nl> + sum_metric + = ( pred_label_real = = label_real ) . sum ( ) <nl> + num_inst + = len ( pred_label_real ) <nl> + return sum_metric , num_inst <nl> <nl> <nl> class BucketSentenceIter ( mx . io . DataIter ) : <nl> def __init__ ( self , train_sets , buckets , batch_size , <nl> - init_states , n_batch = None , <nl> + init_states , delay = 5 , feat_dim = 40 , n_batch = None , <nl> data_name = ' data ' , label_name = ' label ' ) : <nl> <nl> self . train_sets = train_sets <nl> def __init__ ( self , train_sets , buckets , batch_size , <nl> buckets . sort ( ) <nl> self . buckets = buckets <nl> self . data = [ [ ] for k in buckets ] <nl> - self . label = [ [ ] for k in buckets ] <nl> - <nl> - self . default_bucket_key = buckets [ 0 ] <nl> + # self . label = [ [ ] for k in buckets ] <nl> + self . feat_dim = feat_dim <nl> + self . default_bucket_key = max ( buckets ) <nl> <nl> n = 0 <nl> while True : <nl> def __init__ ( self , train_sets , buckets , batch_size , <nl> for i , bkt in enumerate ( buckets ) : <nl> if bkt > = feats . shape [ 0 ] : <nl> n = n + 1 <nl> - self . data [ i ] . append ( ( feats , tgts ) ) <nl> + self . data [ i ] . append ( ( feats , tgts + 1 ) ) <nl> break <nl> # we just ignore the sentence it is longer than the maximum <nl> # bucket size here <nl> <nl> + # convert data into ndarrays for better speed during training <nl> + data = [ np . zeros ( ( len ( x ) , buckets [ i ] , self . feat_dim ) ) for i , x in enumerate ( self . data ) ] <nl> + label = [ np . zeros ( ( len ( x ) , buckets [ i ] ) ) for i , x in enumerate ( self . data ) ] <nl> + for i_bucket in range ( len ( self . buckets ) ) : <nl> + for j in range ( len ( self . data [ i_bucket ] ) ) : <nl> + sentence = self . data [ i_bucket ] [ j ] <nl> + sentence [ 1 ] [ delay : ] = sentence [ 1 ] [ : - delay ] <nl> + sentence [ 1 ] [ : delay ] = [ sentence [ 1 ] [ 0 ] ] * delay <nl> + data [ i_bucket ] [ j , : len ( sentence [ 0 ] ) ] = sentence [ 0 ] <nl> + label [ i_bucket ] [ j , : len ( sentence [ 1 ] ) ] = sentence [ 1 ] <nl> + self . data = data <nl> + self . label = label <nl> + <nl> + <nl> # Get the size of each bucket , so that we could sample <nl> # uniformly from the bucket <nl> bucket_sizes = [ len ( x ) for x in self . data ] <nl> def __init__ ( self , train_sets , buckets , batch_size , <nl> <nl> self . bucket_sizes = bucket_sizes <nl> self . batch_size = batch_size <nl> + self . make_data_iter_plan ( ) <nl> + <nl> if n_batch is None : <nl> n_batch = int ( bucket_size_tot / batch_size ) <nl> self . n_batch = n_batch <nl> def __init__ ( self , train_sets , buckets , batch_size , <nl> self . init_states = init_states <nl> self . init_state_arrays = [ mx . nd . zeros ( x [ 1 ] ) for x in init_states ] <nl> <nl> - self . provide_data = [ ( ' % s / % d ' % ( self . data_name , t ) , ( self . batch_size , 40 ) ) <nl> - for t in range ( self . default_bucket_key ) ] + init_states <nl> - self . provide_label = [ ( ' % s / % d ' % ( self . label_name , t ) , ( self . batch_size , ) ) <nl> - for t in range ( self . default_bucket_key ) ] <nl> + # self . provide_data = [ ( ' % s / % d ' % ( self . data_name , t ) , ( self . batch_size , 40 ) ) <nl> + # for t in range ( self . default_bucket_key ) ] + init_states <nl> + # self . provide_label = [ ( ' % s / % d ' % ( self . label_name , t ) , ( self . batch_size , ) ) <nl> + # for t in range ( self . default_bucket_key ) ] <nl> + self . provide_data = [ ( ' data ' , ( batch_size , self . default_bucket_key , self . feat_dim ) ) ] + init_states <nl> + self . provide_label = [ ( ' softmax_label ' , ( self . batch_size , self . default_bucket_key ) ) ] <nl> + <nl> + def make_data_iter_plan ( self ) : <nl> + " make a random data iteration plan " <nl> + # truncate each bucket into multiple of batch - size <nl> + bucket_n_batches = [ ] <nl> + for i in range ( len ( self . data ) ) : <nl> + bucket_n_batches . append ( len ( self . data [ i ] ) / self . batch_size ) <nl> + self . data [ i ] = self . data [ i ] [ : int ( bucket_n_batches [ i ] * self . batch_size ) , : ] <nl> + self . label [ i ] = self . label [ i ] [ : int ( bucket_n_batches [ i ] * self . batch_size ) ] <nl> + <nl> + bucket_plan = np . hstack ( [ np . zeros ( n , int ) + i for i , n in enumerate ( bucket_n_batches ) ] ) <nl> + np . random . shuffle ( bucket_plan ) <nl> + <nl> + bucket_idx_all = [ np . random . permutation ( len ( x ) ) for x in self . data ] <nl> + <nl> + self . bucket_plan = bucket_plan <nl> + self . bucket_idx_all = bucket_idx_all <nl> + self . bucket_curr_idx = [ 0 for x in self . data ] <nl> + <nl> + self . data_buffer = [ ] <nl> + self . label_buffer = [ ] <nl> + for i_bucket in range ( len ( self . data ) ) : <nl> + data = np . zeros ( ( self . batch_size , self . buckets [ i_bucket ] , self . feat_dim ) ) <nl> + label = np . zeros ( ( self . batch_size , self . buckets [ i_bucket ] ) ) <nl> + self . data_buffer . append ( data ) <nl> + self . label_buffer . append ( label ) <nl> + <nl> <nl> def __iter__ ( self ) : <nl> init_state_names = [ x [ 0 ] for x in self . init_states ] <nl> - idx_bucket = np . arange ( len ( self . buckets ) ) <nl> - i = 0 <nl> - for i_bucket in idx_bucket : <nl> - idx_list = np . arange ( self . bucket_sizes [ i_bucket ] , dtype = " int32 " ) <nl> - np . random . shuffle ( idx_list ) <nl> - <nl> - for s , i_batch in enumerate ( idx_list ) : <nl> - <nl> - if i = = 0 : <nl> - data = np . zeros ( ( self . batch_size , self . buckets [ i_bucket ] , 40 ) ) <nl> - label = np . zeros ( ( self . batch_size , self . buckets [ i_bucket ] ) ) <nl> - <nl> - sentence = self . data [ i_bucket ] [ i_batch ] [ 0 ] <nl> - tgt = self . data [ i_bucket ] [ i_batch ] [ 1 ] <nl> - data [ i , : len ( sentence ) , : ] = sentence <nl> - label [ i , : len ( tgt ) ] = tgt + 1 <nl> - <nl> - i = i + 1 <nl> - if i = = self . batch_size or s = = ( len ( idx_list ) - 1 ) : <nl> - data_all = [ mx . nd . array ( data [ : , t , : ] ) <nl> - for t in range ( self . buckets [ i_bucket ] ) ] + self . init_state_arrays <nl> - label_all = [ mx . nd . array ( label [ : , t ] ) <nl> - for t in range ( self . buckets [ i_bucket ] ) ] <nl> - data_names = [ ' % s / % d ' % ( self . data_name , t ) <nl> - for t in range ( self . buckets [ i_bucket ] ) ] + init_state_names <nl> - label_names = [ ' % s / % d ' % ( self . label_name , t ) <nl> - for t in range ( self . buckets [ i_bucket ] ) ] <nl> - <nl> - data_batch = SimpleBatch ( data_names , data_all , label_names , label_all , <nl> - self . buckets [ i_bucket ] ) <nl> - i = 0 <nl> - yield data_batch <nl> <nl> + for i_bucket in self . bucket_plan : <nl> + data = self . data_buffer [ i_bucket ] <nl> + label = self . label_buffer [ i_bucket ] <nl> + <nl> + i_idx = self . bucket_curr_idx [ i_bucket ] <nl> + idx = self . bucket_idx_all [ i_bucket ] [ i_idx : i_idx + self . batch_size ] <nl> + self . bucket_curr_idx [ i_bucket ] + = self . batch_size <nl> + data [ : ] = self . data [ i_bucket ] [ idx ] <nl> + label [ : ] = self . label [ i_bucket ] [ idx ] <nl> + data_all = [ mx . nd . array ( data [ : , : , : ] ) ] + self . init_state_arrays <nl> + label_all = [ mx . nd . array ( label ) ] <nl> + data_names = [ ' data ' ] + init_state_names <nl> + label_names = [ ' softmax_label ' ] <nl> + <nl> + data_batch = SimpleBatch ( data_names , data_all , label_names , label_all , <nl> + self . buckets [ i_bucket ] ) <nl> + yield data_batch <nl> + <nl> + def reset ( self ) : <nl> + self . bucket_curr_idx = [ 0 for x in self . data ] <nl> # we define a new unrolling function here because the original <nl> # one in lstm . py concats all the labels at the last layer together , <nl> # making the mini - batch size of the label different from the data . <nl> def lstm_unroll ( num_lstm_layer , seq_len , input_size , <nl> last_states . append ( state ) <nl> assert ( len ( last_states ) = = num_lstm_layer ) <nl> <nl> - loss_all = [ ] <nl> + data = mx . sym . Variable ( ' data ' ) <nl> + label = mx . sym . Variable ( ' softmax_label ' ) <nl> + <nl> + dataSlice = mx . sym . SliceChannel ( data = data , num_outputs = seq_len , squeeze_axis = 1 ) <nl> + <nl> + hidden_all = [ ] <nl> for seqidx in range ( seq_len ) : <nl> - hidden = mx . sym . Variable ( " data / % d " % seqidx ) <nl> + hidden = dataSlice [ seqidx ] <nl> <nl> # stack LSTM <nl> for i in range ( num_lstm_layer ) : <nl> def lstm_unroll ( num_lstm_layer , seq_len , input_size , <nl> # decoder <nl> if dropout > 0 . : <nl> hidden = mx . sym . Dropout ( data = hidden , p = dropout ) <nl> - fc = mx . sym . FullyConnected ( data = hidden , weight = cls_weight , bias = cls_bias , <nl> - num_hidden = num_label ) <nl> - sm = mx . sym . SoftmaxOutput ( data = fc , label = mx . sym . Variable ( ' label / % d ' % seqidx ) , <nl> - name = ' t % d_sm ' % seqidx ) <nl> - loss_all . append ( sm ) <nl> - <nl> - # for i in range ( num_lstm_layer ) : <nl> - # state = last_states [ i ] <nl> - # state = LSTMState ( c = mx . sym . BlockGrad ( state . c , name = " l % d_last_c " % i ) , <nl> - # h = mx . sym . BlockGrad ( state . h , name = " l % d_last_h " % i ) ) <nl> - # last_states [ i ] = state <nl> - # <nl> - # unpack_c = [ state . c for state in last_states ] <nl> - # unpack_h = [ state . h for state in last_states ] <nl> - # <nl> - # return mx . sym . Group ( loss_all + unpack_c + unpack_h ) <nl> - return mx . sym . Group ( loss_all ) <nl> + hidden_all . append ( hidden ) <nl> + <nl> + hidden_concat = mx . sym . Concat ( * hidden_all , dim = 0 ) <nl> + pred = mx . sym . FullyConnected ( data = hidden_concat , num_hidden = num_label , <nl> + weight = cls_weight , bias = cls_bias , name = ' pred ' ) <nl> + <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + # Make label the same shape as our produced data path <nl> + # I did not observe big speed difference between the following two ways <nl> + <nl> + label = mx . sym . transpose ( data = label ) <nl> + label = mx . sym . Reshape ( data = label , target_shape = ( 0 , ) ) <nl> + <nl> + # label_slice = mx . sym . SliceChannel ( data = label , num_outputs = seq_len ) <nl> + # label = [ label_slice [ t ] for t in range ( seq_len ) ] <nl> + # label = mx . sym . Concat ( * label , dim = 0 ) <nl> + # label = mx . sym . Reshape ( data = label , target_shape = ( 0 , ) ) <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + <nl> + sm = mx . sym . SoftmaxOutput ( data = pred , label = label , name = ' softmax ' ) <nl> + <nl> + return sm <nl> + <nl> <nl> <nl> if __name__ = = ' __main__ ' : <nl> batch_size = 40 <nl> - buckets = [ 100 , 200 , 300 , 400 , 500 ] <nl> - num_hidden = 512 <nl> - num_lstm_layer = 2 <nl> + buckets = [ 100 , 200 , 300 , 400 , 500 , 600 , 700 , 800 ] <nl> + num_hidden = 1024 <nl> + num_lstm_layer = 3 <nl> <nl> - num_epoch = 50 <nl> + num_epoch = 20 <nl> learning_rate = 0 . 002 <nl> momentum = 0 . 9 <nl> <nl> def lstm_unroll ( num_lstm_layer , seq_len , input_size , <nl> <nl> feat_dim = 40 <nl> label_dim = 1955 + 1 <nl> - def sym_gen ( seq_len ) : <nl> - return lstm_unroll ( num_lstm_layer , seq_len , feat_dim , <nl> - num_hidden = num_hidden , <nl> - num_label = label_dim ) <nl> <nl> init_c = [ ( ' l % d_init_c ' % l , ( batch_size , num_hidden ) ) for l in range ( num_lstm_layer ) ] <nl> init_h = [ ( ' l % d_init_h ' % l , ( batch_size , num_hidden ) ) for l in range ( num_lstm_layer ) ] <nl> init_states = init_c + init_h <nl> <nl> + state_names = [ x [ 0 ] for x in init_states ] <nl> + def sym_gen ( seq_len ) : <nl> + sym = lstm_unroll ( num_lstm_layer , seq_len , feat_dim , <nl> + num_hidden = num_hidden , <nl> + num_label = label_dim ) <nl> + data_names = [ ' data ' ] + state_names <nl> + label_names = [ ' softmax_label ' ] <nl> + return ( sym , data_names , label_names ) <nl> + <nl> + <nl> <nl> train_data = DATASETS [ sys . argv [ 1 ] + " _train " ] <nl> dev_data = DATASETS [ sys . argv [ 1 ] + " _dev " ] <nl> def sym_gen ( seq_len ) : <nl> data_val = BucketSentenceIter ( dev_sets , <nl> buckets , batch_size , init_states ) <nl> <nl> - model = mx . model . FeedForward ( <nl> - ctx = contexts , <nl> - symbol = sym_gen , <nl> - num_epoch = num_epoch , <nl> - # learning_rate = learning_rate , <nl> - # momentum = momentum , <nl> - optimizer = " adam " , <nl> - wd = 0 . 0 , <nl> - initializer = mx . init . Xavier ( factor_type = " in " , magnitude = 2 . 34 ) ) <nl> + model = mx . mod . BucketingModule ( sym_gen , default_bucket_key = data_train . default_bucket_key , context = contexts ) <nl> + <nl> import logging <nl> head = ' % ( asctime ) - 15s % ( message ) s ' <nl> logging . basicConfig ( level = logging . DEBUG , format = head ) <nl> - <nl> - model . fit ( X = data_train , eval_data = data_val , eval_metric = Accuracy2 ( ) , <nl> - batch_end_callback = mx . callback . Speedometer ( batch_size , 100 ) , ) <nl> - <nl> + model . fit ( data_train , eval_data = data_val , num_epoch = num_epoch , <nl> + eval_metric = mx . metric . np ( Acc_exlude_padding ) , <nl> + batch_end_callback = mx . callback . Speedometer ( batch_size , 100 ) , <nl> + initializer = mx . init . Xavier ( factor_type = " in " , magnitude = 2 . 34 ) , <nl> + optimizer = " adam " , <nl> + optimizer_params = { ' learning_rate ' : 0 . 002 , ' wd ' : 0 . 0 } ) <nl> + # optimizer = ' sgd ' , <nl> + # optimizer_params = { ' learning_rate ' : 0 . 002 , ' momentum ' : 0 . 9 , ' wd ' : 0 . 00001 } ) <nl> + <nl> + <nl> + # model . score ( data_val , eval_metric ) <nl> + # for name , val in metric . get_name_value ( ) : <nl> + # logging . info ( ' validation - % s = % f ' , name , val ) <nl> mmm a / python / mxnet / metric . py <nl> ppp b / python / mxnet / metric . py <nl> def update ( self , labels , preds ) : <nl> if pred . shape [ 1 ] = = 2 : <nl> pred = pred [ : , 1 ] <nl> <nl> - self . sum_metric + = self . _feval ( label , pred ) <nl> - self . num_inst + = 1 <nl> + reval = self . _feval ( label , pred ) <nl> + if isinstance ( reval , tuple ) : <nl> + ( sum_metric , num_inst ) = reval <nl> + self . sum_metric + = sum_metric <nl> + self . num_inst + = num_inst <nl> + else : <nl> + self . sum_metric + = reval <nl> + self . num_inst + = 1 <nl> <nl> # pylint : disable = invalid - name <nl> def np ( numpy_feval , name = None ) : <nl> mmm a / python / mxnet / optimizer . py <nl> ppp b / python / mxnet / optimizer . py <nl> class Adam ( Optimizer ) : <nl> clip_gradient : float , optional <nl> clip gradient in range [ - clip_gradient , clip_gradient ] <nl> " " " <nl> - def __init__ ( self , beta1 = 0 . 9 , beta2 = 0 . 999 , epsilon = 1e - 8 , <nl> + def __init__ ( self , learning_rate = 0 . 002 , beta1 = 0 . 9 , beta2 = 0 . 999 , epsilon = 1e - 8 , <nl> decay_factor = ( 1 - 1e - 8 ) , * * kwargs ) : <nl> - super ( Adam , self ) . __init__ ( * * kwargs ) <nl> + super ( Adam , self ) . __init__ ( learning_rate = learning_rate , * * kwargs ) <nl> self . beta1 = beta1 <nl> self . beta2 = beta2 <nl> self . epsilon = epsilon <nl>
|
Merge pull request from yzhang87 / master
|
apache/incubator-mxnet
|
234d1efdf42988c78dad429ce8d14441abeb04b9
|
2016-04-23T04:41:49Z
|
mmm a / hphp / runtime / base / program - functions . cpp <nl> ppp b / hphp / runtime / base / program - functions . cpp <nl> static int start_server ( const std : : string & username , int xhprof ) { <nl> <nl> if ( RuntimeOption : : EvalEnableNuma & & ! getenv ( " HHVM_DISABLE_NUMA " ) ) { <nl> purge_all ( ) ; <nl> - enable_numa ( RuntimeOption : : EvalEnableNumaLocal ) ; <nl> + enable_numa ( ) ; <nl> BootStats : : mark ( " enable_numa " ) ; <nl> } <nl> + # ifdef USE_JEMALLOC <nl> + / / Local arenas for worker threads , created even when NUMA isn ' t used . <nl> + setup_local_arenas ( ) ; <nl> + # endif <nl> <nl> HttpServer : : CheckMemAndWait ( true ) ; / / Final wait <nl> if ( readaheadThread . get ( ) ) { <nl> mmm a / hphp / runtime / base / runtime - option . h <nl> ppp b / hphp / runtime / base / runtime - option . h <nl> struct RuntimeOption { <nl> F ( string , PCRECacheType , std : : string ( " static " ) ) \ <nl> F ( bool , EnableCompactBacktrace , true ) \ <nl> F ( bool , EnableNuma , ServerExecutionMode ( ) ) \ <nl> - F ( bool , EnableNumaLocal , ServerExecutionMode ( ) ) \ <nl> / * Use 1G pages for jemalloc metadata . * / \ <nl> F ( bool , EnableArenaMetadata1GPage , false ) \ <nl> / * Use 1G pages for jemalloc metadata ( NUMA arenas if applicable ) . * / \ <nl> mmm a / hphp / util / alloc . cpp <nl> ppp b / hphp / util / alloc . cpp <nl> void flush_thread_stack ( ) { <nl> } <nl> <nl> # if ! defined USE_JEMALLOC | | ! defined HAVE_NUMA <nl> - void enable_numa ( bool local ) { } <nl> + void enable_numa ( ) { } <nl> void set_numa_binding ( int node ) { } <nl> void * mallocx_on_node ( size_t size , int node , size_t align ) { <nl> void * ret = nullptr ; <nl> static std : : atomic < size_t > a0ReservedLeft ( 0 ) ; <nl> __thread int high_arena_tcache = - 1 ; <nl> # endif <nl> <nl> - # ifdef HAVE_NUMA <nl> - static uint32_t base_arena ; <nl> - static bool threads_bind_local = false ; <nl> - <nl> - void enable_numa ( bool local ) { <nl> - if ( local ) { <nl> - threads_bind_local = true ; <nl> - <nl> - unsigned arenas ; <nl> - if ( mallctlRead < unsigned , true > ( " arenas . narenas " , & arenas ) ! = 0 ) { <nl> - return ; <nl> - } <nl> - <nl> - base_arena = arenas ; <nl> - for ( int i = 0 ; i < numa_num_nodes ; i + + ) { <nl> - int arena , ret ; <nl> + static unsigned base_arena ; <nl> <nl> + / / Create an arena per NUMA node for use by VM worker threads . This is done even <nl> + / / when there is only one socket , or when HAVE_NUMA isn ' t defined . Note that it <nl> + / / throws if arena creation fails . <nl> + void setup_local_arenas ( ) { <nl> + mallctlRead < unsigned > ( " arenas . narenas " , & base_arena ) ; / / throw upon failure <nl> + for ( int i = 0 ; i < num_numa_nodes ( ) ; i + + ) { <nl> + unsigned arena = 0 ; <nl> # if USE_JEMALLOC_EXTENT_HOOKS <nl> - if ( jemallocMetadataCanUseHuge . load ( ) & & enableNumaArenaMetadata1GPage ) { <nl> - size_t size = sizeof ( unsigned ) ; <nl> - extent_hooks_t * hooks = & huge_page_metadata_hooks ; <nl> - ret = mallctl ( JEMALLOC_NEW_ARENA_CMD , & arena , & size , & hooks , <nl> - sizeof ( hooks ) ) ; <nl> - } else <nl> - # endif <nl> - { <nl> - ret = mallctlRead < int , true > ( JEMALLOC_NEW_ARENA_CMD , & arena ) ; <nl> - } <nl> - <nl> - if ( ret ! = 0 ) { <nl> - return ; <nl> + if ( jemallocMetadataCanUseHuge . load ( ) & & enableNumaArenaMetadata1GPage ) { <nl> + size_t size = sizeof ( unsigned ) ; <nl> + extent_hooks_t * hooks = & huge_page_metadata_hooks ; <nl> + if ( mallctl ( JEMALLOC_NEW_ARENA_CMD , <nl> + & arena , & size , & hooks , sizeof ( hooks ) ) ) { <nl> + throw std : : runtime_error { JEMALLOC_NEW_ARENA_CMD " failed " } ; <nl> } <nl> - if ( arena ! = arenas ) { <nl> - return ; <nl> - } <nl> - arenas + + ; <nl> + } else <nl> + # endif <nl> + { <nl> + mallctlRead < unsigned > ( JEMALLOC_NEW_ARENA_CMD , & arena ) ; <nl> } <nl> + always_assert ( arena = = base_arena + i ) ; <nl> } <nl> + } <nl> <nl> - if ( numa_available ( ) < 0 ) return ; <nl> + # ifdef HAVE_NUMA <nl> <nl> + void enable_numa ( ) { <nl> + if ( numa_available ( ) < 0 ) return ; <nl> / * <nl> * libnuma is only partially aware of taskset . If on entry , <nl> * you have completely disabled a node via taskset , the node <nl> void enable_numa ( bool local ) { <nl> } <nl> <nl> void set_numa_binding ( int node ) { <nl> - if ( node < 0 ) return ; <nl> - <nl> + if ( node < 0 ) return ; / / thread not created from JobQueue <nl> s_numaNode = node ; <nl> + unsigned arena = base_arena + node ; <nl> + mallctlWrite ( " thread . arena " , arena ) ; <nl> <nl> if ( use_numa ) { <nl> numa_sched_setaffinity ( 0 , node_to_cpu_mask [ node ] ) ; <nl> - if ( threads_bind_local ) { <nl> - numa_set_interleave_mask ( numa_no_nodes_ptr ) ; <nl> - bitmask * nodes = numa_allocate_nodemask ( ) ; <nl> - numa_bitmask_setbit ( nodes , node ) ; <nl> - numa_set_membind ( nodes ) ; <nl> - numa_bitmask_free ( nodes ) ; <nl> - } <nl> - } <nl> - if ( threads_bind_local ) { <nl> - int arena = base_arena + node ; <nl> - mallctlWrite ( " thread . arena " , arena ) ; <nl> + numa_set_interleave_mask ( numa_no_nodes_ptr ) ; <nl> + bitmask * nodes = numa_allocate_nodemask ( ) ; <nl> + numa_bitmask_setbit ( nodes , node ) ; <nl> + numa_set_membind ( nodes ) ; <nl> + numa_bitmask_free ( nodes ) ; <nl> } <nl> } <nl> <nl> mmm a / hphp / util / alloc . h <nl> ppp b / hphp / util / alloc . h <nl> extern int low_arena_flags ; <nl> extern int lower_arena_flags ; <nl> extern __thread int high_arena_flags ; <nl> <nl> + void setup_local_arenas ( ) ; <nl> + <nl> # if USE_JEMALLOC_EXTENT_HOOKS <nl> <nl> / / Explicit per - thread tcache for the huge arenas . <nl> extern __thread MemBlock s_tlSpace ; <nl> extern __thread MemBlock s_hugeRange ; <nl> <nl> / * <nl> - * enable the numa support in hhvm , <nl> - * and determine whether threads should default to using <nl> - * local memory . <nl> + * Enable the numa support in hhvm . <nl> * / <nl> - void enable_numa ( bool local ) ; <nl> + void enable_numa ( ) ; <nl> / * <nl> * Set the thread affinity , and the jemalloc arena for the current <nl> * thread . <nl>
|
always create the local arena
|
facebook/hhvm
|
208aa3d2e7567bf82117db280bcdc727b5469be1
|
2019-04-21T05:42:33Z
|
mmm a / jstests / aggregation / sources / merge / all_modes . js <nl> ppp b / jstests / aggregation / sources / merge / all_modes . js <nl> const target = db . all_modes_target ; <nl> assert ( target . drop ( ) ) ; <nl> assert . commandWorked ( <nl> target . insert ( [ { _id : 1 , a : 10 , c : " x " } , { _id : 3 , a : 30 , c : " y " } , { _id : 4 , a : 40 , c : " z " } ] ) ) ; <nl> - const error = assert . throws ( <nl> - ( ) = > source . aggregate ( <nl> - [ { $ merge : { into : target . getName ( ) , whenMatched : " merge " , whenNotMatched : " fail " } } ] ) ) ; <nl> + const error = assert . throws ( ( ) = > source . aggregate ( [ <nl> + { $ sort : { _id : 1 } } , <nl> + { $ _internalInhibitOptimization : { } } , <nl> + { $ merge : { into : target . getName ( ) , whenMatched : " merge " , whenNotMatched : " fail " } } <nl> + ] ) ) ; <nl> assert . commandFailedWithCode ( error , ErrorCodes . MergeStageNoMatchingDocument ) ; <nl> assertArrayEq ( { <nl> actual : target . find ( ) . toArray ( ) , <nl>
|
SERVER - 48321 Tests for $ merge should not assume ordering
|
mongodb/mongo
|
102a0f671d454eb27f6edd3e2135a1d0815d47ef
|
2020-05-21T14:25:38Z
|
mmm a / guetzli / butteraugli_comparator . cc <nl> ppp b / guetzli / butteraugli_comparator . cc <nl> <nl> <nl> namespace guetzli { <nl> <nl> - namespace { <nl> - using : : butteraugli : : ConstRestrict ; <nl> - using : : butteraugli : : ImageF ; <nl> - using : : butteraugli : : CreatePlanes ; <nl> - using : : butteraugli : : PlanesFromPacked ; <nl> - using : : butteraugli : : PackedFromPlanes ; <nl> - <nl> - std : : vector < ImageF > LinearRgb ( const size_t xsize , const size_t ysize , <nl> - const std : : vector < uint8_t > & rgb ) { <nl> - const double * lut = Srgb8ToLinearTable ( ) ; <nl> - std : : vector < ImageF > planes = CreatePlanes < float > ( xsize , ysize , 3 ) ; <nl> - for ( int c = 0 ; c < 3 ; + + c ) { <nl> - for ( size_t y = 0 ; y < ysize ; + + y ) { <nl> - ConstRestrict < const uint8_t * > row_in = & rgb [ 3 * xsize * y ] ; <nl> - ConstRestrict < float * > row_out = planes [ c ] . Row ( y ) ; <nl> - for ( size_t x = 0 ; x < xsize ; + + x ) { <nl> - row_out [ x ] = lut [ row_in [ 3 * x + c ] ] ; <nl> - } <nl> - } <nl> - } <nl> - return planes ; <nl> - } <nl> - <nl> - } / / namespace <nl> - <nl> ButteraugliComparator : : ButteraugliComparator ( const int width , const int height , <nl> const std : : vector < uint8_t > & rgb , <nl> const float target_distance , <nl> ButteraugliComparator : : ButteraugliComparator ( const int width , const int height , <nl> : width_ ( width ) , <nl> height_ ( height ) , <nl> target_distance_ ( target_distance ) , <nl> + rgb_linear_pregamma_ ( 3 , std : : vector < float > ( width_ * height_ ) ) , <nl> comparator_ ( width_ , height_ , kButteraugliStep ) , <nl> distance_ ( 0 . 0 ) , <nl> distmap_ ( width_ , height_ ) , <nl> stats_ ( stats ) { <nl> - rgb_linear_pregamma_ = LinearRgb ( width , height , rgb ) ; <nl> + const double * lut = Srgb8ToLinearTable ( ) ; <nl> + for ( int c = 0 ; c < 3 ; + + c ) { <nl> + for ( int y = 0 , ix = 0 ; y < height_ ; + + y ) { <nl> + for ( int x = 0 ; x < width_ ; + + x , + + ix ) { <nl> + rgb_linear_pregamma_ [ c ] [ ix ] = lut [ rgb [ 3 * ix + c ] ] ; <nl> + } <nl> + } <nl> + } <nl> const int block_w = ( width_ + 7 ) / 8 ; <nl> const int block_h = ( height_ + 7 ) / 8 ; <nl> const int nblocks = block_w * block_h ; <nl> ButteraugliComparator : : ButteraugliComparator ( const int width , const int height , <nl> for ( int ix = 0 ; ix < 8 ; + + ix , + + i ) { <nl> int x = std : : min ( 8 * block_x + ix , width_ - 1 ) ; <nl> int y = std : : min ( 8 * block_y + iy , height_ - 1 ) ; <nl> + int px = y * width_ + x ; <nl> for ( int c = 0 ; c < 3 ; + + c ) { <nl> - ConstRestrict < const float * > row_linear = <nl> - rgb_linear_pregamma_ [ c ] . Row ( y ) ; <nl> - per_block_pregamma_ [ bx ] [ c ] [ i ] = row_linear [ x ] ; <nl> + per_block_pregamma_ [ bx ] [ c ] [ i ] = rgb_linear_pregamma_ [ c ] [ px ] ; <nl> } <nl> } <nl> } <nl> : : butteraugli : : OpsinDynamicsImage ( 8 , 8 , per_block_pregamma_ [ bx ] ) ; <nl> } <nl> } <nl> - std : : vector < std : : vector < float > > pregamma = <nl> - PackedFromPlanes ( rgb_linear_pregamma_ ) ; <nl> - : : butteraugli : : OpsinDynamicsImage ( width_ , height_ , pregamma ) ; <nl> - rgb_linear_pregamma_ = PlanesFromPacked ( width_ , height_ , pregamma ) ; <nl> + : : butteraugli : : OpsinDynamicsImage ( width_ , height_ , rgb_linear_pregamma_ ) ; <nl> std : : vector < std : : vector < float > > dummy ( 3 ) ; <nl> - : : butteraugli : : Mask ( pregamma , pregamma , width_ , height_ , <nl> + : : butteraugli : : Mask ( rgb_linear_pregamma_ , rgb_linear_pregamma_ , <nl> + width_ , height_ , <nl> & mask_xyz_ , & dummy ) ; <nl> } <nl> <nl> void ButteraugliComparator : : Compare ( const OutputImage & img ) { <nl> std : : vector < std : : vector < float > > rgb ( 3 , std : : vector < float > ( width_ * height_ ) ) ; <nl> img . ToLinearRGB ( & rgb ) ; <nl> : : butteraugli : : OpsinDynamicsImage ( width_ , height_ , rgb ) ; <nl> - ImageF distmap ; <nl> - const std : : vector < ImageF > rgb_planes = PlanesFromPacked ( width_ , height_ , rgb ) ; <nl> - comparator_ . DiffmapOpsinDynamicsImage ( rgb_linear_pregamma_ , <nl> - rgb_planes , distmap ) ; <nl> - distmap_ . resize ( width_ * height_ ) ; <nl> - CopyToPacked ( distmap , & distmap_ ) ; <nl> - distance_ = : : butteraugli : : ButteraugliScoreFromDiffmap ( distmap ) ; <nl> + comparator_ . DiffmapOpsinDynamicsImage ( rgb_linear_pregamma_ , rgb , distmap_ ) ; <nl> + distance_ = : : butteraugli : : ButteraugliScoreFromDiffmap ( distmap_ ) ; <nl> GUETZLI_LOG ( stats_ , " BA [ 100 . 00 % % ] D [ % 6 . 4f ] " , distance_ ) ; <nl> } <nl> <nl> mmm a / guetzli / butteraugli_comparator . h <nl> ppp b / guetzli / butteraugli_comparator . h <nl> class ButteraugliComparator : public Comparator { <nl> const int width_ ; <nl> const int height_ ; <nl> const float target_distance_ ; <nl> - std : : vector < : : butteraugli : : ImageF > rgb_linear_pregamma_ ; <nl> + std : : vector < std : : vector < float > > rgb_linear_pregamma_ ; <nl> std : : vector < std : : vector < float > > mask_xyz_ ; <nl> std : : vector < std : : vector < std : : vector < float > > > per_block_pregamma_ ; <nl> : : butteraugli : : ButteraugliComparator comparator_ ; <nl> mmm a / third_party / butteraugli / butteraugli / butteraugli . cc <nl> ppp b / third_party / butteraugli / butteraugli / butteraugli . cc <nl> <nl> <nl> namespace butteraugli { <nl> <nl> - void * CacheAligned : : Allocate ( const size_t bytes ) { <nl> - char * const allocated = static_cast < char * > ( malloc ( bytes + kCacheLineSize ) ) ; <nl> - if ( allocated = = nullptr ) { <nl> - return nullptr ; <nl> - } <nl> - const uintptr_t misalignment = <nl> - reinterpret_cast < uintptr_t > ( allocated ) & ( kCacheLineSize - 1 ) ; <nl> - / / malloc is at least kPointerSize aligned , so we can store the " allocated " <nl> - / / pointer immediately before the aligned memory . <nl> - assert ( misalignment % kPointerSize = = 0 ) ; <nl> - char * const aligned = allocated + kCacheLineSize - misalignment ; <nl> - memcpy ( aligned - kPointerSize , & allocated , kPointerSize ) ; <nl> - return aligned ; <nl> - } <nl> - <nl> - void CacheAligned : : Free ( void * aligned_pointer ) { <nl> - if ( aligned_pointer = = nullptr ) { <nl> - return ; <nl> - } <nl> - char * const aligned = static_cast < char * > ( aligned_pointer ) ; <nl> - assert ( reinterpret_cast < uintptr_t > ( aligned ) % kCacheLineSize = = 0 ) ; <nl> - char * allocated ; <nl> - memcpy ( & allocated , aligned - kPointerSize , kPointerSize ) ; <nl> - assert ( allocated < = aligned - kPointerSize ) ; <nl> - assert ( allocated > = aligned - kCacheLineSize ) ; <nl> - free ( allocated ) ; <nl> - } <nl> - <nl> - static inline bool IsNan ( const float x ) { <nl> - uint32_t bits ; <nl> - memcpy ( & bits , & x , sizeof ( bits ) ) ; <nl> - const uint32_t bitmask_exp = 0x7F800000 ; <nl> - return ( bits & bitmask_exp ) = = bitmask_exp & & ( bits & 0x7FFFFF ) ; <nl> - } <nl> - <nl> - static inline bool IsNan ( const double x ) { <nl> - uint64_t bits ; <nl> - memcpy ( & bits , & x , sizeof ( bits ) ) ; <nl> - return ( 0x7ff0000000000001ULL < = bits & & bits < = 0x7fffffffffffffffULL ) | | <nl> - ( 0xfff0000000000001ULL < = bits & & bits < = 0xffffffffffffffffULL ) ; <nl> - } <nl> - <nl> - static inline void CheckImage ( const ImageF & image , const char * name ) { <nl> - for ( size_t y = 0 ; y < image . ysize ( ) ; + + y ) { <nl> - ConstRestrict < const float * > row = image . Row ( y ) ; <nl> - for ( size_t x = 0 ; x < image . xsize ( ) ; + + x ) { <nl> - if ( IsNan ( row [ x ] ) ) { <nl> - printf ( " Image % s @ % lu , % lu ( of % lu , % lu ) \ n " , name , x , y , image . xsize ( ) , <nl> - image . ysize ( ) ) ; <nl> - exit ( 1 ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - <nl> - # if BUTTERAUGLI_ENABLE_CHECKS <nl> - <nl> - # define CHECK_NAN ( x , str ) \ <nl> - do { \ <nl> - if ( IsNan ( x ) ) { \ <nl> - printf ( " % d : % s \ n " , __LINE__ , str ) ; \ <nl> - abort ( ) ; \ <nl> - } \ <nl> - } while ( 0 ) <nl> - <nl> - # define CHECK_IMAGE ( image , name ) CheckImage ( image , name ) <nl> - <nl> - # else <nl> - <nl> - # define CHECK_NAN ( x , str ) <nl> - # define CHECK_IMAGE ( image , name ) <nl> - <nl> - # endif <nl> - <nl> - <nl> static const double kInternalGoodQualityThreshold = 14 . 921561160295326 ; <nl> static const double kGlobalScale = 1 . 0 / kInternalGoodQualityThreshold ; <nl> <nl> void Blur ( size_t xsize , size_t ysize , float * channel , double sigma , <nl> int dxsize = ( xsize + xstep - 1 ) / xstep ; <nl> int dysize = ( ysize + ystep - 1 ) / ystep ; <nl> std : : vector < float > tmp ( dxsize * ysize ) ; <nl> - std : : vector < float > downsampled_output ( dxsize * dysize ) ; <nl> Convolution ( xsize , ysize , xstep , expn_size , diff , expn . data ( ) , channel , <nl> border_ratio , <nl> tmp . data ( ) ) ; <nl> + float * output = channel ; <nl> + std : : vector < float > downsampled_output ; <nl> + if ( xstep > 1 ) { <nl> + downsampled_output . resize ( dxsize * dysize ) ; <nl> + output = downsampled_output . data ( ) ; <nl> + } <nl> Convolution ( ysize , dxsize , ystep , expn_size , diff , expn . data ( ) , tmp . data ( ) , <nl> - border_ratio , <nl> - downsampled_output . data ( ) ) ; <nl> - for ( size_t y = 0 ; y < ysize ; y + + ) { <nl> - for ( size_t x = 0 ; x < xsize ; x + + ) { <nl> - / / TODO : Use correct rounding . <nl> - channel [ y * xsize + x ] = <nl> - downsampled_output [ ( y / ystep ) * dxsize + ( x / xstep ) ] ; <nl> + border_ratio , output ) ; <nl> + if ( xstep > 1 ) { <nl> + for ( size_t y = 0 ; y < ysize ; y + + ) { <nl> + for ( size_t x = 0 ; x < xsize ; x + + ) { <nl> + / / TODO : Use correct rounding . <nl> + channel [ y * xsize + x ] = <nl> + downsampled_output [ ( y / ystep ) * dxsize + ( x / xstep ) ] ; <nl> + } <nl> } <nl> } <nl> } <nl> double SimpleGamma ( double v ) { <nl> return retval ; <nl> } <nl> <nl> + / / Polynomial evaluation via Clenshaw ' s scheme ( similar to Horner ' s ) . <nl> + / / Template enables compile - time unrolling of the recursion , but must reside <nl> + / / outside of a class due to the specialization . <nl> + template < int INDEX > <nl> + static inline void ClenshawRecursion ( const double x , const double * coefficients , <nl> + double * b1 , double * b2 ) { <nl> + const double x_b1 = x * ( * b1 ) ; <nl> + const double t = ( x_b1 + x_b1 ) - ( * b2 ) + coefficients [ INDEX ] ; <nl> + * b2 = * b1 ; <nl> + * b1 = t ; <nl> + <nl> + ClenshawRecursion < INDEX - 1 > ( x , coefficients , b1 , b2 ) ; <nl> + } <nl> + <nl> + / / Base case <nl> + template < > <nl> + inline void ClenshawRecursion < 0 > ( const double x , const double * coefficients , <nl> + double * b1 , double * b2 ) { <nl> + const double x_b1 = x * ( * b1 ) ; <nl> + / / The final iteration differs - no 2 * x_b1 here . <nl> + * b1 = x_b1 - ( * b2 ) + coefficients [ 0 ] ; <nl> + } <nl> + <nl> + / / Rational polynomial : = dividing two polynomial evaluations . These are easier <nl> + / / to find than minimax polynomials . <nl> + struct RationalPolynomial { <nl> + template < int N > <nl> + static double EvaluatePolynomial ( const double x , <nl> + const double ( & coefficients ) [ N ] ) { <nl> + double b1 = 0 . 0 ; <nl> + double b2 = 0 . 0 ; <nl> + ClenshawRecursion < N - 1 > ( x , coefficients , & b1 , & b2 ) ; <nl> + return b1 ; <nl> + } <nl> + <nl> + / / Evaluates the polynomial at x ( in [ min_value , max_value ] ) . <nl> + inline double operator ( ) ( const float x ) const { <nl> + / / First normalize to [ 0 , 1 ] . <nl> + const double x01 = ( x - min_value ) / ( max_value - min_value ) ; <nl> + / / And then to [ - 1 , 1 ] domain of Chebyshev polynomials . <nl> + const double xc = 2 . 0 * x01 - 1 . 0 ; <nl> + <nl> + const double yp = EvaluatePolynomial ( xc , p ) ; <nl> + const double yq = EvaluatePolynomial ( xc , q ) ; <nl> + if ( yq = = 0 . 0 ) return 0 . 0 ; <nl> + return static_cast < float > ( yp / yq ) ; <nl> + } <nl> + <nl> + / / Domain of the polynomials ; they are undefined elsewhere . <nl> + double min_value ; <nl> + double max_value ; <nl> + <nl> + / / Coefficients of T_n ( Chebyshev polynomials of the first kind ) . <nl> + / / Degree 5 / 5 is a compromise between accuracy ( 0 . 1 % ) and numerical stability . <nl> + double p [ 5 + 1 ] ; <nl> + double q [ 5 + 1 ] ; <nl> + } ; <nl> + <nl> + static inline float GammaPolynomial ( float value ) { <nl> + / / Generated by gamma_polynomial . m from equispaced x / gamma ( x ) samples . <nl> + static const RationalPolynomial r = { <nl> + 0 . 770000000000000 , 274 . 579999999999984 , <nl> + { <nl> + 881 . 979476556478289 , 1496 . 058452015812463 , 908 . 662212739659481 , <nl> + 373 . 566100223287378 , 85 . 840860336314364 , 6 . 683258861509244 , <nl> + } , <nl> + { <nl> + 12 . 262350348616792 , 20 . 557285797683576 , 12 . 161463238367844 , <nl> + 4 . 711532733641639 , 0 . 899112889751053 , 0 . 035662329617191 , <nl> + } } ; <nl> + return r ( value ) ; <nl> + } <nl> + <nl> static inline double Gamma ( double v ) { <nl> / / return SimpleGamma ( v ) ; <nl> return GammaPolynomial ( v ) ; <nl> void CalculateDiffmap ( const size_t xsize , const size_t ysize , <nl> / / values have no meaning , they only exist to keep the result map the same <nl> / / size as the input images . <nl> int s2 = ( 8 - step ) / 2 ; <nl> - / / Upsample and take square root . <nl> - std : : vector < float > diffmap_out ( xsize * ysize ) ; <nl> - const size_t res_xsize = ( xsize + step - 1 ) / step ; <nl> - for ( size_t res_y = 0 ; res_y + 8 - step < ysize ; res_y + = step ) { <nl> - for ( size_t res_x = 0 ; res_x + 8 - step < xsize ; res_x + = step ) { <nl> - size_t res_ix = ( res_y * res_xsize + res_x ) / step ; <nl> - float orig_val = ( * diffmap ) [ res_ix ] ; <nl> - constexpr float kInitialSlope = 100 ; <nl> - / / TODO ( b / 29974893 ) : Until that is fixed do not call sqrt on very small <nl> - / / numbers . <nl> - double val = orig_val < ( 1 . 0 / ( kInitialSlope * kInitialSlope ) ) <nl> - ? kInitialSlope * orig_val <nl> - : std : : sqrt ( orig_val ) ; <nl> - for ( size_t off_y = 0 ; off_y < step ; + + off_y ) { <nl> - for ( size_t off_x = 0 ; off_x < step ; + + off_x ) { <nl> - diffmap_out [ ( res_y + off_y + s2 ) * xsize + res_x + off_x + s2 ] = val ; <nl> + { <nl> + / / Upsample and take square root . <nl> + std : : vector < float > diffmap_out ( xsize * ysize ) ; <nl> + const size_t res_xsize = ( xsize + step - 1 ) / step ; <nl> + for ( size_t res_y = 0 ; res_y + 8 - step < ysize ; res_y + = step ) { <nl> + for ( size_t res_x = 0 ; res_x + 8 - step < xsize ; res_x + = step ) { <nl> + size_t res_ix = ( res_y * res_xsize + res_x ) / step ; <nl> + float orig_val = ( * diffmap ) [ res_ix ] ; <nl> + constexpr float kInitialSlope = 100 ; <nl> + / / TODO ( b / 29974893 ) : Until that is fixed do not call sqrt on very small <nl> + / / numbers . <nl> + double val = orig_val < ( 1 . 0 / ( kInitialSlope * kInitialSlope ) ) <nl> + ? kInitialSlope * orig_val <nl> + : std : : sqrt ( orig_val ) ; <nl> + for ( size_t off_y = 0 ; off_y < step ; + + off_y ) { <nl> + for ( size_t off_x = 0 ; off_x < step ; + + off_x ) { <nl> + diffmap_out [ ( res_y + off_y + s2 ) * xsize + <nl> + res_x + off_x + s2 ] = val ; <nl> + } <nl> } <nl> } <nl> } <nl> + * diffmap = diffmap_out ; <nl> } <nl> - * diffmap = diffmap_out ; <nl> { <nl> static const double kSigma = 8 . 8510880283 ; <nl> static const double mul1 = 24 . 8235314874 ; <nl> void CalculateDiffmap ( const size_t xsize , const size_t ysize , <nl> } <nl> } <nl> <nl> - void ButteraugliComparator : : Diffmap ( const std : : vector < ImageF > & rgb0_arg , <nl> - const std : : vector < ImageF > & rgb1_arg , <nl> - ImageF & result ) { <nl> - result = ImageF ( xsize_ , ysize_ ) ; <nl> - if ( xsize_ < 8 | | ysize_ < 8 ) return ; <nl> - std : : vector < std : : vector < float > > rgb0_c = PackedFromPlanes ( rgb0_arg ) ; <nl> - std : : vector < std : : vector < float > > rgb1_c = PackedFromPlanes ( rgb1_arg ) ; <nl> - OpsinDynamicsImage ( xsize_ , ysize_ , rgb0_c ) ; <nl> - OpsinDynamicsImage ( xsize_ , ysize_ , rgb1_c ) ; <nl> - std : : vector < ImageF > pg0 = PlanesFromPacked ( xsize_ , ysize_ , rgb0_c ) ; <nl> - std : : vector < ImageF > pg1 = PlanesFromPacked ( xsize_ , ysize_ , rgb1_c ) ; <nl> - DiffmapOpsinDynamicsImage ( pg0 , pg1 , result ) ; <nl> - } <nl> - <nl> void ButteraugliComparator : : DiffmapOpsinDynamicsImage ( <nl> - const std : : vector < ImageF > & xyb0_arg , const std : : vector < ImageF > & xyb1_arg , <nl> - ImageF & result ) { <nl> - result = ImageF ( xsize_ , ysize_ ) ; <nl> + const std : : vector < std : : vector < float > > & xyb0_arg , <nl> + std : : vector < std : : vector < float > > & xyb1 , <nl> + std : : vector < float > & result ) { <nl> if ( xsize_ < 8 | | ysize_ < 8 ) return ; <nl> - std : : vector < std : : vector < float > > xyb0 = PackedFromPlanes ( xyb0_arg ) ; <nl> - std : : vector < std : : vector < float > > xyb1 = PackedFromPlanes ( xyb1_arg ) ; <nl> - auto xyb0_c = xyb0 ; <nl> - auto xyb1_c = xyb1 ; <nl> - <nl> - MaskHighIntensityChange ( xsize_ , ysize_ , xyb0_c , xyb1_c , xyb0 , xyb1 ) ; <nl> + auto xyb0 = xyb0_arg ; <nl> + { <nl> + auto xyb1_c = xyb1 ; <nl> + MaskHighIntensityChange ( xsize_ , ysize_ , xyb0_arg , xyb1_c , xyb0 , xyb1 ) ; <nl> + } <nl> assert ( 8 < = xsize_ ) ; <nl> for ( int i = 0 ; i < 3 ; i + + ) { <nl> assert ( xyb0 [ i ] . size ( ) = = num_pixels_ ) ; <nl> assert ( xyb1 [ i ] . size ( ) = = num_pixels_ ) ; <nl> } <nl> - std : : vector < std : : vector < float > > mask_xyb ( 3 ) ; <nl> - std : : vector < std : : vector < float > > mask_xyb_dc ( 3 ) ; <nl> std : : vector < float > block_diff_dc ( 3 * res_xsize_ * res_ysize_ ) ; <nl> std : : vector < float > block_diff_ac ( 3 * res_xsize_ * res_ysize_ ) ; <nl> std : : vector < float > edge_detector_map ( 3 * res_xsize_ * res_ysize_ ) ; <nl> - std : : vector < float > packed_result ; <nl> BlockDiffMap ( xyb0 , xyb1 , & block_diff_dc , & block_diff_ac ) ; <nl> EdgeDetectorMap ( xyb0 , xyb1 , & edge_detector_map ) ; <nl> EdgeDetectorLowFreq ( xyb0 , xyb1 , & block_diff_ac ) ; <nl> - Mask ( xyb0 , xyb1 , xsize_ , ysize_ , & mask_xyb , & mask_xyb_dc ) ; <nl> - CombineChannels ( mask_xyb , mask_xyb_dc , block_diff_dc , block_diff_ac , <nl> - edge_detector_map , & packed_result ) ; <nl> - CalculateDiffmap ( xsize_ , ysize_ , step_ , & packed_result ) ; <nl> - CopyFromPacked ( packed_result , & result ) ; <nl> + { <nl> + std : : vector < std : : vector < float > > mask_xyb ( 3 ) ; <nl> + std : : vector < std : : vector < float > > mask_xyb_dc ( 3 ) ; <nl> + Mask ( xyb0 , xyb1 , xsize_ , ysize_ , & mask_xyb , & mask_xyb_dc ) ; <nl> + CombineChannels ( mask_xyb , mask_xyb_dc , block_diff_dc , block_diff_ac , <nl> + edge_detector_map , & result ) ; <nl> + } <nl> + CalculateDiffmap ( xsize_ , ysize_ , step_ , & result ) ; <nl> } <nl> <nl> void ButteraugliComparator : : BlockDiffMap ( <nl> void ButteraugliComparator : : CombineChannels ( <nl> } <nl> } <nl> <nl> - double ButteraugliScoreFromDiffmap ( const ImageF & diffmap ) { <nl> + double ButteraugliScoreFromDiffmap ( const std : : vector < float > & diffmap ) { <nl> PROFILER_FUNC ; <nl> float retval = 0 . 0f ; <nl> - for ( size_t y = 0 ; y < diffmap . ysize ( ) ; + + y ) { <nl> - ConstRestrict < const float * > row = diffmap . Row ( y ) ; <nl> - for ( size_t x = 0 ; x < diffmap . xsize ( ) ; + + x ) { <nl> - retval = std : : max ( retval , row [ x ] ) ; <nl> - } <nl> + for ( size_t ix = 0 ; ix < diffmap . size ( ) ; + + ix ) { <nl> + retval = std : : max ( retval , diffmap [ ix ] ) ; <nl> } <nl> return retval ; <nl> } <nl> void Mask ( const std : : vector < std : : vector < float > > & xyb0 , <nl> } <nl> } <nl> <nl> - void ButteraugliDiffmap ( const std : : vector < ImageF > & rgb0_image , <nl> - const std : : vector < ImageF > & rgb1_image , <nl> - ImageF & result_image ) { <nl> - const size_t xsize = rgb0_image [ 0 ] . xsize ( ) ; <nl> - const size_t ysize = rgb0_image [ 0 ] . ysize ( ) ; <nl> - ButteraugliComparator butteraugli ( xsize , ysize , 3 ) ; <nl> - butteraugli . Diffmap ( rgb0_image , rgb1_image , result_image ) ; <nl> - } <nl> - <nl> - bool ButteraugliInterface ( const std : : vector < ImageF > & rgb0 , <nl> - const std : : vector < ImageF > & rgb1 , <nl> - ImageF & diffmap , <nl> - double & diffvalue ) { <nl> - const size_t xsize = rgb0 [ 0 ] . xsize ( ) ; <nl> - const size_t ysize = rgb0 [ 0 ] . ysize ( ) ; <nl> - if ( xsize < 1 | | ysize < 1 ) { <nl> - / / Butteraugli values for small ( where xsize or ysize is smaller <nl> - / / than 8 pixels ) images are non - sensical , but most likely it is <nl> - / / less disruptive to try to compute something than just give up . <nl> - return false ; / / No image . <nl> - } <nl> - for ( int i = 1 ; i < 3 ; i + + ) { <nl> - if ( rgb0 [ i ] . xsize ( ) ! = xsize | | rgb0 [ i ] . ysize ( ) ! = ysize | | <nl> - rgb1 [ i ] . xsize ( ) ! = xsize | | rgb1 [ i ] . ysize ( ) ! = ysize ) { <nl> - return false ; / / Image planes must have same dimensions . <nl> - } <nl> - } <nl> - if ( xsize < 8 | | ysize < 8 ) { <nl> - for ( size_t y = 0 ; y < ysize ; + + y ) { <nl> - for ( size_t x = 0 ; x < xsize ; + + x ) { <nl> - diffmap . Row ( y ) [ x ] = 0 ; <nl> - } <nl> - } <nl> - diffvalue = 0 ; <nl> - return true ; <nl> - } <nl> - ButteraugliDiffmap ( rgb0 , rgb1 , diffmap ) ; <nl> - diffvalue = ButteraugliScoreFromDiffmap ( diffmap ) ; <nl> - return true ; <nl> - } <nl> - <nl> - bool ButteraugliAdaptiveQuantization ( size_t xsize , size_t ysize , <nl> - const std : : vector < std : : vector < float > > & rgb , std : : vector < float > & quant ) { <nl> - if ( xsize < 16 | | ysize < 16 ) { <nl> - return false ; / / Butteraugli is undefined for small images . <nl> - } <nl> - size_t size = xsize * ysize ; <nl> - <nl> - std : : vector < std : : vector < float > > scale_xyb ( 3 ) ; <nl> - std : : vector < std : : vector < float > > scale_xyb_dc ( 3 ) ; <nl> - Mask ( rgb , rgb , xsize , ysize , & scale_xyb , & scale_xyb_dc ) ; <nl> - quant . resize ( size ) ; <nl> - <nl> - / / Mask gives us values in 3 color channels , but for now we take only <nl> - / / the intensity channel . <nl> - for ( size_t i = 0 ; i < size ; i + + ) { <nl> - quant [ i ] = scale_xyb [ 1 ] [ i ] ; <nl> - } <nl> - return true ; <nl> - } <nl> - <nl> - double ButteraugliFuzzyClass ( double score ) { <nl> - static const double fuzzy_width_up = 10 . 287189655 ; <nl> - static const double fuzzy_width_down = 6 . 97490803335 ; <nl> - static const double m0 = 2 . 0 ; <nl> - double fuzzy_width = score < 1 . 0 ? fuzzy_width_down : fuzzy_width_up ; <nl> - return m0 / ( 1 . 0 + exp ( ( score - 1 . 0 ) * fuzzy_width ) ) ; <nl> - } <nl> - <nl> - double ButteraugliFuzzyInverse ( double seek ) { <nl> - double pos = 0 ; <nl> - for ( double range = 1 . 0 ; range > = 1e - 10 ; range * = 0 . 5 ) { <nl> - double cur = ButteraugliFuzzyClass ( pos ) ; <nl> - if ( cur < seek ) { <nl> - pos - = range ; <nl> - } else { <nl> - pos + = range ; <nl> - } <nl> - } <nl> - return pos ; <nl> - } <nl> - <nl> } / / namespace butteraugli <nl> mmm a / third_party / butteraugli / butteraugli / butteraugli . h <nl> ppp b / third_party / butteraugli / butteraugli / butteraugli . h <nl> <nl> # define PROFILER_ZONE ( name ) <nl> # endif <nl> <nl> - # define BUTTERAUGLI_ENABLE_CHECKS 0 <nl> - <nl> - / / This is the main interface to butteraugli image similarity <nl> - / / analysis function . <nl> - <nl> namespace butteraugli { <nl> <nl> - template < typename T > <nl> - class Image ; <nl> - <nl> - using Image8 = Image < uint8_t > ; <nl> - using ImageF = Image < float > ; <nl> - using ImageD = Image < double > ; <nl> - <nl> - / / ButteraugliInterface defines the public interface for butteraugli . <nl> - / / <nl> - / / It calculates the difference between rgb0 and rgb1 . <nl> - / / <nl> - / / rgb0 and rgb1 contain the images . rgb0 [ c ] [ px ] and rgb1 [ c ] [ px ] contains <nl> - / / the red image for c = = 0 , green for c = = 1 , blue for c = = 2 . Location index <nl> - / / px is calculated as y * xsize + x . <nl> - / / <nl> - / / Value of pixels of images rgb0 and rgb1 need to be represented as raw <nl> - / / intensity . Most image formats store gamma corrected intensity in pixel <nl> - / / values . This gamma correction has to be removed , by applying the following <nl> - / / function : <nl> - / / butteraugli_val = 255 . 0 * pow ( png_val / 255 . 0 , gamma ) ; <nl> - / / A typical value of gamma is 2 . 2 . It is usually stored in the image header . <nl> - / / Take care not to confuse that value with its inverse . The gamma value should <nl> - / / be always greater than one . <nl> - / / Butteraugli does not work as intended if the caller does not perform <nl> - / / gamma correction . <nl> - / / <nl> - / / diffmap will contain an image of the size xsize * ysize , containing <nl> - / / localized differences for values px ( indexed with the px the same as rgb0 <nl> - / / and rgb1 ) . diffvalue will give a global score of similarity . <nl> - / / <nl> - / / A diffvalue smaller than kButteraugliGood indicates that images can be <nl> - / / observed as the same image . <nl> - / / diffvalue larger than kButteraugliBad indicates that a difference between <nl> - / / the images can be observed . <nl> - / / A diffvalue between kButteraugliGood and kButteraugliBad indicates that <nl> - / / a subtle difference can be observed between the images . <nl> - / / <nl> - / / Returns true on success . <nl> - <nl> - bool ButteraugliInterface ( const std : : vector < ImageF > & rgb0 , <nl> - const std : : vector < ImageF > & rgb1 , <nl> - ImageF & diffmap , <nl> - double & diffvalue ) ; <nl> - <nl> - const double kButteraugliQuantLow = 0 . 26 ; <nl> - const double kButteraugliQuantHigh = 1 . 454 ; <nl> - <nl> - / / Converts the butteraugli score into fuzzy class values that are continuous <nl> - / / at the class boundary . The class boundary location is based on human <nl> - / / raters , but the slope is arbitrary . Particularly , it does not reflect <nl> - / / the expectation value of probabilities of the human raters . It is just <nl> - / / expected that a smoother class boundary will allow for higher - level <nl> - / / optimization algorithms to work faster . <nl> - / / <nl> - / / Returns 2 . 0 for a perfect match , and 1 . 0 for ' ok ' , 0 . 0 for bad . Because the <nl> - / / scoring is fuzzy , a butteraugli score of 0 . 96 would return a class of <nl> - / / around 1 . 9 . <nl> - double ButteraugliFuzzyClass ( double score ) ; <nl> - <nl> - / / Input values should be in range 0 ( bad ) to 2 ( good ) . Use <nl> - / / kButteraugliNormalization as normalization . <nl> - double ButteraugliFuzzyInverse ( double seek ) ; <nl> - <nl> - / / Returns a map which can be used for adaptive quantization . Values can <nl> - / / typically range from kButteraugliQuantLow to kButteraugliQuantHigh . Low <nl> - / / values require coarse quantization ( e . g . near random noise ) , high values <nl> - / / require fine quantization ( e . g . in smooth bright areas ) . <nl> - bool ButteraugliAdaptiveQuantization ( size_t xsize , size_t ysize , <nl> - const std : : vector < std : : vector < float > > & rgb , std : : vector < float > & quant ) ; <nl> - <nl> - / / Implementation details , don ' t use anything below or your code will <nl> - / / break in the future . <nl> - <nl> - # ifdef _MSC_VER <nl> - # define BUTTERAUGLI_RESTRICT <nl> - # else <nl> - # define BUTTERAUGLI_RESTRICT __restrict__ <nl> - # endif <nl> - <nl> - # ifdef _MSC_VER <nl> - # define BUTTERAUGLI_CACHE_ALIGNED_RETURN / * not supported * / <nl> - # else <nl> - # define BUTTERAUGLI_CACHE_ALIGNED_RETURN __attribute__ ( ( assume_aligned ( 64 ) ) ) <nl> - # endif <nl> - <nl> - / / Alias for unchangeable , non - aliased pointers . T is a pointer type , <nl> - / / possibly to a const type . Example : ConstRestrict < uint8_t * > ptr = nullptr . <nl> - / / The conventional syntax uint8_t * const RESTRICT is more confusing - it is <nl> - / / not immediately obvious that the pointee is non - const . <nl> - template < typename T > <nl> - using ConstRestrict = T const BUTTERAUGLI_RESTRICT ; <nl> - <nl> - / / Functions that depend on the cache line size . <nl> - class CacheAligned { <nl> - public : <nl> - static constexpr size_t kPointerSize = sizeof ( void * ) ; <nl> - static constexpr size_t kCacheLineSize = 64 ; <nl> - <nl> - / / The aligned - return annotation is only allowed on function declarations . <nl> - static void * Allocate ( const size_t bytes ) BUTTERAUGLI_CACHE_ALIGNED_RETURN ; <nl> - static void Free ( void * aligned_pointer ) ; <nl> - } ; <nl> - <nl> - template < typename T > <nl> - using CacheAlignedUniquePtrT = std : : unique_ptr < T [ ] , void ( * ) ( void * ) > ; <nl> - <nl> - using CacheAlignedUniquePtr = CacheAlignedUniquePtrT < uint8_t > ; <nl> - <nl> - template < typename T = uint8_t > <nl> - static inline CacheAlignedUniquePtrT < T > Allocate ( const size_t entries ) { <nl> - return CacheAlignedUniquePtrT < T > ( <nl> - static_cast < ConstRestrict < T * > > ( <nl> - CacheAligned : : Allocate ( entries * sizeof ( T ) ) ) , <nl> - CacheAligned : : Free ) ; <nl> - } <nl> - <nl> - / / Returns the smallest integer not less than " amount " that is divisible by <nl> - / / " multiple " , which must be a power of two . <nl> - template < size_t multiple > <nl> - static inline size_t Align ( const size_t amount ) { <nl> - static_assert ( multiple ! = 0 & & ( ( multiple & ( multiple - 1 ) ) = = 0 ) , <nl> - " Align < > argument must be a power of two " ) ; <nl> - return ( amount + multiple - 1 ) & ~ ( multiple - 1 ) ; <nl> - } <nl> - <nl> - / / Single channel , contiguous ( cache - aligned ) rows separated by padding . <nl> - / / T must be POD . <nl> - / / <nl> - / / Rationale : vectorization benefits from aligned operands - unaligned loads and <nl> - / / especially stores are expensive when the address crosses cache line <nl> - / / boundaries . Introducing padding after each row ensures the start of a row is <nl> - / / aligned , and that row loops can process entire vectors ( writes to the padding <nl> - / / are allowed and ignored ) . <nl> - / / <nl> - / / We prefer a planar representation , where channels are stored as separate <nl> - / / 2D arrays , because that simplifies vectorization ( repeating the same <nl> - / / operation on multiple adjacent components ) without the complexity of a <nl> - / / hybrid layout ( 8 R , 8 G , 8 B , . . . ) . In particular , clients can easily iterate <nl> - / / over all components in a row and Image requires no knowledge of the pixel <nl> - / / format beyond the component type " T " . The downside is that we duplicate the <nl> - / / xsize / ysize members for each channel . <nl> - / / <nl> - / / This image layout could also be achieved with a vector and a row accessor <nl> - / / function , but a class wrapper with support for " deleter " allows wrapping <nl> - / / existing memory allocated by clients without copying the pixels . It also <nl> - / / provides convenient accessors for xsize / ysize , which shortens function <nl> - / / argument lists . Supports move - construction so it can be stored in containers . <nl> - template < typename ComponentType > <nl> - class Image { <nl> - / / Returns cache - aligned row stride , being careful to avoid 2K aliasing . <nl> - static size_t BytesPerRow ( const size_t xsize ) { <nl> - / / Allow reading one extra AVX - 2 vector on the right margin . <nl> - const size_t row_size = xsize * sizeof ( T ) + 32 ; <nl> - const size_t align = CacheAligned : : kCacheLineSize ; <nl> - size_t bytes_per_row = ( row_size + align - 1 ) & ~ ( align - 1 ) ; <nl> - / / During the lengthy window before writes are committed to memory , CPUs <nl> - / / guard against read after write hazards by checking the address , but <nl> - / / only the lower 11 bits . We avoid a false dependency between writes to <nl> - / / consecutive rows by ensuring their sizes are not multiples of 2 KiB . <nl> - if ( bytes_per_row % 2048 = = 0 ) { <nl> - bytes_per_row + = align ; <nl> - } <nl> - return bytes_per_row ; <nl> - } <nl> - <nl> - public : <nl> - using T = ComponentType ; <nl> - <nl> - Image ( ) : xsize_ ( 0 ) , ysize_ ( 0 ) , bytes_per_row_ ( 0 ) , bytes_ ( static_cast < uint8_t * > ( nullptr ) , Ignore ) { } <nl> - <nl> - Image ( const size_t xsize , const size_t ysize ) <nl> - : xsize_ ( xsize ) , <nl> - ysize_ ( ysize ) , <nl> - bytes_per_row_ ( BytesPerRow ( xsize ) ) , <nl> - bytes_ ( Allocate ( bytes_per_row_ * ysize ) ) { } <nl> - <nl> - Image ( const size_t xsize , const size_t ysize , ConstRestrict < uint8_t * > bytes , <nl> - const size_t bytes_per_row ) <nl> - : xsize_ ( xsize ) , <nl> - ysize_ ( ysize ) , <nl> - bytes_per_row_ ( bytes_per_row ) , <nl> - bytes_ ( bytes , Ignore ) { } <nl> - <nl> - / / Move constructor ( required for returning Image from function ) <nl> - Image ( Image & & other ) <nl> - : xsize_ ( other . xsize_ ) , <nl> - ysize_ ( other . ysize_ ) , <nl> - bytes_per_row_ ( other . bytes_per_row_ ) , <nl> - bytes_ ( std : : move ( other . bytes_ ) ) { } <nl> - <nl> - / / Move assignment ( required for std : : vector ) <nl> - Image & operator = ( Image & & other ) { <nl> - xsize_ = other . xsize_ ; <nl> - ysize_ = other . ysize_ ; <nl> - bytes_per_row_ = other . bytes_per_row_ ; <nl> - bytes_ = std : : move ( other . bytes_ ) ; <nl> - return * this ; <nl> - } <nl> - <nl> - void Swap ( Image & other ) { <nl> - std : : swap ( xsize_ , other . xsize_ ) ; <nl> - std : : swap ( ysize_ , other . ysize_ ) ; <nl> - std : : swap ( bytes_per_row_ , other . bytes_per_row_ ) ; <nl> - std : : swap ( bytes_ , other . bytes_ ) ; <nl> - } <nl> - <nl> - / / How many pixels . <nl> - size_t xsize ( ) const { return xsize_ ; } <nl> - size_t ysize ( ) const { return ysize_ ; } <nl> - <nl> - ConstRestrict < T * > Row ( const size_t y ) BUTTERAUGLI_CACHE_ALIGNED_RETURN { <nl> - # ifdef BUTTERAUGLI_ENABLE_CHECKS <nl> - if ( y > = ysize_ ) { <nl> - printf ( " Row % zu out of bounds ( ysize = % zu ) \ n " , y , ysize_ ) ; <nl> - abort ( ) ; <nl> - } <nl> - # endif <nl> - return reinterpret_cast < T * > ( bytes_ . get ( ) + y * bytes_per_row_ ) ; <nl> - } <nl> - <nl> - ConstRestrict < const T * > Row ( const size_t y ) const <nl> - BUTTERAUGLI_CACHE_ALIGNED_RETURN { <nl> - # ifdef BUTTERAUGLI_ENABLE_CHECKS <nl> - if ( y > = ysize_ ) { <nl> - printf ( " Const row % zu out of bounds ( ysize = % zu ) \ n " , y , ysize_ ) ; <nl> - abort ( ) ; <nl> - } <nl> - # endif <nl> - return reinterpret_cast < const T * > ( bytes_ . get ( ) + y * bytes_per_row_ ) ; <nl> - } <nl> - <nl> - / / Raw access to byte contents , for interfacing with other libraries . <nl> - / / Unsigned char instead of char to avoid surprises ( sign extension ) . <nl> - ConstRestrict < uint8_t * > bytes ( ) { return bytes_ . get ( ) ; } <nl> - ConstRestrict < const uint8_t * > bytes ( ) const { return bytes_ . get ( ) ; } <nl> - size_t bytes_per_row ( ) const { return bytes_per_row_ ; } <nl> - <nl> - / / Returns number of pixels ( some of which are padding ) per row . Useful for <nl> - / / computing other rows via pointer arithmetic . <nl> - intptr_t PixelsPerRow ( ) const { <nl> - static_assert ( CacheAligned : : kCacheLineSize % sizeof ( T ) = = 0 , <nl> - " Padding must be divisible by the pixel size . " ) ; <nl> - return static_cast < intptr_t > ( bytes_per_row_ / sizeof ( T ) ) ; <nl> - } <nl> - <nl> - private : <nl> - / / Deleter used when bytes are not owned . <nl> - static void Ignore ( void * ptr ) { } <nl> - <nl> - / / ( Members are non - const to enable assignment during move - assignment . ) <nl> - size_t xsize_ ; / / original intended pixels , not including any padding . <nl> - size_t ysize_ ; <nl> - size_t bytes_per_row_ ; / / [ bytes ] including padding . <nl> - CacheAlignedUniquePtr bytes_ ; <nl> - } ; <nl> - <nl> - / / Returns newly allocated planes of the given dimensions . <nl> - template < typename T > <nl> - static inline std : : vector < Image < T > > CreatePlanes ( const size_t xsize , <nl> - const size_t ysize , <nl> - const size_t num_planes ) { <nl> - std : : vector < Image < T > > planes ; <nl> - planes . reserve ( num_planes ) ; <nl> - for ( size_t i = 0 ; i < num_planes ; + + i ) { <nl> - planes . emplace_back ( xsize , ysize ) ; <nl> - } <nl> - return planes ; <nl> - } <nl> - <nl> - / / Returns a new image with the same dimensions and pixel values . <nl> - template < typename T > <nl> - static inline Image < T > CopyPixels ( const Image < T > & other ) { <nl> - Image < T > copy ( other . xsize ( ) , other . ysize ( ) ) ; <nl> - const void * BUTTERAUGLI_RESTRICT from = other . bytes ( ) ; <nl> - void * BUTTERAUGLI_RESTRICT to = copy . bytes ( ) ; <nl> - memcpy ( to , from , other . ysize ( ) * other . bytes_per_row ( ) ) ; <nl> - return copy ; <nl> - } <nl> - <nl> - / / Returns new planes with the same dimensions and pixel values . <nl> - template < typename T > <nl> - static inline std : : vector < Image < T > > CopyPlanes ( <nl> - const std : : vector < Image < T > > & planes ) { <nl> - std : : vector < Image < T > > copy ; <nl> - copy . reserve ( planes . size ( ) ) ; <nl> - for ( const Image < T > & plane : planes ) { <nl> - copy . push_back ( CopyPixels ( plane ) ) ; <nl> - } <nl> - return copy ; <nl> - } <nl> - <nl> - / / Compacts a padded image into a preallocated packed vector . <nl> - template < typename T > <nl> - static inline void CopyToPacked ( const Image < T > & from , std : : vector < T > * to ) { <nl> - const size_t xsize = from . xsize ( ) ; <nl> - const size_t ysize = from . ysize ( ) ; <nl> - # if BUTTERAUGLI_ENABLE_CHECKS <nl> - if ( to - > size ( ) < xsize * ysize ) { <nl> - printf ( " % zu x % zu exceeds % zu capacity \ n " , xsize , ysize , to - > size ( ) ) ; <nl> - abort ( ) ; <nl> - } <nl> - # endif <nl> - for ( size_t y = 0 ; y < ysize ; + + y ) { <nl> - ConstRestrict < const float * > row_from = from . Row ( y ) ; <nl> - ConstRestrict < float * > row_to = to - > data ( ) + y * xsize ; <nl> - memcpy ( row_to , row_from , xsize * sizeof ( T ) ) ; <nl> - } <nl> - } <nl> - <nl> - / / Expands a packed vector into a preallocated padded image . <nl> - template < typename T > <nl> - static inline void CopyFromPacked ( const std : : vector < T > & from , Image < T > * to ) { <nl> - const size_t xsize = to - > xsize ( ) ; <nl> - const size_t ysize = to - > ysize ( ) ; <nl> - assert ( from . size ( ) = = xsize * ysize ) ; <nl> - for ( size_t y = 0 ; y < ysize ; + + y ) { <nl> - ConstRestrict < const float * > row_from = from . data ( ) + y * xsize ; <nl> - ConstRestrict < float * > row_to = to - > Row ( y ) ; <nl> - memcpy ( row_to , row_from , xsize * sizeof ( T ) ) ; <nl> - } <nl> - } <nl> - <nl> - template < typename T > <nl> - static inline std : : vector < Image < T > > PlanesFromPacked ( <nl> - const size_t xsize , const size_t ysize , <nl> - const std : : vector < std : : vector < T > > & packed ) { <nl> - std : : vector < Image < T > > planes ; <nl> - planes . reserve ( packed . size ( ) ) ; <nl> - for ( const std : : vector < T > & p : packed ) { <nl> - planes . push_back ( Image < T > ( xsize , ysize ) ) ; <nl> - CopyFromPacked ( p , & planes . back ( ) ) ; <nl> - } <nl> - return planes ; <nl> - } <nl> - <nl> - template < typename T > <nl> - static inline std : : vector < std : : vector < T > > PackedFromPlanes ( <nl> - const std : : vector < Image < T > > & planes ) { <nl> - assert ( ! planes . empty ( ) ) ; <nl> - const size_t num_pixels = planes [ 0 ] . xsize ( ) * planes [ 0 ] . ysize ( ) ; <nl> - std : : vector < std : : vector < T > > packed ; <nl> - packed . reserve ( planes . size ( ) ) ; <nl> - for ( const Image < T > & image : planes ) { <nl> - packed . push_back ( std : : vector < T > ( num_pixels ) ) ; <nl> - CopyToPacked ( image , & packed . back ( ) ) ; <nl> - } <nl> - return packed ; <nl> - } <nl> - <nl> class ButteraugliComparator { <nl> public : <nl> ButteraugliComparator ( size_t xsize , size_t ysize , int step ) ; <nl> <nl> - / / Computes the butteraugli map between rgb0 and rgb1 and updates result . <nl> - void Diffmap ( const std : : vector < ImageF > & rgb0 , <nl> - const std : : vector < ImageF > & rgb1 , <nl> - ImageF & result ) ; <nl> - <nl> - / / Same as above , but OpsinDynamicsImage ( ) was already applied to <nl> - / / rgb0 and rgb1 . <nl> - void DiffmapOpsinDynamicsImage ( const std : : vector < ImageF > & rgb0 , <nl> - const std : : vector < ImageF > & rgb1 , <nl> - ImageF & result ) ; <nl> + / / Computes the butteraugli map between xyb0 and xyb1 and updates result . <nl> + / / Both xyb0 and xyb1 are in opsin - dynamics space . <nl> + / / NOTE : The xyb1 image is mutated by this function in - place . <nl> + void DiffmapOpsinDynamicsImage ( const std : : vector < std : : vector < float > > & xyb0 , <nl> + std : : vector < std : : vector < float > > & xyb1 , <nl> + std : : vector < float > & result ) ; <nl> <nl> private : <nl> void BlockDiffMap ( const std : : vector < std : : vector < float > > & rgb0 , <nl> class ButteraugliComparator { <nl> const size_t res_ysize_ ; <nl> } ; <nl> <nl> - void ButteraugliDiffmap ( const std : : vector < ImageF > & rgb0 , <nl> - const std : : vector < ImageF > & rgb1 , <nl> - ImageF & diffmap ) ; <nl> - <nl> - double ButteraugliScoreFromDiffmap ( const ImageF & distmap ) ; <nl> + double ButteraugliScoreFromDiffmap ( const std : : vector < float > & distmap ) ; <nl> <nl> / / Compute values of local frequency and dc masking based on the activity <nl> / / in the two images . <nl> void ButteraugliBlockDiff ( double rgb0 [ 192 ] , <nl> double diff_xyb_ac [ 3 ] , <nl> double diff_xyb_edge_dc [ 3 ] ) ; <nl> <nl> - void OpsinAbsorbance ( const double in [ 3 ] , double out [ 3 ] ) ; <nl> - <nl> void OpsinDynamicsImage ( size_t xsize , size_t ysize , <nl> std : : vector < std : : vector < float > > & rgb ) ; <nl> <nl> void MaskHighIntensityChange ( <nl> void Blur ( size_t xsize , size_t ysize , float * channel , double sigma , <nl> double border_ratio = 0 . 0 ) ; <nl> <nl> - void RgbToXyb ( double r , double g , double b , <nl> - double * valx , double * valy , double * valz ) ; <nl> - <nl> - double SimpleGamma ( double v ) ; <nl> - <nl> - double GammaMinArg ( ) ; <nl> - double GammaMaxArg ( ) ; <nl> - <nl> - / / Polynomial evaluation via Clenshaw ' s scheme ( similar to Horner ' s ) . <nl> - / / Template enables compile - time unrolling of the recursion , but must reside <nl> - / / outside of a class due to the specialization . <nl> - template < int INDEX > <nl> - static inline void ClenshawRecursion ( const double x , const double * coefficients , <nl> - double * b1 , double * b2 ) { <nl> - const double x_b1 = x * ( * b1 ) ; <nl> - const double t = ( x_b1 + x_b1 ) - ( * b2 ) + coefficients [ INDEX ] ; <nl> - * b2 = * b1 ; <nl> - * b1 = t ; <nl> - <nl> - ClenshawRecursion < INDEX - 1 > ( x , coefficients , b1 , b2 ) ; <nl> - } <nl> - <nl> - / / Base case <nl> - template < > <nl> - inline void ClenshawRecursion < 0 > ( const double x , const double * coefficients , <nl> - double * b1 , double * b2 ) { <nl> - const double x_b1 = x * ( * b1 ) ; <nl> - / / The final iteration differs - no 2 * x_b1 here . <nl> - * b1 = x_b1 - ( * b2 ) + coefficients [ 0 ] ; <nl> - } <nl> - <nl> - / / Rational polynomial : = dividing two polynomial evaluations . These are easier <nl> - / / to find than minimax polynomials . <nl> - struct RationalPolynomial { <nl> - template < int N > <nl> - static double EvaluatePolynomial ( const double x , <nl> - const double ( & coefficients ) [ N ] ) { <nl> - double b1 = 0 . 0 ; <nl> - double b2 = 0 . 0 ; <nl> - ClenshawRecursion < N - 1 > ( x , coefficients , & b1 , & b2 ) ; <nl> - return b1 ; <nl> - } <nl> - <nl> - / / Evaluates the polynomial at x ( in [ min_value , max_value ] ) . <nl> - inline double operator ( ) ( const float x ) const { <nl> - / / First normalize to [ 0 , 1 ] . <nl> - const double x01 = ( x - min_value ) / ( max_value - min_value ) ; <nl> - / / And then to [ - 1 , 1 ] domain of Chebyshev polynomials . <nl> - const double xc = 2 . 0 * x01 - 1 . 0 ; <nl> - <nl> - const double yp = EvaluatePolynomial ( xc , p ) ; <nl> - const double yq = EvaluatePolynomial ( xc , q ) ; <nl> - if ( yq = = 0 . 0 ) return 0 . 0 ; <nl> - return static_cast < float > ( yp / yq ) ; <nl> - } <nl> - <nl> - / / Domain of the polynomials ; they are undefined elsewhere . <nl> - double min_value ; <nl> - double max_value ; <nl> - <nl> - / / Coefficients of T_n ( Chebyshev polynomials of the first kind ) . <nl> - / / Degree 5 / 5 is a compromise between accuracy ( 0 . 1 % ) and numerical stability . <nl> - double p [ 5 + 1 ] ; <nl> - double q [ 5 + 1 ] ; <nl> - } ; <nl> - <nl> - static inline float GammaPolynomial ( float value ) { <nl> - / / Generated by gamma_polynomial . m from equispaced x / gamma ( x ) samples . <nl> - static const RationalPolynomial r = { <nl> - 0 . 770000000000000 , 274 . 579999999999984 , <nl> - { <nl> - 881 . 979476556478289 , 1496 . 058452015812463 , 908 . 662212739659481 , <nl> - 373 . 566100223287378 , 85 . 840860336314364 , 6 . 683258861509244 , <nl> - } , <nl> - { <nl> - 12 . 262350348616792 , 20 . 557285797683576 , 12 . 161463238367844 , <nl> - 4 . 711532733641639 , 0 . 899112889751053 , 0 . 035662329617191 , <nl> - } } ; <nl> - return r ( value ) ; <nl> - } <nl> - <nl> } / / namespace butteraugli <nl> <nl> # endif / / BUTTERAUGLI_BUTTERAUGLI_H_ <nl>
|
Reduce memory usage of butteraugli .
|
google/guetzli
|
663905462f015e63e078232fb3f2baab9ea2ea47
|
2017-03-29T12:26:31Z
|
mmm a / configure . in <nl> ppp b / configure . in <nl> <nl> # Process this file with autoconf to produce a configure script . <nl> <nl> AC_PREREQ ( 2 . 59 ) <nl> - AC_INIT ( [ kodi ] , [ 13 . 9 . 805 ] , [ http : / / issues . kodi . tv ] ) <nl> + AC_INIT ( [ kodi ] , [ 13 . 9 . 901 ] , [ http : / / issues . kodi . tv ] ) <nl> AC_CONFIG_HEADERS ( [ xbmc / config . h ] ) <nl> AH_TOP ( [ # pragma once ] ) <nl> m4_include ( [ m4 / ax_prog_cc_for_build . m4 ] ) <nl> Binary files a / media / Splash . png and b / media / Splash . png differ <nl> mmm a / version . txt <nl> ppp b / version . txt <nl> COMPANY_NAME XBMC - Foundation <nl> WEBSITE http : / / kodi . tv <nl> VERSION_MAJOR 14 <nl> VERSION_MINOR 0 <nl> - VERSION_TAG BETA5 <nl> - VERSION_CODE 139805 <nl> - ADDON_API 13 . 9 . 805 <nl> + VERSION_TAG RC1 <nl> + VERSION_CODE 139901 <nl> + ADDON_API 13 . 9 . 901 <nl> <nl> # Notes : <nl> # Change AC_INIT in configure . in <nl>
|
Merge pull request from MartijnKaijser / 14 . 0rc1
|
xbmc/xbmc
|
ea20b8352fa1761f022cc936f9857e52798e990a
|
2014-11-30T12:25:37Z
|
mmm a / tensorflow / python / client / tf_session_helper . cc <nl> ppp b / tensorflow / python / client / tf_session_helper . cc <nl> void TF_Run_wrapper_helper ( TF_Session * session , const char * handle , <nl> } <nl> input_names . push_back ( key_string ) ; <nl> <nl> - PyArrayObject * array = reinterpret_cast < PyArrayObject * > ( <nl> - PyArray_FromAny ( value , nullptr , 0 , 0 , NPY_ARRAY_CARRAY , nullptr ) ) ; <nl> - if ( ! array ) { <nl> + / / The array object will be dereferenced at the end of this iteration <nl> + / / ( or if we return early due to an error ) . <nl> + Safe_PyObjectPtr array_safe ( make_safe ( <nl> + PyArray_FromAny ( value , nullptr , 0 , 0 , NPY_ARRAY_CARRAY , nullptr ) ) ) ; <nl> + if ( ! array_safe ) { <nl> Set_TF_Status_from_Status ( out_status , <nl> errors : : InvalidArgument ( kFeedDictErrorMsg ) ) ; <nl> return ; <nl> } <nl> + PyArrayObject * array = reinterpret_cast < PyArrayObject * > ( array_safe . get ( ) ) ; <nl> <nl> / / Convert numpy dtype to TensorFlow dtype . <nl> TF_DataType dtype = TF_FLOAT ; <nl>
|
Fix reference - counting bug in SWIG wrapper for feed_dict .
|
tensorflow/tensorflow
|
2832fc4adb95e7e9144e423b50f4b6cb04a13fb2
|
2016-09-19T17:17:48Z
|
mmm a / tensorflow / BUILD <nl> ppp b / tensorflow / BUILD <nl> filegroup ( <nl> " / / tensorflow / contrib / cloud : all_files " , <nl> " / / tensorflow / contrib / cloud / kernels : all_files " , <nl> " / / tensorflow / contrib / cluster_resolver : all_files " , <nl> + " / / tensorflow / contrib / coder : all_files " , <nl> " / / tensorflow / contrib / compiler : all_files " , <nl> " / / tensorflow / contrib / copy_graph : all_files " , <nl> " / / tensorflow / contrib / crf : all_files " , <nl> mmm a / tensorflow / c / eager / runtime . cc <nl> ppp b / tensorflow / c / eager / runtime . cc <nl> Status KernelAndDevice : : Run ( std : : vector < Tensor > * input_tensors , <nl> allocator_pair . second - > GetRecordsAndUnRef ( ) ; <nl> } <nl> auto * ms = stats - > mutable_memory_stats ( ) ; <nl> - ms - > set_host_temp_memory_size ( context . host_temp_memory_size ( ) ) ; <nl> - ms - > set_device_temp_memory_size ( context . device_temp_memory_size ( ) ) ; <nl> - for ( const auto & alloc_id : context . host_persistent_alloc_ids ( ) ) { <nl> - ms - > mutable_host_persistent_tensor_alloc_ids ( ) - > Add ( alloc_id ) ; <nl> + ms - > set_temp_memory_size ( context . temp_memory_size ( ) ) ; <nl> + for ( const auto & alloc_id : context . persistent_alloc_ids ( ) ) { <nl> + ms - > mutable_persistent_tensor_alloc_ids ( ) - > Add ( alloc_id ) ; <nl> } <nl> - for ( const auto & alloc_id : context . device_persistent_alloc_ids ( ) ) { <nl> - ms - > mutable_device_persistent_tensor_alloc_ids ( ) - > Add ( alloc_id ) ; <nl> - } <nl> - ms - > set_host_persistent_memory_size ( <nl> - context . host_persistent_memory_allocated ( ) ) ; <nl> - ms - > set_device_persistent_memory_size ( <nl> - context . device_persistent_memory_allocated ( ) ) ; <nl> + <nl> + ms - > set_persistent_memory_size ( context . persistent_memory_allocated ( ) ) ; <nl> } <nl> return Status : : OK ( ) ; <nl> } <nl> mmm a / tensorflow / compiler / tf2xla / kernels / image_resize_ops . cc <nl> ppp b / tensorflow / compiler / tf2xla / kernels / image_resize_ops . cc <nl> xla : : ComputationDataHandle MakeBilinearResizeKernel ( <nl> XlaHelpers : : Iota ( builder , DataType : : DT_INT32 , channels , & channels_iota ) ) ; <nl> <nl> auto diag = builder - > ConvertElementType ( <nl> - builder - > Eq ( builder - > Reshape ( channels_iota , { 1 , 1 , 1 , channels } ) , <nl> - channels_iota , / * broadcast_dimensions = * / { 2 } ) , <nl> + builder - > Eq ( <nl> + builder - > Broadcast ( channels_iota , { 2 * kernel_size [ 0 ] - 1 , <nl> + 2 * kernel_size [ 1 ] - 1 , channels } ) , <nl> + channels_iota , / * broadcast_dimensions = * / { 2 } ) , <nl> xla : : PrimitiveType : : F32 ) ; <nl> return builder - > Mul ( <nl> builder - > Mul ( diag , <nl> mmm a / tensorflow / compiler / xla / python / local_computation_builder . cc <nl> ppp b / tensorflow / compiler / xla / python / local_computation_builder . cc <nl> const Computation & LocalComputation : : computation ( ) const { <nl> LocalComputationBuilder : : LocalComputationBuilder ( const string & computation_name ) <nl> : builder_ ( GetOrCreateLocalClient ( ) , computation_name ) { } <nl> <nl> + void LocalComputationBuilder : : SetOpMetadata ( const OpMetadata & metadata ) { <nl> + builder_ . SetOpMetadata ( metadata ) ; <nl> + } <nl> + <nl> + void LocalComputationBuilder : : ClearOpMetadata ( ) { builder_ . ClearOpMetadata ( ) ; } <nl> + <nl> StatusOr < LocalComputation * > LocalComputationBuilder : : Build ( ) { <nl> TF_ASSIGN_OR_RETURN ( Computation computation , builder_ . Build ( ) ) ; <nl> return new LocalComputation ( std : : move ( computation ) ) ; <nl> ComputationDataHandle LocalComputationBuilder : : Broadcast ( <nl> return builder_ . Broadcast ( operand , broadcast_sizes ) ; <nl> } <nl> <nl> + ComputationDataHandle LocalComputationBuilder : : Pad ( <nl> + const ComputationDataHandle & operand , <nl> + const ComputationDataHandle & padding_value , <nl> + const PaddingConfig & padding_config ) { <nl> + return builder_ . Pad ( operand , padding_value , padding_config ) ; <nl> + } <nl> + <nl> ComputationDataHandle LocalComputationBuilder : : Reshape ( <nl> const ComputationDataHandle & operand , <nl> tensorflow : : gtl : : ArraySlice < int64 > dimensions , <nl> mmm a / tensorflow / compiler / xla / python / local_computation_builder . h <nl> ppp b / tensorflow / compiler / xla / python / local_computation_builder . h <nl> class LocalComputationBuilder { <nl> public : <nl> LocalComputationBuilder ( const string & computation_name ) ; <nl> <nl> + void SetOpMetadata ( const OpMetadata & metadata ) ; <nl> + void ClearOpMetadata ( ) ; <nl> + <nl> / / Returns an owned LocalComputation to the caller on success . <nl> StatusOr < LocalComputation * > Build ( ) ; <nl> <nl> class LocalComputationBuilder { <nl> const ComputationDataHandle & operand , <nl> tensorflow : : gtl : : ArraySlice < int64 > broadcast_sizes ) ; <nl> <nl> + ComputationDataHandle Pad ( const ComputationDataHandle & operand , <nl> + const ComputationDataHandle & padding_value , <nl> + const PaddingConfig & padding_config ) ; <nl> + <nl> ComputationDataHandle Reshape ( const ComputationDataHandle & operand , <nl> tensorflow : : gtl : : ArraySlice < int64 > dimensions , <nl> tensorflow : : gtl : : ArraySlice < int64 > new_sizes ) ; <nl> mmm a / tensorflow / compiler / xla / python / local_computation_builder . i <nl> ppp b / tensorflow / compiler / xla / python / local_computation_builder . i <nl> limitations under the License . <nl> / / std : : vector < Shape > < - sequence of shape information pairs <nl> / / PrimitiveType < - int <nl> / / ArraySlice < pair < int64 , in64 > > < - sequence of int pairs <nl> + / / PaddingConfig proto < - corresponding Python proto <nl> / / ConvolutionDimensionNumbers proto < - corresponding Python proto <nl> / / <nl> / / Arrows indicate whether a conversion only ever occurs in one <nl> tensorflow : : ImportNumpy ( ) ; <nl> $ 1 = & temps ; <nl> } <nl> <nl> + / / OpMetadata <nl> + <nl> + % typemap ( in ) const OpMetadata & ( OpMetadata temp ) { <nl> + StatusOr < OpMetadata > statusor = numpy : : OpMetadataFromPyObject ( $ input ) ; <nl> + if ( ! statusor . ok ( ) ) { <nl> + PyErr_SetString ( PyExc_RuntimeError , statusor . status ( ) . ToString ( ) . c_str ( ) ) ; <nl> + return NULL ; <nl> + } <nl> + temp = std : : move ( statusor ) . ValueOrDie ( ) ; <nl> + $ 1 = & temp ; <nl> + } <nl> + <nl> / / Shape <nl> <nl> % typemap ( in ) const Shape & ( Shape temp ) { <nl> tensorflow : : ImportNumpy ( ) ; <nl> $ 1 = temps ; <nl> } <nl> <nl> + / / PaddingConfig <nl> + <nl> + % typemap ( in ) const PaddingConfig & <nl> + ( PaddingConfig padding_config ) { <nl> + PyObject * dimensions = PyObject_GetAttrString ( $ input , " dimensions " ) ; <nl> + if ( ! dimensions ) { <nl> + return NULL ; <nl> + } <nl> + <nl> + int length = PySequence_Size ( dimensions ) ; <nl> + if ( length = = - 1 ) { <nl> + Py_DECREF ( dimensions ) ; <nl> + return NULL ; <nl> + } <nl> + <nl> + for ( int i = 0 ; i < length ; + + i ) { <nl> + PyObject * item = PySequence_GetItem ( dimensions , i ) ; <nl> + if ( ! item ) { <nl> + Py_DECREF ( dimensions ) ; <nl> + return NULL ; <nl> + } <nl> + int64 edge_padding_low , edge_padding_high , interior_padding ; <nl> + if ( ! GetIntAttr ( item , " edge_padding_low " , & edge_padding_low ) <nl> + | | ! GetIntAttr ( item , " edge_padding_high " , & edge_padding_high ) <nl> + | | ! GetIntAttr ( item , " interior_padding " , & interior_padding ) ) { <nl> + Py_DECREF ( item ) ; <nl> + Py_DECREF ( dimensions ) ; <nl> + return NULL ; <nl> + } <nl> + Py_DECREF ( item ) ; <nl> + <nl> + PaddingConfig : : PaddingConfigDimension * dimension = <nl> + padding_config . add_dimensions ( ) ; <nl> + dimension - > set_edge_padding_low ( edge_padding_low ) ; <nl> + dimension - > set_edge_padding_high ( edge_padding_high ) ; <nl> + dimension - > set_interior_padding ( interior_padding ) ; <nl> + } <nl> + Py_DECREF ( dimensions ) ; <nl> + <nl> + $ 1 = & padding_config ; <nl> + } <nl> + <nl> / / ConvolutionDimensionNumbers <nl> <nl> % typemap ( in ) const ConvolutionDimensionNumbers & <nl> tensorflow : : ImportNumpy ( ) ; <nl> % unignore xla : : swig : : LocalComputationBuilder ; <nl> % unignore xla : : swig : : LocalComputationBuilder : : LocalComputationBuilder ; <nl> % unignore xla : : swig : : LocalComputationBuilder : : Build ; <nl> + % unignore xla : : swig : : LocalComputationBuilder : : SetOpMetadata ; <nl> + % unignore xla : : swig : : LocalComputationBuilder : : ClearOpMetadata ; <nl> % unignore xla : : swig : : LocalComputationBuilder : : Parameter ; <nl> % unignore xla : : swig : : LocalComputationBuilder : : GetShape ; <nl> % unignore xla : : swig : : LocalComputationBuilder : : Infeed ; <nl> tensorflow : : ImportNumpy ( ) ; <nl> % unignore xla : : swig : : LocalComputationBuilder : : ConstantLiteral ; <nl> % unignore xla : : swig : : LocalComputationBuilder : : ConstantR0 ; <nl> % unignore xla : : swig : : LocalComputationBuilder : : Broadcast ; <nl> + % unignore xla : : swig : : LocalComputationBuilder : : Pad ; <nl> % unignore xla : : swig : : LocalComputationBuilder : : Reshape ; <nl> % unignore xla : : swig : : LocalComputationBuilder : : Collapse ; <nl> % unignore xla : : swig : : LocalComputationBuilder : : CrossReplicaSum ; <nl> mmm a / tensorflow / compiler / xla / python / numpy_bridge . cc <nl> ppp b / tensorflow / compiler / xla / python / numpy_bridge . cc <nl> static int NumpyTypenum ( PyObject * o ) { <nl> return reinterpret_cast < PyArray_Descr * > ( o ) - > type_num ; <nl> } <nl> <nl> - / / Safely returns a repr of the given Python object o as a C + + string . <nl> - static string PyObjectCppRepr ( PyObject * o ) { <nl> - PyObject * r = PyObject_Repr ( o ) ; <nl> + / / Extracts the string held inside r and returns it as a C + + string . <nl> + / / <nl> + / / NOTE : this is an internal helper for conversion to a C + + , and so decrefs r . <nl> + static string ExtractStringAndDecref ( PyObject * r ) { <nl> auto error = [ r ] { <nl> - return tensorflow : : strings : : Printf ( " < repr - failed object % p > " , r ) ; <nl> + return tensorflow : : strings : : Printf ( " < failed conversion of % p > " , r ) ; <nl> } ; <nl> if ( r = = nullptr ) { <nl> return error ( ) ; <nl> static string PyObjectCppRepr ( PyObject * o ) { <nl> return result ; <nl> } <nl> <nl> + / / Safely returns a str of the given Python object o as a C + + string . <nl> + static string PyObjectCppStr ( PyObject * o ) { <nl> + PyObject * s = PyObject_Str ( o ) ; <nl> + return ExtractStringAndDecref ( s ) ; <nl> + } <nl> + <nl> + / / Safely returns a repr of the given Python object o as a C + + string . <nl> + static string PyObjectCppRepr ( PyObject * o ) { <nl> + PyObject * r = PyObject_Repr ( o ) ; <nl> + return ExtractStringAndDecref ( r ) ; <nl> + } <nl> + <nl> Status CheckPyShapeInfo ( PyObject * o ) { <nl> auto error = [ o ] ( const string & prefix ) { <nl> return InvalidArgument ( " % s ; got % s " , prefix . c_str ( ) , <nl> Shape XlaShapeFromPyShapeInfo ( PyObject * o ) { <nl> } <nl> } <nl> <nl> + / / Helper that retrieves the member with attr_name , stringifies it if is not <nl> + / / None , and returns it as a C + + string . <nl> + static tensorflow : : gtl : : optional < string > GetAttrAsString ( <nl> + PyObject * o , const string & attr_name ) { <nl> + if ( ! PyObject_HasAttrString ( o , attr_name . c_str ( ) ) ) { <nl> + return tensorflow : : gtl : : nullopt ; <nl> + } <nl> + PyObject * attr = PyObject_GetAttrString ( o , attr_name . c_str ( ) ) ; <nl> + if ( attr = = Py_None ) { <nl> + Py_DECREF ( attr ) ; <nl> + return tensorflow : : gtl : : nullopt ; <nl> + } <nl> + string result = PyObjectCppStr ( attr ) ; <nl> + Py_DECREF ( attr ) ; <nl> + return result ; <nl> + } <nl> + <nl> + / / Helper that retrieves the member with attr_name , checks that it is an integer <nl> + / / if it is not None , and returns it as an int32 value . <nl> + static tensorflow : : gtl : : optional < int32 > GetAttrAsInt32 ( <nl> + PyObject * o , const string & attr_name ) { <nl> + if ( ! PyObject_HasAttrString ( o , attr_name . c_str ( ) ) ) { <nl> + return tensorflow : : gtl : : nullopt ; <nl> + } <nl> + PyObject * attr = PyObject_GetAttrString ( o , attr_name . c_str ( ) ) ; <nl> + if ( attr = = Py_None ) { <nl> + Py_DECREF ( attr ) ; <nl> + return tensorflow : : gtl : : nullopt ; <nl> + } <nl> + if ( ! CheckPyIntOrLong ( attr ) ) { <nl> + Py_DECREF ( attr ) ; <nl> + return tensorflow : : gtl : : nullopt ; <nl> + } <nl> + long value = PyIntOrPyLongToLong ( attr ) ; / / NOLINT <nl> + Py_DECREF ( attr ) ; <nl> + if ( value = = - 1 & & PyErr_Occurred ( ) ! = nullptr ) { <nl> + return tensorflow : : gtl : : nullopt ; <nl> + } <nl> + if ( static_cast < int32 > ( value ) ! = value ) { <nl> + return tensorflow : : gtl : : nullopt ; <nl> + } <nl> + return value ; <nl> + } <nl> + <nl> + StatusOr < OpMetadata > OpMetadataFromPyObject ( PyObject * o ) { <nl> + OpMetadata result ; <nl> + tensorflow : : gtl : : optional < string > op_type = GetAttrAsString ( o , " op_type " ) ; <nl> + if ( op_type . has_value ( ) ) { <nl> + result . set_op_type ( op_type . value ( ) ) ; <nl> + } <nl> + tensorflow : : gtl : : optional < string > op_name = GetAttrAsString ( o , " op_name " ) ; <nl> + if ( op_name . has_value ( ) ) { <nl> + result . set_op_name ( op_name . value ( ) ) ; <nl> + } <nl> + tensorflow : : gtl : : optional < string > source_file = <nl> + GetAttrAsString ( o , " source_file " ) ; <nl> + if ( source_file . has_value ( ) ) { <nl> + result . set_source_file ( source_file . value ( ) ) ; <nl> + } <nl> + tensorflow : : gtl : : optional < int32 > source_line = <nl> + GetAttrAsInt32 ( o , " source_line " ) ; <nl> + if ( source_line . has_value ( ) ) { <nl> + result . set_source_line ( source_line . value ( ) ) ; <nl> + } <nl> + return result ; <nl> + } <nl> + <nl> PyObject * PyObjectFromXlaLiteral ( const Literal & literal ) { <nl> if ( ShapeUtil : : IsTuple ( literal . shape ( ) ) ) { <nl> int num_elements = ShapeUtil : : TupleElementCount ( literal . shape ( ) ) ; <nl> mmm a / tensorflow / compiler / xla / python / numpy_bridge . h <nl> ppp b / tensorflow / compiler / xla / python / numpy_bridge . h <nl> Status CheckPyShapeInfo ( PyObject * o ) ; <nl> / / The return value is a new reference . <nl> Shape XlaShapeFromPyShapeInfo ( PyObject * o ) ; <nl> <nl> + / / Converts a PyObject that represents operation metadata into protocol buffer <nl> + / / form . <nl> + StatusOr < OpMetadata > OpMetadataFromPyObject ( PyObject * o ) ; <nl> + <nl> / / Converts an XLA literal to a Python object , either a Numpy ndarray <nl> / / or a nested Python tuple thereof . <nl> / / <nl> mmm a / tensorflow / compiler / xla / python / xla_client . py <nl> ppp b / tensorflow / compiler / xla / python / xla_client . py <nl> <nl> from __future__ import division <nl> from __future__ import print_function <nl> <nl> + import collections <nl> import enum # pylint : disable = g - bad - import - order <nl> + import inspect <nl> import itertools <nl> + import os <nl> <nl> import numpy as np <nl> <nl> <nl> # pylint : disable = invalid - name <nl> <nl> <nl> + OpMetadata = collections . namedtuple ( <nl> + ' OpMetadata ' , <nl> + [ <nl> + ' op_type ' , <nl> + ' op_name ' , <nl> + ' source_file ' , <nl> + ' source_line ' , <nl> + ] , <nl> + ) <nl> + <nl> + <nl> + def CurrentSourceInfoMetadata ( op_type = None , op_name = None , skip_frames = 1 ) : <nl> + " " " Helper for use in source mapping that returns an OpMetadata object . " " " <nl> + full_filename , lineno = inspect . stack ( ) [ skip_frames ] [ 1 : 3 ] <nl> + filename = os . path . basename ( full_filename ) <nl> + return OpMetadata ( <nl> + op_type = op_type , <nl> + op_name = op_name , <nl> + source_file = filename , <nl> + source_line = lineno ) <nl> + <nl> + <nl> class PaddingType ( enum . Enum ) : <nl> VALID = 1 <nl> SAME = 2 <nl> def __init__ ( self , name ) : <nl> def Build ( self ) : <nl> return LocalComputation ( self . _client . Build ( ) , is_compiled = False ) <nl> <nl> + def SetOpMetadata ( self , op_metadata ) : <nl> + " " " Set metadata for operations that are about to be enqueued . " " " <nl> + self . _client . SetOpMetadata ( op_metadata ) <nl> + <nl> + def ClearOpMetadata ( self ) : <nl> + " " " Clear metadata for operations that are about to be enqueued . " " " <nl> + self . _client . ClearOpMetadata ( ) <nl> + <nl> def Infeed ( self , shape ) : <nl> " " " Enqueues an infeed op onto the computation . <nl> <nl> def GetShape ( self , operand ) : <nl> def GetComputationStats ( self ) : <nl> raise NotImplementedError ( ) <nl> <nl> + def Pad ( self , operand , padding_value , padding_config ) : <nl> + " " " Enqueues a Pad operation onto the computation . <nl> + <nl> + Args : <nl> + operand : ComputationDataHandle representing the array to pad . <nl> + padding_value : ComputationDataHandle representing the scalar pad value . <nl> + padding_config : either an xla_data_pb2 . PaddingConfig or a list of integer <nl> + triples ( edge_padding_low , edge_padding_high , interior_padding ) <nl> + representing the configuration of the padding operation . <nl> + <nl> + Returns : <nl> + A ComputationDataHandle representing the added pad op . <nl> + " " " <nl> + if not isinstance ( padding_config , xla_data_pb2 . PaddingConfig ) : <nl> + padding_config = self . _GetPaddingConfigFromTriples ( padding_config ) <nl> + return _wrap_data_handle ( <nl> + self . _client . Pad ( _unwrap_data_handle ( operand ) , <nl> + _unwrap_data_handle ( padding_value ) , <nl> + padding_config ) ) <nl> + <nl> + def _GetPaddingConfigFromTriples ( self , triples ) : <nl> + " " " Create PaddingConfig proto from list of triples of integers . " " " <nl> + padding_config = xla_data_pb2 . PaddingConfig ( ) <nl> + for lo , hi , interior in triples : <nl> + dimension = padding_config . dimensions . add ( ) <nl> + dimension . edge_padding_low = lo <nl> + dimension . edge_padding_high = hi <nl> + dimension . interior_padding = interior <nl> + return padding_config <nl> + <nl> def Reshape ( self , operand , dimensions , new_sizes ) : <nl> " " " Reshape op . " " " <nl> return _wrap_data_handle ( <nl> mmm a / tensorflow / compiler / xla / python / xla_client_test . py <nl> ppp b / tensorflow / compiler / xla / python / xla_client_test . py <nl> def testMin ( self ) : <nl> c . Constant ( NumpyArrayF32 ( [ 1 . 0 , 0 . 0 , 2 . 0 , 7 . 0 , 12 . 0 ] ) ) ) <nl> self . _ExecuteAndCompareExact ( c , expected = [ 1 . 0 , 0 . 0 , 2 . 0 , 4 . 0 , 9 . 0 ] ) <nl> <nl> + def testPad ( self ) : <nl> + c = self . _NewComputation ( ) <nl> + c . Pad ( <nl> + c . Constant ( NumpyArrayF32 ( [ [ 1 . 0 , 2 . 0 ] , [ 3 . 0 , 4 . 0 ] ] ) ) , <nl> + c . Constant ( NumpyArrayF32 ( 0 . 0 ) ) , <nl> + [ ( 1 , 2 , 1 ) , ( 0 , 1 , 0 ) ] ) <nl> + self . _ExecuteAndCompareClose ( c , expected = [ [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + [ 1 . 0 , 2 . 0 , 0 . 0 ] , <nl> + [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + [ 3 . 0 , 4 . 0 , 0 . 0 ] , <nl> + [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + [ 0 . 0 , 0 . 0 , 0 . 0 ] ] ) <nl> + <nl> + def testPadWithPaddingConfig ( self ) : <nl> + c = self . _NewComputation ( ) <nl> + padding_config = xla_client . xla_data_pb2 . PaddingConfig ( ) <nl> + for lo , hi , interior in [ ( 1 , 2 , 1 ) , ( 0 , 1 , 0 ) ] : <nl> + dimension = padding_config . dimensions . add ( ) <nl> + dimension . edge_padding_low = lo <nl> + dimension . edge_padding_high = hi <nl> + dimension . interior_padding = interior <nl> + c . Pad ( <nl> + c . Constant ( NumpyArrayF32 ( [ [ 1 . 0 , 2 . 0 ] , [ 3 . 0 , 4 . 0 ] ] ) ) , <nl> + c . Constant ( NumpyArrayF32 ( 0 . 0 ) ) , <nl> + padding_config ) <nl> + self . _ExecuteAndCompareClose ( c , expected = [ [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + [ 1 . 0 , 2 . 0 , 0 . 0 ] , <nl> + [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + [ 3 . 0 , 4 . 0 , 0 . 0 ] , <nl> + [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + [ 0 . 0 , 0 . 0 , 0 . 0 ] ] ) <nl> + <nl> def testReshape ( self ) : <nl> c = self . _NewComputation ( ) <nl> c . Reshape ( <nl> def setUp ( self ) : <nl> <nl> def testInvokeWithWrongElementType ( self ) : <nl> c = self . _NewComputation ( ) <nl> + c . SetOpMetadata ( xla_client . CurrentSourceInfoMetadata ( ) ) <nl> c . ParameterFromNumpy ( self . s32_scalar_2 ) <nl> + c . ClearOpMetadata ( ) <nl> self . assertRaisesRegexp ( <nl> - RuntimeError , r " invalid argument shape . * expected s32 \ [ \ ] , got f32 \ [ \ ] " , <nl> + RuntimeError , r " Invalid argument shape . * xla_client_test . py . * " <nl> + r " expected s32 \ [ \ ] , got f32 \ [ \ ] " , <nl> lambda : c . Build ( ) . CompileWithExampleArguments ( [ self . f32_scalar_2 ] ) ) <nl> <nl> <nl> mmm a / tensorflow / compiler / xla / service / local_service . cc <nl> ppp b / tensorflow / compiler / xla / service / local_service . cc <nl> StatusOr < std : : unique_ptr < Executable > > LocalService : : CompileExecutable ( <nl> / / Validate incoming layouts . <nl> if ( argument_layouts . size ( ) ! = program_shape - > parameters_size ( ) ) { <nl> return InvalidArgument ( <nl> - " invalid number of arguments for computation : expected % d , got % zu " , <nl> + " Invalid number of arguments for computation : expected % d , got % zu . " , <nl> program_shape - > parameters_size ( ) , argument_layouts . size ( ) ) ; <nl> } <nl> for ( int i = 0 ; i < argument_layouts . size ( ) ; + + i ) { <nl> const Shape & argument_shape = * argument_layouts [ i ] ; <nl> TF_RETURN_IF_ERROR ( ShapeUtil : : ValidateShape ( argument_shape ) ) ; <nl> if ( ! ShapeUtil : : Compatible ( argument_shape , program_shape - > parameters ( i ) ) ) { <nl> + tensorflow : : gtl : : optional < const OpMetadata * > metadata = <nl> + user_computation - > ParameterMetadata ( i ) ; <nl> + auto metadata_string = [ & metadata ] ( ) - > string { <nl> + if ( ! metadata . has_value ( ) ) { <nl> + return " " ; <nl> + } <nl> + CHECK ( metadata . value ( ) ! = nullptr ) ; <nl> + const OpMetadata & m = * metadata . value ( ) ; <nl> + if ( ! m . source_file ( ) . empty ( ) ) { <nl> + return tensorflow : : strings : : Printf ( <nl> + " ( % s : % d ) " , m . source_file ( ) . c_str ( ) , m . source_line ( ) ) ; <nl> + } <nl> + return " " ; <nl> + } ; <nl> return InvalidArgument ( <nl> - " invalid argument shape for argument % d , expected % s , got % s " , i , <nl> + " Invalid argument shape for argument % d % s , expected % s , got % s . " , i , <nl> + metadata_string ( ) . c_str ( ) , <nl> ShapeUtil : : HumanString ( program_shape - > parameters ( i ) ) . c_str ( ) , <nl> ShapeUtil : : HumanString ( argument_shape ) . c_str ( ) ) ; <nl> } <nl> mmm a / tensorflow / compiler / xla / service / user_computation . cc <nl> ppp b / tensorflow / compiler / xla / service / user_computation . cc <nl> UserComputation : : LookUpRequestForErrorReporting ( <nl> return LookUpRequest ( handle ) ; <nl> } <nl> <nl> + tensorflow : : gtl : : optional < const OpMetadata * > UserComputation : : ParameterMetadata ( <nl> + int parameter_number ) const { <nl> + tensorflow : : mutex_lock lock ( mutex_ ) ; <nl> + auto it = parameters_ . find ( parameter_number ) ; <nl> + if ( it = = parameters_ . end ( ) ) { <nl> + return tensorflow : : gtl : : nullopt ; <nl> + } <nl> + OperationRequest * op = it - > second ; <nl> + return & op - > request ( ) . metadata ( ) ; <nl> + } <nl> + <nl> Status UserComputation : : RemapEmbeddedComputations ( <nl> const std : : map < int64 , ComputationHandle > & old_to_new ) { <nl> auto update = [ & old_to_new ] ( ComputationHandle * to_update ) - > Status { <nl> mmm a / tensorflow / compiler / xla / service / user_computation . h <nl> ppp b / tensorflow / compiler / xla / service / user_computation . h <nl> class UserComputation { <nl> StatusOr < const OperationRequest * > LookUpRequestForErrorReporting ( <nl> const ComputationDataHandle & handle ) const ; <nl> <nl> + / / Retrieves the parameter metadata for the given parameter number . <nl> + / / <nl> + / / If the parameter number is invalid for this computation , nullopt is <nl> + / / returned . When the return value has_value ( ) , nullptr will never be <nl> + / / the held value . <nl> + tensorflow : : gtl : : optional < const OpMetadata * > ParameterMetadata ( <nl> + int parameter_number ) const ; <nl> + <nl> private : <nl> / / Warning : dangerous mutating operation that doesn ' t respect versioning . <nl> / / This is only used at initialization time when constructing from a <nl> mmm a / tensorflow / compiler / xla / tests / local_client_execute_test . cc <nl> ppp b / tensorflow / compiler / xla / tests / local_client_execute_test . cc <nl> XLA_TEST_F ( LocalClientExecuteTest , InvalidNumberOfArguments ) { <nl> <nl> EXPECT_FALSE ( execute_status . ok ( ) ) ; <nl> EXPECT_THAT ( execute_status . status ( ) . error_message ( ) , <nl> - ContainsRegex ( " invalid number of arguments " ) ) ; <nl> + ContainsRegex ( " Invalid number of arguments " ) ) ; <nl> } <nl> <nl> XLA_TEST_F ( LocalClientExecuteTest , IncorrectArgumentShape ) { <nl> XLA_TEST_F ( LocalClientExecuteTest , IncorrectArgumentShape ) { <nl> <nl> EXPECT_FALSE ( execute_status . ok ( ) ) ; <nl> EXPECT_THAT ( execute_status . status ( ) . error_message ( ) , <nl> - ContainsRegex ( " invalid argument shape " ) ) <nl> + ContainsRegex ( " Invalid argument shape " ) ) <nl> < < execute_status . status ( ) ; <nl> } <nl> <nl> mmm a / tensorflow / contrib / BUILD <nl> ppp b / tensorflow / contrib / BUILD <nl> py_library ( <nl> " / / tensorflow / contrib / boosted_trees : init_py " , <nl> " / / tensorflow / contrib / cloud : cloud_py " , <nl> " / / tensorflow / contrib / cluster_resolver : cluster_resolver_py " , <nl> + " / / tensorflow / contrib / coder : coder_ops_py " , <nl> " / / tensorflow / contrib / compiler : compiler_py " , <nl> " / / tensorflow / contrib / copy_graph : copy_graph_py " , <nl> " / / tensorflow / contrib / crf : crf_py " , <nl> cc_library ( <nl> deps = [ <nl> " / / tensorflow / contrib / batching : batch_ops_kernels " , <nl> " / / tensorflow / contrib / boosted_trees : boosted_trees_kernels " , <nl> + " / / tensorflow / contrib / coder : all_kernels " , <nl> " / / tensorflow / contrib / cudnn_rnn : cudnn_rnn_kernels " , <nl> " / / tensorflow / contrib / factorization / kernels : all_kernels " , <nl> " / / tensorflow / contrib / input_pipeline : input_pipeline_ops_kernels " , <nl> cc_library ( <nl> deps = [ <nl> " / / tensorflow / contrib / batching : batch_ops_op_lib " , <nl> " / / tensorflow / contrib / boosted_trees : boosted_trees_ops_op_lib " , <nl> + " / / tensorflow / contrib / coder : all_ops " , <nl> " / / tensorflow / contrib / cudnn_rnn : cudnn_rnn_ops_op_lib " , <nl> " / / tensorflow / contrib / factorization : all_ops " , <nl> " / / tensorflow / contrib / framework : all_ops " , <nl> mmm a / tensorflow / contrib / __init__ . py <nl> ppp b / tensorflow / contrib / __init__ . py <nl> <nl> from tensorflow . contrib import bayesflow <nl> from tensorflow . contrib import cloud <nl> from tensorflow . contrib import cluster_resolver <nl> + from tensorflow . contrib import coder <nl> from tensorflow . contrib import compiler <nl> from tensorflow . contrib import copy_graph <nl> from tensorflow . contrib import crf <nl> mmm a / tensorflow / contrib / all_reduce / python / all_reduce . py <nl> ppp b / tensorflow / contrib / all_reduce / python / all_reduce . py <nl> def _build_nccl_hybrid ( input_tensors , red_op , upper_level_f ) : <nl> level_2_output = upper_level_f ( up_values ) <nl> # Third stage : propagate within each worker using NCCL Broadcast <nl> for w in range ( 0 , num_workers ) : <nl> - dst_devices = per_worker_devices [ w ] [ 1 : ] <nl> - send_op , dst_tensors = nccl . broadcast ( level_2_output [ w ] , dst_devices ) <nl> - # NOTE : need control dependency to ensure send_op executes <nl> - with ops . control_dependencies ( [ send_op ] ) : <nl> - with ops . device ( per_worker_devices [ w ] [ 0 ] ) : <nl> - dst_tensors . insert ( 0 , array_ops . identity ( level_2_output [ w ] ) ) <nl> - down_values [ w ] = dst_tensors <nl> + dst_tensors = [ ] <nl> + with ops . device ( per_worker_devices [ w ] [ 0 ] ) : <nl> + broadcast_src = nccl . broadcast ( array_ops . identity ( level_2_output [ w ] ) ) <nl> + for d in per_worker_devices [ w ] : <nl> + with ops . device ( d ) : <nl> + dst_tensors . append ( array_ops . identity ( broadcast_src ) ) <nl> + down_values [ w ] = dst_tensors <nl> output_tensors = [ v for sublist in down_values for v in sublist ] <nl> if len ( shape ) > 1 : <nl> output_tensors = _reshape_tensors ( output_tensors , shape ) <nl> mmm a / tensorflow / contrib / boosted_trees / kernels / training_ops . cc <nl> ppp b / tensorflow / contrib / boosted_trees / kernels / training_ops . cc <nl> class GrowTreeEnsembleOp : public OpKernel { <nl> / / Increment attempt stats . <nl> ensemble_resource - > IncrementAttempts ( ) ; <nl> <nl> + / / In case we want to do feature selection and we have reached the limit , <nl> + / / build a list of handlers used so far to avoid adding new features . <nl> + std : : vector < int64 > allowed_handlers ; <nl> + if ( learner_config_ . constraints ( ) . max_number_of_unique_feature_columns ( ) > <nl> + 0 ) { <nl> + allowed_handlers = ensemble_resource - > GetUsedHandlers ( ) ; <nl> + / / TODO ( soroush ) : We can disable handlers that are not going to be used to <nl> + / / avoid unnecessary computations . <nl> + if ( allowed_handlers . size ( ) < <nl> + learner_config_ . constraints ( ) <nl> + . max_number_of_unique_feature_columns ( ) ) { <nl> + / / We have not reached the limit yet . Empty the list of allow features <nl> + / / which means we can keep adding new features . <nl> + allowed_handlers . clear ( ) ; <nl> + } <nl> + } <nl> + <nl> / / Find best splits for each active partition . <nl> std : : map < int32 , SplitCandidate > best_splits ; <nl> - FindBestSplitsPerPartition ( context , partition_ids_list , gains_list , <nl> - splits_list , & best_splits ) ; <nl> + FindBestSplitsPerPartition ( context , allowed_handlers , partition_ids_list , <nl> + gains_list , splits_list , & best_splits ) ; <nl> <nl> / / No - op if no new splits can be considered . <nl> if ( best_splits . empty ( ) ) { <nl> class GrowTreeEnsembleOp : public OpKernel { <nl> <nl> / / Split tree nodes . <nl> for ( auto & split_entry : best_splits ) { <nl> - SplitTreeNode ( split_entry . first , & split_entry . second , tree_config ) ; <nl> + SplitTreeNode ( split_entry . first , & split_entry . second , tree_config , <nl> + ensemble_resource ) ; <nl> } <nl> <nl> / / Post - prune finalized tree if needed . <nl> class GrowTreeEnsembleOp : public OpKernel { <nl> / / Helper method which effectively does a reduce over all split candidates <nl> / / and finds the best split for each partition . <nl> void FindBestSplitsPerPartition ( <nl> - OpKernelContext * const context , const OpInputList & partition_ids_list , <nl> - const OpInputList & gains_list , const OpInputList & splits_list , <nl> + OpKernelContext * const context , <nl> + const std : : vector < int64 > & allowed_handlers , / / Empty means all handlers . <nl> + const OpInputList & partition_ids_list , const OpInputList & gains_list , <nl> + const OpInputList & splits_list , <nl> std : : map < int32 , SplitCandidate > * best_splits ) { <nl> / / Find best split per partition going through every feature candidate . <nl> / / TODO ( salehay ) : Is this worth parallelizing ? <nl> for ( int64 handler_id = 0 ; handler_id < num_handlers_ ; + + handler_id ) { <nl> + if ( ! allowed_handlers . empty ( ) ) { <nl> + if ( ! std : : binary_search ( allowed_handlers . begin ( ) , <nl> + allowed_handlers . end ( ) , handler_id ) ) { <nl> + continue ; <nl> + } <nl> + } <nl> const auto & partition_ids = partition_ids_list [ handler_id ] . vec < int32 > ( ) ; <nl> const auto & gains = gains_list [ handler_id ] . vec < float > ( ) ; <nl> const auto & splits = splits_list [ handler_id ] . vec < string > ( ) ; <nl> class GrowTreeEnsembleOp : public OpKernel { <nl> <nl> / / Helper method to split a tree node and append its respective <nl> / / leaf children given the split candidate . <nl> - void SplitTreeNode ( const int32 node_id , SplitCandidate * split , <nl> - boosted_trees : : trees : : DecisionTreeConfig * tree_config ) { <nl> + void SplitTreeNode ( <nl> + const int32 node_id , SplitCandidate * split , <nl> + boosted_trees : : trees : : DecisionTreeConfig * tree_config , <nl> + boosted_trees : : models : : DecisionTreeEnsembleResource * ensemble_resource ) { <nl> / / No - op if we have no real node . <nl> CHECK ( node_id < tree_config - > nodes_size ( ) ) <nl> < < " Invalid node " < < node_id < < " to split . " ; <nl> class GrowTreeEnsembleOp : public OpKernel { <nl> / / Replace node in tree . <nl> ( * tree_config - > mutable_nodes ( node_id ) ) = <nl> * split - > split_info . mutable_split_node ( ) ; <nl> + if ( learner_config_ . constraints ( ) . max_number_of_unique_feature_columns ( ) ) { <nl> + ensemble_resource - > MaybeAddUsedHandler ( split - > handler_id ) ; <nl> + } <nl> } <nl> <nl> void PruneTree ( boosted_trees : : trees : : DecisionTreeConfig * tree_config ) { <nl> mmm a / tensorflow / contrib / boosted_trees / proto / learner . proto <nl> ppp b / tensorflow / contrib / boosted_trees / proto / learner . proto <nl> message TreeConstraintsConfig { <nl> <nl> / / Min hessian weight per node . <nl> float min_node_weight = 2 ; <nl> + <nl> + / / Maximum number of unique features used in the tree . Zero means there is no <nl> + / / limit . <nl> + int64 max_number_of_unique_feature_columns = 3 ; <nl> } <nl> <nl> / / LearningRateConfig describes all supported learning rate tuners . <nl> mmm a / tensorflow / contrib / boosted_trees / proto / tree_config . proto <nl> ppp b / tensorflow / contrib / boosted_trees / proto / tree_config . proto <nl> message GrowingMetadata { <nl> / / Number of layers that we have attempted to build . After pruning , these <nl> / / layers might have been removed . <nl> int64 num_layers_attempted = 2 ; <nl> + <nl> + / / Sorted list of column handlers that have been used in at least one split <nl> + / / so far . <nl> + repeated int64 used_handler_ids = 3 ; <nl> } <nl> <nl> / / DecisionTreeEnsembleConfig describes an ensemble of decision trees . <nl> mmm a / tensorflow / contrib / boosted_trees / python / kernel_tests / training_ops_test . py <nl> ppp b / tensorflow / contrib / boosted_trees / python / kernel_tests / training_ops_test . py <nl> def _gen_learner_config ( num_classes , <nl> if dropout_prob_of_skipping is not None : <nl> config . learning_rate_tuner . dropout . dropout_prob_of_skipping = ( <nl> dropout_prob_of_skipping ) <nl> - return config . SerializeToString ( ) <nl> + return config <nl> <nl> <nl> def _gen_dense_split_info ( fc , threshold , left_weight , right_weight ) : <nl> def testCenterBias ( self ) : <nl> pruning_mode = learner_pb2 . LearnerConfig . PRE_PRUNE , <nl> growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE , <nl> # Dropout does not change anything here . <nl> - dropout_probability = 0 . 5 ) <nl> + dropout_probability = 0 . 5 ) . SerializeToString ( ) <nl> <nl> # Center bias for the initial step . <nl> grads = constant_op . constant ( [ 0 . 4 , - 0 . 3 ] ) <nl> def testGrowEmptyEnsemble ( self ) : <nl> pruning_mode = learner_pb2 . LearnerConfig . PRE_PRUNE , <nl> growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE , <nl> # Dropout does not change anything here , tree is not finalized . <nl> - dropout_probability = 0 . 5 ) <nl> + dropout_probability = 0 . 5 ) . SerializeToString ( ) <nl> <nl> # Prepare handler inputs . <nl> # Note that handlers 1 & 3 have the same gain but different splits . <nl> def testGrowExistingEnsembleTreeNotFinalized ( self ) : <nl> pruning_mode = learner_pb2 . LearnerConfig . PRE_PRUNE , <nl> growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE , <nl> # Dropout does not change anything here - tree is not finalized . <nl> - dropout_probability = 0 . 5 ) <nl> + dropout_probability = 0 . 5 ) . SerializeToString ( ) <nl> <nl> # Prepare handler inputs . <nl> # Handler 1 only has a candidate for partition 1 , handler 2 has candidates <nl> def testGrowExistingEnsembleTreeFinalized ( self ) : <nl> max_depth = 1 , <nl> min_node_weight = 0 , <nl> pruning_mode = learner_pb2 . LearnerConfig . PRE_PRUNE , <nl> - growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) <nl> + growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) . SerializeToString ( <nl> + ) <nl> <nl> # Prepare handler inputs . <nl> handler1_partitions = np . array ( [ 0 ] , dtype = np . int32 ) <nl> def testGrowEnsemblePrePrune ( self ) : <nl> max_depth = 1 , <nl> min_node_weight = 0 , <nl> pruning_mode = learner_pb2 . LearnerConfig . PRE_PRUNE , <nl> - growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) <nl> + growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) . SerializeToString ( <nl> + ) <nl> <nl> # Prepare handler inputs . <nl> # All handlers have negative gain . <nl> def testGrowEnsemblePostPruneNone ( self ) : <nl> max_depth = 1 , <nl> min_node_weight = 0 , <nl> pruning_mode = learner_pb2 . LearnerConfig . POST_PRUNE , <nl> - growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) <nl> + growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) . SerializeToString ( <nl> + ) <nl> <nl> # Prepare handler inputs . <nl> # Note that handlers 1 & 3 have the same gain but different splits . <nl> def testGrowEnsemblePostPruneAll ( self ) : <nl> max_depth = 2 , <nl> min_node_weight = 0 , <nl> pruning_mode = learner_pb2 . LearnerConfig . POST_PRUNE , <nl> - growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) <nl> + growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) . SerializeToString ( <nl> + ) <nl> <nl> # Prepare handler inputs . <nl> # All handlers have negative gain . <nl> def testGrowEnsemblePostPrunePartial ( self ) : <nl> max_depth = 2 , <nl> min_node_weight = 0 , <nl> pruning_mode = learner_pb2 . LearnerConfig . POST_PRUNE , <nl> - growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) <nl> + growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) . SerializeToString ( <nl> + ) <nl> <nl> # Prepare handler inputs . <nl> # Second handler has positive gain . <nl> def testGrowEnsembleTreeLayerByLayer ( self ) : <nl> pruning_mode = learner_pb2 . LearnerConfig . PRE_PRUNE , <nl> growing_mode = learner_pb2 . LearnerConfig . LAYER_BY_LAYER , <nl> # Dropout will have no effect , since the tree will not be fully grown . <nl> - dropout_probability = 1 . 0 ) <nl> + dropout_probability = 1 . 0 ) . SerializeToString ( ) <nl> <nl> # Prepare handler inputs . <nl> # Handler 1 only has a candidate for partition 1 , handler 2 has candidates <nl> def testGrowExistingEnsembleTreeFinalizedWithDropout ( self ) : <nl> min_node_weight = 0 , <nl> pruning_mode = learner_pb2 . LearnerConfig . PRE_PRUNE , <nl> growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE , <nl> - dropout_probability = 1 . 0 ) <nl> + dropout_probability = 1 . 0 ) . SerializeToString ( ) <nl> <nl> # Prepare handler inputs . <nl> handler1_partitions = np . array ( [ 0 ] , dtype = np . int32 ) <nl> def testGrowExistingEnsembleTreeFinalizedWithDropout ( self ) : <nl> self . assertEqual ( <nl> 2 , tree_ensemble_config . tree_metadata [ 2 ] . num_tree_weight_updates ) <nl> <nl> + def testGrowExistingEnsembleTreeWithFeatureSelectionCanStillGrow ( self ) : <nl> + " " " Test growing a tree with feature selection . " " " <nl> + with self . test_session ( ) as session : <nl> + # Create existing ensemble with one root split and one bias tree . <nl> + tree_ensemble_config = tree_config_pb2 . DecisionTreeEnsembleConfig ( ) <nl> + text_format . Merge ( " " " <nl> + trees { <nl> + nodes { <nl> + leaf { <nl> + vector { <nl> + value : - 0 . 32 <nl> + value : 0 . 28 <nl> + } <nl> + } <nl> + } <nl> + } <nl> + trees { <nl> + nodes { <nl> + categorical_id_binary_split { <nl> + feature_column : 3 <nl> + feature_id : 7 <nl> + left_id : 1 <nl> + right_id : 2 <nl> + } <nl> + node_metadata { <nl> + gain : 1 . 3 <nl> + } <nl> + } <nl> + nodes { <nl> + leaf { <nl> + sparse_vector { <nl> + index : 0 <nl> + value : 2 . 3 <nl> + } <nl> + } <nl> + } <nl> + nodes { <nl> + leaf { <nl> + sparse_vector { <nl> + index : 0 <nl> + value : - 0 . 9 <nl> + } <nl> + } <nl> + } <nl> + } <nl> + tree_weights : 0 . 7 <nl> + tree_weights : 1 <nl> + tree_metadata { <nl> + num_tree_weight_updates : 1 <nl> + num_layers_grown : 1 <nl> + is_finalized : true <nl> + } <nl> + tree_metadata { <nl> + num_tree_weight_updates : 5 <nl> + num_layers_grown : 1 <nl> + is_finalized : true <nl> + } <nl> + growing_metadata { <nl> + num_trees_attempted : 2 <nl> + num_layers_attempted : 2 <nl> + used_handler_ids : 2 <nl> + used_handler_ids : 5 <nl> + } <nl> + " " " , tree_ensemble_config ) <nl> + tree_ensemble_handle = model_ops . tree_ensemble_variable ( <nl> + stamp_token = 0 , <nl> + tree_ensemble_config = tree_ensemble_config . SerializeToString ( ) , <nl> + name = " tree_ensemble " ) <nl> + resources . initialize_resources ( resources . shared_resources ( ) ) . run ( ) <nl> + <nl> + # Prepare learner config . <nl> + learner_config = _gen_learner_config ( <nl> + num_classes = 2 , <nl> + l1_reg = 0 , <nl> + l2_reg = 0 , <nl> + tree_complexity = 0 , <nl> + max_depth = 1 , <nl> + min_node_weight = 0 , <nl> + pruning_mode = learner_pb2 . LearnerConfig . PRE_PRUNE , <nl> + growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) <nl> + # There are 2 handler_ids in used_handler_ids already but one of them <nl> + # is handler 2 , so we can still grow trees . <nl> + learner_config . constraints . max_number_of_unique_feature_columns = 2 <nl> + learner_config = learner_config . SerializeToString ( ) <nl> + # Prepare handler inputs . <nl> + handler1_partitions = np . array ( [ 0 ] , dtype = np . int32 ) <nl> + handler1_gains = np . array ( [ 7 . 62 ] , dtype = np . float32 ) <nl> + handler1_split = [ _gen_dense_split_info ( 5 , 0 . 52 , - 4 . 375 , 7 . 143 ) ] <nl> + handler2_partitions = np . array ( [ 0 ] , dtype = np . int32 ) <nl> + handler2_gains = np . array ( [ 0 . 63 ] , dtype = np . float32 ) <nl> + handler2_split = [ _gen_dense_split_info ( 2 , 0 . 23 , - 0 . 6 , 0 . 24 ) ] <nl> + handler3_partitions = np . array ( [ 0 ] , dtype = np . int32 ) <nl> + handler3_gains = np . array ( [ 7 . 62 ] , dtype = np . float32 ) <nl> + handler3_split = [ _gen_categorical_split_info ( 8 , 7 , - 4 . 375 , 7 . 143 ) ] <nl> + <nl> + # Grow tree ensemble . <nl> + grow_op = training_ops . grow_tree_ensemble ( <nl> + tree_ensemble_handle , <nl> + stamp_token = 0 , <nl> + next_stamp_token = 1 , <nl> + learning_rate = 1 , <nl> + partition_ids = [ <nl> + handler1_partitions , handler2_partitions , handler3_partitions <nl> + ] , <nl> + gains = [ handler1_gains , handler2_gains , handler3_gains ] , <nl> + splits = [ handler1_split , handler2_split , handler3_split ] , <nl> + learner_config = learner_config , <nl> + dropout_seed = 123 , <nl> + center_bias = True ) <nl> + session . run ( grow_op ) <nl> + <nl> + # Expect a new tree to be added with the split from handler 1 . <nl> + _ , serialized = session . run ( <nl> + model_ops . tree_ensemble_serialize ( tree_ensemble_handle ) ) <nl> + tree_ensemble_config . ParseFromString ( serialized ) <nl> + self . assertEqual ( 3 , len ( tree_ensemble_config . trees ) ) <nl> + self . assertEqual ( <nl> + 2 , len ( tree_ensemble_config . growing_metadata . used_handler_ids ) ) <nl> + <nl> + def testGrowExistingEnsembleTreeWithFeatureSelectionEmptyEnsemble ( self ) : <nl> + " " " Test growing a tree with feature selection with empty ensemble . " " " <nl> + with self . test_session ( ) as session : <nl> + # Create existing ensemble with one root split and one bias tree . <nl> + tree_ensemble_config = tree_config_pb2 . DecisionTreeEnsembleConfig ( ) <nl> + tree_ensemble_handle = model_ops . tree_ensemble_variable ( <nl> + stamp_token = 0 , <nl> + tree_ensemble_config = tree_ensemble_config . SerializeToString ( ) , <nl> + name = " tree_ensemble " ) <nl> + resources . initialize_resources ( resources . shared_resources ( ) ) . run ( ) <nl> + <nl> + # Prepare learner config . <nl> + learner_config = _gen_learner_config ( <nl> + num_classes = 2 , <nl> + l1_reg = 0 , <nl> + l2_reg = 0 , <nl> + tree_complexity = 0 , <nl> + max_depth = 1 , <nl> + min_node_weight = 0 , <nl> + pruning_mode = learner_pb2 . LearnerConfig . PRE_PRUNE , <nl> + growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) <nl> + learner_config . constraints . max_number_of_unique_feature_columns = 2 <nl> + learner_config = learner_config . SerializeToString ( ) <nl> + # Prepare handler inputs . <nl> + handler1_partitions = np . array ( [ 0 ] , dtype = np . int32 ) <nl> + handler1_gains = np . array ( [ 7 . 62 ] , dtype = np . float32 ) <nl> + handler1_split = [ _gen_dense_split_info ( 5 , 0 . 52 , - 4 . 375 , 7 . 143 ) ] <nl> + handler2_partitions = np . array ( [ 0 ] , dtype = np . int32 ) <nl> + handler2_gains = np . array ( [ 0 . 63 ] , dtype = np . float32 ) <nl> + handler2_split = [ _gen_dense_split_info ( 2 , 0 . 23 , - 0 . 6 , 0 . 24 ) ] <nl> + handler3_partitions = np . array ( [ 0 ] , dtype = np . int32 ) <nl> + handler3_gains = np . array ( [ 7 . 62 ] , dtype = np . float32 ) <nl> + handler3_split = [ _gen_categorical_split_info ( 8 , 7 , - 4 . 375 , 7 . 143 ) ] <nl> + <nl> + # Grow tree ensemble . <nl> + grow_op = training_ops . grow_tree_ensemble ( <nl> + tree_ensemble_handle , <nl> + stamp_token = 0 , <nl> + next_stamp_token = 1 , <nl> + learning_rate = 1 , <nl> + partition_ids = [ <nl> + handler1_partitions , handler2_partitions , handler3_partitions <nl> + ] , <nl> + gains = [ handler1_gains , handler2_gains , handler3_gains ] , <nl> + splits = [ handler1_split , handler2_split , handler3_split ] , <nl> + learner_config = learner_config , <nl> + dropout_seed = 123 , <nl> + center_bias = True ) <nl> + session . run ( grow_op ) <nl> + <nl> + _ , serialized = session . run ( <nl> + model_ops . tree_ensemble_serialize ( tree_ensemble_handle ) ) <nl> + tree_ensemble_config . ParseFromString ( serialized ) <nl> + self . assertEqual ( 1 , len ( tree_ensemble_config . trees ) ) <nl> + self . assertEqual ( <nl> + 1 , len ( tree_ensemble_config . growing_metadata . used_handler_ids ) ) <nl> + <nl> + def testGrowExistingEnsembleTreeWithFeatureSelectionCantGrow ( self ) : <nl> + " " " Test growing a tree with feature selection with empty ensemble . " " " <nl> + with self . test_session ( ) as session : <nl> + # Create existing ensemble with one root split and one bias tree . <nl> + tree_ensemble_config = tree_config_pb2 . DecisionTreeEnsembleConfig ( ) <nl> + text_format . Merge ( " " " <nl> + trees { <nl> + nodes { <nl> + leaf { <nl> + vector { <nl> + value : - 0 . 32 <nl> + value : 0 . 28 <nl> + } <nl> + } <nl> + } <nl> + } <nl> + trees { <nl> + nodes { <nl> + categorical_id_binary_split { <nl> + feature_column : 3 <nl> + feature_id : 7 <nl> + left_id : 1 <nl> + right_id : 2 <nl> + } <nl> + node_metadata { <nl> + gain : 1 . 3 <nl> + } <nl> + } <nl> + nodes { <nl> + leaf { <nl> + sparse_vector { <nl> + index : 0 <nl> + value : 2 . 3 <nl> + } <nl> + } <nl> + } <nl> + nodes { <nl> + leaf { <nl> + sparse_vector { <nl> + index : 0 <nl> + value : - 0 . 9 <nl> + } <nl> + } <nl> + } <nl> + } <nl> + tree_weights : 0 . 7 <nl> + tree_weights : 1 <nl> + tree_metadata { <nl> + num_tree_weight_updates : 1 <nl> + num_layers_grown : 1 <nl> + is_finalized : true <nl> + } <nl> + tree_metadata { <nl> + num_tree_weight_updates : 5 <nl> + num_layers_grown : 1 <nl> + is_finalized : true <nl> + } <nl> + growing_metadata { <nl> + num_trees_attempted : 2 <nl> + num_layers_attempted : 2 <nl> + used_handler_ids : 4 <nl> + used_handler_ids : 5 <nl> + } <nl> + " " " , tree_ensemble_config ) <nl> + tree_ensemble_handle = model_ops . tree_ensemble_variable ( <nl> + stamp_token = 0 , <nl> + tree_ensemble_config = tree_ensemble_config . SerializeToString ( ) , <nl> + name = " tree_ensemble " ) <nl> + resources . initialize_resources ( resources . shared_resources ( ) ) . run ( ) <nl> + <nl> + # Prepare learner config . <nl> + learner_config = _gen_learner_config ( <nl> + num_classes = 2 , <nl> + l1_reg = 0 , <nl> + l2_reg = 0 , <nl> + tree_complexity = 0 , <nl> + max_depth = 1 , <nl> + min_node_weight = 0 , <nl> + pruning_mode = learner_pb2 . LearnerConfig . PRE_PRUNE , <nl> + growing_mode = learner_pb2 . LearnerConfig . WHOLE_TREE ) <nl> + learner_config . constraints . max_number_of_unique_feature_columns = 2 <nl> + learner_config = learner_config . SerializeToString ( ) <nl> + # Prepare handler inputs . <nl> + handler1_partitions = np . array ( [ 0 ] , dtype = np . int32 ) <nl> + handler1_gains = np . array ( [ 7 . 62 ] , dtype = np . float32 ) <nl> + handler1_split = [ _gen_dense_split_info ( 5 , 0 . 52 , - 4 . 375 , 7 . 143 ) ] <nl> + handler2_partitions = np . array ( [ 0 ] , dtype = np . int32 ) <nl> + handler2_gains = np . array ( [ 0 . 63 ] , dtype = np . float32 ) <nl> + handler2_split = [ _gen_dense_split_info ( 2 , 0 . 23 , - 0 . 6 , 0 . 24 ) ] <nl> + handler3_partitions = np . array ( [ 0 ] , dtype = np . int32 ) <nl> + handler3_gains = np . array ( [ 7 . 62 ] , dtype = np . float32 ) <nl> + handler3_split = [ _gen_categorical_split_info ( 8 , 7 , - 4 . 375 , 7 . 143 ) ] <nl> + <nl> + # Grow tree ensemble . <nl> + grow_op = training_ops . grow_tree_ensemble ( <nl> + tree_ensemble_handle , <nl> + stamp_token = 0 , <nl> + next_stamp_token = 1 , <nl> + learning_rate = 1 , <nl> + partition_ids = [ <nl> + handler1_partitions , handler2_partitions , handler3_partitions <nl> + ] , <nl> + gains = [ handler1_gains , handler2_gains , handler3_gains ] , <nl> + splits = [ handler1_split , handler2_split , handler3_split ] , <nl> + learner_config = learner_config , <nl> + dropout_seed = 123 , <nl> + center_bias = True ) <nl> + session . run ( grow_op ) <nl> + <nl> + _ , serialized = session . run ( <nl> + model_ops . tree_ensemble_serialize ( tree_ensemble_handle ) ) <nl> + tree_ensemble_config . ParseFromString ( serialized ) <nl> + # We can ' t grow a tree since we have reached the limit of 2 unique <nl> + # features [ 4 , 5 ] and the only available splits are from <nl> + # handlers [ 0 , 1 , 2 ] . <nl> + self . assertEqual ( 2 , len ( tree_ensemble_config . trees ) ) <nl> + self . assertEqual ( <nl> + 2 , len ( tree_ensemble_config . growing_metadata . used_handler_ids ) ) <nl> + <nl> <nl> if __name__ = = " __main__ " : <nl> googletest . main ( ) <nl> mmm a / tensorflow / contrib / boosted_trees / resources / decision_tree_ensemble_resource . h <nl> ppp b / tensorflow / contrib / boosted_trees / resources / decision_tree_ensemble_resource . h <nl> class DecisionTreeEnsembleResource : public StampedResource { <nl> return decision_tree_ensemble_ - > tree_weights ( index ) ; <nl> } <nl> <nl> + void MaybeAddUsedHandler ( const int32 handler_id ) { <nl> + protobuf : : RepeatedField < protobuf_int64 > * used_ids = <nl> + decision_tree_ensemble_ - > mutable_growing_metadata ( ) <nl> + - > mutable_used_handler_ids ( ) ; <nl> + protobuf : : RepeatedField < protobuf_int64 > : : iterator first = <nl> + std : : lower_bound ( used_ids - > begin ( ) , used_ids - > end ( ) , handler_id ) ; <nl> + if ( first = = used_ids - > end ( ) ) { <nl> + used_ids - > Add ( handler_id ) ; <nl> + return ; <nl> + } <nl> + if ( handler_id = = * first ) { <nl> + / / It is a duplicate entry . <nl> + return ; <nl> + } <nl> + used_ids - > Add ( handler_id ) ; <nl> + std : : rotate ( first , used_ids - > end ( ) - 1 , used_ids - > end ( ) ) ; <nl> + } <nl> + <nl> + std : : vector < int64 > GetUsedHandlers ( ) const { <nl> + std : : vector < int64 > result ; <nl> + result . reserve ( <nl> + decision_tree_ensemble_ - > growing_metadata ( ) . used_handler_ids ( ) . size ( ) ) ; <nl> + for ( int64 h : <nl> + decision_tree_ensemble_ - > growing_metadata ( ) . used_handler_ids ( ) ) { <nl> + result . push_back ( h ) ; <nl> + } <nl> + return result ; <nl> + } <nl> + <nl> / / Sets the weight of i ' th tree , and increment num_updates in tree_metadata . <nl> void SetTreeWeight ( const int32 index , const float weight , <nl> const int32 increment_num_updates ) { <nl> mmm a / tensorflow / contrib / cmake / python_modules . txt <nl> ppp b / tensorflow / contrib / cmake / python_modules . txt <nl> tensorflow / contrib / cloud / python / ops <nl> tensorflow / contrib / cluster_resolver <nl> tensorflow / contrib / cluster_resolver / python <nl> tensorflow / contrib / cluster_resolver / python / training <nl> + tensorflow / contrib / coder <nl> + tensorflow / contrib / coder / kernels <nl> + tensorflow / contrib / coder / ops <nl> + tensorflow / contrib / coder / python <nl> + tensorflow / contrib / coder / python / ops <nl> tensorflow / contrib / compiler <nl> tensorflow / contrib / copy_graph <nl> tensorflow / contrib / copy_graph / python <nl> mmm a / tensorflow / contrib / cmake / tf_core_kernels . cmake <nl> ppp b / tensorflow / contrib / cmake / tf_core_kernels . cmake <nl> if ( tensorflow_BUILD_CONTRIB_KERNELS ) <nl> " $ { tensorflow_source_dir } / tensorflow / contrib / boosted_trees / ops / split_handler_ops . cc " <nl> " $ { tensorflow_source_dir } / tensorflow / contrib / boosted_trees / ops / stats_accumulator_ops . cc " <nl> " $ { tensorflow_source_dir } / tensorflow / contrib / boosted_trees / ops / training_ops . cc " <nl> + " $ { tensorflow_source_dir } / tensorflow / contrib / coder / kernels / range_coder . cc " <nl> + " $ { tensorflow_source_dir } / tensorflow / contrib / coder / kernels / range_coder_ops . cc " <nl> + " $ { tensorflow_source_dir } / tensorflow / contrib / coder / kernels / range_coder_ops_util . cc " <nl> + " $ { tensorflow_source_dir } / tensorflow / contrib / coder / ops / coder_ops . cc " <nl> " $ { tensorflow_source_dir } / tensorflow / contrib / cudnn_rnn / kernels / cudnn_rnn_ops . cc " <nl> " $ { tensorflow_source_dir } / tensorflow / contrib / cudnn_rnn / ops / cudnn_rnn_ops . cc " <nl> " $ { tensorflow_source_dir } / tensorflow / contrib / data / kernels / prefetching_kernels . cc " <nl> mmm a / tensorflow / contrib / cmake / tf_core_ops . cmake <nl> ppp b / tensorflow / contrib / cmake / tf_core_ops . cmake <nl> GENERATE_CONTRIB_OP_LIBRARY ( boosted_trees_training " $ { tensorflow_source_dir } / ten <nl> GENERATE_CONTRIB_OP_LIBRARY ( boosted_trees_prediction " $ { tensorflow_source_dir } / tensorflow / contrib / boosted_trees / ops / prediction_ops . cc " ) <nl> GENERATE_CONTRIB_OP_LIBRARY ( boosted_trees_quantiles " $ { tensorflow_source_dir } / tensorflow / contrib / boosted_trees / ops / quantile_ops . cc " ) <nl> GENERATE_CONTRIB_OP_LIBRARY ( boosted_trees_stats_accumulator " $ { tensorflow_source_dir } / tensorflow / contrib / boosted_trees / ops / stats_accumulator_ops . cc " ) <nl> + GENERATE_CONTRIB_OP_LIBRARY ( coder " $ { tensorflow_source_dir } / tensorflow / contrib / coder / ops / coder_ops . cc " ) <nl> GENERATE_CONTRIB_OP_LIBRARY ( cudnn_rnn " $ { tensorflow_source_dir } / tensorflow / contrib / cudnn_rnn / ops / cudnn_rnn_ops . cc " ) <nl> GENERATE_CONTRIB_OP_LIBRARY ( data_prefetching " $ { tensorflow_source_dir } / tensorflow / contrib / data / ops / prefetching_ops . cc " ) <nl> GENERATE_CONTRIB_OP_LIBRARY ( factorization_clustering " $ { tensorflow_source_dir } / tensorflow / contrib / factorization / ops / clustering_ops . cc " ) <nl> mmm a / tensorflow / contrib / cmake / tf_python . cmake <nl> ppp b / tensorflow / contrib / cmake / tf_python . cmake <nl> GENERATE_PYTHON_OP_LIB ( " contrib_boosted_trees_quantiles_ops " <nl> DESTINATION $ { CMAKE_CURRENT_BINARY_DIR } / tf_python / tensorflow / contrib / boosted_trees / python / ops / gen_quantile_ops . py ) <nl> GENERATE_PYTHON_OP_LIB ( " contrib_boosted_trees_stats_accumulator_ops " <nl> DESTINATION $ { CMAKE_CURRENT_BINARY_DIR } / tf_python / tensorflow / contrib / boosted_trees / python / ops / gen_stats_accumulator_ops . py ) <nl> + GENERATE_PYTHON_OP_LIB ( " contrib_coder_ops " <nl> + DESTINATION $ { CMAKE_CURRENT_BINARY_DIR } / tf_python / tensorflow / contrib / coder / python / ops / gen_coder_ops . py ) <nl> GENERATE_PYTHON_OP_LIB ( " contrib_cudnn_rnn_ops " <nl> DESTINATION $ { CMAKE_CURRENT_BINARY_DIR } / tf_python / tensorflow / contrib / cudnn_rnn / ops / gen_cudnn_rnn_ops . py ) <nl> GENERATE_PYTHON_OP_LIB ( " contrib_data_prefetching_ops " <nl> mmm a / tensorflow / contrib / cmake / tf_tests . cmake <nl> ppp b / tensorflow / contrib / cmake / tf_tests . cmake <nl> if ( tensorflow_BUILD_PYTHON_TESTS ) <nl> " $ { tensorflow_source_dir } / tensorflow / python / profiler / internal / * _test . py " <nl> " $ { tensorflow_source_dir } / tensorflow / python / saved_model / * _test . py " <nl> " $ { tensorflow_source_dir } / tensorflow / python / training / * _test . py " <nl> + " $ { tensorflow_source_dir } / tensorflow / contrib / coder / * _test . py " <nl> " $ { tensorflow_source_dir } / tensorflow / contrib / data / * _test . py " <nl> " $ { tensorflow_source_dir } / tensorflow / contrib / factorization / * _test . py " <nl> " $ { tensorflow_source_dir } / tensorflow / contrib / image / * _test . py " <nl> new file mode 100644 <nl> index 0000000000000 . . ec3d550b70d2a <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / BUILD <nl> <nl> + # Description : <nl> + # Contains entropy coding related modules . <nl> + <nl> + package ( default_visibility = [ <nl> + " / / learning / brain : __subpackages__ " , <nl> + " / / tensorflow : __subpackages__ " , <nl> + ] ) <nl> + <nl> + licenses ( [ " notice " ] ) # Apache 2 . 0 <nl> + <nl> + load ( <nl> + " / / tensorflow : tensorflow . bzl " , <nl> + " tf_cc_test " , <nl> + " tf_custom_op_library " , <nl> + " tf_custom_op_py_library " , <nl> + " tf_gen_op_libs " , <nl> + " tf_gen_op_wrapper_py " , <nl> + " tf_kernel_library " , <nl> + " tf_py_test " , <nl> + ) <nl> + <nl> + cc_library ( <nl> + name = " range_coder " , <nl> + srcs = [ <nl> + " kernels / range_coder . cc " , <nl> + ] , <nl> + hdrs = [ <nl> + " kernels / range_coder . h " , <nl> + ] , <nl> + visibility = [ " / / visibility : public " ] , <nl> + deps = [ <nl> + " / / tensorflow / core : framework " , <nl> + " / / tensorflow / core : lib " , <nl> + ] , <nl> + ) <nl> + <nl> + tf_cc_test ( <nl> + name = " range_coder_test " , <nl> + size = " small " , <nl> + srcs = [ " kernels / range_coder_test . cc " ] , <nl> + deps = [ <nl> + " : range_coder " , <nl> + " / / tensorflow / core : lib " , <nl> + " / / tensorflow / core : lib_internal " , <nl> + " / / tensorflow / core : test " , <nl> + " / / tensorflow / core : test_main " , <nl> + ] , <nl> + ) <nl> + <nl> + tf_gen_op_libs ( <nl> + op_lib_names = [ " coder_ops " ] , <nl> + deps = [ <nl> + " / / tensorflow / core : lib " , <nl> + ] , <nl> + ) <nl> + <nl> + tf_kernel_library ( <nl> + name = " range_coder_ops " , <nl> + srcs = [ <nl> + " kernels / range_coder_ops . cc " , <nl> + " kernels / range_coder_ops_util . cc " , <nl> + ] , <nl> + hdrs = [ <nl> + " kernels / range_coder_ops_util . h " , <nl> + ] , <nl> + visibility = [ " / / visibility : public " ] , <nl> + deps = [ <nl> + " : coder_ops_op_lib " , <nl> + " : range_coder " , <nl> + " / / tensorflow / core : framework " , <nl> + " / / tensorflow / core : lib " , <nl> + ] , <nl> + alwayslink = 1 , <nl> + ) <nl> + <nl> + tf_cc_test ( <nl> + name = " range_coder_ops_test " , <nl> + size = " small " , <nl> + srcs = [ " kernels / range_coder_ops_test . cc " ] , <nl> + deps = [ <nl> + " : range_coder " , <nl> + " : range_coder_ops " , <nl> + " / / tensorflow / core : core_cpu " , <nl> + " / / tensorflow / core : framework " , <nl> + " / / tensorflow / core : lib " , <nl> + " / / tensorflow / core : lib_internal " , <nl> + " / / tensorflow / core : protos_all_cc " , <nl> + " / / tensorflow / core : test " , <nl> + " / / tensorflow / core : test_main " , <nl> + " / / tensorflow / core : testlib " , <nl> + " / / tensorflow / core / kernels : ops_testutil " , <nl> + ] , <nl> + ) <nl> + <nl> + cc_library ( <nl> + name = " all_ops " , <nl> + deps = [ " : coder_ops_op_lib " ] , <nl> + ) <nl> + <nl> + cc_library ( <nl> + name = " all_kernels " , <nl> + deps = [ " : range_coder_ops " ] , <nl> + ) <nl> + <nl> + tf_custom_op_library ( <nl> + name = " python / ops / _coder_ops . so " , <nl> + srcs = [ <nl> + " kernels / range_coder . cc " , <nl> + " kernels / range_coder . h " , <nl> + " kernels / range_coder_ops . cc " , <nl> + " kernels / range_coder_ops_util . cc " , <nl> + " kernels / range_coder_ops_util . h " , <nl> + " ops / coder_ops . cc " , <nl> + ] , <nl> + ) <nl> + <nl> + tf_gen_op_wrapper_py ( <nl> + name = " gen_coder_ops " , <nl> + out = " python / ops / gen_coder_ops . py " , <nl> + deps = [ " : coder_ops_op_lib " ] , <nl> + ) <nl> + <nl> + tf_custom_op_py_library ( <nl> + name = " coder_ops_py " , <nl> + srcs = [ <nl> + " __init__ . py " , <nl> + " python / ops / coder_ops . py " , <nl> + ] , <nl> + dso = [ <nl> + " : python / ops / _coder_ops . so " , <nl> + ] , <nl> + kernels = [ <nl> + " : all_kernels " , <nl> + ] , <nl> + srcs_version = " PY2AND3 " , <nl> + deps = [ <nl> + " : gen_coder_ops " , <nl> + " / / tensorflow / contrib / util : util_py " , <nl> + ] , <nl> + ) <nl> + <nl> + tf_py_test ( <nl> + name = " coder_ops_py_test " , <nl> + srcs = [ <nl> + " python / ops / coder_ops_test . py " , <nl> + ] , <nl> + additional_deps = [ <nl> + " : coder_ops_py " , <nl> + " / / tensorflow / python : array_ops " , <nl> + " / / tensorflow / python : client_testlib " , <nl> + " / / tensorflow / python : dtypes " , <nl> + " / / tensorflow / python : math_ops " , <nl> + " / / tensorflow / python : random_ops " , <nl> + ] , <nl> + main = " python / ops / coder_ops_test . py " , <nl> + ) <nl> + <nl> + filegroup ( <nl> + name = " all_files " , <nl> + srcs = glob ( <nl> + [ " * * / * " ] , <nl> + exclude = [ <nl> + " * * / METADATA " , <nl> + " * * / OWNERS " , <nl> + ] , <nl> + ) , <nl> + ) <nl> new file mode 100644 <nl> index 0000000000000 . . e1e867db5aa70 <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / README . md <nl> <nl> + # Entropy coder <nl> + <nl> + This module contains range encoder and range decoder which can encode integer <nl> + data into string with cumulative distribution functions ( CDF ) . <nl> + <nl> + # # Data and CDF values <nl> + <nl> + The data to be encoded should be non - negative integers in half - open interval <nl> + ` [ 0 , m ) ` . Then a CDF is represented as an integral vector of length ` m + 1 ` <nl> + where ` CDF ( i ) = f ( Pr ( X < i ) * 2 ^ precision ) ` for i = 0 , 1 , . . . , m , and ` precision ` <nl> + is an attribute in range ` 0 < precision < = 16 ` . The function ` f ` maps real <nl> + values into integers , e . g . , round or floor . It is important that to encode a <nl> + number ` i ` , ` CDF ( i + 1 ) - CDF ( i ) ` cannot be zero . <nl> + <nl> + Note that we used ` Pr ( X < i ) ` not ` Pr ( X < = i ) ` , and therefore CDF ( 0 ) = 0 always . <nl> + <nl> + # # RangeEncode : data shapes and CDF shapes <nl> + <nl> + For each data element , its CDF has to be provided . Therefore if the shape of CDF <nl> + should be ` data . shape + ( m + 1 , ) ` in NumPy - like notation . For example , if ` data ` <nl> + is a 2 - D tensor of shape ( 10 , 10 ) and its elements are in ` [ 0 , 64 ) ` , then the <nl> + CDF tensor should have shape ( 10 , 10 , 65 ) . <nl> + <nl> + This may make CDF tensor too large , and in many applications all data elements <nl> + may have the same probability distribution . To handle this , ` RangeEncode ` <nl> + supports limited broadcasting CDF into data . Broadcasting is limited in the <nl> + following sense : <nl> + <nl> + - All CDF axes but the last one is broadcasted into data but not the other way <nl> + around , <nl> + - The number of CDF axes does not extend , i . e . , ` CDF . ndim = = data . ndim + 1 ` . <nl> + <nl> + In the previous example where data has shape ( 10 , 10 ) , the followings are <nl> + acceptable CDF shapes : <nl> + <nl> + - ( 10 , 10 , 65 ) <nl> + - ( 1 , 10 , 65 ) <nl> + - ( 10 , 1 , 65 ) <nl> + - ( 1 , 1 , 65 ) <nl> + <nl> + # # RangeDecode <nl> + <nl> + ` RangeEncode ` encodes neither data shape nor termination character . Therefore <nl> + the decoder should know how many characters are encoded into the string , and <nl> + ` RangeDecode ` takes the encoded data shape as the second argument . The same <nl> + shape restrictions as ` RangeEncode ` inputs apply here . <nl> + <nl> + # # Example <nl> + <nl> + ` ` ` python <nl> + data = tf . random_uniform ( ( 128 , 128 ) , 0 , 10 , dtype = tf . int32 ) <nl> + <nl> + histogram = tf . bincount ( data , minlength = 10 , maxlength = 10 ) <nl> + cdf = tf . cumsum ( histogram , exclusive = False ) <nl> + # CDF should have length m + 1 . <nl> + cdf = tf . pad ( cdf , [ [ 1 , 0 ] ] ) <nl> + # CDF axis count must be one more than data . <nl> + cdf = tf . reshape ( cdf , [ 1 , 1 , - 1 ] ) <nl> + <nl> + # Note that data has 2 ^ 14 elements , and therefore the sum of CDF is 2 ^ 14 . <nl> + data = tf . cast ( data , tf . int16 ) <nl> + encoded = coder . range_encode ( data , cdf , precision = 14 ) <nl> + decoded = coder . range_decode ( encoded , tf . shape ( data ) , cdf , precision = 14 ) <nl> + <nl> + # data and decoded should be the same . <nl> + sess = tf . Session ( ) <nl> + x , y = sess . run ( ( data , decoded ) ) <nl> + assert np . all ( x = = y ) <nl> + ` ` ` <nl> + <nl> + # # Authors <nl> + Sung Jin Hwang ( github : [ ssjhv ] ( https : / / github . com / ssjhv ) ) and Nick Johnston <nl> + ( github : [ nmjohn ] ( https : / / github . com / nmjohn ) ) <nl> new file mode 100644 <nl> index 0000000000000 . . b7e663e6f1359 <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / __init__ . py <nl> <nl> + # Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + # <nl> + # Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + # you may not use this file except in compliance with the License . <nl> + # You may obtain a copy of the License at <nl> + # <nl> + # http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + # <nl> + # Unless required by applicable law or agreed to in writing , software <nl> + # distributed under the License is distributed on an " AS IS " BASIS , <nl> + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + # See the License for the specific language governing permissions and <nl> + # limitations under the License . <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + " " " Entropy code operations . " " " <nl> + <nl> + from __future__ import absolute_import <nl> + from __future__ import division <nl> + from __future__ import print_function <nl> + <nl> + # pylint : disable = wildcard - import <nl> + from tensorflow . contrib . coder . python . ops . coder_ops import * <nl> + # pylint : enable = wildcard - import <nl> + <nl> + from tensorflow . python . util . all_util import remove_undocumented <nl> + remove_undocumented ( __name__ ) <nl> new file mode 100644 <nl> index 0000000000000 . . f4f076b6c4e0c <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / kernels / range_coder . cc <nl> <nl> + / * Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + / / Range coder implementation , based on [ 1 ] . <nl> + / / <nl> + / / [ 1 ] G . N . N . Martin , " Range coding : an algorithm for removing redundancy from <nl> + / / a digitised message " , presented to the Video & Data Recording Conference , <nl> + / / held in Southampton , July 24 - 27 , 1979 . <nl> + / / <nl> + # include " tensorflow / contrib / coder / kernels / range_coder . h " <nl> + <nl> + # include < limits > <nl> + # include < string > <nl> + <nl> + # include " tensorflow / core / lib / gtl / array_slice . h " <nl> + # include " tensorflow / core / platform / logging . h " <nl> + # include " tensorflow / core / platform / types . h " <nl> + <nl> + namespace tensorflow { <nl> + RangeEncoder : : RangeEncoder ( int precision ) : precision_ ( precision ) { <nl> + CHECK_GT ( precision , 0 ) ; <nl> + CHECK_LE ( precision , 16 ) ; <nl> + } <nl> + <nl> + void RangeEncoder : : Encode ( int32 lower , int32 upper , string * sink ) { <nl> + / / Input requirement : 0 < = lower < upper < = 2 ^ precision . <nl> + DCHECK_LE ( 0 , lower ) ; <nl> + DCHECK_LT ( lower , upper ) ; <nl> + DCHECK_LE ( upper , 1 < < precision_ ) ; <nl> + <nl> + / / ` base ` and ` size ` represent a half - open interval [ base , base + size ) . <nl> + / / Loop invariant : 2 ^ 16 < = size < = 2 ^ 32 . <nl> + / / <nl> + / / Note that keeping size above 2 ^ 16 is important . Since the interval sizes <nl> + / / are quantized to up to 16 bits , the smallest interval size the encode may <nl> + / / handle is 2 ^ - 16 . If size is smaller than 2 ^ 16 , a small interval input may <nl> + / / collapse the encoder range into an empty interval . <nl> + const uint64 size = static_cast < uint64 > ( size_minus1_ ) + 1 ; <nl> + DCHECK_NE ( size > > 16 , 0 ) ; <nl> + <nl> + / / For short notation , let u : = lower and v : = upper . <nl> + / / <nl> + / / The input u , v represents a half - open interval [ u , v ) / 2 ^ precision . <nl> + / / This narrows the current interval roughly to <nl> + / / [ base + ( size * u ) / 2 ^ precision , base + ( size * v ) / 2 ^ precision ) . <nl> + / / <nl> + / / TODO ( sjhwang ) : Try rounding if it helps improve compression ratio , at the <nl> + / / expense of more operations . In the test using Zipf distribution , the <nl> + / / overhead over the theoretical compression ratio was ~ 0 . 01 % . <nl> + / / NOTE : The max value of ` size ` is 2 ^ 32 and size > 0 . Therefore ` size * u ` <nl> + / / can be rewritten as ` ( size - 1 ) * u + u ` and all the computation can be <nl> + / / done in 32 - bit mode . If 32 - bit multiply is faster , then rewrite . <nl> + const uint32 a = ( size * static_cast < uint64 > ( lower ) ) > > precision_ ; <nl> + const uint32 b = ( ( size * static_cast < uint64 > ( upper ) ) > > precision_ ) - 1 ; <nl> + DCHECK_LE ( a , b ) ; <nl> + <nl> + / / Let ' s confirm the RHS of a , b fit in uint32 type . <nl> + / / Recall that 0 < = u < 2 ^ precision , and size < = 2 ^ 32 . Therefore <nl> + / / ( size * u ) / 2 ^ precision < size < = 2 ^ 32 , <nl> + / / and the value of a fits in uint32 type . Similarly , since v < = 2 ^ precision , <nl> + / / ( size * v ) / 2 ^ precision - 1 < = size - 1 < 2 ^ 32 . <nl> + / / For lower bound of b , note that 1 < = v , 2 ^ 16 < = size , and 16 < = precision . <nl> + / / Therefore ( size * v ) / 2 ^ precision - 1 > = 2 ^ 16 / 2 ^ precision - 1 > = 0 . <nl> + <nl> + / / The new interval is [ base + a , base + b ] = [ base + a , base + b + 1 ) . <nl> + base_ + = a ; / / May overflow . <nl> + size_minus1_ = b - a ; <nl> + const bool base_overflow = ( base_ < a ) ; <nl> + <nl> + / / The encoder has two states . Let ' s call them state 0 and state 1 . <nl> + / / State 0 is when base < base + size < = 2 ^ 32 . <nl> + / / State 1 is when base < 2 ^ 32 < base + size . <nl> + / / <nl> + / / The encoder initially starts in state 0 , with base = 0 , size = 2 ^ 32 . <nl> + / / <nl> + / / TODO ( sjhwang ) : Requires some profiling , but the encoder stays in state 0 <nl> + / / most of the time . Should optimize code for state 0 . <nl> + / / <nl> + / / Each Encode ( ) has up to two places where the interval changes : <nl> + / / # 1 . Refine the interval . [ base , base + size ) - > [ base + a , base + b + 1 ) . <nl> + / / # 2 . Expand interval if the new size is too small , <nl> + / / and each change may cause a state transition . <nl> + / / <nl> + / / First , consider when the current state is 0 . <nl> + / / <nl> + / / In this case , the next state after # 1 is always state 0 , since refining <nl> + / / interval only shrinks the interval , therefore new_base + new_size < = 2 ^ 32 . <nl> + / / <nl> + / / Let us explain # 2 . <nl> + / / <nl> + / / Recall that at the beginning of each Encode ( ) , the encoder requires <nl> + / / 2 ^ 16 < size < = 2 ^ 32 . As precision < = 16 , the new interval size can be as <nl> + / / small as 1 , but never zero . <nl> + / / <nl> + / / To keep size above 2 ^ 16 , if new size is smaller than or equal to 2 ^ 16 , the <nl> + / / encoder would left - shift base and size by 16 bits : size ' < - size * 2 ^ 16 . <nl> + / / Note that new size ' is now in the range [ 2 ^ 16 , 2 ^ 32 ] . <nl> + / / <nl> + / / Since size is left - shifted , the same should be applied to base as well . <nl> + / / However , after the left - shift , base will then contain 48 bits instead of 32 <nl> + / / bits . Therefore prior to the shift , The upper 16 bits in base should be <nl> + / / stored somewhere else . <nl> + / / <nl> + / / If the upper 16 bits of all values in the interval were the same , i . e . , if <nl> + / / base [ 32 : 16 ] = = ( base + size - 1 ) [ 32 : 16 ] , then base [ 32 : 16 ] can be written <nl> + / / out to ` output ` string , since any further Encode ( ) only narrows down the <nl> + / / interval and that 16 bits would never change . <nl> + / / <nl> + / / If the upper 16 bits were not all the same , since this happens only when <nl> + / / size < = 2 ^ 16 , the upper 16 bits may differ only by one , i . e . , <nl> + / / base [ 32 : 16 ] + 1 = = ( base + size - 1 ) [ 32 : 16 ] . At this stage , it is not <nl> + / / determined yet whether base [ 32 : 16 ] should be written to the output or <nl> + / / ( base [ 32 : 16 ] + 1 ) should be written to the output . In this case , <nl> + / / ( base [ 32 : 16 ] + 1 ) is temporarily stored in ` delay ` , and base is <nl> + / / left - shifted by 16 bits . <nl> + / / <nl> + / / In the latter case , the condition implies that ( base / / 2 ^ 16 ) and <nl> + / / ( ( base + size - 1 ) / / 2 ^ 16 ) were different . Therefore after left - shift by <nl> + / / 16 bits , the new ( base + size ) is greater than 2 ^ 32 , i . e . , the encoder <nl> + / / transition to state 1 . <nl> + / / <nl> + / / = = = = Summary = = = = <nl> + / / To detect the current encoder state , <nl> + / / state 0 : delay = = 0 iff ( base mod 2 ^ 32 ) < ( base + size ) mod 2 ^ 32 , <nl> + / / state 1 : delay ! = 0 iff ( base + size ) mod 2 ^ 32 < = base mod 2 ^ 32 , <nl> + / / because size < = 2 ^ 32 . <nl> + / / <nl> + / / = = = = Summary for state 0 = = = = <nl> + / / 1 . Interval refinement does not cause state transition . <nl> + / / 2 . Interval expansion may cause state transition , depending on the upper 16 <nl> + / / bits of base and base + size - 1 . <nl> + / / <nl> + / / Now suppose the previous state was 1 . This means that <nl> + / / base < = 2 ^ 32 < base + size . <nl> + / / <nl> + / / When in state 1 , an interval refinement may trigger state transition . <nl> + / / After Encode ( ) refines the interval , there are three possibilities : <nl> + / / # 1 . base < = 2 ^ 32 < base + size ( unchanged ) , <nl> + / / # 2 . 2 ^ 32 < = base < base + size ( base overflowed ) , <nl> + / / # 3 . base < base + size < = 2 ^ 32 ( base + size - 1 underflowed ) . <nl> + / / <nl> + / / In case # 1 , the encoder remains in state 1 . <nl> + / / In case # 2 or # 3 , the encoder state changes to state 0 . <nl> + / / <nl> + / / = = = = State transition for interval refinement = = = = <nl> + / / 1 . state 0 - > state 0 , <nl> + / / 2 . state 1 - > state 0 or state 1 . <nl> + / / <nl> + / / Therefore if the new state is 1 , then the previous state must have been <nl> + / / state 1 . <nl> + if ( base_ + size_minus1_ < base_ ) { <nl> + / / If statement checked if 2 ^ 32 < base + size . The new state is 1 , hence the <nl> + / / previous state was also state 1 . <nl> + DCHECK_NE ( ( ( base_ - a ) + size ) > > 32 , 0 ) ; <nl> + DCHECK_NE ( delay_ & 0xFFFF , 0 ) ; <nl> + <nl> + / / Like in state 0 , if the new size is < = 2 ^ 16 , then base and size should <nl> + / / be left - shifted by 16 bits . Combine the conditions <nl> + / / base < = 2 ^ 32 < base + size and size < = 2 ^ 16 to conclude that <nl> + / / base [ 32 : 16 ] > = 0xFFFF and ( base + size - 1 ) [ 32 : 16 ] = 0x0000 . <nl> + / / <nl> + / / Note that 2 ^ 32 - base < size , and since base is at least 0xFFFF0000 , <nl> + / / 2 ^ 16 - base [ 16 : 0 ] < size . Let base ' and size ' be the new base and size <nl> + / / after the bit - shift . Then 2 ^ 32 - base ' < size ' = > 2 ^ 32 < base ' + size ' . <nl> + / / Therefore the encoder remains in state 1 . <nl> + / / <nl> + / / Lastly , ` delay ` is modified . Conceptually , delay has to be changed to <nl> + / / delay ' < - delay * 2 ^ 16 + ( base + size - 1 ) [ 32 : 16 ] . <nl> + / / Since we know above that ( base + size - 1 ) [ 32 : 16 ] = 0x0000 , there is no <nl> + / / need to explicitly do the computation above , but rather store how many <nl> + / / trailing zeros there were . For this reason , the lower 16 bits of <nl> + / / ` delay ` stores the delayed value when state changed from 0 to 1 , and <nl> + / / delay [ 32 : 16 ] stores the # of trailing zeros ( in bytes ) . <nl> + / / <nl> + / / = = = = State transition for interval expansion = = = = <nl> + / / 1 . state 0 - > state 0 or state 1 , <nl> + / / 2 . state 1 - > state 1 . <nl> + if ( size_minus1_ > > 16 = = 0 ) { <nl> + DCHECK_EQ ( base_ > > 16 , 0xFFFF ) ; <nl> + base_ < < = 16 ; <nl> + size_minus1_ < < = 16 ; <nl> + size_minus1_ | = 0xFFFF ; <nl> + / / TODO ( sjhwang ) : It is possible that for very long input , delay <nl> + / / overflow during below . If overflow is detected , this delay is too <nl> + / / long the encoder should forcefully move to state 0 . In such case , <nl> + / / base can be raised to 2 ^ 32 ( force case # 2 ) , or ( base + size ) can be <nl> + / / lowered to 2 ^ 32 ( force case # 3 ) , depending on which transition <nl> + / / keeps size larger . <nl> + CHECK_LT ( delay_ , static_cast < uint64 > ( 1 ) < < 62 ) ; <nl> + delay_ + = 0x20000 ; / / Two more bytes of zeros . Check overflow ? <nl> + } <nl> + return ; <nl> + } <nl> + <nl> + / / If reached here , the current state is 0 . <nl> + / / First handle the case when the previous state was state 1 . <nl> + if ( delay_ ! = 0 ) { <nl> + / / In case # 2 or # 3 , the encoder state changes to state 0 . Recall that when <nl> + / / the encoder state changed from state 0 to state 1 , the top 16 bits of <nl> + / / ( base + size - 1 ) was temporarily stored in ` delay ` , because the output <nl> + / / could be either ( delay - 1 ) or ( delay ) . <nl> + / / <nl> + / / And from above , the delayed value encoded in ` delay ` is <nl> + / / delay ' < - delay [ 16 : 0 ] * 2 ^ ( 8 * delay [ MAX : 16 ] ) <nl> + / / <nl> + / / In case # 2 , the interval moved below 2 ^ 32 . So ( delay ' - 1 ) is the <nl> + / / converged value after interval refinements . Write out <nl> + / / ( delay [ 16 : 0 ] - 1 ) and write ( 8 * delay [ MAX : 16 ] ) bytes of 0xFF . <nl> + / / <nl> + / / In case # 3 , the interval moved above 2 ^ 32 . So delay ' is the converged <nl> + / / value after interval refinement . Write out delay [ 16 : 0 ] and write <nl> + / / ( 8 * delay [ MAX : 16 ] ) bytes of 0x00 . <nl> + if ( base_overflow ) { <nl> + / / Case # 2 . <nl> + DCHECK_NE ( ( static_cast < uint64 > ( base_ - a ) + a ) > > 32 , 0 ) ; <nl> + sink - > push_back ( static_cast < char > ( delay_ > > 8 ) ) ; <nl> + sink - > push_back ( static_cast < char > ( delay_ > > 0 ) ) ; <nl> + sink - > append ( delay_ > > 16 , static_cast < char > ( 0 ) ) ; <nl> + } else { <nl> + / / Case # 3 . <nl> + DCHECK_EQ ( static_cast < uint64 > ( base_ + size_minus1_ ) > > 32 , 0 ) ; <nl> + - - delay_ ; <nl> + sink - > push_back ( static_cast < char > ( delay_ > > 8 ) ) ; <nl> + sink - > push_back ( static_cast < char > ( delay_ > > 0 ) ) ; <nl> + sink - > append ( delay_ > > 16 , static_cast < char > ( 0xFF ) ) ; <nl> + } <nl> + / / Reset to state 0 . <nl> + delay_ = 0 ; <nl> + } <nl> + <nl> + if ( size_minus1_ > > 16 = = 0 ) { <nl> + const uint32 top = base_ > > 16 ; <nl> + <nl> + base_ < < = 16 ; <nl> + size_minus1_ < < = 16 ; <nl> + size_minus1_ | = 0xFFFF ; <nl> + <nl> + if ( base_ < = base_ + size_minus1_ ) { <nl> + / / Still in state 0 . Write the top 16 bits . <nl> + sink - > push_back ( static_cast < char > ( top > > 8 ) ) ; <nl> + sink - > push_back ( static_cast < char > ( top ) ) ; <nl> + } else { <nl> + / / New state is 1 . <nl> + DCHECK_LT ( top , 0xFFFF ) ; <nl> + delay_ = top + 1 ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + void RangeEncoder : : Finalize ( string * sink ) { <nl> + / / Finalize the encode by writing out any number in the interval <nl> + / / [ base , base + size ) . <nl> + / / <nl> + / / Trailing zeros are not explicitly written out as decoder can fill in zeros <nl> + / / by default . <nl> + if ( delay_ ! = 0 ) { <nl> + / / The last state was state 1 . Since base < 2 ^ 32 < base + size , pick 2 ^ 32 <nl> + / / ( state 1 , case # 3 ) . <nl> + / / NOTE : It is a bit difficult to trigger this code path on purpose . <nl> + / / TODO ( sjhwang ) : Find a way to trigger this code path for test coverage . <nl> + sink - > push_back ( static_cast < char > ( delay_ > > 8 ) ) ; <nl> + if ( ( delay_ & 0xFF ) ! = 0 ) { <nl> + sink - > push_back ( static_cast < char > ( delay_ ) ) ; <nl> + } <nl> + } else if ( base_ ! = 0 ) { <nl> + / / If base = = 0 , then pick 0 from [ base , base + size ) and no zeros are <nl> + / / explcitly written . <nl> + / / <nl> + / / Otherwise , pick ( base + ( 2 ^ 16 - base [ 16 : 0 ] ) ) , i . e . , round up base to the <nl> + / / next multiple of 2 ^ 16 . As 2 ^ 16 < size , this value should be in the <nl> + / / interval [ base , base + size ) . <nl> + const uint32 mid = ( ( base_ - 1 ) > > 16 ) + 1 ; <nl> + DCHECK_EQ ( mid & 0xFFFF , mid ) ; <nl> + sink - > push_back ( static_cast < char > ( mid > > 8 ) ) ; <nl> + if ( ( mid & 0xFF ) ! = 0 ) { <nl> + sink - > push_back ( static_cast < char > ( mid > > 0 ) ) ; <nl> + } <nl> + } <nl> + <nl> + base_ = 0 ; <nl> + size_minus1_ = std : : numeric_limits < uint32 > : : max ( ) ; <nl> + delay_ = 0 ; <nl> + } <nl> + <nl> + RangeDecoder : : RangeDecoder ( const string & source , int precision ) <nl> + : current_ ( source . begin ( ) ) , <nl> + begin_ ( source . begin ( ) ) , <nl> + end_ ( source . end ( ) ) , <nl> + precision_ ( precision ) { <nl> + CHECK_LE ( precision , 16 ) ; <nl> + <nl> + Read16BitValue ( ) ; <nl> + Read16BitValue ( ) ; <nl> + } <nl> + <nl> + int32 RangeDecoder : : Decode ( tensorflow : : gtl : : ArraySlice < int32 > cdf ) { <nl> + const uint64 size = static_cast < uint64 > ( size_minus1_ ) + 1 ; <nl> + const uint64 offset = <nl> + ( ( static_cast < uint64 > ( value_ - base_ ) + 1 ) < < precision_ ) - 1 ; <nl> + <nl> + / / This is similar to std : : lower_range ( ) with std : : less_equal as comparison . <nl> + / / After the binary search , ` pv ` points to the smallest number v that <nl> + / / satisfies offset < ( size * v ) / 2 ^ precision . <nl> + <nl> + / / Assumes that cdf [ 0 ] = = 0 . Therefore ( size * cdf [ 0 ] ) / 2 ^ precision is always <nl> + / / less than or equal to offset . <nl> + const int32 * pv = cdf . data ( ) + 1 ; <nl> + / / ` len ` can be cdf . size ( ) - 2 if there is guarantee that the last element of <nl> + / / cdf is 2 ^ precision . <nl> + auto len = cdf . size ( ) - 1 ; <nl> + DCHECK_GT ( len , 0 ) ; <nl> + <nl> + do { <nl> + const auto half = len / 2 ; <nl> + const int32 * mid = pv + half ; <nl> + DCHECK_GE ( * mid , 0 ) ; <nl> + DCHECK_LE ( * mid , 1 < < precision_ ) ; <nl> + if ( size * static_cast < uint64 > ( * mid ) < = offset ) { <nl> + pv = mid + 1 ; <nl> + len - = half + 1 ; <nl> + } else { <nl> + len = half ; <nl> + } <nl> + } while ( len > 0 ) ; <nl> + <nl> + / / If ( size * v ) / 2 ^ precision < = offset for all v in cdf , then pv points to <nl> + / / one after the last element of cdf . That is a decoding error . <nl> + / / <nl> + / / TODO ( sjhwang ) : Consider returning - 1 to indicate error . Or start len = <nl> + / / cdf . size ( ) - 2 instead and give up detecting this error . <nl> + CHECK_LT ( pv , cdf . data ( ) + cdf . size ( ) ) ; <nl> + <nl> + const uint32 a = ( size * static_cast < uint64 > ( * ( pv - 1 ) ) ) > > precision_ ; <nl> + const uint32 b = ( ( size * static_cast < uint64 > ( * pv ) ) > > precision_ ) - 1 ; <nl> + DCHECK_LE ( a , offset > > precision_ ) ; <nl> + DCHECK_LE ( offset > > precision_ , b ) ; <nl> + <nl> + base_ + = a ; <nl> + size_minus1_ = b - a ; <nl> + <nl> + if ( size_minus1_ > > 16 = = 0 ) { <nl> + base_ < < = 16 ; <nl> + size_minus1_ < < = 16 ; <nl> + size_minus1_ | = 0xFFFF ; <nl> + <nl> + Read16BitValue ( ) ; <nl> + } <nl> + <nl> + return pv - cdf . data ( ) - 1 ; <nl> + } <nl> + <nl> + void RangeDecoder : : Read16BitValue ( ) { <nl> + value_ < < = 8 ; <nl> + if ( current_ ! = end_ ) { <nl> + value_ | = static_cast < uint8 > ( * current_ + + ) ; <nl> + } <nl> + value_ < < = 8 ; <nl> + if ( current_ ! = end_ ) { <nl> + value_ | = static_cast < uint8 > ( * current_ + + ) ; <nl> + } <nl> + } <nl> + } / / namespace tensorflow <nl> new file mode 100644 <nl> index 0000000000000 . . c24fb707fc9f1 <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / kernels / range_coder . h <nl> <nl> + / * Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # ifndef THIRD_PARTY_TENSORFLOW_CONTRIB_CODER_KERNELS_RANGE_CODER_H_ <nl> + # define THIRD_PARTY_TENSORFLOW_CONTRIB_CODER_KERNELS_RANGE_CODER_H_ <nl> + <nl> + # include < limits > <nl> + # include < string > <nl> + <nl> + # include " tensorflow / core / lib / gtl / array_slice . h " <nl> + # include " tensorflow / core / platform / types . h " <nl> + <nl> + namespace tensorflow { <nl> + class RangeEncoder { <nl> + public : <nl> + / / ` precision ` determines the granularity of probability masses passed to <nl> + / / Encode ( ) function below . <nl> + / / <nl> + / / REQUIRES : 0 < precision < = 16 . <nl> + explicit RangeEncoder ( int precision ) ; <nl> + <nl> + / / Encodes a half - open interval [ lower / 2 ^ precision , upper / 2 ^ precision ) . <nl> + / / Suppose each character to be encoded is from an integer - valued <nl> + / / distribution . When encoding a random character x0 , the arguments lower and <nl> + / / upper represent <nl> + / / Pr ( X < x0 ) = lower / 2 ^ precision , <nl> + / / Pr ( X < x0 + 1 ) = upper / 2 ^ precision , <nl> + / / where X is a random variable following the distribution . <nl> + / / <nl> + / / For example , assume that the distribution has possible outputs 0 , 1 , 2 , . . . <nl> + / / To encode value 0 , lower = 0 and upper = Pr ( X = 0 ) . <nl> + / / To encode value 1 , lower = Pr ( X = 0 ) and upper = Pr ( X = 0 or 1 ) . <nl> + / / To encode value 2 , lower = Pr ( X = 0 or 1 ) and upper = Pr ( X = 0 , 1 , or 2 ) . <nl> + / / . . . <nl> + / / <nl> + / / REQUIRES : 0 < = lower < upper < = 2 ^ precision . <nl> + void Encode ( int32 lower , int32 upper , string * sink ) ; <nl> + <nl> + / / The encode may contain some under - determined values from previous encoding . <nl> + / / After Encode ( ) calls , Finalize ( ) must be called . Otherwise the encoded <nl> + / / string may not be decoded . <nl> + void Finalize ( string * sink ) ; <nl> + <nl> + private : <nl> + uint32 base_ = 0 ; <nl> + uint32 size_minus1_ = std : : numeric_limits < uint32 > : : max ( ) ; <nl> + uint64 delay_ = 0 ; <nl> + <nl> + const int precision_ ; <nl> + } ; <nl> + <nl> + class RangeDecoder { <nl> + public : <nl> + / / Holds a reference to ` source ` . The caller has to make sure that ` source ` <nl> + / / outlives the decoder object . <nl> + / / <nl> + / / REQUIRES : ` precision ` must be the same as the encoder ' s precision . <nl> + / / REQUIRES : 0 < precision < = 16 . <nl> + RangeDecoder ( const string & source , int precision ) ; <nl> + <nl> + / / Decodes a character from ` source ` using CDF . The size of ` cdf ` should be <nl> + / / one more than the number of the character in the alphabet . <nl> + / / <nl> + / / If x0 , x1 , x2 , . . . are the possible characters ( in increasing order ) from <nl> + / / the distribution , then <nl> + / / cdf [ 0 ] = 0 <nl> + / / cdf [ 1 ] = Pr ( X < = x0 ) , <nl> + / / cdf [ 2 ] = Pr ( X < = x1 ) , <nl> + / / cdf [ 3 ] = Pr ( X < = x2 ) , <nl> + / / . . . <nl> + / / <nl> + / / The returned value is an index to ` cdf ` where the decoded character <nl> + / / corresponds to . <nl> + / / <nl> + / / REQUIRES : cdf . size ( ) > 1 . <nl> + / / REQUIRES : cdf [ i ] < = cdf [ i + 1 ] for i = 0 , 1 , . . . , cdf . size ( ) - 2 . <nl> + / / REQUIRES : cdf [ cdf . size ( ) - 1 ] < = 2 ^ precision . <nl> + / / <nl> + / / In practice the last element of ` cdf ` should equal to 2 ^ precision . <nl> + int32 Decode ( gtl : : ArraySlice < int32 > cdf ) ; <nl> + <nl> + private : <nl> + void Read16BitValue ( ) ; <nl> + <nl> + uint32 base_ = 0 ; <nl> + uint32 size_minus1_ = std : : numeric_limits < uint32 > : : max ( ) ; <nl> + uint32 value_ = 0 ; <nl> + <nl> + string : : const_iterator current_ ; <nl> + const string : : const_iterator begin_ ; <nl> + const string : : const_iterator end_ ; <nl> + <nl> + const int precision_ ; <nl> + } ; <nl> + } / / namespace tensorflow <nl> + <nl> + # endif / / THIRD_PARTY_TENSORFLOW_CONTRIB_CODER_KERNELS_RANGE_CODER_H_ <nl> new file mode 100644 <nl> index 0000000000000 . . cde7982530fea <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / kernels / range_coder_ops . cc <nl> <nl> + / * Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # define EIGEN_USE_THREADS <nl> + <nl> + # include < algorithm > <nl> + # include < array > <nl> + # include < limits > <nl> + # include < type_traits > <nl> + # include < vector > <nl> + <nl> + # include " tensorflow / contrib / coder / kernels / range_coder . h " <nl> + # include " tensorflow / contrib / coder / kernels / range_coder_ops_util . h " <nl> + # include " tensorflow / core / framework / op_kernel . h " <nl> + # include " tensorflow / core / framework / tensor . h " <nl> + # include " tensorflow / core / framework / tensor_shape . h " <nl> + # include " tensorflow / core / framework / tensor_types . h " <nl> + # include " tensorflow / core / lib / core / errors . h " <nl> + # include " tensorflow / core / lib / core / status . h " <nl> + # include " tensorflow / core / lib / gtl / array_slice . h " <nl> + # include " tensorflow / core / platform / logging . h " <nl> + # include " tensorflow / core / platform / macros . h " <nl> + # include " tensorflow / core / platform / types . h " <nl> + <nl> + namespace tensorflow { <nl> + namespace { <nl> + / / A helper class to iterate over data and cdf simultaneously , while cdf is <nl> + / / broadcasted to data . <nl> + / / NOTE : Moving this class out of anonymous namespace impacts compiler <nl> + / / optimization and affects performance . When moving this code around ( e . g . , <nl> + / / into a library header ) , be sure to check the benchmark tests . <nl> + template < typename T , typename U , int N > <nl> + class BroadcastRange { <nl> + public : <nl> + BroadcastRange ( T * data_pointer , gtl : : ArraySlice < int64 > data_shape , <nl> + const U * cdf_pointer , gtl : : ArraySlice < int64 > cdf_shape ) <nl> + : data_pointer_ ( data_pointer ) , cdf_pointer_ ( cdf_pointer ) { <nl> + CHECK ( ! data_shape . empty ( ) ) ; <nl> + CHECK_EQ ( data_shape . size ( ) , N ) ; <nl> + CHECK_EQ ( cdf_shape . size ( ) , N + 1 ) ; <nl> + <nl> + std : : copy ( data_shape . begin ( ) , data_shape . end ( ) , & data_shape_ [ 0 ] ) ; <nl> + data_index_ . fill ( 0 ) ; <nl> + <nl> + const int64 innermost_stride = cdf_shape [ N ] ; <nl> + cdf_displace_ . fill ( innermost_stride ) ; <nl> + <nl> + / / Pre - compute the pointer displacement for cdf . <nl> + int64 stride = innermost_stride ; <nl> + for ( int i = N - 1 ; i > = 0 ; - - i ) { <nl> + const bool broadcasting = ( cdf_shape [ i ] < = 1 ) ; <nl> + <nl> + / / When the data linear index advances by one , the cdf linear index <nl> + / / advances by ` innermost_stride ` . <nl> + / / <nl> + / / Suppose that the i - th axis coordinate of data increased by one , and <nl> + / / that i - th axis is broadcasting . The cdf linear index should be wound <nl> + / / back by i - th axis stride , so that i - th axis coordinate of cdf is <nl> + / / effectively kept at 0 . <nl> + if ( broadcasting ) { <nl> + cdf_displace_ [ i ] - = stride ; <nl> + } <nl> + stride * = cdf_shape [ i ] ; <nl> + } <nl> + } <nl> + <nl> + / / Returns the pointers to the current iterating locations to data and cdf <nl> + / / tensors . <nl> + / / <nl> + / / Note that this function does not track whether data pointer is running past <nl> + / / the end of data buffer . The caller has to make sure Next ( ) is called no <nl> + / / more than that . <nl> + std : : pair < T * , const U * > Next ( ) { <nl> + std : : pair < T * , const U * > return_value = { data_pointer_ , cdf_pointer_ } ; <nl> + <nl> + int i = N - 1 ; <nl> + for ( ; i > 0 ; - - i ) { <nl> + + + data_index_ [ i ] ; <nl> + if ( data_index_ [ i ] < data_shape_ [ i ] ) { <nl> + break ; <nl> + } <nl> + data_index_ [ i ] = 0 ; <nl> + } <nl> + <nl> + / / Advance data pointer by one . <nl> + data_pointer_ + = 1 ; <nl> + <nl> + / / For cdf pointer , it ' s more complicated because of broadcasting . When i - th <nl> + / / coordinate increase by one , and if i - th axis is broadcasting , then we <nl> + / / need to rewind back the pointer so that the effective i - th axis <nl> + / / coordinate for cdf is always 0 . This value is precomputed as <nl> + / / cdf_displace_ . <nl> + cdf_pointer_ + = cdf_displace_ [ i ] ; <nl> + return return_value ; <nl> + } <nl> + <nl> + private : <nl> + std : : array < int64 , N > data_shape_ ; <nl> + std : : array < int64 , N > cdf_displace_ ; <nl> + std : : array < int64 , N > data_index_ ; <nl> + <nl> + T * data_pointer_ ; <nl> + const U * cdf_pointer_ ; <nl> + } ; <nl> + <nl> + Status CheckCdfShape ( const TensorShape & data_shape , <nl> + const TensorShape & cdf_shape ) { <nl> + if ( TF_PREDICT_FALSE ( cdf_shape . dims ( ) ! = data_shape . dims ( ) + 1 ) ) { <nl> + return errors : : InvalidArgument ( <nl> + " ` cdf ` should have one more axis than ` data ` : data shape = " , <nl> + data_shape . DebugString ( ) , " , cdf shape = " , cdf_shape . DebugString ( ) ) ; <nl> + } <nl> + <nl> + if ( TF_PREDICT_FALSE ( cdf_shape . dim_size ( cdf_shape . dims ( ) - 1 ) < = 1 ) ) { <nl> + return errors : : InvalidArgument ( <nl> + " The last dimension of ` cdf ` should be > 1 : " , cdf_shape . DebugString ( ) ) ; <nl> + } <nl> + <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + / / Non - incremental encoder op mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + class RangeEncodeOp : public OpKernel { <nl> + public : <nl> + explicit RangeEncodeOp ( OpKernelConstruction * context ) : OpKernel ( context ) { <nl> + OP_REQUIRES_OK ( context , context - > GetAttr ( " precision " , & precision_ ) ) ; <nl> + OP_REQUIRES ( context , 0 < precision_ & & precision_ < = 16 , <nl> + errors : : InvalidArgument ( " ` precision ` must be in [ 1 , 16 ] : " , <nl> + precision_ ) ) ; <nl> + } <nl> + <nl> + void Compute ( OpKernelContext * context ) override { <nl> + const Tensor & data = context - > input ( 0 ) ; <nl> + const Tensor & cdf = context - > input ( 1 ) ; <nl> + <nl> + OP_REQUIRES_OK ( context , CheckCdfShape ( data . shape ( ) , cdf . shape ( ) ) ) ; <nl> + <nl> + std : : vector < int64 > data_shape , cdf_shape ; <nl> + OP_REQUIRES_OK ( <nl> + context , MergeAxes ( data . shape ( ) , cdf . shape ( ) , & data_shape , & cdf_shape ) ) ; <nl> + <nl> + Tensor * output_tensor ; <nl> + OP_REQUIRES_OK ( context , <nl> + context - > allocate_output ( 0 , TensorShape { } , & output_tensor ) ) ; <nl> + string * output = & output_tensor - > scalar < string > ( ) ( ) ; <nl> + <nl> + switch ( data_shape . size ( ) ) { <nl> + # define RANGE_ENCODE_CASE ( dims ) \ <nl> + case dims : { \ <nl> + RangeEncodeImpl < dims > ( data . flat < int16 > ( ) , data_shape , \ <nl> + cdf . flat_inner_dims < int32 , 2 > ( ) , cdf_shape , output ) ; \ <nl> + } break <nl> + RANGE_ENCODE_CASE ( 1 ) ; <nl> + RANGE_ENCODE_CASE ( 2 ) ; <nl> + RANGE_ENCODE_CASE ( 3 ) ; <nl> + RANGE_ENCODE_CASE ( 4 ) ; <nl> + RANGE_ENCODE_CASE ( 5 ) ; <nl> + RANGE_ENCODE_CASE ( 6 ) ; <nl> + # undef RANGE_ENCODE_CASE <nl> + default : <nl> + context - > CtxFailure ( errors : : InvalidArgument ( <nl> + " Irregular broadcast pattern : " , data . shape ( ) . DebugString ( ) , " , " , <nl> + cdf . shape ( ) . DebugString ( ) ) ) ; <nl> + return ; <nl> + } <nl> + } <nl> + <nl> + private : <nl> + template < int N > <nl> + void RangeEncodeImpl ( TTypes < int16 > : : ConstFlat data , <nl> + gtl : : ArraySlice < int64 > data_shape , <nl> + TTypes < int32 > : : ConstMatrix cdf , <nl> + gtl : : ArraySlice < int64 > cdf_shape , string * output ) const { <nl> + const int64 data_size = data . size ( ) ; <nl> + const int64 cdf_size = cdf . size ( ) ; <nl> + const int64 chip_size = cdf . dimension ( 1 ) ; <nl> + <nl> + BroadcastRange < const int16 , int32 , N > view { data . data ( ) , data_shape , <nl> + cdf . data ( ) , cdf_shape } ; <nl> + RangeEncoder encoder { precision_ } ; <nl> + for ( int64 linear = 0 ; linear < data_size ; + + linear ) { <nl> + const auto pair = view . Next ( ) ; <nl> + <nl> + const int64 index = * pair . first ; <nl> + DCHECK_GE ( index , 0 ) ; <nl> + DCHECK_LT ( index + 1 , chip_size ) ; <nl> + <nl> + const int32 * cdf_slice = pair . second ; <nl> + DCHECK_LE ( cdf_slice + chip_size , cdf . data ( ) + cdf_size ) ; <nl> + <nl> + const int32 lower = cdf_slice [ index ] ; <nl> + const int32 upper = cdf_slice [ index + 1 ] ; <nl> + encoder . Encode ( lower , upper , output ) ; <nl> + } <nl> + <nl> + encoder . Finalize ( output ) ; <nl> + } <nl> + <nl> + int precision_ ; <nl> + } ; <nl> + <nl> + REGISTER_KERNEL_BUILDER ( Name ( " RangeEncode " ) . Device ( DEVICE_CPU ) , RangeEncodeOp ) ; <nl> + <nl> + / / Non - incremental decoder op mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + class RangeDecodeOp : public OpKernel { <nl> + public : <nl> + explicit RangeDecodeOp ( OpKernelConstruction * context ) : OpKernel ( context ) { <nl> + OP_REQUIRES_OK ( context , context - > GetAttr ( " precision " , & precision_ ) ) ; <nl> + OP_REQUIRES ( context , 0 < precision_ & & precision_ < = 16 , <nl> + errors : : InvalidArgument ( " ` precision ` must be in [ 1 , 16 ] : " , <nl> + precision_ ) ) ; <nl> + } <nl> + <nl> + void Compute ( OpKernelContext * context ) override { <nl> + const Tensor & encoded_tensor = context - > input ( 0 ) ; <nl> + const Tensor & shape = context - > input ( 1 ) ; <nl> + const Tensor & cdf = context - > input ( 2 ) ; <nl> + <nl> + OP_REQUIRES ( context , TensorShapeUtils : : IsScalar ( encoded_tensor . shape ( ) ) , <nl> + errors : : InvalidArgument ( " Invalid ` encoded ` shape : " , <nl> + encoded_tensor . shape ( ) . DebugString ( ) ) ) ; <nl> + OP_REQUIRES ( context , TensorShapeUtils : : IsVector ( shape . shape ( ) ) , <nl> + errors : : InvalidArgument ( " Invalid ` shape ` shape : " , <nl> + shape . shape ( ) . DebugString ( ) ) ) ; <nl> + TensorShape output_shape ; <nl> + OP_REQUIRES_OK ( context , TensorShapeUtils : : MakeShape ( shape . vec < int32 > ( ) , <nl> + & output_shape ) ) ; <nl> + OP_REQUIRES_OK ( context , CheckCdfShape ( output_shape , cdf . shape ( ) ) ) ; <nl> + <nl> + std : : vector < int64 > data_shape , cdf_shape ; <nl> + OP_REQUIRES_OK ( <nl> + context , MergeAxes ( output_shape , cdf . shape ( ) , & data_shape , & cdf_shape ) ) ; <nl> + <nl> + const string & encoded = encoded_tensor . scalar < string > ( ) ( ) ; <nl> + <nl> + Tensor * output ; <nl> + OP_REQUIRES_OK ( context , context - > allocate_output ( 0 , output_shape , & output ) ) ; <nl> + <nl> + switch ( data_shape . size ( ) ) { <nl> + # define RANGE_DECODE_CASE ( dim ) \ <nl> + case dim : { \ <nl> + RangeDecodeImpl < dim > ( output - > flat < int16 > ( ) , data_shape , \ <nl> + cdf . flat_inner_dims < int32 > ( ) , cdf_shape , encoded ) ; \ <nl> + } break <nl> + RANGE_DECODE_CASE ( 1 ) ; <nl> + RANGE_DECODE_CASE ( 2 ) ; <nl> + RANGE_DECODE_CASE ( 3 ) ; <nl> + RANGE_DECODE_CASE ( 4 ) ; <nl> + RANGE_DECODE_CASE ( 5 ) ; <nl> + RANGE_DECODE_CASE ( 6 ) ; <nl> + # undef RANGE_DECODE_CASE <nl> + default : <nl> + context - > CtxFailure ( errors : : InvalidArgument ( <nl> + " Irregular broadcast pattern : " , output_shape . DebugString ( ) , " , " , <nl> + cdf . shape ( ) . DebugString ( ) ) ) ; <nl> + return ; <nl> + } <nl> + } <nl> + <nl> + private : <nl> + template < int N > <nl> + void RangeDecodeImpl ( TTypes < int16 > : : Flat output , <nl> + gtl : : ArraySlice < int64 > output_shape , <nl> + TTypes < int32 > : : ConstMatrix cdf , <nl> + gtl : : ArraySlice < int64 > cdf_shape , <nl> + const string & encoded ) const { <nl> + BroadcastRange < int16 , int32 , N > view { output . data ( ) , output_shape , <nl> + cdf . data ( ) , cdf_shape } ; <nl> + <nl> + RangeDecoder decoder { encoded , precision_ } ; <nl> + <nl> + const int64 output_size = output . size ( ) ; <nl> + const int64 cdf_size = cdf . size ( ) ; <nl> + const auto chip_size = <nl> + static_cast < gtl : : ArraySlice < int32 > : : size_type > ( cdf . dimension ( 1 ) ) ; <nl> + <nl> + for ( int64 i = 0 ; i < output_size ; + + i ) { <nl> + const auto pair = view . Next ( ) ; <nl> + <nl> + int16 * data = pair . first ; <nl> + DCHECK_LT ( data , output . data ( ) + output_size ) ; <nl> + <nl> + const int32 * cdf_slice = pair . second ; <nl> + DCHECK_LE ( cdf_slice + chip_size , cdf . data ( ) + cdf_size ) ; <nl> + <nl> + * data = decoder . Decode ( gtl : : ArraySlice < int32 > { cdf_slice , chip_size } ) ; <nl> + } <nl> + } <nl> + <nl> + int precision_ ; <nl> + } ; <nl> + <nl> + REGISTER_KERNEL_BUILDER ( Name ( " RangeDecode " ) . Device ( DEVICE_CPU ) , RangeDecodeOp ) ; <nl> + } / / namespace <nl> + } / / namespace tensorflow <nl> new file mode 100644 <nl> index 0000000000000 . . ae4d9d2836a0f <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / kernels / range_coder_ops_test . cc <nl> <nl> + / * Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # include < memory > <nl> + # include < vector > <nl> + <nl> + # include " tensorflow / contrib / coder / kernels / range_coder . h " <nl> + # include " tensorflow / core / common_runtime / kernel_benchmark_testlib . h " <nl> + # include " tensorflow / core / common_runtime / shape_refiner . h " <nl> + # include " tensorflow / core / framework / fake_input . h " <nl> + # include " tensorflow / core / framework / graph . pb . h " <nl> + # include " tensorflow / core / framework / node_def . pb . h " <nl> + # include " tensorflow / core / framework / node_def_builder . h " <nl> + # include " tensorflow / core / framework / op . h " <nl> + # include " tensorflow / core / framework / tensor_types . h " <nl> + # include " tensorflow / core / framework / types . pb . h " <nl> + # include " tensorflow / core / framework / versions . pb . h " <nl> + # include " tensorflow / core / graph / graph . h " <nl> + # include " tensorflow / core / graph / node_builder . h " <nl> + # include " tensorflow / core / graph / testlib . h " <nl> + # include " tensorflow / core / kernels / ops_testutil . h " <nl> + # include " tensorflow / core / lib / core / bits . h " <nl> + # include " tensorflow / core / lib / core / status_test_util . h " <nl> + # include " tensorflow / core / lib / gtl / array_slice . h " <nl> + # include " tensorflow / core / lib / random / random . h " <nl> + # include " tensorflow / core / lib / random / simple_philox . h " <nl> + # include " tensorflow / core / platform / test . h " <nl> + # include " tensorflow / core / platform / test_benchmark . h " <nl> + # include " tensorflow / core / public / session . h " <nl> + # include " tensorflow / core / public / session_options . h " <nl> + <nl> + namespace tensorflow { <nl> + namespace { <nl> + int LogUniform ( random : : SimplePhilox * gen , uint32 n ) { <nl> + CHECK_GT ( n , 0 ) ; <nl> + <nl> + / / Split [ 0 , n ) into { 0 } , [ 1 , 2 ) , [ 2 , 4 ) , [ 4 , 8 ) , . . . , [ 2 ^ ( m - 1 ) , n ) . <nl> + const int m = Log2Ceiling ( n ) ; <nl> + <nl> + int outcome ; <nl> + do { <nl> + / / Uniform ( ) consumes at least 32 bits per call , therefore this is somewhat <nl> + / / wasteful implementation . Since this is used only for test , we do not <nl> + / / refine this implementation further . <nl> + const int k = gen - > Uniform ( m + 1 ) - 1 ; <nl> + / / If k = = - 1 , then sample from { 0 } . <nl> + / / If k = = 0 , then sample from [ 1 , 2 ) . <nl> + / / If k = = 1 , then sample from [ 2 , 4 ) , . . . and so on . <nl> + if ( k < 1 ) { <nl> + outcome = k + 1 ; <nl> + } else { <nl> + outcome = ( 1 < < k ) + gen - > Uniform ( 1 < < k ) ; <nl> + } <nl> + } while ( n < = outcome ) ; <nl> + return outcome ; <nl> + } <nl> + <nl> + std : : vector < int64 > ComputeStrides ( const TensorShape & shape ) { <nl> + std : : vector < int64 > stride ( shape . dims ( ) ) ; <nl> + int64 current = 1 ; <nl> + for ( int i = shape . dims ( ) - 1 ; i > = 0 ; - - i ) { <nl> + stride [ i ] = current ; <nl> + current * = shape . dim_size ( i ) ; <nl> + } <nl> + return stride ; <nl> + } <nl> + <nl> + class RangeCoderOpsTest : public OpsTestBase { <nl> + protected : <nl> + Status RunEncodeOp ( int precision , gtl : : ArraySlice < Tensor > input , <nl> + Tensor * output ) { <nl> + TF_RETURN_IF_ERROR ( NodeDefBuilder ( " encode " , " RangeEncode " ) <nl> + . Input ( tensorflow : : FakeInput ( DT_INT16 ) ) <nl> + . Input ( tensorflow : : FakeInput ( DT_INT32 ) ) <nl> + . Attr ( " precision " , precision ) <nl> + . Finalize ( node_def ( ) ) ) ; <nl> + TF_RETURN_IF_ERROR ( InitOp ( ) ) ; <nl> + <nl> + inputs_ . clear ( ) ; <nl> + std : : vector < Tensor > copies ( input . size ( ) ) ; <nl> + for ( int i = 0 ; i < input . size ( ) ; + + i ) { <nl> + copies [ i ] = input [ i ] ; <nl> + inputs_ . emplace_back ( & copies [ i ] ) ; <nl> + } <nl> + <nl> + TF_RETURN_IF_ERROR ( RunOpKernel ( ) ) ; <nl> + <nl> + * output = * GetOutput ( 0 ) ; <nl> + inputs_ . clear ( ) ; <nl> + <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + Status RunDecodeOp ( int precision , gtl : : ArraySlice < Tensor > input , <nl> + Tensor * output ) { <nl> + TF_RETURN_IF_ERROR ( NodeDefBuilder ( " decode " , " RangeDecode " ) <nl> + . Input ( tensorflow : : FakeInput ( DT_STRING ) ) <nl> + . Input ( tensorflow : : FakeInput ( DT_INT32 ) ) <nl> + . Input ( tensorflow : : FakeInput ( DT_INT32 ) ) <nl> + . Attr ( " precision " , precision ) <nl> + . Finalize ( node_def ( ) ) ) ; <nl> + TF_RETURN_IF_ERROR ( InitOp ( ) ) ; <nl> + <nl> + inputs_ . clear ( ) ; <nl> + std : : vector < Tensor > copies ( input . size ( ) ) ; <nl> + for ( int i = 0 ; i < input . size ( ) ; + + i ) { <nl> + copies [ i ] = input [ i ] ; <nl> + inputs_ . emplace_back ( & copies [ i ] ) ; <nl> + } <nl> + <nl> + TF_RETURN_IF_ERROR ( RunOpKernel ( ) ) ; <nl> + <nl> + * output = * GetOutput ( 0 ) ; <nl> + inputs_ . clear ( ) ; <nl> + <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + void TestEncodeAndDecode ( int precision , const Tensor & data , <nl> + const Tensor & cdf ) { <nl> + Tensor encoded ; <nl> + TF_ASSERT_OK ( RunEncodeOp ( precision , { data , cdf } , & encoded ) ) ; <nl> + <nl> + const TensorShape & data_shape = data . shape ( ) ; <nl> + Tensor shape { DT_INT32 , { data_shape . dims ( ) } } ; <nl> + for ( int i = 0 ; i < data_shape . dims ( ) ; + + i ) { <nl> + shape . flat < int32 > ( ) ( i ) = data_shape . dim_size ( i ) ; <nl> + } <nl> + <nl> + Tensor decoded ; <nl> + TF_ASSERT_OK ( RunDecodeOp ( precision , { encoded , shape , cdf } , & decoded ) ) ; <nl> + <nl> + EXPECT_EQ ( decoded . dtype ( ) , data . dtype ( ) ) ; <nl> + EXPECT_EQ ( decoded . shape ( ) , data . shape ( ) ) ; <nl> + EXPECT_EQ ( decoded . tensor_data ( ) , data . tensor_data ( ) ) ; <nl> + } <nl> + <nl> + void PopulateMaxValues ( random : : SimplePhilox * gen , Tensor * maxvalue_tensor , <nl> + int min_maxvalue , int max_maxvalue ) { <nl> + const int range = max_maxvalue - min_maxvalue ; <nl> + TTypes < int16 > : : Flat flat = maxvalue_tensor - > flat < int16 > ( ) ; <nl> + <nl> + for ( int64 i = 0 ; i < flat . size ( ) ; + + i ) { <nl> + flat ( i ) = min_maxvalue + gen - > Uniform ( range ) ; <nl> + } <nl> + } <nl> + <nl> + void BuildCdf ( random : : SimplePhilox * gen , Tensor * data_tensor , <nl> + Tensor * cdf_tensor , const Tensor & maxvalue_tensor ) { <nl> + CHECK ( TensorShapeUtils : : StartsWith ( cdf_tensor - > shape ( ) , <nl> + maxvalue_tensor . shape ( ) ) ) ; <nl> + CHECK_EQ ( cdf_tensor - > dims ( ) , maxvalue_tensor . dims ( ) + 1 ) ; <nl> + const int64 chip_size = cdf_tensor - > dim_size ( cdf_tensor - > dims ( ) - 1 ) ; <nl> + <nl> + std : : vector < int64 > data_stride = ComputeStrides ( data_tensor - > shape ( ) ) ; <nl> + std : : vector < int64 > cdf_stride = ComputeStrides ( cdf_tensor - > shape ( ) ) ; <nl> + <nl> + for ( int i = 0 ; i < cdf_tensor - > dims ( ) ; + + i ) { <nl> + if ( cdf_tensor - > dim_size ( i ) = = 1 ) { <nl> + cdf_stride [ i ] = 0 ; <nl> + } <nl> + } <nl> + <nl> + Tensor histogram_tensor { DT_INT32 , cdf_tensor - > shape ( ) } ; <nl> + TTypes < int16 > : : Flat data = data_tensor - > flat < int16 > ( ) ; <nl> + TTypes < int32 > : : Flat histogram = histogram_tensor . flat < int32 > ( ) ; <nl> + TTypes < int16 > : : ConstFlat maxvalue = maxvalue_tensor . flat < int16 > ( ) ; <nl> + histogram . setZero ( ) ; <nl> + <nl> + for ( int64 index = 0 ; index < data . size ( ) ; + + index ) { <nl> + int64 temp = index ; <nl> + int64 offset = 0 ; <nl> + for ( int dim = 0 ; dim < data_stride . size ( ) ; + + dim ) { <nl> + const int64 coord = temp / data_stride [ dim ] ; <nl> + offset + = coord * cdf_stride [ dim ] ; <nl> + temp - = coord * data_stride [ dim ] ; <nl> + } <nl> + ASSERT_EQ ( temp , 0 ) ; <nl> + <nl> + const int64 maxvalue_offset = offset / chip_size ; <nl> + CHECK_EQ ( maxvalue_offset * chip_size , offset ) ; <nl> + CHECK_LT ( maxvalue ( maxvalue_offset ) + 1 , chip_size ) ; <nl> + const int value = LogUniform ( gen , maxvalue ( maxvalue_offset ) ) ; <nl> + data ( index ) = value ; <nl> + histogram ( offset + value + 1 ) + = 1 ; <nl> + } <nl> + <nl> + cdf_tensor - > flat_inner_dims < int32 , 2 > ( ) = <nl> + histogram_tensor . flat_inner_dims < int32 , 2 > ( ) . cumsum ( 1 ) ; <nl> + } <nl> + } ; <nl> + <nl> + TEST_F ( RangeCoderOpsTest , NoBroadcast ) { <nl> + constexpr int kPrecision = 14 ; <nl> + constexpr int kMaxValue = 10 ; <nl> + <nl> + Tensor data { DT_INT16 , { 1 , 32 , 32 , 16 } } ; <nl> + Tensor temp { DT_INT32 , { 1 , 1 , 1 , 1 , kMaxValue + 2 } } ; <nl> + Tensor maxvalue { DT_INT16 , { 1 , 1 , 1 , 1 } } ; <nl> + maxvalue . flat < int16 > ( ) ( 0 ) = kMaxValue ; <nl> + <nl> + ASSERT_LE ( data . shape ( ) . num_elements ( ) , 1 < < kPrecision ) ; <nl> + <nl> + random : : PhiloxRandom philox ( random : : New64 ( ) , random : : New64 ( ) ) ; <nl> + random : : SimplePhilox gen ( & philox ) ; <nl> + BuildCdf ( & gen , & data , & temp , maxvalue ) ; <nl> + <nl> + const Eigen : : array < int32 , 5 > broadcast = { 1 , 32 , 32 , 16 , 1 } ; <nl> + <nl> + Tensor cdf { DT_INT32 , { 1 , 32 , 32 , 16 , kMaxValue + 2 } } ; <nl> + cdf . tensor < int32 , 5 > ( ) = temp . tensor < int32 , 5 > ( ) . broadcast ( broadcast ) ; <nl> + <nl> + TestEncodeAndDecode ( kPrecision , data , cdf ) ; <nl> + } <nl> + <nl> + TEST_F ( RangeCoderOpsTest , Broadcast1Axis ) { <nl> + constexpr int kPrecision = 9 ; <nl> + constexpr int kDimensionSize = 1 < < kPrecision ; <nl> + constexpr int kMinMaxValue = 10 ; <nl> + constexpr int kMaxMaxValue = 64 ; <nl> + <nl> + random : : PhiloxRandom philox ( random : : New64 ( ) , random : : New64 ( ) ) ; <nl> + random : : SimplePhilox gen ( & philox ) ; <nl> + Tensor data { DT_INT16 , { 1 , kDimensionSize , kDimensionSize } } ; <nl> + <nl> + Tensor maxvalue { DT_INT16 , { kDimensionSize } } ; <nl> + PopulateMaxValues ( & gen , & maxvalue , kMinMaxValue , kMaxMaxValue ) ; <nl> + <nl> + { <nl> + / / Axis 1 . <nl> + Tensor maxvalue1 ; <nl> + ASSERT_TRUE ( maxvalue1 . CopyFrom ( maxvalue , { 1 , 1 , kDimensionSize } ) ) ; <nl> + <nl> + Tensor cdf { DT_INT32 , { 1 , 1 , kDimensionSize , kMaxMaxValue + 2 } } ; <nl> + BuildCdf ( & gen , & data , & cdf , maxvalue1 ) ; <nl> + TestEncodeAndDecode ( kPrecision , data , cdf ) ; <nl> + } <nl> + <nl> + { <nl> + / / Axis 2 . <nl> + Tensor maxvalue2 ; <nl> + ASSERT_TRUE ( maxvalue2 . CopyFrom ( maxvalue , { 1 , kDimensionSize , 1 } ) ) ; <nl> + <nl> + Tensor cdf { DT_INT32 , { 1 , kDimensionSize , 1 , kMaxMaxValue + 2 } } ; <nl> + BuildCdf ( & gen , & data , & cdf , maxvalue2 ) ; <nl> + TestEncodeAndDecode ( kPrecision , data , cdf ) ; <nl> + } <nl> + } <nl> + <nl> + TEST_F ( RangeCoderOpsTest , Broadcast2Axes ) { <nl> + constexpr int kPrecision = 13 ; <nl> + constexpr int kDimensionSize1 = 1 < < ( kPrecision / 2 ) ; <nl> + constexpr int kDimensionSize2 = 1 < < ( kPrecision - kPrecision / 2 ) ; <nl> + constexpr int kMinMaxValue = 10 ; <nl> + constexpr int kMaxMaxValue = 64 ; <nl> + <nl> + random : : PhiloxRandom philox ( random : : New64 ( ) , random : : New64 ( ) ) ; <nl> + random : : SimplePhilox gen ( & philox ) ; <nl> + Tensor maxvalue { DT_INT16 , { 2 , 1 , 1 , 7 } } ; <nl> + PopulateMaxValues ( & gen , & maxvalue , kMinMaxValue , kMaxMaxValue ) ; <nl> + <nl> + Tensor data { DT_INT16 , { 2 , kDimensionSize1 , kDimensionSize2 , 7 } } ; <nl> + Tensor cdf { DT_INT32 , { 2 , 1 , 1 , 7 , kMaxMaxValue + 2 } } ; <nl> + BuildCdf ( & gen , & data , & cdf , maxvalue ) ; <nl> + TestEncodeAndDecode ( kPrecision , data , cdf ) ; <nl> + } <nl> + <nl> + TEST_F ( RangeCoderOpsTest , InvalidCdfShape ) { <nl> + Tensor data { DT_INT16 , { 3 , 3 } } ; <nl> + Tensor cdf { DT_INT32 , { 3 , 3 } } ; <nl> + <nl> + Tensor unused ; <nl> + { <nl> + const Status status = RunEncodeOp ( 10 , { data , cdf } , & unused ) ; <nl> + EXPECT_FALSE ( status . ok ( ) ) ; <nl> + EXPECT_NE ( status . error_message ( ) . find ( " ` cdf ` should have one more axis " ) , <nl> + string : : npos ) ; <nl> + } <nl> + <nl> + Tensor empty { DT_STRING , { } } ; <nl> + Tensor shape { DT_INT32 , { 2 } } ; <nl> + shape . vec < int32 > ( ) . setValues ( { 3 , 3 } ) ; <nl> + { <nl> + const Status status = RunDecodeOp ( 10 , { empty , shape , cdf } , & unused ) ; <nl> + EXPECT_FALSE ( status . ok ( ) ) ; <nl> + EXPECT_NE ( status . error_message ( ) . find ( " ` cdf ` should have one more axis " ) , <nl> + string : : npos ) ; <nl> + } <nl> + <nl> + cdf = Tensor { DT_INT32 , { 3 , 3 , 1 } } ; <nl> + { <nl> + const Status status = RunEncodeOp ( 10 , { data , cdf } , & unused ) ; <nl> + EXPECT_FALSE ( status . ok ( ) ) ; <nl> + EXPECT_NE ( <nl> + status . error_message ( ) . find ( " last dimension of ` cdf ` should be > 1 " ) , <nl> + string : : npos ) ; <nl> + } <nl> + { <nl> + const Status status = RunDecodeOp ( 10 , { empty , shape , cdf } , & unused ) ; <nl> + EXPECT_FALSE ( status . ok ( ) ) ; <nl> + EXPECT_NE ( <nl> + status . error_message ( ) . find ( " last dimension of ` cdf ` should be > 1 " ) , <nl> + string : : npos ) ; <nl> + } <nl> + } <nl> + <nl> + TEST_F ( RangeCoderOpsTest , DecoderShapeFn ) { <nl> + Tensor encoded_tensor { DT_STRING , { } } ; <nl> + Tensor shape_tensor { DT_INT32 , { 3 } } ; <nl> + Tensor cdf_tensor { DT_INT32 , { 4 , 6 , 8 , 2 } } ; <nl> + <nl> + shape_tensor . flat < int32 > ( ) . setValues ( { 4 , 6 , 8 } ) ; <nl> + <nl> + Graph g { OpRegistry : : Global ( ) } ; <nl> + Node * encoded = test : : graph : : Constant ( & g , encoded_tensor ) ; <nl> + Node * shape = test : : graph : : Constant ( & g , shape_tensor ) ; <nl> + Node * cdf = test : : graph : : Constant ( & g , cdf_tensor ) ; <nl> + Node * decode ; <nl> + TF_ASSERT_OK ( NodeBuilder ( " range_decode " , " RangeDecode " , g . op_registry ( ) ) <nl> + . Input ( encoded ) <nl> + . Input ( shape ) <nl> + . Input ( cdf ) <nl> + . Attr ( " precision " , 10 ) <nl> + . Finalize ( & g , & decode ) ) ; <nl> + <nl> + ShapeRefiner refiner { g . versions ( ) . producer ( ) , g . op_registry ( ) } ; <nl> + TF_ASSERT_OK ( refiner . AddNode ( encoded ) ) ; <nl> + TF_ASSERT_OK ( refiner . AddNode ( shape ) ) ; <nl> + TF_ASSERT_OK ( refiner . AddNode ( cdf ) ) ; <nl> + TF_ASSERT_OK ( refiner . AddNode ( decode ) ) ; <nl> + <nl> + auto * context = refiner . GetContext ( decode ) ; <nl> + ASSERT_NE ( context , nullptr ) ; <nl> + <nl> + ASSERT_EQ ( context - > num_outputs ( ) , 1 ) ; <nl> + auto shape_handle = context - > output ( 0 ) ; <nl> + <nl> + ASSERT_EQ ( context - > Rank ( shape_handle ) , 3 ) ; <nl> + EXPECT_EQ ( context - > Value ( context - > Dim ( shape_handle , 0 ) ) , 4 ) ; <nl> + EXPECT_EQ ( context - > Value ( context - > Dim ( shape_handle , 1 ) ) , 6 ) ; <nl> + EXPECT_EQ ( context - > Value ( context - > Dim ( shape_handle , 2 ) ) , 8 ) ; <nl> + } <nl> + <nl> + TEST_F ( RangeCoderOpsTest , InvalidBroadcast ) { <nl> + Tensor data { DT_INT16 , { 3 , 3 } } ; <nl> + Tensor cdf { DT_INT32 , { 3 , 2 , 2 } } ; <nl> + <nl> + Tensor unused ; <nl> + { <nl> + const Status status = RunEncodeOp ( 10 , { data , cdf } , & unused ) ; <nl> + EXPECT_FALSE ( status . ok ( ) ) ; <nl> + EXPECT_NE ( status . error_message ( ) . find ( " Cannot broadcast shape " ) , <nl> + string : : npos ) ; <nl> + } <nl> + <nl> + data = Tensor { DT_INT16 , { 3 , 1 } } ; <nl> + cdf = Tensor { DT_INT32 , { 3 , 3 , 2 } } ; <nl> + Tensor empty { DT_STRING , { } } ; <nl> + Tensor shape { DT_INT32 , { 2 } } ; <nl> + shape . vec < int32 > ( ) . setValues ( { 3 , 1 } ) ; <nl> + { <nl> + const Status status = RunDecodeOp ( 10 , { empty , shape , cdf } , & unused ) ; <nl> + EXPECT_FALSE ( status . ok ( ) ) ; <nl> + EXPECT_NE ( status . error_message ( ) . find ( " Cannot broadcast shape " ) , <nl> + string : : npos ) ; <nl> + } <nl> + <nl> + std : : vector < int64 > shape_vector = { 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 } ; <nl> + data = Tensor { DT_INT16 , TensorShape { shape_vector } } ; <nl> + cdf = Tensor { DT_INT32 , { 2 , 1 , 2 , 1 , 2 , 1 , 2 , 1 , 2 , 2 } } ; <nl> + { <nl> + const Status status = RunEncodeOp ( 10 , { data , cdf } , & unused ) ; <nl> + EXPECT_FALSE ( status . ok ( ) ) ; <nl> + EXPECT_NE ( status . error_message ( ) . find ( " Irregular broadcast " ) , string : : npos ) ; <nl> + } <nl> + <nl> + shape = Tensor { DT_INT32 , { static_cast < int64 > ( shape_vector . size ( ) ) } } ; <nl> + for ( int i = 0 ; i < shape_vector . size ( ) ; + + i ) { <nl> + shape . flat < int32 > ( ) ( i ) = shape_vector [ i ] ; <nl> + } <nl> + { <nl> + const Status status = RunDecodeOp ( 10 , { empty , shape , cdf } , & unused ) ; <nl> + EXPECT_FALSE ( status . ok ( ) ) ; <nl> + EXPECT_NE ( status . error_message ( ) . find ( " Irregular broadcast " ) , string : : npos ) ; <nl> + } <nl> + } <nl> + <nl> + / / Benchmark mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + / / This function creates RangeEncode graph with CDF built from a separate data <nl> + / / sample . <nl> + Graph * CreateRangeEncodeFullBroadcastGraph ( const TensorShape & shape , <nl> + int precision ) { <nl> + CHECK_EQ ( shape . dims ( ) , 4 ) ; <nl> + <nl> + constexpr int kAlphabetSize = 70 ; <nl> + <nl> + Tensor histogram { DT_INT32 , { kAlphabetSize + 1 } } ; <nl> + TTypes < int32 > : : Vec h = histogram . vec < int32 > ( ) ; <nl> + h . setConstant ( 1 ) ; <nl> + h ( 0 ) = 0 ; <nl> + <nl> + random : : PhiloxRandom philox ( random : : New64 ( ) , random : : New64 ( ) ) ; <nl> + random : : SimplePhilox gen ( & philox ) ; <nl> + for ( int i = 0 ; i < ( 1 < < precision ) - kAlphabetSize ; + + i ) { <nl> + const int value = LogUniform ( & gen , kAlphabetSize - 1 ) ; <nl> + h ( value + 1 ) + = 1 ; <nl> + } <nl> + <nl> + Tensor cdf { DT_INT32 , { 1 , 1 , 1 , 1 , kAlphabetSize + 1 } } ; <nl> + cdf . flat < int32 > ( ) = h . cumsum ( 0 ) ; <nl> + <nl> + Tensor data { DT_INT16 , shape } ; <nl> + TTypes < int16 > : : Flat d = data . flat < int16 > ( ) ; <nl> + for ( int64 i = 0 ; i < d . size ( ) ; + + i ) { <nl> + d ( i ) = LogUniform ( & gen , kAlphabetSize - 1 ) ; <nl> + } <nl> + <nl> + Graph * g = new Graph ( OpRegistry : : Global ( ) ) ; <nl> + TF_CHECK_OK ( NodeBuilder ( " range_encode " , " RangeEncode " , g - > op_registry ( ) ) <nl> + . Input ( test : : graph : : Constant ( g , data ) ) <nl> + . Input ( test : : graph : : Constant ( g , cdf ) ) <nl> + . Attr ( " precision " , precision ) <nl> + . Finalize ( g , nullptr ) ) ; <nl> + return g ; <nl> + } <nl> + <nl> + / / This function creates RangeDecode graph with CDF built from a separate data <nl> + / / sample . <nl> + Graph * CreateRangeDecodeFullBroadcastGraph ( const TensorShape & shape , <nl> + int precision ) { <nl> + CHECK_EQ ( shape . dims ( ) , 4 ) ; <nl> + <nl> + constexpr int kAlphabetSize = 200 ; <nl> + const int64 num_elements = shape . num_elements ( ) ; <nl> + <nl> + Tensor histogram { DT_INT32 , { kAlphabetSize + 1 } } ; <nl> + TTypes < int32 > : : Vec h = histogram . vec < int32 > ( ) ; <nl> + h . setConstant ( 1 ) ; <nl> + h ( 0 ) = 0 ; <nl> + <nl> + random : : PhiloxRandom philox ( random : : New64 ( ) , random : : New64 ( ) ) ; <nl> + random : : SimplePhilox gen ( & philox ) ; <nl> + for ( int i = 0 ; i < ( 1 < < precision ) - kAlphabetSize ; + + i ) { <nl> + const int value = LogUniform ( & gen , kAlphabetSize - 1 ) ; <nl> + h ( value + 1 ) + = 1 ; <nl> + } <nl> + <nl> + Tensor cdf_tensor { DT_INT32 , { 1 , 1 , 1 , 1 , kAlphabetSize + 1 } } ; <nl> + TTypes < int32 > : : Flat cdf = cdf_tensor . flat < int32 > ( ) ; <nl> + cdf = h . cumsum ( 0 ) ; <nl> + <nl> + Tensor string_tensor { DT_STRING , TensorShape { } } ; <nl> + string & sink = string_tensor . scalar < string > ( ) ( ) ; <nl> + <nl> + RangeEncoder encoder { precision } ; <nl> + for ( int64 i = 0 ; i < num_elements ; + + i ) { <nl> + const int value = LogUniform ( & gen , kAlphabetSize - 1 ) ; <nl> + encoder . Encode ( cdf ( value ) , cdf ( value + 1 ) , & sink ) ; <nl> + } <nl> + encoder . Finalize ( & sink ) ; <nl> + <nl> + Tensor shape_tensor { DT_INT32 , { shape . dims ( ) } } ; <nl> + for ( int i = 0 ; i < shape . dims ( ) ; + + i ) { <nl> + shape_tensor . flat < int32 > ( ) ( i ) = shape . dim_size ( i ) ; <nl> + } <nl> + <nl> + Graph * g = new Graph ( OpRegistry : : Global ( ) ) ; <nl> + TF_CHECK_OK ( NodeBuilder ( " range_decode " , " RangeDecode " , g - > op_registry ( ) ) <nl> + . Input ( test : : graph : : Constant ( g , string_tensor ) ) <nl> + . Input ( test : : graph : : Constant ( g , shape_tensor ) ) <nl> + . Input ( test : : graph : : Constant ( g , cdf_tensor ) ) <nl> + . Attr ( " precision " , precision ) <nl> + . Finalize ( g , nullptr ) ) ; <nl> + return g ; <nl> + } <nl> + <nl> + void RunTensorFlowBenchmark ( int iters , Graph * g , int64 num_elements ) { <nl> + SessionOptions opts ; <nl> + opts . config . set_intra_op_parallelism_threads ( 1 ) ; <nl> + opts . config . set_inter_op_parallelism_threads ( 1 ) ; <nl> + <nl> + testing : : UseRealTime ( ) ; <nl> + test : : Benchmark ( " cpu " , g , & opts ) . Run ( iters ) ; <nl> + <nl> + const int64 num_items = static_cast < int64 > ( iters ) * num_elements ; <nl> + testing : : ItemsProcessed ( num_items ) ; <nl> + } <nl> + <nl> + void BM_RangeEncodeFullBroadcast ( int iters , int code_size ) { <nl> + constexpr int kPrecision = 14 ; <nl> + const TensorShape shape = { 1 , code_size , code_size , 256 } ; <nl> + Graph * g = CreateRangeEncodeFullBroadcastGraph ( shape , kPrecision ) ; <nl> + RunTensorFlowBenchmark ( iters , g , shape . num_elements ( ) ) ; <nl> + } <nl> + <nl> + BENCHMARK ( BM_RangeEncodeFullBroadcast ) - > Arg ( 32 ) - > Arg ( 64 ) ; <nl> + <nl> + void BM_RangeDecodeFullBroadcast ( int iters , int code_size ) { <nl> + constexpr int kPrecision = 14 ; <nl> + const TensorShape shape = { 1 , code_size , code_size , 256 } ; <nl> + Graph * g = CreateRangeDecodeFullBroadcastGraph ( shape , kPrecision ) ; <nl> + RunTensorFlowBenchmark ( iters , g , shape . num_elements ( ) ) ; <nl> + } <nl> + <nl> + BENCHMARK ( BM_RangeDecodeFullBroadcast ) - > Arg ( 32 ) - > Arg ( 64 ) ; <nl> + <nl> + } / / namespace <nl> + } / / namespace tensorflow <nl> new file mode 100644 <nl> index 0000000000000 . . d66730cb4881e <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / kernels / range_coder_ops_util . cc <nl> <nl> + / * Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # include " tensorflow / contrib / coder / kernels / range_coder_ops_util . h " <nl> + <nl> + # include < vector > <nl> + <nl> + # include " tensorflow / core / framework / tensor_shape . h " <nl> + # include " tensorflow / core / lib / core / status . h " <nl> + # include " tensorflow / core / platform / macros . h " <nl> + # include " tensorflow / core / platform / types . h " <nl> + <nl> + using tensorflow : : errors : : InvalidArgument ; <nl> + <nl> + namespace tensorflow { <nl> + Status MergeAxes ( const TensorShape & broadcast_shape , <nl> + const TensorShape & storage_shape , <nl> + std : : vector < int64 > * merged_broadcast_shape_pointer , <nl> + std : : vector < int64 > * merged_storage_shape_pointer ) { <nl> + CHECK_EQ ( storage_shape . dims ( ) , broadcast_shape . dims ( ) + 1 ) ; <nl> + <nl> + std : : vector < int64 > & merged_broadcast_shape = * merged_broadcast_shape_pointer ; <nl> + std : : vector < int64 > & merged_storage_shape = * merged_storage_shape_pointer ; <nl> + <nl> + / / The shapes are simplified so that the conversions between linear index <nl> + / / and coordinates takes less CPU cycles . Two adjacent dimensions are <nl> + / / merged if they both are broadcasting dimensions or if they both are <nl> + / / non - broadcasting dimensions . <nl> + merged_broadcast_shape . resize ( 1 ) ; <nl> + merged_broadcast_shape [ 0 ] = 1 ; <nl> + merged_storage_shape . resize ( 1 ) ; <nl> + merged_storage_shape [ 0 ] = 1 ; <nl> + <nl> + for ( int i = 0 , j = 0 ; j < broadcast_shape . dims ( ) ; + + j ) { <nl> + if ( TF_PREDICT_FALSE ( <nl> + ( broadcast_shape . dim_size ( j ) ! = storage_shape . dim_size ( j ) ) & & <nl> + ( storage_shape . dim_size ( j ) ! = 1 ) ) ) { <nl> + return InvalidArgument ( " Cannot broadcast shape " , <nl> + storage_shape . DebugString ( ) , " to " , <nl> + broadcast_shape . DebugString ( ) ) ; <nl> + } <nl> + <nl> + const bool was_broadcasting = ( merged_storage_shape [ i ] = = 1 ) ; <nl> + const bool is_broadcasting = ( storage_shape . dim_size ( j ) = = 1 ) ; <nl> + <nl> + / / Merge two adjacent axes if they both are broadcasting or both are <nl> + / / non - broadcasting axes . The second and the third conditions in the if <nl> + / / clause below are when the previously merged axis or the next j - th axis <nl> + / / may be interpreted as either a broadcasting or a non - broadcasting axis . <nl> + const bool merge = ( was_broadcasting = = is_broadcasting ) | | <nl> + ( broadcast_shape . dim_size ( j ) < = 1 ) | | <nl> + ( merged_broadcast_shape [ i ] < = 1 ) ; <nl> + <nl> + if ( merge ) { <nl> + merged_broadcast_shape [ i ] * = broadcast_shape . dim_size ( j ) ; <nl> + merged_storage_shape [ i ] * = storage_shape . dim_size ( j ) ; <nl> + } else { <nl> + / / Move to the next axis . <nl> + merged_broadcast_shape . push_back ( broadcast_shape . dim_size ( j ) ) ; <nl> + merged_storage_shape . push_back ( storage_shape . dim_size ( j ) ) ; <nl> + + + i ; <nl> + } <nl> + } <nl> + <nl> + int64 storage_stride = 1 ; <nl> + for ( int i = broadcast_shape . dims ( ) ; i < storage_shape . dims ( ) ; + + i ) { <nl> + storage_stride * = storage_shape . dim_size ( i ) ; <nl> + } <nl> + merged_storage_shape . push_back ( storage_stride ) ; <nl> + <nl> + return Status : : OK ( ) ; <nl> + } <nl> + } / / namespace tensorflow <nl> new file mode 100644 <nl> index 0000000000000 . . 95241a8682891 <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / kernels / range_coder_ops_util . h <nl> <nl> + / * Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # ifndef THIRD_PARTY_TENSORFLOW_CONTRIB_CODER_KERNELS_RANGE_CODER_OPS_UTIL_H_ <nl> + # define THIRD_PARTY_TENSORFLOW_CONTRIB_CODER_KERNELS_RANGE_CODER_OPS_UTIL_H_ <nl> + <nl> + # include < vector > <nl> + <nl> + # include " tensorflow / core / framework / tensor_shape . h " <nl> + # include " tensorflow / core / lib / core / status . h " <nl> + # include " tensorflow / core / platform / types . h " <nl> + <nl> + namespace tensorflow { <nl> + / / The shapes are simplified to reduce indexing cost . <nl> + Status MergeAxes ( const TensorShape & broadcast_shape , <nl> + const TensorShape & storage_shape , <nl> + std : : vector < int64 > * merged_broadcast_shape_pointer , <nl> + std : : vector < int64 > * merged_storage_shape_pointer ) ; <nl> + } / / namespace tensorflow <nl> + <nl> + # endif / / THIRD_PARTY_TENSORFLOW_CONTRIB_CODER_KERNELS_RANGE_CODER_OPS_UTIL_H_ <nl> new file mode 100644 <nl> index 0000000000000 . . 442994bf7c756 <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / kernels / range_coder_test . cc <nl> <nl> + / * Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # include " tensorflow / contrib / coder / kernels / range_coder . h " <nl> + <nl> + # include < cmath > <nl> + <nl> + # include " tensorflow / core / lib / random / distribution_sampler . h " <nl> + # include " tensorflow / core / lib / random / philox_random . h " <nl> + # include " tensorflow / core / lib / random / random . h " <nl> + # include " tensorflow / core / lib / random / simple_philox . h " <nl> + # include " tensorflow / core / platform / test . h " <nl> + <nl> + namespace tensorflow { <nl> + namespace { <nl> + void RangeEncodeDecodeTest ( int precision , random : : SimplePhilox * gen ) { <nl> + constexpr int kAlphabetSize = 256 ; <nl> + <nl> + std : : vector < float > distribution_weight ; <nl> + distribution_weight . reserve ( kAlphabetSize ) ; <nl> + for ( int i = 1 ; i < = kAlphabetSize ; + + i ) { <nl> + distribution_weight . push_back ( std : : pow ( static_cast < float > ( i ) , - 2 . 0f ) ) ; <nl> + } <nl> + <nl> + random : : DistributionSampler sampler ( distribution_weight ) ; <nl> + <nl> + const int multiplier = ( precision > 7 ) ? 32 : 1 ; <nl> + std : : vector < int32 > histogram ( kAlphabetSize , multiplier - 1 ) ; <nl> + <nl> + const int data_size = <nl> + ( multiplier < < precision ) - histogram . size ( ) * ( multiplier - 1 ) ; <nl> + CHECK_GE ( data_size , 0 ) ; <nl> + std : : vector < uint8 > data ( data_size ) ; <nl> + for ( uint8 & x : data ) { <nl> + x = sampler . Sample ( gen ) ; <nl> + + + histogram [ x ] ; <nl> + } <nl> + <nl> + std : : vector < int32 > cdf ( histogram . size ( ) + 1 , 0 ) ; <nl> + int partial_sum = 0 ; <nl> + for ( int i = 0 ; i < histogram . size ( ) ; + + i ) { <nl> + partial_sum + = histogram [ i ] ; <nl> + cdf [ i + 1 ] = partial_sum / multiplier ; <nl> + } <nl> + <nl> + ASSERT_EQ ( cdf . front ( ) , 0 ) ; <nl> + ASSERT_EQ ( cdf . back ( ) , 1 < < precision ) ; <nl> + <nl> + std : : vector < double > ideal_code_length ( histogram . size ( ) ) ; <nl> + const double normalizer = static_cast < double > ( 1 < < precision ) ; <nl> + for ( int i = 0 ; i < ideal_code_length . size ( ) ; + + i ) { <nl> + ideal_code_length [ i ] = - std : : log2 ( ( cdf [ i + 1 ] - cdf [ i ] ) / normalizer ) ; <nl> + } <nl> + <nl> + RangeEncoder encoder ( precision ) ; <nl> + string encoded ; <nl> + double ideal_length = 0 . 0 ; <nl> + for ( uint8 x : data ) { <nl> + encoder . Encode ( cdf [ x ] , cdf [ x + 1 ] , & encoded ) ; <nl> + ideal_length + = ideal_code_length [ x ] ; <nl> + } <nl> + encoder . Finalize ( & encoded ) ; <nl> + <nl> + LOG ( INFO ) < < " Encoded string length ( bits ) : " < < 8 * encoded . size ( ) <nl> + < < " , whereas ideal " < < ideal_length < < " ( " <nl> + < < ( 8 * encoded . size ( ) ) / ideal_length < < " of ideal ) " <nl> + < < " ( ideal compression rate " < < ideal_length / ( 8 * data . size ( ) ) <nl> + < < " ) " ; <nl> + <nl> + RangeDecoder decoder ( encoded , precision ) ; <nl> + for ( int i = 0 ; i < data . size ( ) ; + + i ) { <nl> + const int32 decoded = decoder . Decode ( cdf ) ; <nl> + ASSERT_EQ ( decoded , static_cast < int32 > ( data [ i ] ) ) < < i ; <nl> + } <nl> + } <nl> + <nl> + TEST ( RangeCoderTest , Precision1To11 ) { <nl> + random : : PhiloxRandom gen ( random : : New64 ( ) , random : : New64 ( ) ) ; <nl> + random : : SimplePhilox rand ( & gen ) ; <nl> + const int precision = 1 + rand . Uniform ( 11 ) ; <nl> + RangeEncodeDecodeTest ( precision , & rand ) ; <nl> + } <nl> + <nl> + TEST ( RangeCoderTest , Precision12To16 ) { <nl> + random : : PhiloxRandom gen ( random : : New64 ( ) , random : : New64 ( ) ) ; <nl> + random : : SimplePhilox rand ( & gen ) ; <nl> + for ( int precision = 12 ; precision < 17 ; + + precision ) { <nl> + RangeEncodeDecodeTest ( precision , & rand ) ; <nl> + } <nl> + } <nl> + <nl> + TEST ( RangeCoderTest , FinalizeState0 ) { <nl> + constexpr int kPrecision = 2 ; <nl> + <nl> + string output ; <nl> + RangeEncoder encoder ( kPrecision ) ; <nl> + encoder . Encode ( 0 , 2 , & output ) ; <nl> + encoder . Finalize ( & output ) ; <nl> + <nl> + RangeDecoder decoder ( output , kPrecision ) ; <nl> + EXPECT_EQ ( decoder . Decode ( { 0 , 2 , 4 } ) , 0 ) ; <nl> + } <nl> + } / / namespace <nl> + } / / namespace tensorflow <nl> new file mode 100644 <nl> index 0000000000000 . . 9056d1a6963d7 <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / ops / coder_ops . cc <nl> <nl> + / * Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # include " tensorflow / core / framework / common_shape_fns . h " <nl> + # include " tensorflow / core / framework / op . h " <nl> + # include " tensorflow / core / framework / shape_inference . h " <nl> + # include " tensorflow / core / lib / core / status . h " <nl> + <nl> + namespace tensorflow { <nl> + using shape_inference : : InferenceContext ; <nl> + using shape_inference : : ShapeHandle ; <nl> + <nl> + / / clang - format off <nl> + REGISTER_OP ( " RangeEncode " ) <nl> + . Input ( " data : int16 " ) <nl> + . Input ( " cdf : int32 " ) <nl> + . Output ( " encoded : string " ) <nl> + . Attr ( " precision : int > = 1 " ) <nl> + . SetShapeFn ( shape_inference : : ScalarShape ) <nl> + . Doc ( R " doc ( <nl> + Using the provided cumulative distribution functions ( CDF ) inside ` cdf ` , returns <nl> + a range - code of ` data ` . <nl> + <nl> + The shape of ` cdf ` should have one more axis than the shape of ` data ` , and the <nl> + prefix ` cdf . shape [ : - 1 ] ` should be broadcastable to ` data . shape ` . That is , for <nl> + every ` i = 0 , . . . , rank ( data ) - 1 ` , the op requires that either <nl> + ` cdf . shape [ i ] = = 1 ` or ` cdf . shape [ i ] = = data . shape [ i ] ` . Note that this <nl> + broadcasting is limited in the sense that the number of axes must match , and <nl> + broadcasts only ` cdf ` but not ` data ` . <nl> + <nl> + ` data ` should have an upper bound ` m > 0 ` such that each element is an integer <nl> + in range ` [ 0 , m ) ` . Then the last dimension size of ` cdf ` must be ` m + 1 ` . For <nl> + each element of ` data ` , the innermost strip of ` cdf ` is a vector representing a <nl> + CDF . For each k = 0 , . . . , m , ` cdf [ . . . , k ] / 2 ^ precision ` is the probability that <nl> + an outcome is less than ` k ` ( not less than or equal to ) . <nl> + <nl> + ` ` ` <nl> + cdf [ . . . , 0 ] / 2 ^ precision = Pr ( data [ . . . ] < 0 ) <nl> + cdf [ . . . , 1 ] / 2 ^ precision = Pr ( data [ . . . ] < 1 ) = Pr ( data [ . . . ] < = 0 ) <nl> + cdf [ . . . , 2 ] / 2 ^ precision = Pr ( data [ . . . ] < 2 ) = Pr ( data [ . . . ] < = 1 ) <nl> + . . . <nl> + cdf [ . . . , m ] / 2 ^ precision = Pr ( data [ . . . ] < m ) = 1 <nl> + ` ` ` <nl> + <nl> + Therefore each element of ` cdf ` must be in ` [ 0 , 2 ^ precision ] ` . <nl> + <nl> + Ideally ` cdf [ . . . , m ] ` should equal to ` 2 ^ precision ` but this is not a hard <nl> + requirement as long as ` cdf [ . . . , m ] < = 2 ^ precision ` . <nl> + <nl> + The encoded string neither contains the shape information of the encoded data <nl> + nor a termination symbol . Therefore the shape of the encoded data must be <nl> + explicitly provided to the decoder . <nl> + <nl> + Implementation notes : <nl> + <nl> + - Because of potential performance issues , the op does not check whether <nl> + elements of ` data ` is in the correct range ` [ 0 , m ) ` , or if ` cdf ` satisfies <nl> + monotonic increase property . <nl> + <nl> + - For the range coder to decode the encoded string correctly , the decoder should <nl> + be able to reproduce the internal states of the encoder precisely . Otherwise , <nl> + the decoding would fail and once an error occur , all subsequent decoded values <nl> + are incorrect . For this reason , the range coder uses integer arithmetics and <nl> + avoids using any floating point operations internally , and ` cdf ` should contain <nl> + integers representing quantized probability mass rather than floating points . <nl> + <nl> + data : An int32 tensor . <nl> + cdf : An int32 tensor representing the CDF ' s of ` data ` . Each integer is divided <nl> + by ` 2 ^ precision ` to represent a fraction . <nl> + encoded : A range - coded scalar string . <nl> + precision : The number of bits for probability quantization . Must be < = 16 . <nl> + ) doc " ) ; <nl> + <nl> + <nl> + REGISTER_OP ( " RangeDecode " ) <nl> + . Input ( " encoded : string " ) <nl> + . Input ( " shape : int32 " ) <nl> + . Input ( " cdf : int32 " ) <nl> + . Output ( " decoded : int16 " ) <nl> + . Attr ( " precision : int > = 1 " ) <nl> + . SetShapeFn ( [ ] ( InferenceContext * c ) { <nl> + ShapeHandle out ; <nl> + TF_RETURN_IF_ERROR ( c - > MakeShapeFromShapeTensor ( 1 , & out ) ) ; <nl> + c - > set_output ( 0 , out ) ; <nl> + return Status : : OK ( ) ; <nl> + } ) <nl> + . Doc ( R " doc ( <nl> + Decodes a range - coded ` code ` into an int32 tensor of shape ` shape ` . <nl> + <nl> + This is the reverse op of RangeEncode . The shape of the tensor that was encoded <nl> + should be known by the caller . <nl> + <nl> + Implementation notes : <nl> + <nl> + - If wrong input was given ( e . g . , corrupt ` encoded ` string , or ` cdf ` or <nl> + ` precision ` do not match encoder ) , the decode is unsuccessful . Because of <nl> + potential performance issues , the decoder does not return error status . <nl> + <nl> + encoded : A scalar string tensor from RangeEncode . <nl> + shape : An int32 1 - D tensor representing the shape of the data encoded by <nl> + RangeEncode . <nl> + decoded : An int32 tensor with shape equal to ` shape ` . <nl> + precision : The number of bits for probability quantization . Must be < = 16 , and <nl> + must match the precision used by RangeEncode that produced ` encoded ` . <nl> + ) doc " ) ; <nl> + / / clang - format on <nl> + } / / namespace tensorflow <nl> new file mode 100644 <nl> index 0000000000000 . . bb262e338baf1 <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / python / ops / coder_ops . py <nl> <nl> + # Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + # <nl> + # Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + # you may not use this file except in compliance with the License . <nl> + # You may obtain a copy of the License at <nl> + # <nl> + # http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + # <nl> + # Unless required by applicable law or agreed to in writing , software <nl> + # distributed under the License is distributed on an " AS IS " BASIS , <nl> + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + # See the License for the specific language governing permissions and <nl> + # limitations under the License . <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + " " " Range coder operations . " " " <nl> + <nl> + from __future__ import absolute_import <nl> + from __future__ import division <nl> + from __future__ import print_function <nl> + <nl> + # pylint : disable = wildcard - import , unused - import <nl> + from tensorflow . contrib . coder . python . ops import gen_coder_ops <nl> + from tensorflow . contrib . coder . python . ops . gen_coder_ops import * <nl> + # pylint : enable = wildcard - import , unused - import <nl> + from tensorflow . contrib . util import loader <nl> + from tensorflow . python . platform import resource_loader <nl> + <nl> + <nl> + _coder_ops = loader . load_op_library ( <nl> + resource_loader . get_path_to_datafile ( " _coder_ops . so " ) ) <nl> new file mode 100644 <nl> index 0000000000000 . . d5e14e7a641b5 <nl> mmm / dev / null <nl> ppp b / tensorflow / contrib / coder / python / ops / coder_ops_test . py <nl> <nl> + # Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + # <nl> + # Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + # you may not use this file except in compliance with the License . <nl> + # You may obtain a copy of the License at <nl> + # <nl> + # http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + # <nl> + # Unless required by applicable law or agreed to in writing , software <nl> + # distributed under the License is distributed on an " AS IS " BASIS , <nl> + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + # See the License for the specific language governing permissions and <nl> + # limitations under the License . <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + " " " Coder operations tests . " " " <nl> + <nl> + from __future__ import absolute_import <nl> + from __future__ import division <nl> + from __future__ import print_function <nl> + <nl> + from tensorflow . contrib . coder . python . ops import coder_ops <nl> + from tensorflow . python . framework import dtypes <nl> + from tensorflow . python . ops import array_ops <nl> + from tensorflow . python . ops import math_ops <nl> + from tensorflow . python . ops import random_ops <nl> + from tensorflow . python . platform import test <nl> + <nl> + <nl> + class CoderOpsTest ( test . TestCase ) : <nl> + " " " Coder ops test . <nl> + <nl> + Coder ops have C + + tests . Python test just ensures that Python binding is not <nl> + broken . <nl> + " " " <nl> + <nl> + def testReadmeExample ( self ) : <nl> + data = random_ops . random_uniform ( ( 128 , 128 ) , 0 , 10 , dtype = dtypes . int32 ) <nl> + histogram = math_ops . bincount ( data , minlength = 10 , maxlength = 10 ) <nl> + cdf = math_ops . cumsum ( histogram , exclusive = False ) <nl> + cdf = array_ops . pad ( cdf , [ [ 1 , 0 ] ] ) <nl> + cdf = array_ops . reshape ( cdf , [ 1 , 1 , - 1 ] ) <nl> + <nl> + data = math_ops . cast ( data , dtypes . int16 ) <nl> + encoded = coder_ops . range_encode ( data , cdf , precision = 14 ) <nl> + decoded = coder_ops . range_decode ( <nl> + encoded , array_ops . shape ( data ) , cdf , precision = 14 ) <nl> + <nl> + with self . test_session ( ) as sess : <nl> + self . assertAllEqual ( * sess . run ( ( data , decoded ) ) ) <nl> + <nl> + <nl> + if __name__ = = ' __main__ ' : <nl> + test . main ( ) <nl> mmm a / tensorflow / contrib / data / python / kernel_tests / dataset_constructor_op_test . py <nl> ppp b / tensorflow / contrib / data / python / kernel_tests / dataset_constructor_op_test . py <nl> def testSplitPipelineFailsWithPlacementError ( self ) : <nl> sess . run ( var_1 . initializer ) <nl> <nl> iterator = dataset . make_initializable_iterator ( ) <nl> + sess . run ( iterator . initializer ) <nl> <nl> with self . assertRaisesRegexp ( <nl> - errors . InvalidArgumentError , <nl> - " Trying to access resource located in device " ) : <nl> - sess . run ( iterator . initializer ) <nl> + errors . FailedPreconditionError , <nl> + " Error while reading resource variable Variable " ) : <nl> + sess . run ( iterator . get_next ( ) ) <nl> <nl> def testRestructureDataset ( self ) : <nl> components = ( array_ops . placeholder ( dtypes . int32 ) , <nl> mmm a / tensorflow / contrib / data / python / kernel_tests / map_dataset_op_test . py <nl> ppp b / tensorflow / contrib / data / python / kernel_tests / map_dataset_op_test . py <nl> def testCaptureUninitializedVariableError ( self ) : <nl> contrib_dataset_ops . Dataset . from_tensors ( 0 ) . repeat ( 10 ) <nl> . map ( lambda _ : counter_var . assign_add ( 1 ) ) . make_initializable_iterator ( ) ) <nl> init_op = iterator . initializer <nl> + get_next = iterator . get_next ( ) <nl> <nl> with self . test_session ( ) as sess : <nl> - with self . assertRaisesRegexp ( errors . FailedPreconditionError , <nl> - " Failed to capture resource " ) : <nl> - sess . run ( init_op ) <nl> + sess . run ( init_op ) <nl> + with self . assertRaises ( errors . NotFoundError ) : <nl> + sess . run ( get_next ) <nl> <nl> def testSeededStatefulOperatorIsProperlyStateful ( self ) : <nl> iterator = ( <nl> def _build_graph ( ) : <nl> ds = _build_ds ( captured_iterator ) <nl> iterator = ds . make_initializable_iterator ( ) <nl> init_op = iterator . initializer <nl> - return captured_iterator . initializer , init_op <nl> + get_next = iterator . get_next ( ) <nl> + return captured_iterator . initializer , init_op , get_next <nl> <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> - captured_init_op , init_op = _build_graph ( ) <nl> + captured_init_op , init_op , get_next = _build_graph ( ) <nl> with self . test_session ( graph = g ) as sess : <nl> sess . run ( captured_init_op ) <nl> - with self . assertRaises ( errors . UnimplementedError ) : <nl> - # CapturedFunction does not support capturing IteratorResource . <nl> - sess . run ( init_op ) <nl> + sess . run ( init_op ) <nl> + for i in range ( 10 ) : <nl> + self . assertEquals ( i * i , sess . run ( get_next ) ) <nl> + with self . assertRaises ( errors . OutOfRangeError ) : <nl> + sess . run ( get_next ) <nl> <nl> <nl> class MapDatasetSerializationTest ( <nl> mmm a / tensorflow / contrib / eager / python / tfe . py <nl> ppp b / tensorflow / contrib / eager / python / tfe . py <nl> <nl> @ @ EagerVariableStore <nl> <nl> @ @ Network <nl> + @ @ Sequential <nl> @ @ save_network_checkpoint <nl> @ @ restore_network_checkpoint <nl> <nl> <nl> from tensorflow . contrib . eager . python import metrics <nl> from tensorflow . contrib . eager . python . datasets import Iterator <nl> from tensorflow . contrib . eager . python . network import Network <nl> + from tensorflow . contrib . eager . python . network import Sequential <nl> from tensorflow . contrib . eager . python . network import save_network_checkpoint <nl> from tensorflow . contrib . eager . python . network import restore_network_checkpoint <nl> from tensorflow . contrib . eager . python . saver import get_optimizer_variables <nl> mmm a / tensorflow / contrib / tensorboard / db / schema . cc <nl> ppp b / tensorflow / contrib / tensorboard / db / schema . cc <nl> Status SetupTensorboardSqliteDb ( Sqlite * db ) { <nl> / / inserted_time : Float UNIX timestamp with µs precision . This is <nl> / / always the wall time of when the row was inserted into the <nl> / / DB . It may be used as a hint for an archival job . <nl> - / / node_def : Contains tf . GraphDef proto . All fields will be cleared <nl> - / / except those not expressed in SQL . <nl> + / / graph_def : Contains the tf . GraphDef proto parts leftover which <nl> + / / haven ' t been defined in SQL yet . <nl> s . Update ( Run ( db , R " sql ( <nl> CREATE TABLE IF NOT EXISTS Graphs ( <nl> rowid INTEGER PRIMARY KEY , <nl> Status SetupTensorboardSqliteDb ( Sqlite * db ) { <nl> / / node_def . name proto field must not be cleared . <nl> / / op : Copied from tf . NodeDef proto . <nl> / / device : Copied from tf . NodeDef proto . <nl> - / / node_def : Contains tf . NodeDef proto . All fields will be cleared <nl> - / / except those not expressed in SQL . <nl> + / / node_def : Contains the tf . NodeDef proto parts leftover which <nl> + / / haven ' t been defined in SQL yet . <nl> / / <nl> / / TODO ( jart ) : Make separate tables for op and device strings . <nl> s . Update ( Run ( db , R " sql ( <nl> mmm a / tensorflow / contrib / tpu / profiler / BUILD <nl> ppp b / tensorflow / contrib / tpu / profiler / BUILD <nl> cc_library ( <nl> tf_cc_binary ( <nl> name = " capture_tpu_profile " , <nl> srcs = [ " capture_tpu_profile . cc " ] , <nl> - visibility = [ " / / tensorflow / contrib / tpu / profiler : __subpackages__ " ] , <nl> + visibility = [ " / / visibility : public " ] , <nl> deps = [ <nl> " : dump_tpu_profile " , <nl> " : tpu_profiler_proto_cc " , <nl> mmm a / tensorflow / contrib / tpu / python / tpu / tpu_estimator . py <nl> ppp b / tensorflow / contrib / tpu / python / tpu / tpu_estimator . py <nl> def is_running_on_cpu ( self ) : <nl> <nl> @ property <nl> def global_batch_size ( self ) : <nl> - return self . _train_batch_size <nl> + mode = self . _assert_mode ( ) <nl> + if mode = = model_fn_lib . ModeKeys . EVAL and self . _eval_batch_size is None : <nl> + raise RuntimeError ( ' Internal error , EVAL on TPU is not enabled , but ' <nl> + ' ` global_batch_size ` is called . ' ) <nl> + return ( self . _train_batch_size <nl> + if mode = = model_fn_lib . ModeKeys . TRAIN else self . _eval_batch_size ) <nl> <nl> @ property <nl> def batch_size_for_input_fn ( self ) : <nl> def _model_fn ( features , labels , mode , config , params ) : <nl> _train_on_tpu_system ( ctx , model_fn_wrapper , dequeue_fn ) ) <nl> hooks = [ <nl> TPUInfeedOutfeedSessionHook ( ctx , enqueue_ops ) , <nl> - ExamplesPerSecondHook ( self . _ctx . global_batch_size ) , <nl> + ExamplesPerSecondHook ( ctx . global_batch_size ) , <nl> training . LoggingTensorHook ( <nl> - { ' loss ' : array_ops . identity ( loss ) , <nl> - ' step ' : training . get_global_step ( ) } , <nl> + { <nl> + ' loss ' : array_ops . identity ( loss ) , <nl> + ' step ' : training . get_global_step ( ) <nl> + } , <nl> every_n_secs = 30 ) <nl> ] <nl> summary . scalar ( model_fn_lib . LOSS_METRIC_KEY , loss ) <nl> def __enter__ ( self ) : <nl> <nl> def __exit__ ( self , _ , __ , ___ ) : # pylint : disable = invalid - name <nl> self . _g . _set_control_flow_context ( self . _old ) # pylint : disable = protected - access <nl> - <nl> - <nl> new file mode 100644 <nl> index 0000000000000 . . a6c4d0d4008f3 <nl> mmm / dev / null <nl> ppp b / tensorflow / core / api_def / base_api / api_def_MatrixLogarithm . pbtxt <nl> <nl> + op { <nl> + graph_op_name : " MatrixLogarithm " <nl> + visibility : HIDDEN <nl> + in_arg { <nl> + name : " input " <nl> + description : < < END <nl> + Shape is ` [ . . . , M , M ] ` . <nl> + END <nl> + } <nl> + out_arg { <nl> + name : " output " <nl> + description : < < END <nl> + Shape is ` [ . . . , M , M ] ` . <nl> + <nl> + @ compatibility ( scipy ) <nl> + Equivalent to scipy . linalg . logm <nl> + @ end_compatibility <nl> + END <nl> + } <nl> + summary : " Computes the matrix logarithm of one or more square matrices : " <nl> + description : < < END <nl> + <nl> + log ( exp ( A ) ) = A <nl> + <nl> + This op is only defined for complex matrices . If A is positive - definite and <nl> + real , then casting to a complex matrix , taking the logarithm and casting back <nl> + to a real matrix will give the correct result . <nl> + <nl> + This function computes the matrix logarithm using the Schur - Parlett algorithm . <nl> + Details of the algorithm can be found in Section 11 . 6 . 2 of : <nl> + Nicholas J . Higham , Functions of Matrices : Theory and Computation , SIAM 2008 . <nl> + ISBN 978 - 0 - 898716 - 46 - 7 . <nl> + <nl> + The input is a tensor of shape ` [ . . . , M , M ] ` whose inner - most 2 dimensions <nl> + form square matrices . The output is a tensor of the same shape as the input <nl> + containing the exponential for all input submatrices ` [ . . . , : , : ] ` . <nl> + END <nl> + } <nl> mmm a / tensorflow / core / common_runtime / device . h <nl> ppp b / tensorflow / core / common_runtime / device . h <nl> class Device : public DeviceBase { <nl> return BuildDeviceAttributes ( name , device , memory_limit , locality , " " ) ; <nl> } <nl> <nl> + / / Clears the resource manager associated with this device . <nl> + void ClearResourceMgr ( ) { rmgr_ - > Clear ( ) ; } <nl> + <nl> protected : <nl> void DeleteResourceMgr ( ) { <nl> delete rmgr_ ; <nl> mmm a / tensorflow / core / common_runtime / direct_session . cc <nl> ppp b / tensorflow / core / common_runtime / direct_session . cc <nl> DirectSession : : DirectSession ( const SessionOptions & options , <nl> factory_ ( factory ) , <nl> cancellation_manager_ ( new CancellationManager ( ) ) , <nl> operation_timeout_in_ms_ ( options_ . config . operation_timeout_in_ms ( ) ) { <nl> - const int thread_pool_size = <nl> - options_ . config . session_inter_op_thread_pool_size ( ) ; <nl> + const int thread_pool_size = <nl> + options_ . config . session_inter_op_thread_pool_size ( ) ; <nl> if ( thread_pool_size > 0 ) { <nl> for ( int i = 0 ; i < thread_pool_size ; + + i ) { <nl> thread : : ThreadPool * pool = nullptr ; <nl> DirectSession : : ~ DirectSession ( ) { <nl> for ( auto d : device_mgr_ - > ListDevices ( ) ) { <nl> d - > op_segment ( ) - > RemoveHold ( session_handle_ ) ; <nl> } <nl> + for ( auto d : device_mgr_ - > ListDevices ( ) ) { <nl> + d - > ClearResourceMgr ( ) ; <nl> + } <nl> + functions_ . clear ( ) ; <nl> delete cancellation_manager_ ; <nl> for ( const auto & p_and_owned : thread_pools_ ) { <nl> if ( p_and_owned . second ) delete p_and_owned . first ; <nl> Status DirectSession : : GetOrCreateExecutors ( <nl> } <nl> <nl> std : : shared_ptr < ExecutorsAndKeys > ek ( new ExecutorsAndKeys ) ; <nl> + std : : unique_ptr < FunctionInfo > func_info ( new FunctionInfo ) ; <nl> <nl> / / The executor_lock_ is intentionally released while executor is <nl> / / being created . <nl> std : : unordered_map < string , std : : unique_ptr < Graph > > graphs ; <nl> - TF_RETURN_IF_ERROR ( CreateGraphs ( options , & graphs , & ek - > flib_def , <nl> + TF_RETURN_IF_ERROR ( CreateGraphs ( options , & graphs , & func_info - > flib_def , <nl> run_state_args , & ek - > input_types , <nl> & ek - > output_types ) ) ; <nl> <nl> Status DirectSession : : GetOrCreateExecutors ( <nl> graph_def_version = <nl> execution_state_ - > original_graph_def ( ) . versions ( ) . producer ( ) ; <nl> } <nl> - ek - > proc_flr . reset ( new ProcessFunctionLibraryRuntime ( <nl> - device_mgr_ . get ( ) , options_ . env , graph_def_version , ek - > flib_def . get ( ) , <nl> - optimizer_opts ) ) ; <nl> + func_info - > proc_flr . reset ( new ProcessFunctionLibraryRuntime ( <nl> + device_mgr_ . get ( ) , options_ . env , graph_def_version , <nl> + func_info - > flib_def . get ( ) , optimizer_opts ) ) ; <nl> <nl> GraphOptimizer optimizer ( optimizer_opts ) ; <nl> for ( auto iter = graphs . begin ( ) ; iter ! = graphs . end ( ) ; + + iter ) { <nl> Status DirectSession : : GetOrCreateExecutors ( <nl> <nl> ek - > items . resize ( ek - > items . size ( ) + 1 ) ; <nl> auto * item = & ( ek - > items . back ( ) ) ; <nl> - auto lib = ek - > proc_flr - > GetFLR ( partition_name ) ; <nl> + auto lib = func_info - > proc_flr - > GetFLR ( partition_name ) ; <nl> if ( lib = = nullptr ) { <nl> return errors : : Internal ( " Could not find device : " , partition_name ) ; <nl> } <nl> Status DirectSession : : GetOrCreateExecutors ( <nl> <nl> / / Reacquire the lock , try to insert into the map . <nl> mutex_lock l ( executor_lock_ ) ; <nl> + functions_ . push_back ( std : : move ( func_info ) ) ; <nl> <nl> / / Another thread may have created the entry before us , in which case we will <nl> / / reuse the already created one . <nl> mmm a / tensorflow / core / common_runtime / direct_session . h <nl> ppp b / tensorflow / core / common_runtime / direct_session . h <nl> class DirectSession : public Session { <nl> / / a partition of the graph bundled with its dependent library runtime . <nl> / / ' input_keys ' are the rendezvous keys for the feeds and ' output_keys ' <nl> / / are rendezvous keys for the fetches . <nl> - / / ' flib_def ' is the function library used by graphs in ' items ' . <nl> - / / ' proc_flr ' is the collection of FunctionLibraryRuntime objects , one per <nl> - / / device . <nl> - / / TODO ( phawkins ) : currently partitions always share the same function <nl> - / / library . Consider giving each partition its own function library to enable <nl> - / / per - partition rewrites . <nl> struct ExecutorsAndKeys { <nl> ExecutorsAndKeys ( ) : step_count ( 0 ) { } <nl> <nl> std : : atomic_int_fast64_t step_count ; <nl> std : : unique_ptr < Graph > graph ; <nl> NameNodeMap name_to_node ; <nl> - std : : unique_ptr < FunctionLibraryDefinition > flib_def ; <nl> - std : : unique_ptr < ProcessFunctionLibraryRuntime > proc_flr ; <nl> std : : vector < PerPartitionExecutorsAndLib > items ; <nl> std : : unordered_map < string , size_t > input_name_to_index ; <nl> std : : unordered_map < string , string > input_name_to_rendezvous_key ; <nl> class DirectSession : public Session { <nl> DataTypeVector output_types ; <nl> } ; <nl> <nl> + / / A FunctionInfo object is created for every unique set of feeds / fetches . <nl> + / / This info could be folded into the ExecutorsAndKeys object but we would <nl> + / / like to maintain a deletion order in which the OpKernels ( owned by the <nl> + / / executor ) should be destroyed first , followed by the resources in the <nl> + / / device and then followed by the function stuff . <nl> + / / TODO ( rohanj ) : Consolidate function library definitions so that we can <nl> + / / instantiate only one ProcFLR and lib_def and make this just a member <nl> + / / variable and not a vector . <nl> + / / ' flib_def ' is the function library used . <nl> + / / ' proc_flr ' is the collection of FunctionLibraryRuntime objects , one per <nl> + / / device . <nl> + struct FunctionInfo { <nl> + std : : unique_ptr < FunctionLibraryDefinition > flib_def ; <nl> + std : : unique_ptr < ProcessFunctionLibraryRuntime > proc_flr ; <nl> + } ; <nl> + <nl> / / For each live partial execution , the session maintains a RunState . <nl> / / ' status ' is the current status of this partial execution . ' executor_done ' <nl> / / is " notified " when all executors are done . ' pending_inputs ' are the set <nl> class DirectSession : public Session { <nl> / / Schedules ' c ' for execution on pool . <nl> void SchedClosure ( thread : : ThreadPool * pool , std : : function < void ( ) > c ) ; <nl> <nl> + std : : vector < std : : unique_ptr < FunctionInfo > > functions_ <nl> + GUARDED_BY ( executor_lock_ ) ; <nl> + <nl> mutex executor_lock_ ; / / protects executors_ <nl> / / Holds mappings from signature to the executors that process <nl> / / it . The reason for a level of indirection around mapped_type is <nl> mmm a / tensorflow / core / common_runtime / executor . cc <nl> ppp b / tensorflow / core / common_runtime / executor . cc <nl> void SetMemory ( NodeExecStatsWrapper * stats , OpKernelContext * ctx ) { <nl> stats - > AddAllocation ( allocator_pair . first , allocator_pair . second ) ; <nl> } <nl> auto * ms = stats - > stats ( ) - > mutable_memory_stats ( ) ; <nl> - ms - > set_host_temp_memory_size ( ctx - > host_temp_memory_size ( ) ) ; <nl> - ms - > set_device_temp_memory_size ( ctx - > device_temp_memory_size ( ) ) ; <nl> - for ( const auto & alloc_id : ctx - > host_persistent_alloc_ids ( ) ) { <nl> - ms - > mutable_host_persistent_tensor_alloc_ids ( ) - > Add ( alloc_id ) ; <nl> + ms - > set_temp_memory_size ( ctx - > temp_memory_size ( ) ) ; <nl> + for ( const auto & alloc_id : ctx - > persistent_alloc_ids ( ) ) { <nl> + ms - > mutable_persistent_tensor_alloc_ids ( ) - > Add ( alloc_id ) ; <nl> } <nl> - for ( const auto & alloc_id : ctx - > device_persistent_alloc_ids ( ) ) { <nl> - ms - > mutable_device_persistent_tensor_alloc_ids ( ) - > Add ( alloc_id ) ; <nl> - } <nl> - ms - > set_host_persistent_memory_size ( ctx - > host_persistent_memory_allocated ( ) ) ; <nl> - ms - > set_device_persistent_memory_size ( <nl> - ctx - > device_persistent_memory_allocated ( ) ) ; <nl> + ms - > set_persistent_memory_size ( ctx - > persistent_memory_allocated ( ) ) ; <nl> } <nl> <nl> void SetReferencedTensors ( NodeExecStatsWrapper * stats , <nl> mmm a / tensorflow / core / common_runtime / function . cc <nl> ppp b / tensorflow / core / common_runtime / function . cc <nl> FunctionLibraryRuntimeImpl : : FunctionLibraryRuntimeImpl ( <nl> } <nl> <nl> FunctionLibraryRuntimeImpl : : ~ FunctionLibraryRuntimeImpl ( ) { <nl> + / / The most common patterns of FLR usage don ' t require the caller to <nl> + / / explicitly release handles . As a result , we try to unref each item until <nl> + / / it ' s erased . <nl> for ( auto item : items_ ) { <nl> - if ( item . second ) item . second - > Unref ( ) ; <nl> + if ( item . second ) { <nl> + while ( ! item . second - > Unref ( ) ) { <nl> + } <nl> + } <nl> } <nl> } <nl> <nl> Status FunctionLibraryRuntimeImpl : : Instantiate ( <nl> const string key = Canonicalize ( function_name , attrs , options_copy ) ; <nl> * handle = parent_ - > GetHandle ( key ) ; <nl> if ( * handle ! = kInvalidHandle ) { <nl> + mutex_lock l ( mu_ ) ; <nl> + items_ [ parent_ - > GetHandleOnDevice ( device_name_ , * handle ) ] - > Ref ( ) ; <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> Status FunctionLibraryRuntimeImpl : : Instantiate ( <nl> * handle = parent_ - > GetHandle ( key ) ; <nl> if ( * handle ! = kInvalidHandle ) { <nl> delete fbody ; <nl> + items_ [ parent_ - > GetHandleOnDevice ( device_name_ , * handle ) ] - > Ref ( ) ; <nl> } else { <nl> * handle = parent_ - > AddHandle ( key , device_name_ , next_handle_ ) ; <nl> Item * item = new Item ; <nl> mmm a / tensorflow / core / common_runtime / function_test . cc <nl> ppp b / tensorflow / core / common_runtime / function_test . cc <nl> TEST_F ( FunctionLibraryRuntimeTest , PruneBody ) { <nl> FunctionLibraryRuntime : : Options opts ; <nl> opts . stats_collector = & stats_collector ; <nl> TF_CHECK_OK ( Run ( flr0_ , handle , opts , { x } , { & y } ) ) ; <nl> + TF_CHECK_OK ( flr0_ - > ReleaseHandle ( handle ) ) ; <nl> <nl> TF_CHECK_OK ( InstantiateAndRun ( flr0_ , " SquareAndAddOneWithStatefulNodes " , { } , <nl> { x } , { & y } ) ) ; <nl> mmm a / tensorflow / core / framework / cost_graph . proto <nl> ppp b / tensorflow / core / framework / cost_graph . proto <nl> message CostGraphDef { <nl> / / Temporary memory used by this node . <nl> int64 temporary_memory_size = 6 ; <nl> <nl> - int64 host_temp_memory_size = 10 ; <nl> - int64 device_temp_memory_size = 11 ; <nl> - int64 host_persistent_memory_size = 12 ; <nl> - int64 device_persistent_memory_size = 16 ; <nl> + / / Persistent memory used by this node . <nl> + int64 persistent_memory_size = 12 ; <nl> + <nl> + int64 host_temp_memory_size = 10 [ deprecated = true ] ; <nl> + int64 device_temp_memory_size = 11 [ deprecated = true ] ; <nl> + int64 device_persistent_memory_size = 16 [ deprecated = true ] ; <nl> <nl> / / Estimate of the computational cost of this node , in microseconds . <nl> int64 compute_cost = 9 ; <nl> mmm a / tensorflow / core / framework / op_kernel . cc <nl> ppp b / tensorflow / core / framework / op_kernel . cc <nl> OpKernelContext : : OpKernelContext ( Params * params ) <nl> OpKernelContext : : OpKernelContext ( Params * params , int num_outputs ) <nl> : params_ ( params ) , <nl> outputs_ ( num_outputs ) , <nl> - host_temp_memory_size_ ( 0 ) , <nl> - device_temp_memory_size_ ( 0 ) , <nl> - host_persistent_memory_allocated_ ( 0 ) , <nl> - device_persistent_memory_allocated_ ( 0 ) { <nl> + temp_memory_size_ ( 0 ) , <nl> + persistent_memory_allocated_ ( 0 ) { <nl> Allocator * eigen_gpu_allocator = get_allocator ( AllocatorAttributes ( ) ) ; <nl> params_ - > ensure_eigen_gpu_device ( ) ; <nl> params_ - > device - > ReinitializeGpuDevice ( this , params_ - > eigen_gpu_device , <nl> Status OpKernelContext : : allocate_temp ( <nl> if ( a - > TracksAllocationSizes ( ) ) { <nl> int64 alloc_size = <nl> a - > AllocatedSize ( const_cast < char * > ( out_temp - > tensor_data ( ) . data ( ) ) ) ; <nl> - if ( allocate_on_host ( allocator_attr ) ) { <nl> - record_host_temp_memory_size ( alloc_size ) ; <nl> - } else { <nl> - record_device_temp_memory_size ( alloc_size ) ; <nl> - } <nl> + record_temp_memory_size ( alloc_size ) ; <nl> } <nl> } <nl> return s ; <nl> bool OpKernelContext : : allocate_on_host ( AllocatorAttributes alloc_attr ) const { <nl> return alloc_attr . on_host ( ) | | device ( ) - > attributes ( ) . device_type ( ) = = " CPU " ; <nl> } <nl> <nl> - void OpKernelContext : : record_host_persistent_memory_allocation ( int64 size , <nl> - int64 alloc_id ) { <nl> - host_persistent_memory_allocated_ + = size ; <nl> - host_persistent_alloc_ids_ . push_back ( alloc_id ) ; <nl> - } <nl> - <nl> - void OpKernelContext : : record_device_persistent_memory_allocation ( <nl> - int64 size , int64 alloc_id ) { <nl> - device_persistent_memory_allocated_ + = size ; <nl> - device_persistent_alloc_ids_ . push_back ( alloc_id ) ; <nl> - } <nl> - <nl> - std : : vector < int64 > OpKernelContext : : host_persistent_alloc_ids ( ) const { <nl> - return std : : vector < int64 > ( host_persistent_alloc_ids_ . begin ( ) , <nl> - host_persistent_alloc_ids_ . end ( ) ) ; <nl> + void OpKernelContext : : record_persistent_memory_allocation ( int64 size , <nl> + int64 alloc_id ) { <nl> + persistent_memory_allocated_ + = size ; <nl> + persistent_alloc_ids_ . push_back ( alloc_id ) ; <nl> } <nl> <nl> - std : : vector < int64 > OpKernelContext : : device_persistent_alloc_ids ( ) const { <nl> - return std : : vector < int64 > ( device_persistent_alloc_ids_ . begin ( ) , <nl> - device_persistent_alloc_ids_ . end ( ) ) ; <nl> + std : : vector < int64 > OpKernelContext : : persistent_alloc_ids ( ) const { <nl> + return std : : vector < int64 > ( persistent_alloc_ids_ . begin ( ) , <nl> + persistent_alloc_ids_ . end ( ) ) ; <nl> } <nl> <nl> / / OpKernel registration mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm a / tensorflow / core / framework / op_kernel . h <nl> ppp b / tensorflow / core / framework / op_kernel . h <nl> class OpKernelContext { <nl> bool allocate_on_host ( AllocatorAttributes alloc_attr ) const ; <nl> <nl> / / Records temporary memory sizes . <nl> - void record_host_temp_memory_size ( int64 size ) { <nl> - host_temp_memory_size_ + = size ; <nl> - } <nl> - void record_device_temp_memory_size ( int64 size ) { <nl> - device_temp_memory_size_ + = size ; <nl> - } <nl> + void record_temp_memory_size ( int64 size ) { temp_memory_size_ + = size ; } <nl> <nl> / / Returns recorded size of temporary memory ; <nl> - int64 host_temp_memory_size ( ) const { return host_temp_memory_size_ ; } <nl> - int64 device_temp_memory_size ( ) const { return device_temp_memory_size_ ; } <nl> + int64 temp_memory_size ( ) const { return temp_memory_size_ ; } <nl> <nl> / / Records persistent memory allocation , size can be negative indicating <nl> / / deallocation . <nl> - void record_host_persistent_memory_allocation ( int64 size , <nl> - int64 alloc_id = - 1 ) ; <nl> - void record_device_persistent_memory_allocation ( int64 size , <nl> - int64 alloc_id = - 1 ) ; <nl> + void record_persistent_memory_allocation ( int64 size , int64 alloc_id = - 1 ) ; <nl> <nl> / / Returns recorded size and ids of persistent memory . <nl> - int64 host_persistent_memory_allocated ( ) const { <nl> - return host_persistent_memory_allocated_ ; <nl> + int64 persistent_memory_allocated ( ) const { <nl> + return persistent_memory_allocated_ ; <nl> } <nl> - int64 device_persistent_memory_allocated ( ) const { <nl> - return device_persistent_memory_allocated_ ; <nl> - } <nl> - std : : vector < int64 > host_persistent_alloc_ids ( ) const ; <nl> - std : : vector < int64 > device_persistent_alloc_ids ( ) const ; <nl> + <nl> + std : : vector < int64 > persistent_alloc_ids ( ) const ; <nl> <nl> bool input_is_ref ( int index ) const ; <nl> <nl> class OpKernelContext { <nl> <nl> bool is_output_dead_ = false ; <nl> <nl> - int64 host_temp_memory_size_ ; <nl> - int64 device_temp_memory_size_ ; <nl> - gtl : : InlinedVector < int64 , 2 > host_persistent_alloc_ids_ ; <nl> - gtl : : InlinedVector < int64 , 2 > device_persistent_alloc_ids_ ; <nl> - int64 host_persistent_memory_allocated_ ; <nl> - int64 device_persistent_memory_allocated_ ; <nl> + int64 temp_memory_size_ ; <nl> + gtl : : InlinedVector < int64 , 2 > persistent_alloc_ids_ ; <nl> + int64 persistent_memory_allocated_ ; <nl> <nl> TF_DISALLOW_COPY_AND_ASSIGN ( OpKernelContext ) ; <nl> } ; <nl> mmm a / tensorflow / core / framework / step_stats . proto <nl> ppp b / tensorflow / core / framework / step_stats . proto <nl> message NodeOutput { <nl> <nl> / / For memory tracking . <nl> message MemoryStats { <nl> - int64 host_temp_memory_size = 1 ; <nl> - int64 device_temp_memory_size = 2 ; <nl> - int64 host_persistent_memory_size = 3 ; <nl> - int64 device_persistent_memory_size = 4 ; <nl> - repeated int64 host_persistent_tensor_alloc_ids = 5 ; <nl> - repeated int64 device_persistent_tensor_alloc_ids = 6 ; <nl> + int64 temp_memory_size = 1 ; <nl> + int64 persistent_memory_size = 3 ; <nl> + repeated int64 persistent_tensor_alloc_ids = 5 ; <nl> + <nl> + int64 device_temp_memory_size = 2 [ deprecated = true ] ; <nl> + int64 device_persistent_memory_size = 4 [ deprecated = true ] ; <nl> + repeated int64 device_persistent_tensor_alloc_ids = 6 [ deprecated = true ] ; <nl> } <nl> <nl> / / Time / size stats recorded for a single execution of a graph node . <nl> mmm a / tensorflow / core / graph / costmodel . cc <nl> ppp b / tensorflow / core / graph / costmodel . cc <nl> Bytes CostModel : : TempMemorySize ( const Node * node ) const { <nl> return max_mem_usage_ [ id ] . temp_memory_size ; <nl> } <nl> <nl> - Bytes CostModel : : HostTempMemorySize ( const Node * node ) const { <nl> + Bytes CostModel : : PersistentMemorySize ( const Node * node ) const { <nl> const int id = Id ( node ) ; <nl> if ( id < 0 ) { <nl> return Bytes ( 0 ) ; <nl> } <nl> - return max_mem_usage_ [ id ] . host_temp_memory_size ; <nl> - } <nl> - <nl> - Bytes CostModel : : DeviceTempMemorySize ( const Node * node ) const { <nl> - const int id = Id ( node ) ; <nl> - if ( id < 0 ) { <nl> - return Bytes ( 0 ) ; <nl> - } <nl> - return max_mem_usage_ [ id ] . device_temp_memory_size ; <nl> - } <nl> - <nl> - Bytes CostModel : : HostPersistentMemorySize ( const Node * node ) const { <nl> - const int id = Id ( node ) ; <nl> - if ( id < 0 ) { <nl> - return Bytes ( 0 ) ; <nl> - } <nl> - return max_mem_usage_ [ id ] . host_persistent_memory_size ; <nl> - } <nl> - <nl> - Bytes CostModel : : DevicePersistentMemorySize ( const Node * node ) const { <nl> - const int id = Id ( node ) ; <nl> - if ( id < 0 ) { <nl> - return Bytes ( 0 ) ; <nl> - } <nl> - return max_mem_usage_ [ id ] . device_persistent_memory_size ; <nl> + return max_mem_usage_ [ id ] . persistent_memory_size ; <nl> } <nl> <nl> void CostModel : : RecordMemoryStats ( const Node * node , <nl> const MemoryStats & memory_stats ) { <nl> const int id = Id ( node ) ; <nl> if ( id < 0 ) return ; <nl> - max_mem_usage_ [ id ] . host_temp_memory_size = <nl> - memory_stats . host_temp_memory_size ( ) ; <nl> - max_mem_usage_ [ id ] . device_temp_memory_size = <nl> - memory_stats . device_temp_memory_size ( ) ; <nl> - max_mem_usage_ [ id ] . host_persistent_memory_size = <nl> - memory_stats . host_persistent_memory_size ( ) ; <nl> - max_mem_usage_ [ id ] . device_persistent_memory_size = <nl> - memory_stats . device_persistent_memory_size ( ) ; <nl> - for ( int64 alloc_id : memory_stats . host_persistent_tensor_alloc_ids ( ) ) { <nl> - if ( alloc_id > 0 ) { <nl> - host_persistent_alloc_ids_ . insert ( alloc_id ) ; <nl> - } <nl> - } <nl> - for ( int64 alloc_id : memory_stats . device_persistent_tensor_alloc_ids ( ) ) { <nl> + max_mem_usage_ [ id ] . temp_memory_size = memory_stats . temp_memory_size ( ) ; <nl> + max_mem_usage_ [ id ] . persistent_memory_size = <nl> + memory_stats . persistent_memory_size ( ) ; <nl> + for ( int64 alloc_id : memory_stats . persistent_tensor_alloc_ids ( ) ) { <nl> if ( alloc_id > 0 ) { <nl> - persistent_alloc_ids_by_devices_ [ node - > assigned_device_name ( ) ] . insert ( <nl> - alloc_id ) ; <nl> + persistent_alloc_ids_ . insert ( alloc_id ) ; <nl> } <nl> } <nl> } <nl> int64 CostModel : : AllocationId ( const Node * node , int slot ) const { <nl> } <nl> <nl> bool CostModel : : IsPersistentTensor ( const Node * node , int64 alloc_id ) const { <nl> - if ( host_persistent_alloc_ids_ . count ( alloc_id ) > 0 ) { <nl> + if ( persistent_alloc_ids_ . count ( alloc_id ) > 0 ) { <nl> return true ; <nl> } <nl> if ( persistent_alloc_ids_by_devices_ . find ( node - > assigned_device_name ( ) ) = = <nl> void CostModel : : AddToCostGraphDef ( const Graph * graph , <nl> cnode - > add_control_input ( Id ( e - > src ( ) ) ) ; <nl> } <nl> <nl> - cnode - > set_host_temp_memory_size ( HostTempMemorySize ( n ) . value ( ) ) ; <nl> - cnode - > set_device_temp_memory_size ( DeviceTempMemorySize ( n ) . value ( ) ) ; <nl> - cnode - > set_host_persistent_memory_size ( HostPersistentMemorySize ( n ) . value ( ) ) ; <nl> - cnode - > set_device_persistent_memory_size ( <nl> - DevicePersistentMemorySize ( n ) . value ( ) ) ; <nl> + cnode - > set_temporary_memory_size ( TempMemorySize ( n ) . value ( ) ) ; <nl> + cnode - > set_persistent_memory_size ( PersistentMemorySize ( n ) . value ( ) ) ; <nl> <nl> cnode - > set_compute_cost ( MaxExecutionTime ( n ) . value ( ) ) ; <nl> <nl> mmm a / tensorflow / core / graph / costmodel . h <nl> ppp b / tensorflow / core / graph / costmodel . h <nl> class CostModel { <nl> / / Returns the size in bytes of temporary memory consumed by " node " . <nl> Bytes TempMemorySize ( const Node * node ) const ; <nl> <nl> - / / Returns the size in bytes of temporary memory consumed by " node " . <nl> - Bytes HostTempMemorySize ( const Node * node ) const ; <nl> - Bytes DeviceTempMemorySize ( const Node * node ) const ; <nl> - <nl> / / Returns the size of persistent memory allocated by " node " . <nl> - Bytes HostPersistentMemorySize ( const Node * node ) const ; <nl> - Bytes DevicePersistentMemorySize ( const Node * node ) const ; <nl> + Bytes PersistentMemorySize ( const Node * node ) const ; <nl> <nl> / / Records memory stats such as temp momory and persistent memory . <nl> void RecordMemoryStats ( const Node * node , const MemoryStats & memory_stats ) ; <nl> class CostModel { <nl> <nl> / / Maximum memory usage <nl> struct MemUsage { <nl> - MemUsage ( ) <nl> - : temp_memory_size ( - 1 ) , <nl> - host_temp_memory_size ( 0 ) , <nl> - device_temp_memory_size ( 0 ) , <nl> - host_persistent_memory_size ( 0 ) , <nl> - device_persistent_memory_size ( 0 ) { } <nl> + MemUsage ( ) : temp_memory_size ( 0 ) , persistent_memory_size ( 0 ) { } <nl> <nl> / / TODO ( yuefengz ) : temp_memory_size is not being used , remove it . <nl> Bytes temp_memory_size ; <nl> - <nl> - Bytes host_temp_memory_size ; <nl> - Bytes device_temp_memory_size ; <nl> - <nl> - Bytes host_persistent_memory_size ; <nl> - Bytes device_persistent_memory_size ; <nl> + Bytes persistent_memory_size ; <nl> <nl> gtl : : InlinedVector < Bytes , 2 > output_port_mem ; <nl> gtl : : InlinedVector < TensorShapeProto , 2 > output_port_shape ; <nl> class CostModel { <nl> <nl> std : : vector < gtl : : InlinedVector < int64 , 2 > > output_port_alloc_ids_ ; <nl> <nl> - std : : set < int64 > host_persistent_alloc_ids_ ; <nl> + std : : set < int64 > persistent_alloc_ids_ ; <nl> std : : map < string , std : : set < int64 > > persistent_alloc_ids_by_devices_ ; <nl> <nl> TensorShapeProto unknown_shape_ ; <nl> mmm a / tensorflow / core / grappler / clusters / single_machine_test . cc <nl> ppp b / tensorflow / core / grappler / clusters / single_machine_test . cc <nl> TEST_F ( SingleMachineTest , PersistentMemory ) { <nl> found_hashtable = true ; <nl> / / Persistent memory usage should be 0 since it ' s recorded as part of the <nl> / / initialize_table op . <nl> - EXPECT_EQ ( 0 , node . host_persistent_memory_size ( ) ) ; <nl> - EXPECT_EQ ( 0 , node . device_persistent_memory_size ( ) ) ; <nl> + EXPECT_EQ ( 0 , node . persistent_memory_size ( ) ) ; <nl> } else if ( node . name ( ) = = " initialize_table " ) { <nl> found_table_init = true ; <nl> / / Persistent memory should hold 2 keys and 2 values . <nl> - EXPECT_LE ( 4 * sizeof ( int64 ) , node . host_persistent_memory_size ( ) ) ; <nl> - EXPECT_EQ ( 0 , node . device_persistent_memory_size ( ) ) ; <nl> + EXPECT_LE ( 4 * sizeof ( int64 ) , node . persistent_memory_size ( ) ) ; <nl> } <nl> } <nl> EXPECT_TRUE ( found_table_init ) ; <nl> mmm a / tensorflow / core / grappler / costs / op_performance_data . proto <nl> ppp b / tensorflow / core / grappler / costs / op_performance_data . proto <nl> message OpPerformance { <nl> / / The output information may have memory usage and output shapes . <nl> repeated int64 output_memory = 1 ; <nl> <nl> - / / Temporary memory allocated by this node . <nl> - int64 host_temp_memory = 2 ; <nl> - int64 device_temp_memory = 3 ; <nl> + / / Temp and persistent memory allocated by this node . <nl> + int64 temp_memory = 2 ; <nl> + int64 persistent_memory = 4 ; <nl> <nl> - / / The persisted_memory doesn ' t include outputs . <nl> - int64 host_persistent_memory = 4 ; <nl> - int64 device_persistent_memory = 5 ; <nl> + int64 device_temp_memory = 3 [ deprecated = true ] ; <nl> + int64 device_persistent_memory = 5 [ deprecated = true ] ; <nl> } <nl> OpMemory op_memory = 9 ; <nl> } <nl> mmm a / tensorflow / core / grappler / costs / utils . cc <nl> ppp b / tensorflow / core / grappler / costs / utils . cc <nl> OpPerformanceList CostGraphToOpPerformanceData ( const CostGraphDef & cost_graph , <nl> perf - > mutable_op_memory ( ) - > add_output_memory ( output_info . size ( ) ) ; <nl> } <nl> <nl> - perf - > mutable_op_memory ( ) - > set_host_temp_memory ( <nl> - cost_node - > host_temp_memory_size ( ) ) ; <nl> - perf - > mutable_op_memory ( ) - > set_device_temp_memory ( <nl> - cost_node - > device_temp_memory_size ( ) ) ; <nl> - perf - > mutable_op_memory ( ) - > set_host_persistent_memory ( <nl> - cost_node - > host_persistent_memory_size ( ) ) ; <nl> - perf - > mutable_op_memory ( ) - > set_device_persistent_memory ( <nl> - cost_node - > device_persistent_memory_size ( ) ) ; <nl> + perf - > mutable_op_memory ( ) - > set_temp_memory ( <nl> + cost_node - > temporary_memory_size ( ) ) ; <nl> + perf - > mutable_op_memory ( ) - > set_persistent_memory ( <nl> + cost_node - > persistent_memory_size ( ) ) ; <nl> } <nl> return ret ; <nl> } <nl> mmm a / tensorflow / core / grappler / costs / virtual_scheduler . cc <nl> ppp b / tensorflow / core / grappler / costs / virtual_scheduler . cc <nl> Costs VirtualScheduler : : Summary ( RunMetadata * metadata ) { <nl> nodestate . time_scheduled . asMicroSeconds ( ) . count ( ) ) ; <nl> auto * mem_stats = node_stats - > mutable_memory_stats ( ) ; <nl> / / VirtualScheduler does not specify scratch pad memory usage . <nl> - mem_stats - > set_host_temp_memory_size ( 0 ) ; <nl> - mem_stats - > set_device_temp_memory_size ( 0 ) ; <nl> - int64 host_persistent_memory_size = 0 ; <nl> - int64 device_persistent_memory_size = 0 ; <nl> + mem_stats - > set_temp_memory_size ( 0 ) ; <nl> + int64 persistent_memory_size = 0 ; <nl> if ( IsPersistentNode ( node_def ) ) { <nl> - if ( device . first . find ( " cpu " ) ! = string : : npos | | <nl> - device . first . find ( " CPU " ) ! = string : : npos ) { <nl> - host_persistent_memory_size = total_output_size ; <nl> - } else { <nl> - device_persistent_memory_size = total_output_size ; <nl> - } <nl> + persistent_memory_size = total_output_size ; <nl> } <nl> - mem_stats - > set_host_persistent_memory_size ( host_persistent_memory_size ) ; <nl> - mem_stats - > set_device_persistent_memory_size ( <nl> - device_persistent_memory_size ) ; <nl> + mem_stats - > set_persistent_memory_size ( persistent_memory_size ) ; <nl> * device_partition_graph - > add_node ( ) = * node_def ; <nl> } <nl> } <nl> mmm a / tensorflow / core / kernels / BUILD <nl> ppp b / tensorflow / core / kernels / BUILD <nl> cc_library ( <nl> " : determinant_op " , <nl> " : matrix_exponential_op " , <nl> " : matrix_inverse_op " , <nl> + " : matrix_logarithm_op " , <nl> " : matrix_solve_ls_op " , <nl> " : matrix_solve_op " , <nl> " : matrix_triangular_solve_op " , <nl> tf_kernel_library ( <nl> deps = LINALG_DEPS , <nl> ) <nl> <nl> + tf_kernel_library ( <nl> + name = " matrix_logarithm_op " , <nl> + prefix = " matrix_logarithm_op " , <nl> + deps = LINALG_DEPS , <nl> + ) <nl> + <nl> tf_kernel_library ( <nl> name = " self_adjoint_eig_op " , <nl> prefix = " self_adjoint_eig_op " , <nl> mmm a / tensorflow / core / kernels / constant_op . cc <nl> ppp b / tensorflow / core / kernels / constant_op . cc <nl> ConstantOp : : ConstantOp ( OpKernelConstruction * ctx ) <nl> void ConstantOp : : Compute ( OpKernelContext * ctx ) { <nl> ctx - > set_output ( 0 , tensor_ ) ; <nl> if ( TF_PREDICT_FALSE ( ctx - > track_allocations ( ) ) ) { <nl> - AllocatorAttributes attr ; <nl> - if ( ctx - > allocate_on_host ( attr ) ) { <nl> - ctx - > record_host_persistent_memory_allocation ( tensor_ . AllocatedBytes ( ) ) ; <nl> - } else { <nl> - ctx - > record_device_persistent_memory_allocation ( tensor_ . AllocatedBytes ( ) ) ; <nl> - } <nl> + ctx - > record_persistent_memory_allocation ( tensor_ . AllocatedBytes ( ) ) ; <nl> } <nl> } <nl> <nl> mmm a / tensorflow / core / kernels / constant_op_test . cc <nl> ppp b / tensorflow / core / kernels / constant_op_test . cc <nl> void ConstantOpTest : : PersistentMemoryTrackingTest ( bool on_gpu ) { <nl> TF_EXPECT_OK ( ctx . status ( ) ) ; <nl> <nl> if ( on_gpu ) { <nl> - EXPECT_EQ ( ctx . device_persistent_memory_allocated ( ) , 512 ) ; <nl> + EXPECT_EQ ( ctx . persistent_memory_allocated ( ) , 512 ) ; <nl> } else { <nl> - EXPECT_EQ ( ctx . host_persistent_memory_allocated ( ) , 480 ) ; <nl> + EXPECT_EQ ( ctx . persistent_memory_allocated ( ) , 480 ) ; <nl> } <nl> <nl> / / Remove memry leak errors . <nl> mmm a / tensorflow / core / kernels / data / BUILD <nl> ppp b / tensorflow / core / kernels / data / BUILD <nl> cc_library ( <nl> deps = [ <nl> " : captured_function " , <nl> " : dataset " , <nl> + " / / tensorflow / core : core_cpu_internal " , <nl> " / / tensorflow / core : framework " , <nl> " / / tensorflow / core : lib " , <nl> " / / tensorflow / core : lib_internal " , <nl> tf_kernel_library ( <nl> " / / tensorflow / core : lib " , <nl> " / / tensorflow / core : lib_internal " , <nl> " / / tensorflow / core : protos_all_cc " , <nl> + " / / tensorflow / core : session_options " , <nl> " / / tensorflow / core / kernels : ops_util " , <nl> ] , <nl> ) <nl> mmm a / tensorflow / core / kernels / data / captured_function . cc <nl> ppp b / tensorflow / core / kernels / data / captured_function . cc <nl> limitations under the License . <nl> <nl> # include < utility > <nl> <nl> - # include " tensorflow / core / common_runtime / threadpool_device . h " <nl> - # include " tensorflow / core / framework / allocator . h " <nl> - # include " tensorflow / core / framework / device_attributes . pb . h " <nl> - # include " tensorflow / core / framework / lookup_interface . h " <nl> - # include " tensorflow / core / framework / op_kernel . h " <nl> - # include " tensorflow / core / framework / queue_interface . h " <nl> - # include " tensorflow / core / framework / reader_interface . h " <nl> - # include " tensorflow / core / framework / resource_handle . pb_text . h " <nl> - # include " tensorflow / core / kernels / data / dataset . h " <nl> - # include " tensorflow / core / kernels / variable_ops . h " <nl> + # include " tensorflow / core / common_runtime / function . h " <nl> + # include " tensorflow / core / framework / cancellation . h " <nl> # include " tensorflow / core / lib / gtl / optional . h " <nl> + # include " tensorflow / core / lib / random / random . h " <nl> # include " tensorflow / core / platform / notification . h " <nl> - # include " tensorflow / core / public / session_options . h " <nl> <nl> <nl> namespace tensorflow { <nl> <nl> / * static * / <nl> Status CapturedFunction : : Create ( <nl> - OpKernelContext * ctx , const NameAttrList & func , int graph_def_version , <nl> - std : : vector < Tensor > captured_inputs , <nl> + const NameAttrList & func , std : : vector < Tensor > captured_inputs , <nl> std : : unique_ptr < CapturedFunction > * out_function ) { <nl> - / / NOTE ( mrry ) : We need to assign a name to the device , and we choose <nl> - / / the same name as the calling context ' s device so that we do not <nl> - / / need to rewrite resource handles that are found in ` captured_inputs ` . <nl> - Device * device = <nl> - new ThreadPoolDevice ( SessionOptions ( ) , ctx - > device ( ) - > attributes ( ) . name ( ) , <nl> - Bytes ( 256 < < 20 ) , DeviceLocality ( ) , cpu_allocator ( ) ) ; <nl> - <nl> - / / TODO ( mrry ) : Handle arbitrary resource types , which might require a <nl> - / / redesign ( or opening up access to ` ResourceMgr : : DoLookup ( ) ` and <nl> - / / ` ResourceMgr : : DoCreate ( ) ` to this code ) . <nl> - # define HANDLE_RESOURCE_TYPE ( ResourceType ) \ <nl> - if ( input_handle . hash_code ( ) = = MakeTypeIndex < ResourceType > ( ) . hash_code ( ) ) { \ <nl> - ResourceType * resource ; \ <nl> - Status s = LookupResource ( ctx , input_handle , & resource ) ; \ <nl> - if ( errors : : IsNotFound ( s ) ) { \ <nl> - return errors : : FailedPrecondition ( \ <nl> - " Failed to capture resource named \ " " , input_handle . name ( ) , \ <nl> - " \ " in a dataset function . You may need to initialize it " \ <nl> - " explicitly before initializing an iterator that uses it . " ) ; \ <nl> - } else if ( ! s . ok ( ) ) { \ <nl> - return s ; \ <nl> - } \ <nl> - ResourceType * already_created_resource ; \ <nl> - / * Look up the resource in the this function ' s resource manager , in case \ <nl> - * it has already been created . * / \ <nl> - s = device - > resource_manager ( ) - > Lookup ( input_handle . container ( ) , \ <nl> - input_handle . name ( ) , \ <nl> - & already_created_resource ) ; \ <nl> - if ( s . ok ( ) ) { \ <nl> - CHECK_EQ ( resource , already_created_resource ) ; \ <nl> - resource - > Unref ( ) ; \ <nl> - already_created_resource - > Unref ( ) ; \ <nl> - } else { \ <nl> - if ( errors : : IsNotFound ( s ) ) { \ <nl> - TF_RETURN_IF_ERROR ( device - > resource_manager ( ) - > Create ( \ <nl> - input_handle . container ( ) , input_handle . name ( ) , resource ) ) ; \ <nl> - } else { \ <nl> - return s ; \ <nl> - } \ <nl> - } \ <nl> - continue ; \ <nl> - } <nl> + out_function - > reset ( new CapturedFunction ( func , std : : move ( captured_inputs ) ) ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> <nl> - for ( size_t i = 0 ; i < captured_inputs . size ( ) ; + + i ) { <nl> - if ( captured_inputs [ i ] . dtype ( ) = = DT_RESOURCE ) { <nl> - / / Extract the resource from ` ctx - > resource_manager ( ) ` and <nl> - / / insert it into ` device - > resource_manager ( ) ` so that it can be <nl> - / / used when the function executes . <nl> - ResourceHandle input_handle = <nl> - captured_inputs [ i ] . scalar < ResourceHandle > ( ) ( ) ; <nl> - HANDLE_RESOURCE_TYPE ( lookup : : LookupInterface ) ; <nl> - HANDLE_RESOURCE_TYPE ( QueueInterface ) ; <nl> - HANDLE_RESOURCE_TYPE ( Var ) ; <nl> - return errors : : Unimplemented ( <nl> - " Cannot currently capture resource ' " , <nl> - ProtoDebugString ( input_handle ) , <nl> - " ' in a dataset function ( type not supported ) . " ) ; <nl> - } <nl> + CapturedFunction : : ~ CapturedFunction ( ) { } <nl> + <nl> + Status CapturedFunction : : set_lib ( FunctionLibraryRuntime * lib ) { <nl> + mutex_lock l ( mu_ ) ; <nl> + if ( lib_ = = nullptr ) { <nl> + lib_ = lib ; <nl> + return Status : : OK ( ) ; <nl> } <nl> - # undef HANDLE_RESOURCE_TYPE <nl> - <nl> - std : : unique_ptr < DeviceMgr > device_mgr ( new DeviceMgr ( { device } ) ) ; <nl> - std : : unique_ptr < FunctionLibraryDefinition > flib_def ( <nl> - new FunctionLibraryDefinition ( <nl> - * ctx - > function_library ( ) - > GetFunctionLibraryDefinition ( ) ) ) ; <nl> - std : : unique_ptr < ProcessFunctionLibraryRuntime > pflr ( <nl> - new ProcessFunctionLibraryRuntime ( device_mgr . get ( ) , ctx - > env ( ) , <nl> - graph_def_version , flib_def . get ( ) , <nl> - { } / * TODO ( mrry ) : OptimizerOptions ? * / , <nl> - nullptr / * TODO ( mrry ) : ClusterFLR * / ) ) ; <nl> - <nl> - FunctionLibraryRuntime * lib = pflr - > GetFLR ( device - > name ( ) ) ; <nl> - <nl> - FunctionLibraryRuntime : : Handle f_handle ; <nl> - TF_RETURN_IF_ERROR ( <nl> - lib - > Instantiate ( func . name ( ) , AttrSlice ( & func . attr ( ) ) , & f_handle ) ) ; <nl> - const FunctionBody * fbody = lib - > GetFunctionBody ( f_handle ) ; <nl> - if ( fbody = = nullptr ) { <nl> - return errors : : Internal ( " Failed to instantiate function body . " ) ; <nl> + if ( lib ! = lib_ ) { <nl> + return errors : : Internal ( <nl> + " Captured function was called with a different " <nl> + " FunctionLibraryRuntime * , which is not permitted . " ) ; <nl> } <nl> - <nl> - out_function - > reset ( new CapturedFunction ( <nl> - device , std : : move ( device_mgr ) , std : : move ( flib_def ) , std : : move ( pflr ) , lib , <nl> - f_handle , std : : move ( captured_inputs ) , fbody - > ret_types ) ) ; <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> class BorrowedArgsCallFrame : public CallFrameBase { <nl> <nl> } / / namespace <nl> <nl> - Status CapturedFunction : : Run ( FunctionLibraryRuntime : : Options f_opts , <nl> + Status CapturedFunction : : MaybeInstantiate ( <nl> + FunctionLibraryRuntime * lib , <nl> + FunctionLibraryRuntime : : InstantiateOptions inst_opts ) { <nl> + TF_RETURN_IF_ERROR ( set_lib ( lib ) ) ; <nl> + inst_opts . state_handle = std : : to_string ( random : : New64 ( ) ) ; <nl> + mutex_lock l ( mu_ ) ; <nl> + if ( f_handle_ = = kInvalidHandle ) { <nl> + TF_RETURN_IF_ERROR ( lib_ - > Instantiate ( func_ . name ( ) , AttrSlice ( & func_ . attr ( ) ) , <nl> + inst_opts , & f_handle_ ) ) ; <nl> + } <nl> + const FunctionBody * fbody = lib_ - > GetFunctionBody ( f_handle_ ) ; <nl> + if ( fbody = = nullptr ) { <nl> + return errors : : Internal ( " Failed to instantiate function body . " ) ; <nl> + } <nl> + ret_types_ = fbody - > ret_types ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + Status CapturedFunction : : Run ( IteratorContext * ctx , <nl> + FunctionLibraryRuntime : : Options f_opts , <nl> std : : vector < Tensor > & & args , <nl> std : : vector < Tensor > * rets ) { <nl> + FunctionLibraryRuntime : : InstantiateOptions inst_opts ; <nl> + inst_opts . overlay_lib = ctx - > function_library ( ) . get ( ) ; <nl> + TF_RETURN_IF_ERROR ( MaybeInstantiate ( ctx - > lib ( ) , inst_opts ) ) ; <nl> / / TODO ( mrry ) : Add cancellation manager support to IteratorContext <nl> / / so that we can cancel running map functions . The local <nl> / / cancellation manager here is created so that we can run kernels <nl> Status CapturedFunction : : Run ( FunctionLibraryRuntime : : Options f_opts , <nl> f_opts . cancellation_manager = c_mgr ; <nl> Notification n ; <nl> Status s ; <nl> + mutex_lock l ( mu_ ) ; <nl> lib_ - > Run ( f_opts , f_handle_ , frame , <nl> [ rets , c_mgr , frame , & n , & s ] ( Status func_status ) { <nl> delete c_mgr ; <nl> Status CapturedFunction : : Run ( FunctionLibraryRuntime : : Options f_opts , <nl> } <nl> <nl> Status CapturedFunction : : RunWithBorrowedArgs ( <nl> - FunctionLibraryRuntime : : Options f_opts , const std : : vector < Tensor > & args , <nl> - std : : vector < Tensor > * rets ) { <nl> + IteratorContext * ctx , FunctionLibraryRuntime : : Options f_opts , <nl> + const std : : vector < Tensor > & args , std : : vector < Tensor > * rets ) { <nl> + FunctionLibraryRuntime : : InstantiateOptions inst_opts ; <nl> + inst_opts . overlay_lib = ctx - > function_library ( ) . get ( ) ; <nl> + TF_RETURN_IF_ERROR ( MaybeInstantiate ( ctx - > lib ( ) , inst_opts ) ) ; <nl> / / TODO ( mrry ) : Add cancellation manager support to IteratorContext <nl> / / so that we can cancel running map functions . The local <nl> / / cancellation manager here is created so that we can run kernels <nl> Status CapturedFunction : : RunWithBorrowedArgs ( <nl> f_opts . cancellation_manager = c_mgr ; <nl> Notification n ; <nl> Status s ; <nl> + mutex_lock l ( mu_ ) ; <nl> + <nl> lib_ - > Run ( f_opts , f_handle_ , & frame , <nl> [ rets , c_mgr , & frame , & n , & s ] ( Status func_status ) { <nl> delete c_mgr ; <nl> Status CapturedFunction : : RunWithBorrowedArgs ( <nl> return s ; <nl> } <nl> <nl> - void CapturedFunction : : RunAsync ( FunctionLibraryRuntime : : Options f_opts , <nl> - std : : vector < Tensor > & & args , <nl> - std : : vector < Tensor > * rets , <nl> - FunctionLibraryRuntime : : DoneCallback done ) { <nl> + void CapturedFunction : : RunAsync ( <nl> + FunctionLibraryRuntime * lib , <nl> + FunctionLibraryRuntime : : InstantiateOptions inst_opts , <nl> + FunctionLibraryRuntime : : Options f_opts , std : : vector < Tensor > & & args , <nl> + std : : vector < Tensor > * rets , FunctionLibraryRuntime : : DoneCallback done ) { <nl> + Status s = MaybeInstantiate ( lib , inst_opts ) ; <nl> + if ( ! s . ok ( ) ) { <nl> + done ( s ) ; <nl> + return ; <nl> + } <nl> / / TODO ( mrry ) : Add cancellation manager support to IteratorContext <nl> / / so that we can cancel running map functions . The local <nl> / / cancellation manager here is created so that we can run kernels <nl> void CapturedFunction : : RunAsync ( FunctionLibraryRuntime : : Options f_opts , <nl> auto frame = <nl> new OwnedArgsCallFrame ( std : : move ( args ) , & captured_inputs_ , ret_types_ ) ; <nl> f_opts . cancellation_manager = c_mgr ; <nl> + mutex_lock l ( mu_ ) ; <nl> + <nl> lib_ - > Run ( f_opts , f_handle_ , frame , <nl> std : : bind ( <nl> [ rets , c_mgr , frame ] ( FunctionLibraryRuntime : : DoneCallback done , <nl> void CapturedFunction : : RunAsync ( FunctionLibraryRuntime : : Options f_opts , <nl> std : : move ( done ) , std : : placeholders : : _1 ) ) ; <nl> } <nl> <nl> - CapturedFunction : : CapturedFunction ( <nl> - Device * device , std : : unique_ptr < DeviceMgr > device_mgr , <nl> - std : : unique_ptr < FunctionLibraryDefinition > flib_def , <nl> - std : : unique_ptr < ProcessFunctionLibraryRuntime > pflr , <nl> - FunctionLibraryRuntime * lib , FunctionLibraryRuntime : : Handle f_handle , <nl> - std : : vector < Tensor > captured_inputs , DataTypeSlice ret_types ) <nl> - : device_ ( device ) , <nl> - device_mgr_ ( std : : move ( device_mgr ) ) , <nl> - flib_def_ ( std : : move ( flib_def ) ) , <nl> - pflr_ ( std : : move ( pflr ) ) , <nl> - lib_ ( lib ) , <nl> - f_handle_ ( f_handle ) , <nl> - captured_inputs_ ( std : : move ( captured_inputs ) ) , <nl> - ret_types_ ( ret_types ) { } <nl> + CapturedFunction : : CapturedFunction ( const NameAttrList & func , <nl> + std : : vector < Tensor > captured_inputs ) <nl> + : func_ ( func ) , <nl> + lib_ ( nullptr ) , <nl> + f_handle_ ( kInvalidHandle ) , <nl> + captured_inputs_ ( std : : move ( captured_inputs ) ) { } <nl> <nl> } / / namespace tensorflow <nl> mmm a / tensorflow / core / kernels / data / captured_function . h <nl> ppp b / tensorflow / core / kernels / data / captured_function . h <nl> limitations under the License . <nl> # include < memory > <nl> # include < vector > <nl> <nl> - # include " tensorflow / core / common_runtime / function . h " <nl> + # include " tensorflow / core / framework / function . h " <nl> # include " tensorflow / core / framework / tensor . h " <nl> + # include " tensorflow / core / kernels / data / dataset . h " <nl> # include " tensorflow / core / lib / core / status . h " <nl> # include " tensorflow / core / lib / gtl / array_slice . h " <nl> # include " tensorflow / core / lib / random / random . h " <nl> class ResourceMgr ; <nl> / / The ` Dataset ` - related classes use ` CapturedFunction ` to execute <nl> / / TensorFlow functions outside a the normal ` OpKernel : : Compute ( ) ` <nl> / / context . <nl> - / / <nl> - / / NOTE ( mrry ) : Here we are taking a conservative approach to dealing with <nl> - / / ownership of the various framework and runtime objects that are needed <nl> - / / to execute functions . We copy the function library * definition * ( i . e . <nl> - / / a set of FunctionDefs ) out of this kernel ' s context ' s function library <nl> - / / * runtime * , then we use that together with a specially - created <nl> - / / ThreadPoolDevice to build a new FunctionLibraryRuntime for the Dataset . <nl> - / / <nl> - / / We need to do this ( or refactor the ownership of framework components <nl> - / / in each of the session implementations ) to make it possible to close <nl> - / / down a ParallelMapDataset : : Iterator when its session is closed . <nl> - / / <nl> - / / TODO ( mrry ) : Clean this up . Investigate whether it would be possible to <nl> - / / reuse the session ' s FunctionLibraryRuntime ( s ) or Device ( s ) . <nl> class CapturedFunction { <nl> public : <nl> / / NOTE ( mrry ) : The ` captured_inputs ` are passed by value . For <nl> / / efficiency , you are recommended to move this argument into the call . <nl> - static Status Create ( OpKernelContext * ctx , const NameAttrList & func , <nl> - int graph_def_version , <nl> + static Status Create ( const NameAttrList & func , <nl> std : : vector < Tensor > captured_inputs , <nl> std : : unique_ptr < CapturedFunction > * out_function ) ; <nl> <nl> - / / Synchronously runs the captured function on the given ` args ` , and stores <nl> - / / the results in ` * rets ` . This method takes ownership of the tensors in <nl> - / / ` args ` , in order to be able to deallocate them as early as possible . <nl> - / / Use ` RunWithBorrowedArgs ( ) ` if the caller needs to retain ownership of <nl> - / / the ` args ` . <nl> - Status Run ( FunctionLibraryRuntime : : Options f_opts , std : : vector < Tensor > & & args , <nl> - std : : vector < Tensor > * rets ) ; <nl> + ~ CapturedFunction ( ) ; <nl> + <nl> + / / Runs the " Captured function " using the given FLR and caches the lib and <nl> + / / handle generated during instantiation . If Run is called with a different <nl> + / / lib afterwards , generates an error . This method takes ownership of the <nl> + / / tensors in ` args ` , in order to be able to deallocate them as early as <nl> + / / possible . Use ` RunWithBorrowedArgs ( ) ` if the caller needs to retain <nl> + / / ownership of the ` args ` . <nl> + Status Run ( IteratorContext * ctx , FunctionLibraryRuntime : : Options f_opts , <nl> + std : : vector < Tensor > & & args , std : : vector < Tensor > * rets ) ; <nl> <nl> / / Synchronously runs the captured function on the given ` args ` , and stores <nl> / / the results in ` * rets ` . Prefer to use ` Run ( ) ` or ` RunAsync ( ) ` when <nl> / / possible . <nl> - Status RunWithBorrowedArgs ( FunctionLibraryRuntime : : Options f_opts , <nl> + Status RunWithBorrowedArgs ( IteratorContext * ctx , <nl> + FunctionLibraryRuntime : : Options f_opts , <nl> const std : : vector < Tensor > & args , <nl> std : : vector < Tensor > * rets ) ; <nl> <nl> class CapturedFunction { <nl> / / the results in ` * rets ` , and calls the given ` done ` callback when the <nl> / / function returns . This method takes ownership of the tensors in ` args ` , <nl> / / in order to be able to deallocate them as early as possible . <nl> - void RunAsync ( FunctionLibraryRuntime : : Options f_opts , <nl> + void RunAsync ( FunctionLibraryRuntime * lib , <nl> + FunctionLibraryRuntime : : InstantiateOptions inst_opts , <nl> + FunctionLibraryRuntime : : Options f_opts , <nl> std : : vector < Tensor > & & args , std : : vector < Tensor > * rets , <nl> FunctionLibraryRuntime : : DoneCallback done ) ; <nl> <nl> - / / Returns a borrowed pointer to the ` ResourceManager ` used when this <nl> - / / function is run . <nl> - ResourceMgr * resource_manager ( ) const { return device_ - > resource_manager ( ) ; } <nl> - <nl> / / Returns that additional captured inputs that will be passed to the function <nl> / / when ` Run * ( ) ` is called . <nl> const std : : vector < Tensor > & captured_inputs ( ) { return captured_inputs_ ; } <nl> class CapturedFunction { <nl> } <nl> <nl> private : <nl> - CapturedFunction ( Device * device , std : : unique_ptr < DeviceMgr > device_mgr , <nl> - std : : unique_ptr < FunctionLibraryDefinition > flib_def , <nl> - std : : unique_ptr < ProcessFunctionLibraryRuntime > pflr , <nl> - FunctionLibraryRuntime * lib , <nl> - FunctionLibraryRuntime : : Handle f_handle , <nl> - std : : vector < Tensor > captured_inputs , <nl> - DataTypeSlice ret_types ) ; <nl> - <nl> - Device * const device_ ; / / owned by device_mgr_ . <nl> - const std : : unique_ptr < DeviceMgr > device_mgr_ ; <nl> - const std : : unique_ptr < FunctionLibraryDefinition > flib_def_ ; <nl> - const std : : unique_ptr < ProcessFunctionLibraryRuntime > pflr_ ; <nl> - FunctionLibraryRuntime * const lib_ ; / / owned by pflr_ . <nl> - const FunctionLibraryRuntime : : Handle f_handle_ ; <nl> + CapturedFunction ( const NameAttrList & func , <nl> + std : : vector < Tensor > captured_inputs ) ; <nl> + <nl> + Status set_lib ( FunctionLibraryRuntime * lib ) ; <nl> + <nl> + Status MaybeInstantiate ( FunctionLibraryRuntime * lib , <nl> + FunctionLibraryRuntime : : InstantiateOptions inst_opts ) ; <nl> + <nl> + mutex mu_ ; <nl> + const NameAttrList func_ ; <nl> + FunctionLibraryRuntime * lib_ GUARDED_BY ( mu_ ) ; <nl> + FunctionLibraryRuntime : : Handle f_handle_ GUARDED_BY ( mu_ ) ; <nl> const std : : vector < Tensor > captured_inputs_ ; <nl> - DataTypeSlice ret_types_ ; / / owned by pflr_ . <nl> + DataTypeSlice ret_types_ ; <nl> <nl> TF_DISALLOW_COPY_AND_ASSIGN ( CapturedFunction ) ; <nl> } ; <nl> mmm a / tensorflow / core / kernels / data / dataset . h <nl> ppp b / tensorflow / core / kernels / data / dataset . h <nl> class IteratorContext { <nl> std : : function < std : : shared_ptr < StatsAggregator > ( ) > stats_aggregator_getter = <nl> nullptr ; <nl> <nl> + / / The FunctionLibraryRuntime object to be used to make function calls . <nl> + FunctionLibraryRuntime * lib = nullptr ; <nl> std : : shared_ptr < const FunctionLibraryDefinition > function_library = nullptr ; <nl> } ; <nl> <nl> class IteratorContext { <nl> return params_ . function_library ; <nl> } <nl> <nl> + FunctionLibraryRuntime * lib ( ) { return params_ . lib ; } <nl> + <nl> + void set_lib ( FunctionLibraryRuntime * lib ) { params_ . lib = lib ; } <nl> + <nl> private : <nl> Params params_ ; <nl> } ; <nl> mmm a / tensorflow / core / kernels / data / dataset_utils . cc <nl> ppp b / tensorflow / core / kernels / data / dataset_utils . cc <nl> limitations under the License . <nl> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> <nl> # include " tensorflow / core / kernels / data / dataset_utils . h " <nl> + # include " tensorflow / core / common_runtime / device . h " <nl> <nl> namespace tensorflow { <nl> <nl> Status MakeIteratorFromInputElement ( <nl> / / MasterSession generates 56 - bit random step IDs whose MSB <nl> / / is always 0 , so a negative random step ID should suffice . <nl> opts . step_id = CapturedFunction : : generate_step_id ( ) ; <nl> - ScopedStepContainer step_container ( <nl> - opts . step_id , [ captured_func ] ( const string & name ) { <nl> - captured_func - > resource_manager ( ) - > Cleanup ( name ) . IgnoreError ( ) ; <nl> - } ) ; <nl> + ScopedStepContainer step_container ( opts . step_id , [ ctx ] ( const string & name ) { <nl> + ctx - > lib ( ) - > device ( ) - > resource_manager ( ) - > Cleanup ( name ) . IgnoreError ( ) ; <nl> + } ) ; <nl> opts . step_container = & step_container ; <nl> std : : vector < Tensor > return_values ; <nl> - TF_RETURN_IF_ERROR ( <nl> - captured_func - > RunWithBorrowedArgs ( opts , input_element , & return_values ) ) ; <nl> + <nl> + TF_RETURN_IF_ERROR ( captured_func - > RunWithBorrowedArgs ( <nl> + ctx , opts , input_element , & return_values ) ) ; <nl> <nl> if ( ! ( return_values . size ( ) = = 1 & & return_values [ 0 ] . dtype ( ) = = DT_VARIANT & & <nl> TensorShapeUtils : : IsScalar ( return_values [ 0 ] . shape ( ) ) ) ) { <nl> mmm a / tensorflow / core / kernels / data / filter_dataset_op . cc <nl> ppp b / tensorflow / core / kernels / data / filter_dataset_op . cc <nl> class FilterDatasetOp : public UnaryDatasetOpKernel { <nl> } <nl> <nl> std : : unique_ptr < CapturedFunction > captured_func ; <nl> - OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( ctx , func_ , graph_def_version_ , <nl> - std : : move ( other_arguments ) , <nl> - & captured_func ) ) ; <nl> + OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( <nl> + func_ , std : : move ( other_arguments ) , & captured_func ) ) ; <nl> <nl> * output = new Dataset ( ctx , input , func_ , std : : move ( captured_func ) ) ; <nl> } <nl> class FilterDatasetOp : public UnaryDatasetOpKernel { <nl> <nl> FunctionLibraryRuntime : : Options opts ; <nl> opts . step_id = CapturedFunction : : generate_step_id ( ) ; <nl> - ScopedStepContainer step_container ( <nl> - opts . step_id , [ this ] ( const string & name ) { <nl> - dataset ( ) <nl> - - > captured_func_ - > resource_manager ( ) <nl> - - > Cleanup ( name ) <nl> - . IgnoreError ( ) ; <nl> - } ) ; <nl> + ScopedStepContainer step_container ( opts . step_id , <nl> + [ ctx ] ( const string & name ) { <nl> + ctx - > lib ( ) <nl> + - > device ( ) <nl> + - > resource_manager ( ) <nl> + - > Cleanup ( name ) <nl> + . IgnoreError ( ) ; <nl> + } ) ; <nl> opts . step_container = & step_container ; <nl> opts . runner = ctx - > runner ( ) ; <nl> / / TODO ( mrry ) : Avoid blocking a threadpool thread . We will need to <nl> class FilterDatasetOp : public UnaryDatasetOpKernel { <nl> Status ret ; <nl> std : : vector < Tensor > result ; <nl> ret = dataset ( ) - > captured_func_ - > RunWithBorrowedArgs ( <nl> - opts , * out_tensors , & result ) ; <nl> + ctx , opts , * out_tensors , & result ) ; <nl> <nl> if ( ! ret . ok ( ) ) { <nl> return ret ; <nl> mmm a / tensorflow / core / kernels / data / flat_map_dataset_op . cc <nl> ppp b / tensorflow / core / kernels / data / flat_map_dataset_op . cc <nl> class FlatMapDatasetOp : public UnaryDatasetOpKernel { <nl> } <nl> <nl> std : : unique_ptr < CapturedFunction > captured_func ; <nl> - OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( ctx , func_ , graph_def_version_ , <nl> - std : : move ( other_arguments ) , <nl> - & captured_func ) ) ; <nl> + OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( <nl> + func_ , std : : move ( other_arguments ) , & captured_func ) ) ; <nl> <nl> * output = new Dataset ( ctx , input , func_ , std : : move ( captured_func ) , <nl> output_types_ , output_shapes_ ) ; <nl> class FlatMapDatasetOp : public UnaryDatasetOpKernel { <nl> IteratorContext : : Params params ; <nl> params . env = ctx - > env ( ) ; <nl> params . runner = * ( ctx - > runner ( ) ) ; <nl> + params . lib = ctx - > function_library ( ) ; <nl> IteratorContext iter_ctx ( std : : move ( params ) ) ; <nl> return BuildCurrentElementIteratorLocked ( & iter_ctx ) ; <nl> } <nl> mmm a / tensorflow / core / kernels / data / group_by_window_dataset_op . cc <nl> ppp b / tensorflow / core / kernels / data / group_by_window_dataset_op . cc <nl> class GroupByWindowDatasetOp : public UnaryDatasetOpKernel { <nl> / / TODO ( mrry ) : Refactor CapturedFunction to share the runtime <nl> / / state between multiple functions ? <nl> std : : unique_ptr < CapturedFunction > captured_key_func ; <nl> - OP_REQUIRES_OK ( ctx , <nl> - CapturedFunction : : Create ( ctx , key_func_ , graph_def_version_ , <nl> - std : : move ( key_func_other_arguments ) , <nl> - & captured_key_func ) ) ; <nl> + OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( <nl> + key_func_ , std : : move ( key_func_other_arguments ) , <nl> + & captured_key_func ) ) ; <nl> std : : unique_ptr < CapturedFunction > captured_reduce_func ; <nl> OP_REQUIRES_OK ( <nl> - ctx , CapturedFunction : : Create ( ctx , reduce_func_ , graph_def_version_ , <nl> + ctx , CapturedFunction : : Create ( reduce_func_ , <nl> std : : move ( reduce_func_other_arguments ) , <nl> & captured_reduce_func ) ) ; <nl> std : : unique_ptr < CapturedFunction > captured_window_size_func ; <nl> - OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( <nl> - ctx , window_size_func_ , graph_def_version_ , <nl> - std : : move ( window_size_func_other_arguments ) , <nl> - & captured_window_size_func ) ) ; <nl> + OP_REQUIRES_OK ( <nl> + ctx , CapturedFunction : : Create ( <nl> + window_size_func_ , std : : move ( window_size_func_other_arguments ) , <nl> + & captured_window_size_func ) ) ; <nl> <nl> * output = new Dataset ( <nl> ctx , input , key_func_ , reduce_func_ , window_size_func_ , <nl> class GroupByWindowDatasetOp : public UnaryDatasetOpKernel { <nl> FunctionLibraryRuntime : : Options opts ; <nl> opts . step_id = CapturedFunction : : generate_step_id ( ) ; <nl> opts . runner = ctx - > runner ( ) ; <nl> - ScopedStepContainer step_container ( <nl> - opts . step_id , [ this ] ( const string & name ) { <nl> - dataset ( ) <nl> - - > captured_key_func_ - > resource_manager ( ) <nl> - - > Cleanup ( name ) <nl> - . IgnoreError ( ) ; <nl> - } ) ; <nl> + ScopedStepContainer step_container ( opts . step_id , <nl> + [ ctx ] ( const string & name ) { <nl> + ctx - > lib ( ) <nl> + - > device ( ) <nl> + - > resource_manager ( ) <nl> + - > Cleanup ( name ) <nl> + . IgnoreError ( ) ; <nl> + } ) ; <nl> opts . step_container = & step_container ; <nl> <nl> / / Run the key function on the input element to identify its <nl> class GroupByWindowDatasetOp : public UnaryDatasetOpKernel { <nl> std : : vector < Tensor > key_func_output ; <nl> TF_RETURN_IF_ERROR ( <nl> dataset ( ) - > captured_key_func_ - > RunWithBorrowedArgs ( <nl> - opts , next_input_element , & key_func_output ) ) ; <nl> + ctx , opts , next_input_element , & key_func_output ) ) ; <nl> <nl> if ( key_func_output . size ( ) ! = 1 | | <nl> key_func_output [ 0 ] . dtype ( ) ! = DT_INT64 | | <nl> class GroupByWindowDatasetOp : public UnaryDatasetOpKernel { <nl> FunctionLibraryRuntime : : Options opts2 ; <nl> opts2 . step_id = CapturedFunction : : generate_step_id ( ) ; <nl> opts2 . runner = ctx - > runner ( ) ; <nl> - ScopedStepContainer step_container2 ( <nl> - opts2 . step_id , [ this ] ( const string & name ) { <nl> - dataset ( ) <nl> - - > captured_window_size_func_ - > resource_manager ( ) <nl> - - > Cleanup ( name ) <nl> - . IgnoreError ( ) ; <nl> - } ) ; <nl> + ScopedStepContainer step_container2 ( opts2 . step_id , <nl> + [ ctx ] ( const string & name ) { <nl> + ctx - > lib ( ) <nl> + - > device ( ) <nl> + - > resource_manager ( ) <nl> + - > Cleanup ( name ) <nl> + . IgnoreError ( ) ; <nl> + } ) ; <nl> opts2 . step_container = & step_container2 ; <nl> <nl> / / Run the window size function on the key to identify its <nl> / / window size . <nl> std : : vector < Tensor > window_size_func_output ; <nl> TF_RETURN_IF_ERROR ( dataset ( ) - > captured_window_size_func_ - > Run ( <nl> - opts2 , std : : move ( key_func_output ) , <nl> + ctx , opts2 , std : : move ( key_func_output ) , <nl> & window_size_func_output ) ) ; <nl> <nl> if ( window_size_func_output . size ( ) ! = 1 | | <nl> class GroupByWindowDatasetOp : public UnaryDatasetOpKernel { <nl> reader - > ReadScalar ( full_name ( " current_key " ) , & current_key_ ) ) ; <nl> <nl> / / Initialize current_group_iterator_ <nl> - IteratorContext : : Params params ; <nl> - params . env = ctx - > env ( ) ; <nl> - params . runner = * ( ctx - > runner ( ) ) ; <nl> - IteratorContext iter_ctx ( std : : move ( params ) ) ; <nl> - TF_RETURN_IF_ERROR ( StartFlushingGroup ( & iter_ctx , current_key_ ) ) ; <nl> + TF_RETURN_IF_ERROR ( StartFlushingGroup ( ctx , current_key_ ) ) ; <nl> / / Restore current_group_iterator_ state <nl> TF_RETURN_IF_ERROR ( <nl> RestoreParent ( ctx , reader , current_group_iterator_ ) ) ; <nl> class GroupByWindowDatasetOp : public UnaryDatasetOpKernel { <nl> FunctionLibraryRuntime : : Options opts ; <nl> opts . step_id = CapturedFunction : : generate_step_id ( ) ; <nl> opts . runner = ctx - > runner ( ) ; <nl> - ScopedStepContainer step_container ( <nl> - opts . step_id , [ this ] ( const string & name ) { <nl> - dataset ( ) <nl> - - > captured_reduce_func_ - > resource_manager ( ) <nl> - - > Cleanup ( name ) <nl> - . IgnoreError ( ) ; <nl> - } ) ; <nl> + ScopedStepContainer step_container ( opts . step_id , [ ctx ] ( const string & <nl> + name ) { <nl> + ctx - > lib ( ) - > device ( ) - > resource_manager ( ) - > Cleanup ( name ) . IgnoreError ( ) ; <nl> + } ) ; <nl> opts . step_container = & step_container ; <nl> <nl> DatasetBase * group_dataset ; <nl> class GroupByWindowDatasetOp : public UnaryDatasetOpKernel { <nl> std : : vector < Tensor > args ( <nl> { std : : move ( key_arg ) , std : : move ( group_dataset_arg ) } ) ; <nl> std : : vector < Tensor > return_values ; <nl> - <nl> TF_RETURN_IF_ERROR ( dataset ( ) - > captured_reduce_func_ - > Run ( <nl> - opts , std : : move ( args ) , & return_values ) ) ; <nl> + ctx , opts , std : : move ( args ) , & return_values ) ) ; <nl> <nl> if ( ! ( return_values . size ( ) = = 1 & & <nl> return_values [ 0 ] . dtype ( ) = = DT_VARIANT & & <nl> mmm a / tensorflow / core / kernels / data / interleave_dataset_op . cc <nl> ppp b / tensorflow / core / kernels / data / interleave_dataset_op . cc <nl> class InterleaveDatasetOp : public UnaryDatasetOpKernel { <nl> errors : : InvalidArgument ( " block_length must be greater than zero . " ) ) ; <nl> <nl> std : : unique_ptr < CapturedFunction > captured_func ; <nl> - OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( ctx , func_ , graph_def_version_ , <nl> - std : : move ( other_arguments ) , <nl> - & captured_func ) ) ; <nl> + OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( <nl> + func_ , std : : move ( other_arguments ) , & captured_func ) ) ; <nl> <nl> * output = <nl> new Dataset ( ctx , input , func_ , std : : move ( captured_func ) , cycle_length , <nl> mmm a / tensorflow / core / kernels / data / iterator_ops . cc <nl> ppp b / tensorflow / core / kernels / data / iterator_ops . cc <nl> limitations under the License . <nl> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> # include " tensorflow / core / common_runtime / function . h " <nl> # include " tensorflow / core / common_runtime / graph_runner . h " <nl> + # include " tensorflow / core / common_runtime / threadpool_device . h " <nl> # include " tensorflow / core / framework / iterator . pb . h " <nl> # include " tensorflow / core / framework / partial_tensor_shape . h " <nl> # include " tensorflow / core / framework / resource_op_kernel . h " <nl> limitations under the License . <nl> # include " tensorflow / core / lib / strings / strcat . h " <nl> # include " tensorflow / core / lib / strings / stringprintf . h " <nl> # include " tensorflow / core / platform / env . h " <nl> + # include " tensorflow / core / public / session_options . h " <nl> <nl> namespace tensorflow { <nl> <nl> class IteratorResource : public ResourceBase { <nl> public : <nl> IteratorResource ( const DataTypeVector & output_dtypes , <nl> const std : : vector < PartialTensorShape > & output_shapes , <nl> - const int graph_def_version ) <nl> - : iterator_ ( nullptr ) , <nl> + const int graph_def_version , <nl> + std : : unique_ptr < DeviceMgr > device_mgr , <nl> + std : : unique_ptr < FunctionLibraryDefinition > flib_def , <nl> + std : : unique_ptr < ProcessFunctionLibraryRuntime > pflr , <nl> + FunctionLibraryRuntime * lib ) <nl> + : device_mgr_ ( std : : move ( device_mgr ) ) , <nl> + flib_def_ ( std : : move ( flib_def ) ) , <nl> + pflr_ ( std : : move ( pflr ) ) , <nl> + lib_ ( lib ) , <nl> + iterator_ ( nullptr ) , <nl> output_dtypes_ ( output_dtypes ) , <nl> output_shapes_ ( output_shapes ) , <nl> graph_def_version_ ( graph_def_version ) { } <nl> class IteratorResource : public ResourceBase { <nl> bool * end_of_sequence ) { <nl> std : : shared_ptr < IteratorBase > captured_iterator ( iterator_ ) ; <nl> if ( captured_iterator ) { <nl> + if ( lib_ ! = nullptr ) { <nl> + ctx - > set_lib ( lib_ ) ; <nl> + } <nl> return captured_iterator - > GetNext ( ctx , out_tensors , end_of_sequence ) ; <nl> } else { <nl> return errors : : FailedPrecondition ( <nl> class IteratorResource : public ResourceBase { <nl> new FunctionLibraryDefinition ( <nl> * ctx - > function_library ( ) - > GetFunctionLibraryDefinition ( ) ) ) ; <nl> TF_RETURN_IF_ERROR ( flib_def - > AddLibrary ( graph_def . library ( ) ) ) ; <nl> - std : : unique_ptr < ProcessFunctionLibraryRuntime > pflr ( <nl> - new ProcessFunctionLibraryRuntime ( nullptr , ctx - > env ( ) , <nl> - graph_def_version_ , flib_def . get ( ) , <nl> - { } , nullptr ) ) ; <nl> - FunctionLibraryRuntime * lib = <nl> - pflr - > GetFLR ( ProcessFunctionLibraryRuntime : : kDefaultFLRDevice ) ; <nl> <nl> TF_RETURN_IF_ERROR ( <nl> - graph_runner . Run ( & graph , lib , { } , { output_node } , & outputs ) ) ; <nl> + graph_runner . Run ( & graph , lib_ , { } , { output_node } , & outputs ) ) ; <nl> TF_RETURN_IF_ERROR ( GetDatasetFromVariantTensor ( outputs [ 0 ] , & dataset ) ) ; <nl> <nl> TF_RETURN_IF_ERROR ( set_iterator ( dataset - > MakeIterator ( " Iterator " ) ) ) ; <nl> class IteratorResource : public ResourceBase { <nl> params . env = ctx - > env ( ) ; <nl> params . runner = * ( ctx - > runner ( ) ) ; <nl> params . function_library = flib_def ; <nl> + params . lib = lib_ ; <nl> IteratorContext iter_ctx ( std : : move ( params ) ) ; <nl> <nl> TF_RETURN_IF_ERROR ( captured_iterator - > Restore ( & iter_ctx , reader ) ) ; <nl> class IteratorResource : public ResourceBase { <nl> } <nl> <nl> private : <nl> + / / The following ( device_mgr_ , flib_def_ , pflr_ ) are only used when the <nl> + / / IteratorResource is shared between sessions and in that case we create <nl> + / / a new FLR . Otherwise these are set to null . <nl> + std : : unique_ptr < DeviceMgr > device_mgr_ ; <nl> + std : : unique_ptr < FunctionLibraryDefinition > flib_def_ ; <nl> + std : : unique_ptr < ProcessFunctionLibraryRuntime > pflr_ ; <nl> + FunctionLibraryRuntime * lib_ = nullptr ; / / not owned . <nl> std : : shared_ptr < IteratorBase > iterator_ ; <nl> mutex mu_ ; <nl> std : : shared_ptr < StatsAggregator > stats_aggregator_ GUARDED_BY ( mu_ ) ; <nl> REGISTER_UNARY_VARIANT_DECODE_FUNCTION ( IteratorStateVariant , <nl> kIteratorVariantTypeName ) ; <nl> <nl> / / TODO ( mrry ) : Can we simply use the template kernel here ? <nl> - class IteratorHandleOp : public ResourceOpKernel < IteratorResource > { <nl> + class IteratorHandleOp : public OpKernel { <nl> public : <nl> explicit IteratorHandleOp ( OpKernelConstruction * ctx ) <nl> - : ResourceOpKernel < IteratorResource > ( ctx ) , <nl> - graph_def_version_ ( ctx - > graph_def_version ( ) ) { <nl> + : OpKernel ( ctx ) , graph_def_version_ ( ctx - > graph_def_version ( ) ) { <nl> + OP_REQUIRES_OK ( ctx , ctx - > allocate_persistent ( DT_STRING , TensorShape ( { 2 } ) , <nl> + & handle_ , nullptr ) ) ; <nl> OP_REQUIRES_OK ( ctx , ctx - > GetAttr ( " output_types " , & output_dtypes_ ) ) ; <nl> OP_REQUIRES_OK ( ctx , ctx - > GetAttr ( " output_shapes " , & output_shapes_ ) ) ; <nl> + OP_REQUIRES_OK ( ctx , ctx - > GetAttr ( " shared_name " , & name_ ) ) ; <nl> } <nl> <nl> - private : <nl> - Status CreateResource ( IteratorResource * * ret ) override <nl> - EXCLUSIVE_LOCKS_REQUIRED ( mu_ ) { <nl> - * ret = new IteratorResource ( output_dtypes_ , output_shapes_ , <nl> - graph_def_version_ ) ; <nl> - return Status : : OK ( ) ; <nl> + / / The resource is deleted from the resource manager only when it is private <nl> + / / to kernel . Ideally the resource should be deleted when it is no longer held <nl> + / / by anyone , but it would break backward compatibility . <nl> + ~ IteratorHandleOp ( ) override { <nl> + if ( resource_ ! = nullptr ) { <nl> + resource_ - > Unref ( ) ; <nl> + if ( cinfo_ . resource_is_private_to_kernel ( ) ) { <nl> + if ( ! cinfo_ . resource_manager ( ) <nl> + - > template Delete < IteratorResource > ( cinfo_ . container ( ) , <nl> + cinfo_ . name ( ) ) <nl> + . ok ( ) ) { <nl> + / / Do nothing ; the resource can have been deleted by session resets . <nl> + } <nl> + } <nl> + } <nl> } <nl> <nl> - Status VerifyResource ( IteratorResource * resource ) override { <nl> + void Compute ( OpKernelContext * context ) override LOCKS_EXCLUDED ( mu_ ) { <nl> + mutex_lock l ( mu_ ) ; <nl> + FunctionLibraryRuntime * lib = context - > function_library ( ) ; <nl> + std : : unique_ptr < DeviceMgr > device_mgr ( nullptr ) ; <nl> + std : : unique_ptr < FunctionLibraryDefinition > flib_def ( nullptr ) ; <nl> + std : : unique_ptr < ProcessFunctionLibraryRuntime > pflr ( nullptr ) ; <nl> + / / If the iterator is shared then we construct a new FLR , and pass that in . <nl> + / / NOTE ( mrry , rohanj ) : In this case it is not possible to call remote <nl> + / / functions from the iterator . We may add this functionality if there <nl> + / / is sufficient demand , but it will require a significant refactoring . <nl> + if ( ! name_ . empty ( ) ) { <nl> + lib = CreateFLR ( context , & device_mgr , & flib_def , & pflr ) ; <nl> + } <nl> + <nl> + if ( resource_ = = nullptr ) { <nl> + ResourceMgr * mgr = context - > resource_manager ( ) ; <nl> + OP_REQUIRES_OK ( context , cinfo_ . Init ( mgr , def ( ) ) ) ; <nl> + <nl> + IteratorResource * resource ; <nl> + OP_REQUIRES_OK ( <nl> + context , <nl> + mgr - > LookupOrCreate < IteratorResource > ( <nl> + cinfo_ . container ( ) , cinfo_ . name ( ) , & resource , <nl> + [ lib , & device_mgr , & flib_def , & pflr , this ] ( IteratorResource * * ret ) <nl> + EXCLUSIVE_LOCKS_REQUIRED ( mu_ ) { <nl> + * ret = new IteratorResource ( <nl> + output_dtypes_ , output_shapes_ , graph_def_version_ , <nl> + std : : move ( device_mgr ) , std : : move ( flib_def ) , <nl> + std : : move ( pflr ) , lib ) ; <nl> + return Status : : OK ( ) ; <nl> + } ) ) ; <nl> + <nl> + Status s = VerifyResource ( resource ) ; <nl> + if ( TF_PREDICT_FALSE ( ! s . ok ( ) ) ) { <nl> + resource - > Unref ( ) ; <nl> + context - > SetStatus ( s ) ; <nl> + return ; <nl> + } <nl> + <nl> + auto h = handle_ . AccessTensor ( context ) - > template flat < string > ( ) ; <nl> + h ( 0 ) = cinfo_ . container ( ) ; <nl> + h ( 1 ) = cinfo_ . name ( ) ; <nl> + resource_ = resource ; <nl> + } <nl> + if ( context - > expected_output_dtype ( 0 ) = = DT_RESOURCE ) { <nl> + OP_REQUIRES_OK ( context , MakeResourceHandleToOutput ( <nl> + context , 0 , cinfo_ . container ( ) , cinfo_ . name ( ) , <nl> + MakeTypeIndex < IteratorResource > ( ) ) ) ; <nl> + } else { <nl> + context - > set_output_ref ( 0 , & mu_ , handle_ . AccessTensor ( context ) ) ; <nl> + } <nl> + } <nl> + <nl> + private : <nl> + / / During the first Compute ( ) , resource is either created or looked up using <nl> + / / shared_name . In the latter case , the resource found should be verified if <nl> + / / it is compatible with this op ' s configuration . The verification may fail in <nl> + / / cases such as two graphs asking queues of the same shared name to have <nl> + / / inconsistent capacities . <nl> + Status VerifyResource ( IteratorResource * resource ) { <nl> TF_RETURN_IF_ERROR ( <nl> VerifyTypesMatch ( output_dtypes_ , resource - > output_dtypes ( ) ) ) ; <nl> TF_RETURN_IF_ERROR ( <nl> class IteratorHandleOp : public ResourceOpKernel < IteratorResource > { <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> - private : <nl> + FunctionLibraryRuntime * CreateFLR ( <nl> + OpKernelContext * ctx , std : : unique_ptr < DeviceMgr > * device_mgr , <nl> + std : : unique_ptr < FunctionLibraryDefinition > * flib_def , <nl> + std : : unique_ptr < ProcessFunctionLibraryRuntime > * pflr ) { <nl> + Device * device = new ThreadPoolDevice ( <nl> + SessionOptions ( ) , ctx - > device ( ) - > attributes ( ) . name ( ) , Bytes ( 256 < < 20 ) , <nl> + DeviceLocality ( ) , cpu_allocator ( ) ) ; <nl> + <nl> + device_mgr - > reset ( new DeviceMgr ( { device } ) ) ; <nl> + flib_def - > reset ( new FunctionLibraryDefinition ( <nl> + * ctx - > function_library ( ) - > GetFunctionLibraryDefinition ( ) ) ) ; <nl> + pflr - > reset ( new ProcessFunctionLibraryRuntime ( <nl> + device_mgr - > get ( ) , ctx - > env ( ) , graph_def_version_ , flib_def - > get ( ) , <nl> + { } / * TODO ( mrry ) : OptimizerOptions ? * / , <nl> + nullptr / * TODO ( mrry ) : ClusterFLR * / ) ) ; <nl> + <nl> + return ( * pflr ) - > GetFLR ( device - > name ( ) ) ; <nl> + } <nl> + <nl> + mutex mu_ ; <nl> + ContainerInfo cinfo_ GUARDED_BY ( mu_ ) ; <nl> + IteratorResource * resource_ GUARDED_BY ( mu_ ) = nullptr ; <nl> + PersistentTensor handle_ GUARDED_BY ( mu_ ) ; <nl> DataTypeVector output_dtypes_ ; <nl> std : : vector < PartialTensorShape > output_shapes_ ; <nl> const int graph_def_version_ ; <nl> + string name_ ; <nl> } ; <nl> <nl> class MakeIteratorOp : public OpKernel { <nl> class ToSingleElementOp : public AsyncOpKernel { <nl> IteratorContext : : Params params ; <nl> params . env = ctx - > env ( ) ; <nl> params . runner = * ( ctx - > runner ( ) ) ; <nl> + params . lib = ctx - > function_library ( ) ; <nl> IteratorContext iter_ctx ( std : : move ( params ) ) ; <nl> <nl> std : : vector < Tensor > components ; <nl> class OneShotIteratorOp : public AsyncOpKernel { <nl> Status TryInit ( OpKernelContext * ctx , IteratorResource * * iterator , <nl> ContainerInfo * cinfo ) { <nl> TF_RETURN_IF_ERROR ( cinfo - > Init ( ctx - > resource_manager ( ) , def ( ) ) ) ; <nl> + FunctionLibraryRuntime * lib = ctx - > function_library ( ) ; <nl> <nl> / / Create an IteratorResource that will hold the iterator for this op . <nl> TF_RETURN_IF_ERROR ( <nl> ctx - > resource_manager ( ) - > LookupOrCreate < IteratorResource > ( <nl> cinfo - > container ( ) , cinfo - > name ( ) , iterator , <nl> - [ this ] ( IteratorResource * * ret ) EXCLUSIVE_LOCKS_REQUIRED ( mu_ ) { <nl> + [ lib , this ] ( IteratorResource * * ret ) EXCLUSIVE_LOCKS_REQUIRED ( mu_ ) { <nl> * ret = new IteratorResource ( output_dtypes_ , output_shapes_ , <nl> - graph_def_version_ ) ; <nl> + graph_def_version_ , nullptr , nullptr , <nl> + nullptr , lib ) ; <nl> return Status : : OK ( ) ; <nl> } ) ) ; <nl> <nl> mmm a / tensorflow / core / kernels / data / map_and_batch_dataset_op . cc <nl> ppp b / tensorflow / core / kernels / data / map_and_batch_dataset_op . cc <nl> class MapAndBatchDatasetOp : public UnaryDatasetOpKernel { <nl> " num_parallel_batches must be greater than zero . " ) ) ; <nl> <nl> std : : unique_ptr < CapturedFunction > captured_func ; <nl> - OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( ctx , func_ , graph_def_version_ , <nl> - std : : move ( other_arguments ) , <nl> - & captured_func ) ) ; <nl> + OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( <nl> + func_ , std : : move ( other_arguments ) , & captured_func ) ) ; <nl> <nl> * output = new Dataset ( input , batch_size , num_parallel_batches , <nl> output_types_ , output_shapes_ , <nl> class MapAndBatchDatasetOp : public UnaryDatasetOpKernel { <nl> / / to unblock a consumer . <nl> FunctionLibraryRuntime : : Options opts ; <nl> opts . step_id = CapturedFunction : : generate_step_id ( ) ; <nl> - ScopedStepContainer * step_container = <nl> - new ScopedStepContainer ( opts . step_id , [ this ] ( const string & name ) { <nl> - dataset ( ) <nl> - - > captured_func_ - > resource_manager ( ) <nl> - - > Cleanup ( name ) <nl> - . IgnoreError ( ) ; <nl> + ResourceMgr * resource_mgr = ctx - > lib ( ) - > device ( ) - > resource_manager ( ) ; <nl> + ScopedStepContainer * step_container = new ScopedStepContainer ( <nl> + opts . step_id , [ resource_mgr ] ( const string & name ) { <nl> + resource_mgr - > Cleanup ( name ) . IgnoreError ( ) ; <nl> } ) ; <nl> opts . step_container = step_container ; <nl> std : : function < void ( std : : function < void ( ) > ) > * runner = <nl> new std : : function < void ( std : : function < void ( ) > ) > ( * ctx - > runner ( ) ) ; <nl> opts . runner = runner ; <nl> + FunctionLibraryRuntime * lib = ctx - > lib ( ) ; <nl> + FunctionLibraryRuntime : : InstantiateOptions inst_opts ; <nl> + inst_opts . overlay_lib = ctx - > function_library ( ) . get ( ) ; <nl> + <nl> ( * ctx - > runner ( ) ) ( std : : bind ( <nl> - [ = ] ( std : : vector < Tensor > input_element ) { <nl> + [ this , lib , inst_opts , opts , result , step_container , runner , <nl> + batch_result , offset ] ( std : : vector < Tensor > input_element ) { <nl> dataset ( ) - > captured_func_ - > RunAsync ( <nl> - opts , std : : move ( input_element ) , & result - > return_values , <nl> + lib , inst_opts , opts , std : : move ( input_element ) , <nl> + & result - > return_values , <nl> [ this , step_container , runner , result , batch_result , <nl> offset ] ( Status ret_status ) { <nl> delete step_container ; <nl> mmm a / tensorflow / core / kernels / data / map_dataset_op . cc <nl> ppp b / tensorflow / core / kernels / data / map_dataset_op . cc <nl> class MapDatasetOp : public UnaryDatasetOpKernel { <nl> } <nl> <nl> std : : unique_ptr < CapturedFunction > captured_func ; <nl> - OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( ctx , func_ , graph_def_version_ , <nl> - std : : move ( other_arguments ) , <nl> - & captured_func ) ) ; <nl> + OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( <nl> + func_ , std : : move ( other_arguments ) , & captured_func ) ) ; <nl> <nl> * output = new Dataset ( ctx , input , func_ , std : : move ( captured_func ) , <nl> output_types_ , output_shapes_ ) ; <nl> class MapDatasetOp : public UnaryDatasetOpKernel { <nl> <nl> FunctionLibraryRuntime : : Options opts ; <nl> opts . step_id = CapturedFunction : : generate_step_id ( ) ; <nl> - ScopedStepContainer step_container ( <nl> - opts . step_id , [ this ] ( const string & name ) { <nl> - dataset ( ) <nl> - - > captured_func_ - > resource_manager ( ) <nl> - - > Cleanup ( name ) <nl> - . IgnoreError ( ) ; <nl> - } ) ; <nl> + <nl> + ScopedStepContainer step_container ( opts . step_id , [ ctx ] ( const string & <nl> + name ) { <nl> + ctx - > lib ( ) - > device ( ) - > resource_manager ( ) - > Cleanup ( name ) . IgnoreError ( ) ; <nl> + } ) ; <nl> opts . step_container = & step_container ; <nl> opts . runner = ctx - > runner ( ) ; <nl> / / TODO ( mrry ) : Avoid blocking a threadpool thread . We will need to <nl> / / stack - rip the iterators and use async kernels . <nl> - Status s = <nl> - dataset ( ) - > captured_func_ - > Run ( opts , std : : move ( args ) , out_tensors ) ; <nl> + Status s = dataset ( ) - > captured_func_ - > Run ( ctx , opts , std : : move ( args ) , <nl> + out_tensors ) ; <nl> if ( errors : : IsOutOfRange ( s ) ) { <nl> / / ` f ` may deliberately raise ` errors : : OutOfRange ` to indicate <nl> / / that we should terminate the iteration early . <nl> mmm a / tensorflow / core / kernels / data / parallel_interleave_dataset_op . cc <nl> ppp b / tensorflow / core / kernels / data / parallel_interleave_dataset_op . cc <nl> class ParallelInterleaveDatasetOp : public UnaryDatasetOpKernel { <nl> errors : : InvalidArgument ( " ` prefetch_input_elements ` must be > = 0 " ) ) ; <nl> <nl> std : : unique_ptr < CapturedFunction > captured_func ; <nl> - OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( ctx , func_ , graph_def_version_ , <nl> - std : : move ( other_arguments ) , <nl> - & captured_func ) ) ; <nl> + OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( <nl> + func_ , std : : move ( other_arguments ) , & captured_func ) ) ; <nl> <nl> * output = <nl> new Dataset ( input , std : : move ( captured_func ) , cycle_length , block_length , <nl> mmm a / tensorflow / core / kernels / data / parallel_map_dataset_op . cc <nl> ppp b / tensorflow / core / kernels / data / parallel_map_dataset_op . cc <nl> class ParallelMapDatasetOp : public UnaryDatasetOpKernel { <nl> " num_parallel_calls must be greater than zero . " ) ) ; <nl> <nl> std : : unique_ptr < CapturedFunction > captured_func ; <nl> - OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( ctx , func_ , graph_def_version_ , <nl> - std : : move ( other_arguments ) , <nl> - & captured_func ) ) ; <nl> + OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( <nl> + func_ , std : : move ( other_arguments ) , & captured_func ) ) ; <nl> <nl> * output = new Dataset ( ctx , input , func_ , num_parallel_calls , output_types_ , <nl> output_shapes_ , std : : move ( captured_func ) ) ; <nl> class ParallelMapDatasetOp : public UnaryDatasetOpKernel { <nl> <nl> FunctionLibraryRuntime : : Options opts ; <nl> opts . step_id = CapturedFunction : : generate_step_id ( ) ; <nl> - ScopedStepContainer * step_container = <nl> - new ScopedStepContainer ( opts . step_id , [ this ] ( const string & name ) { <nl> - dataset ( ) <nl> - - > captured_func_ - > resource_manager ( ) <nl> - - > Cleanup ( name ) <nl> - . IgnoreError ( ) ; <nl> + ResourceMgr * resource_manager = <nl> + ctx - > lib ( ) - > device ( ) - > resource_manager ( ) ; <nl> + ScopedStepContainer * step_container = new ScopedStepContainer ( <nl> + opts . step_id , [ resource_manager ] ( const string & name ) { <nl> + resource_manager - > Cleanup ( name ) . IgnoreError ( ) ; <nl> } ) ; <nl> opts . step_container = step_container ; <nl> opts . runner = ctx - > runner ( ) ; <nl> + FunctionLibraryRuntime : : InstantiateOptions inst_opts ; <nl> + inst_opts . overlay_lib = ctx - > function_library ( ) . get ( ) ; <nl> + <nl> dataset ( ) - > captured_func_ - > RunAsync ( <nl> - opts , std : : move ( input_element ) , & result - > return_values , <nl> + ctx - > lib ( ) , inst_opts , opts , std : : move ( input_element ) , <nl> + & result - > return_values , <nl> [ result , step_container , result_index ] ( Status ret_status ) { <nl> delete step_container ; <nl> result - > status . Update ( ret_status ) ; <nl> mmm a / tensorflow / core / kernels / data / scan_dataset_op . cc <nl> ppp b / tensorflow / core / kernels / data / scan_dataset_op . cc <nl> class ScanDatasetOp : public UnaryDatasetOpKernel { <nl> } <nl> <nl> std : : unique_ptr < CapturedFunction > captured_func ; <nl> - OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( ctx , func_ , graph_def_version_ , <nl> - std : : move ( other_arguments ) , <nl> - & captured_func ) ) ; <nl> + OP_REQUIRES_OK ( ctx , CapturedFunction : : Create ( <nl> + func_ , std : : move ( other_arguments ) , & captured_func ) ) ; <nl> <nl> * output = new Dataset ( ctx , input , func_ , std : : move ( initial_state ) , <nl> std : : move ( captured_func ) , state_types_ , output_types_ , <nl> class ScanDatasetOp : public UnaryDatasetOpKernel { <nl> <nl> FunctionLibraryRuntime : : Options opts ; <nl> opts . step_id = CapturedFunction : : generate_step_id ( ) ; <nl> - ScopedStepContainer step_container ( <nl> - opts . step_id , [ this ] ( const string & name ) { <nl> - dataset ( ) <nl> - - > captured_func_ - > resource_manager ( ) <nl> - - > Cleanup ( name ) <nl> - . IgnoreError ( ) ; <nl> - } ) ; <nl> + ScopedStepContainer step_container ( opts . step_id , [ ctx ] ( const string & <nl> + name ) { <nl> + ctx - > lib ( ) - > device ( ) - > resource_manager ( ) - > Cleanup ( name ) . IgnoreError ( ) ; <nl> + } ) ; <nl> opts . step_container = & step_container ; <nl> opts . runner = ctx - > runner ( ) ; <nl> std : : vector < Tensor > state_and_output ; <nl> state_and_output . reserve ( dataset ( ) - > state_types_ . size ( ) + <nl> output_dtypes ( ) . size ( ) ) ; <nl> - Status s = dataset ( ) - > captured_func_ - > Run ( opts , std : : move ( args ) , <nl> + <nl> + Status s = dataset ( ) - > captured_func_ - > Run ( ctx , opts , std : : move ( args ) , <nl> & state_and_output ) ; <nl> if ( s . ok ( ) ) { <nl> state_ . clear ( ) ; <nl> mmm a / tensorflow / core / kernels / lookup_table_init_op . cc <nl> ppp b / tensorflow / core / kernels / lookup_table_init_op . cc <nl> class InitializeTableOp : public OpKernel { <nl> } <nl> OP_REQUIRES_OK ( ctx , table - > Initialize ( iter ) ) ; <nl> if ( ctx - > track_allocations ( ) ) { <nl> - ctx - > record_host_persistent_memory_allocation ( table - > MemoryUsed ( ) - <nl> - memory_used_before ) ; <nl> + ctx - > record_persistent_memory_allocation ( table - > MemoryUsed ( ) - <nl> + memory_used_before ) ; <nl> } <nl> } <nl> <nl> class InitializeTableFromTextFileOp : public OpKernel { <nl> vocab_filename , vocab_size_ , delimiter_ , key_index_ , <nl> value_index_ , ctx - > env ( ) , table ) ) ; <nl> if ( ctx - > track_allocations ( ) ) { <nl> - ctx - > record_host_persistent_memory_allocation ( table - > MemoryUsed ( ) - <nl> - memory_used_before ) ; <nl> + ctx - > record_persistent_memory_allocation ( table - > MemoryUsed ( ) - <nl> + memory_used_before ) ; <nl> } <nl> } <nl> <nl> mmm a / tensorflow / core / kernels / lookup_table_op . cc <nl> ppp b / tensorflow / core / kernels / lookup_table_op . cc <nl> class LookupTableInsertOp : public OpKernel { <nl> } <nl> OP_REQUIRES_OK ( ctx , table - > Insert ( ctx , keys , values ) ) ; <nl> if ( ctx - > track_allocations ( ) ) { <nl> - ctx - > record_host_persistent_memory_allocation ( table - > MemoryUsed ( ) - <nl> - memory_used_before ) ; <nl> + ctx - > record_persistent_memory_allocation ( table - > MemoryUsed ( ) - <nl> + memory_used_before ) ; <nl> } <nl> } <nl> } ; <nl> class LookupTableImportOp : public OpKernel { <nl> } <nl> OP_REQUIRES_OK ( ctx , table - > ImportValues ( ctx , keys , values ) ) ; <nl> if ( ctx - > track_allocations ( ) ) { <nl> - ctx - > record_host_persistent_memory_allocation ( table - > MemoryUsed ( ) - <nl> - memory_used_before ) ; <nl> + ctx - > record_persistent_memory_allocation ( table - > MemoryUsed ( ) - <nl> + memory_used_before ) ; <nl> } <nl> } <nl> } ; <nl> mmm a / tensorflow / core / kernels / lookup_table_op . h <nl> ppp b / tensorflow / core / kernels / lookup_table_op . h <nl> class LookupTableOp : public OpKernel { <nl> return ctx - > status ( ) ; <nl> } <nl> if ( ctx - > track_allocations ( ) ) { <nl> - ctx - > record_host_persistent_memory_allocation ( <nl> + ctx - > record_persistent_memory_allocation ( <nl> container - > MemoryUsed ( ) + table_handle_ . AllocatedBytes ( ) ) ; <nl> } <nl> * ret = container ; <nl> new file mode 100644 <nl> index 0000000000000 . . cf0007b5b6776 <nl> mmm / dev / null <nl> ppp b / tensorflow / core / kernels / matrix_logarithm_op . cc <nl> <nl> + / * Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + / / See docs in . . / ops / linalg_ops . cc . <nl> + <nl> + # include " third_party / eigen3 / Eigen / Core " <nl> + # include " third_party / eigen3 / unsupported / Eigen / MatrixFunctions " <nl> + # include " tensorflow / core / framework / kernel_def_builder . h " <nl> + # include " tensorflow / core / framework / op_kernel . h " <nl> + # include " tensorflow / core / framework / tensor_shape . h " <nl> + # include " tensorflow / core / kernels / linalg_ops_common . h " <nl> + # include " tensorflow / core / lib / core / errors . h " <nl> + # include " tensorflow / core / platform / logging . h " <nl> + # include " tensorflow / core / platform / macros . h " <nl> + # include " tensorflow / core / platform / types . h " <nl> + <nl> + <nl> + namespace tensorflow { <nl> + <nl> + template < class Scalar > <nl> + class MatrixLogarithmOp : public LinearAlgebraOp < Scalar > { <nl> + public : <nl> + INHERIT_LINALG_TYPEDEFS ( Scalar ) ; <nl> + <nl> + explicit MatrixLogarithmOp ( OpKernelConstruction * context ) : Base ( context ) { } <nl> + <nl> + void ComputeMatrix ( OpKernelContext * context , const ConstMatrixMaps & inputs , <nl> + MatrixMaps * outputs ) final { <nl> + const ConstMatrixMap & input = inputs [ 0 ] ; <nl> + if ( input . rows ( ) = = 0 ) return ; <nl> + using Matrix = Eigen : : Matrix < Scalar , Eigen : : Dynamic , Eigen : : Dynamic , Eigen : : RowMajor > ; <nl> + Matrix tmp = input ; <nl> + outputs - > at ( 0 ) = tmp . log ( ) ; <nl> + } <nl> + <nl> + private : <nl> + TF_DISALLOW_COPY_AND_ASSIGN ( MatrixLogarithmOp ) ; <nl> + } ; <nl> + <nl> + / / For real - valued matrices , this Op would return the real part of the matrix <nl> + / / logarithm . If all eigenvalues are positive , then this returns the correct <nl> + / / logarithm , however checking for positive definiteness adds significant <nl> + / / overhead . Therefore at present we only register this Op for complex types . <nl> + REGISTER_LINALG_OP ( " MatrixLogarithm " , <nl> + ( MatrixLogarithmOp < complex64 > ) , complex64 ) ; <nl> + REGISTER_LINALG_OP ( " MatrixLogarithm " , <nl> + ( MatrixLogarithmOp < complex128 > ) , complex128 ) ; <nl> + <nl> + } / / namespace tensorflow <nl> mmm a / tensorflow / core / kernels / queue_op . h <nl> ppp b / tensorflow / core / kernels / queue_op . h <nl> class QueueOp : public ResourceOpKernel < QueueInterface > { <nl> void Compute ( OpKernelContext * context ) override { <nl> ResourceOpKernel < QueueInterface > : : Compute ( context ) ; <nl> if ( resource_ & & context - > track_allocations ( ) ) { <nl> - context - > record_host_persistent_memory_allocation ( <nl> - resource_ - > MemoryUsed ( ) ) ; <nl> + context - > record_persistent_memory_allocation ( resource_ - > MemoryUsed ( ) ) ; <nl> } <nl> } <nl> <nl> mmm a / tensorflow / core / kernels / reduction_ops_common . h <nl> ppp b / tensorflow / core / kernels / reduction_ops_common . h <nl> class ReductionOp : public OpKernel { <nl> ctx - > SetStatus ( errors : : Internal ( " Error during reduction copy . " ) ) ; <nl> } <nl> if ( ctx - > track_allocations ( ) ) { <nl> - / / The temporary memory becomes the output memory . <nl> - if ( ctx - > allocate_on_host ( alloc_attr ) ) { <nl> - ctx - > record_host_temp_memory_size ( <nl> - - static_cast < int64 > ( out . AllocatedBytes ( ) ) ) ; <nl> - } else { <nl> - ctx - > record_device_temp_memory_size ( <nl> - - static_cast < int64 > ( out . AllocatedBytes ( ) ) ) ; <nl> - } <nl> + ctx - > record_temp_memory_size ( - static_cast < int64 > ( out . AllocatedBytes ( ) ) ) ; <nl> } <nl> ctx - > set_output ( 0 , out ) ; <nl> } <nl> mmm a / tensorflow / core / kernels / variable_ops . cc <nl> ppp b / tensorflow / core / kernels / variable_ops . cc <nl> void VariableOp : : Compute ( OpKernelContext * ctx ) { <nl> AllocatorAttributes attr ; <nl> attr . set_gpu_compatible ( true ) ; <nl> attr . set_nic_compatible ( true ) ; <nl> - if ( ctx - > allocate_on_host ( attr ) ) { <nl> - ctx - > record_host_persistent_memory_allocation ( <nl> - var - > tensor ( ) - > AllocatedBytes ( ) ) ; <nl> - } else { <nl> - ctx - > record_device_persistent_memory_allocation ( <nl> - var - > tensor ( ) - > AllocatedBytes ( ) ) ; <nl> - } <nl> + ctx - > record_persistent_memory_allocation ( var - > tensor ( ) - > AllocatedBytes ( ) ) ; <nl> } <nl> var - > Unref ( ) ; <nl> } <nl> class TemporaryVariableOp : public OpKernel { <nl> var_name_ , tmp_var ) ) ; <nl> context - > set_output_ref ( 0 , & tmp_var - > mu , & tmp_var - > val ) ; <nl> if ( context - > track_allocations ( ) ) { <nl> - AllocatorAttributes attr ; <nl> - if ( context - > allocate_on_host ( attr ) ) { <nl> - context - > record_host_persistent_memory_allocation ( <nl> - tmp_var - > val . AllocatedBytes ( ) ) ; <nl> - } else { <nl> - context - > record_device_persistent_memory_allocation ( <nl> - tmp_var - > val . AllocatedBytes ( ) ) ; <nl> - } <nl> + context - > record_persistent_memory_allocation ( <nl> + tmp_var - > val . AllocatedBytes ( ) ) ; <nl> } <nl> } <nl> <nl> class DestroyTemporaryVariableOp : public OpKernel { <nl> OP_REQUIRES_OK ( context , rm - > Delete < TemporaryVariableOp : : TmpVar > ( <nl> context - > step_container ( ) - > name ( ) , var_name_ ) ) ; <nl> if ( context - > track_allocations ( ) ) { <nl> - if ( context - > allocate_on_host ( AllocatorAttributes ( ) ) ) { <nl> - context - > record_host_persistent_memory_allocation ( <nl> - - static_cast < int64 > ( tmpvar . AllocatedBytes ( ) ) ) ; <nl> - } else { <nl> - context - > record_device_persistent_memory_allocation ( <nl> - - static_cast < int64 > ( tmpvar . AllocatedBytes ( ) ) ) ; <nl> - } <nl> + context - > record_persistent_memory_allocation ( <nl> + - static_cast < int64 > ( tmpvar . AllocatedBytes ( ) ) ) ; <nl> } <nl> } <nl> <nl> mmm a / tensorflow / core / ops / compat / ops_history . v1 . pbtxt <nl> ppp b / tensorflow / core / ops / compat / ops_history . v1 . pbtxt <nl> op { <nl> } <nl> } <nl> } <nl> + op { <nl> + name : " MatrixLogarithm " <nl> + input_arg { <nl> + name : " input " <nl> + type_attr : " T " <nl> + } <nl> + output_arg { <nl> + name : " output " <nl> + type_attr : " T " <nl> + } <nl> + attr { <nl> + name : " T " <nl> + type : " type " <nl> + allowed_values { <nl> + list { <nl> + type : DT_COMPLEX64 <nl> + type : DT_COMPLEX128 <nl> + } <nl> + } <nl> + } <nl> + } <nl> op { <nl> name : " MatrixSetDiag " <nl> input_arg { <nl> mmm a / tensorflow / core / ops / linalg_ops . cc <nl> ppp b / tensorflow / core / ops / linalg_ops . cc <nl> REGISTER_OP ( " MatrixExponential " ) <nl> . Attr ( " T : { double , float , complex64 , complex128 } " ) <nl> . SetShapeFn ( BatchUnchangedSquareShapeFn ) ; <nl> <nl> + REGISTER_OP ( " MatrixLogarithm " ) <nl> + . Input ( " input : T " ) <nl> + . Output ( " output : T " ) <nl> + . Attr ( " T : { complex64 , complex128 } " ) <nl> + . SetShapeFn ( BatchUnchangedSquareShapeFn ) ; <nl> + <nl> REGISTER_OP ( " Cholesky " ) <nl> . Input ( " input : T " ) <nl> . Output ( " output : T " ) <nl> mmm a / tensorflow / core / ops / ops . pbtxt <nl> ppp b / tensorflow / core / ops / ops . pbtxt <nl> op { <nl> } <nl> } <nl> } <nl> + op { <nl> + name : " MatrixLogarithm " <nl> + input_arg { <nl> + name : " input " <nl> + type_attr : " T " <nl> + } <nl> + output_arg { <nl> + name : " output " <nl> + type_attr : " T " <nl> + } <nl> + attr { <nl> + name : " T " <nl> + type : " type " <nl> + allowed_values { <nl> + list { <nl> + type : DT_COMPLEX64 <nl> + type : DT_COMPLEX128 <nl> + } <nl> + } <nl> + } <nl> + } <nl> op { <nl> name : " MatrixSetDiag " <nl> input_arg { <nl> mmm a / tensorflow / core / platform / env . cc <nl> ppp b / tensorflow / core / platform / env . cc <nl> Status Env : : GetFileSystemForFile ( const string & fname , FileSystem * * result ) { <nl> io : : ParseURI ( fname , & scheme , & host , & path ) ; <nl> FileSystem * file_system = file_system_registry_ - > Lookup ( scheme . ToString ( ) ) ; <nl> if ( ! file_system ) { <nl> - return errors : : Unimplemented ( " File system scheme " , scheme , <nl> - " not implemented " ) ; <nl> + if ( scheme . empty ( ) ) { <nl> + scheme = " [ local ] " ; <nl> + } <nl> + <nl> + return errors : : Unimplemented ( " File system scheme ' " , scheme , <nl> + " ' not implemented ( file : ' " , fname , " ' ) " ) ; <nl> } <nl> * result = file_system ; <nl> return Status : : OK ( ) ; <nl> bool Env : : FilesExist ( const std : : vector < string > & files , <nl> if ( ! file_system ) { <nl> fs_result = false ; <nl> if ( fs_status ) { <nl> - Status s = errors : : Unimplemented ( " File system scheme " , itr . first , <nl> - " not implemented " ) ; <nl> + Status s = errors : : Unimplemented ( " File system scheme ' " , itr . first , <nl> + " ' not implemented " ) ; <nl> local_status . resize ( itr . second . size ( ) , s ) ; <nl> } <nl> } else { <nl> Binary files a / tensorflow / core / profiler / internal / testdata / run_meta and b / tensorflow / core / profiler / internal / testdata / run_meta differ <nl> mmm a / tensorflow / core / profiler / internal / tfprof_node . cc <nl> ppp b / tensorflow / core / profiler / internal / tfprof_node . cc <nl> void ExecStep : : AddMemoryStats ( const string & dev , <nl> exec_mem . set_output_bytes ( total_output_bytes ) ; <nl> <nl> if ( step_stat . has_memory_stats ( ) ) { <nl> - exec_mem . set_host_temp_bytes ( <nl> - exec_mem . host_temp_bytes ( ) + <nl> - step_stat . memory_stats ( ) . host_temp_memory_size ( ) ) ; <nl> - exec_mem . set_host_persistent_bytes ( <nl> - exec_mem . host_persistent_bytes ( ) + <nl> - step_stat . memory_stats ( ) . host_persistent_memory_size ( ) ) ; <nl> - exec_mem . set_accelerator_temp_bytes ( <nl> - exec_mem . accelerator_temp_bytes ( ) + <nl> - step_stat . memory_stats ( ) . device_temp_memory_size ( ) ) ; <nl> - exec_mem . set_accelerator_persistent_bytes ( <nl> - exec_mem . accelerator_persistent_bytes ( ) + <nl> - step_stat . memory_stats ( ) . device_persistent_memory_size ( ) ) ; <nl> + if ( IsPlacedOnCPU ( dev ) ) { <nl> + / / Currently we assume ops placed on gpu only allocate memory on gpu . <nl> + exec_mem . set_host_temp_bytes ( exec_mem . host_temp_bytes ( ) + <nl> + step_stat . memory_stats ( ) . temp_memory_size ( ) ) ; <nl> + exec_mem . set_host_persistent_bytes ( <nl> + exec_mem . host_persistent_bytes ( ) + <nl> + step_stat . memory_stats ( ) . persistent_memory_size ( ) ) ; <nl> + } else { <nl> + exec_mem . set_accelerator_temp_bytes ( <nl> + exec_mem . accelerator_temp_bytes ( ) + <nl> + step_stat . memory_stats ( ) . temp_memory_size ( ) ) ; <nl> + exec_mem . set_accelerator_persistent_bytes ( <nl> + exec_mem . accelerator_persistent_bytes ( ) + <nl> + step_stat . memory_stats ( ) . persistent_memory_size ( ) ) ; <nl> + } <nl> } <nl> <nl> / / TODO ( xpan ) : Make this more accurate : <nl> mmm a / tensorflow / core / profiler / internal / tfprof_show . cc <nl> ppp b / tensorflow / core / profiler / internal / tfprof_show . cc <nl> limitations under the License . <nl> namespace tensorflow { <nl> namespace tfprof { <nl> <nl> - const GraphNodeProto & TFShow : : Show ( const Options & opts ) { <nl> + const GraphNodeProto & TFShow : : Show ( const string & prefix , const Options & opts ) { <nl> if ( opts . output_type = = kOutput [ 0 ] ) { <nl> Timeline timeline ( opts . step , opts . output_options . at ( kTimelineOpts [ 0 ] ) ) ; <nl> return ShowInternal ( opts , & timeline ) - > proto ( ) ; <nl> } else { <nl> const ShowNode * ret = ShowInternal ( opts , nullptr ) ; <nl> if ( opts . output_type = = kOutput [ 1 ] ) { <nl> - printf ( " % s " , ret - > formatted_str . c_str ( ) ) ; <nl> + printf ( " % s " , ( prefix + ret - > formatted_str ) . c_str ( ) ) ; <nl> fflush ( stdout ) ; <nl> } else if ( opts . output_type = = kOutput [ 2 ] ) { <nl> Status s = WriteStringToFile ( Env : : Default ( ) , <nl> opts . output_options . at ( kFileOpts [ 0 ] ) , <nl> - ret - > formatted_str ) ; <nl> + prefix + ret - > formatted_str ) ; <nl> if ( ! s . ok ( ) ) { <nl> fprintf ( stderr , " % s \ n " , s . ToString ( ) . c_str ( ) ) ; <nl> } <nl> mmm a / tensorflow / core / profiler / internal / tfprof_show . h <nl> ppp b / tensorflow / core / profiler / internal / tfprof_show . h <nl> class TFShow { <nl> virtual ~ TFShow ( ) { } <nl> virtual void AddNode ( TFGraphNode * node ) = 0 ; <nl> virtual void Build ( ) = 0 ; <nl> - const GraphNodeProto & Show ( const Options & opts ) ; <nl> + virtual const GraphNodeProto & Show ( const string & prefix , <nl> + const Options & opts ) final ; <nl> <nl> protected : <nl> virtual const ShowNode * ShowInternal ( const Options & opts , <nl> mmm a / tensorflow / core / profiler / internal / tfprof_show_multi . cc <nl> ppp b / tensorflow / core / profiler / internal / tfprof_show_multi . cc <nl> limitations under the License . <nl> namespace tensorflow { <nl> namespace tfprof { <nl> <nl> - const MultiGraphNodeProto & TFMultiShow : : Show ( const Options & opts ) { <nl> + const MultiGraphNodeProto & TFMultiShow : : Show ( const string & prefix , <nl> + const Options & opts ) { <nl> if ( opts . output_type = = kOutput [ 0 ] ) { <nl> Timeline timeline ( opts . step , opts . output_options . at ( kTimelineOpts [ 0 ] ) ) ; <nl> return ShowInternal ( opts , & timeline ) - > proto ( ) ; <nl> } else { <nl> const ShowMultiNode * ret = ShowInternal ( opts , nullptr ) ; <nl> if ( opts . output_type = = kOutput [ 1 ] ) { <nl> - printf ( " % s " , ret - > formatted_str . c_str ( ) ) ; <nl> + printf ( " % s " , ( prefix + ret - > formatted_str ) . c_str ( ) ) ; <nl> fflush ( stdout ) ; <nl> } else if ( opts . output_type = = kOutput [ 2 ] ) { <nl> Status s = WriteStringToFile ( Env : : Default ( ) , <nl> opts . output_options . at ( kFileOpts [ 0 ] ) , <nl> - ret - > formatted_str ) ; <nl> + prefix + ret - > formatted_str ) ; <nl> if ( ! s . ok ( ) ) { <nl> fprintf ( stderr , " % s \ n " , s . ToString ( ) . c_str ( ) ) ; <nl> } <nl> mmm a / tensorflow / core / profiler / internal / tfprof_show_multi . h <nl> ppp b / tensorflow / core / profiler / internal / tfprof_show_multi . h <nl> class TFMultiShow { <nl> virtual ~ TFMultiShow ( ) { } <nl> virtual void AddNode ( TFGraphNode * node ) = 0 ; <nl> virtual void Build ( ) = 0 ; <nl> - const MultiGraphNodeProto & Show ( const Options & opts ) ; <nl> + virtual const MultiGraphNodeProto & Show ( const string & prefix , <nl> + const Options & opts ) final ; <nl> <nl> protected : <nl> virtual const ShowMultiNode * ShowInternal ( const Options & opts , <nl> mmm a / tensorflow / core / profiler / internal / tfprof_show_test . cc <nl> ppp b / tensorflow / core / profiler / internal / tfprof_show_test . cc <nl> limitations under the License . <nl> <nl> namespace tensorflow { <nl> namespace tfprof { <nl> + <nl> + string CheckAndRemoveDoc ( const string & doc ) { <nl> + auto pos = doc . find ( " Profile : " ) ; <nl> + CHECK ( pos ! = doc . npos ) ; <nl> + return doc . substr ( pos + 9 ) ; <nl> + } <nl> + <nl> class TFProfShowTest : public : : testing : : Test { <nl> protected : <nl> TFProfShowTest ( ) { <nl> TEST_F ( TFProfShowTest , DumpScopeMode ) { <nl> " 1 . 28KB / 1 . 28KB , 1 . 28KB / 1 . 28KB , 1 . 28KB / 1 . 28KB , 11us / 11us , 0us / 0us , " <nl> " 11us / 11us ) \ n ScalarW ( 1 , 1 / 1 params , 0 / 0 flops , 0B / 0B , 0B / 0B , 0B / 0B , " <nl> " 0B / 0B , 0us / 0us , 0us / 0us , 0us / 0us ) \ n " , <nl> - dump_str ) ; <nl> + CheckAndRemoveDoc ( dump_str ) ) ; <nl> <nl> EXPECT_EQ ( dump_str , TestToFromProto ( " scope " , opts ) ) ; <nl> } <nl> TEST_F ( TFProfShowTest , DumpAcceleratorAndCPUMicros ) { <nl> " 0us / 0us ) \ n ScalarW / Initializer / random_normal / stddev ( 0us / 0us , " <nl> " 0us / 0us ) \ n ScalarW / read ( 0us / 0us , 0us / 0us ) \ n init ( 0us / 0us , " <nl> " 0us / 0us ) \ n " , <nl> - dump_str ) ; <nl> + CheckAndRemoveDoc ( dump_str ) ) ; <nl> <nl> EXPECT_EQ ( dump_str , TestToFromProto ( " scope " , opts ) ) ; <nl> } <nl> TEST_F ( TFProfShowTest , DumpOpMode ) { <nl> " type : 0 : 1 \ t ( run * 0 | defined * 1 ) \ texec_time : 0us \ ninput_type : 0 : 2x2x6x12 \ t ( run * " <nl> " 0 | defined * 1 ) \ texec_time : 0us \ ninput_type : 0 : 3x3x3x6 \ t ( run * 0 | defined * 1 ) " <nl> " \ texec_time : 0us \ n \ n " , <nl> - StringReplace ( dump_str , " " , " " ) ) ; <nl> + StringReplace ( CheckAndRemoveDoc ( dump_str ) , " " , " " ) ) ; <nl> <nl> EXPECT_EQ ( dump_str , TestToFromProto ( " op " , opts , true ) ) ; <nl> } <nl> mmm a / tensorflow / core / profiler / internal / tfprof_stats . cc <nl> ppp b / tensorflow / core / profiler / internal / tfprof_stats . cc <nl> limitations under the License . <nl> namespace tensorflow { <nl> namespace tfprof { <nl> namespace { <nl> + <nl> + const char * const kProfilePrefix = " Profile : \ n " ; <nl> + <nl> bool CreateRunMetadataNode ( const string & name , NodeDef * def ) { <nl> / / TODO ( xpan ) : Better solution than blacklisting this 2 nodes . They <nl> / / actually cost some resources , maybe include them . Some nodes , such <nl> TFStats : : TFStats ( std : : unique_ptr < GraphDef > graph , <nl> std : : unique_ptr < OpLogProto > op_log , <nl> std : : unique_ptr < checkpoint : : CheckpointReader > ckpt_reader ) <nl> : has_code_traces_ ( false ) , <nl> - miss_gpu_stream_ ( false ) , <nl> + miss_accelerator_stream_ ( false ) , <nl> ckpt_reader_ ( std : : move ( ckpt_reader ) ) { <nl> CHECK ( graph ) < < " Must at least have GraphDef " ; <nl> <nl> TFStats : : TFStats ( std : : unique_ptr < GraphDef > graph , <nl> TFStats : : TFStats ( const string & filename , <nl> std : : unique_ptr < checkpoint : : CheckpointReader > ckpt_reader ) <nl> : has_code_traces_ ( false ) , <nl> - miss_gpu_stream_ ( false ) , <nl> + miss_accelerator_stream_ ( false ) , <nl> ckpt_reader_ ( std : : move ( ckpt_reader ) ) { <nl> string str ; <nl> Status s = ReadFileToString ( Env : : Default ( ) , filename , & str ) ; <nl> const GraphNodeProto & TFStats : : ShowGraphNode ( const string & cmd , <nl> if ( ! Validate ( opts ) ) { <nl> return empty_graph_node_ ; <nl> } <nl> + string prefix = MaybeReportMissingTrace ( ) ; <nl> + prefix + = QueryDoc ( cmd , opts ) + kProfilePrefix ; <nl> + <nl> if ( cmd = = kCmds [ 0 ] ) { <nl> - return scope_view_ - > Show ( opts ) ; <nl> + return scope_view_ - > Show ( prefix , opts ) ; <nl> } else if ( cmd = = kCmds [ 1 ] ) { <nl> if ( opts . step < 0 & & opts . output_type = = kOutput [ 0 ] ) { <nl> for ( int64 step : steps_ ) { <nl> Options nopts = opts ; <nl> nopts . step = step ; <nl> - graph_view_ - > Show ( nopts ) ; <nl> + graph_view_ - > Show ( prefix , nopts ) ; <nl> } <nl> return empty_graph_node_ ; <nl> } <nl> - return graph_view_ - > Show ( opts ) ; <nl> + return graph_view_ - > Show ( prefix , opts ) ; <nl> } else { <nl> fprintf ( stderr , " Unknown command : % s \ n " , cmd . c_str ( ) ) ; <nl> return empty_graph_node_ ; <nl> const MultiGraphNodeProto & TFStats : : ShowMultiGraphNode ( <nl> if ( ! Validate ( opts ) ) { <nl> return empty_multi_graph_node_ ; <nl> } <nl> + string prefix = MaybeReportMissingTrace ( ) ; <nl> + prefix + = QueryDoc ( cmd , opts ) + kProfilePrefix ; <nl> + <nl> if ( cmd = = kCmds [ 2 ] ) { <nl> if ( ! has_code_traces ( ) ) { <nl> fprintf ( stderr , " No code trace information \ n " ) ; <nl> return empty_multi_graph_node_ ; <nl> } <nl> - return code_view_ - > Show ( opts ) ; <nl> + return code_view_ - > Show ( prefix , opts ) ; <nl> } else if ( cmd = = kCmds [ 3 ] ) { <nl> - return op_view_ - > Show ( opts ) ; <nl> + return op_view_ - > Show ( prefix , opts ) ; <nl> } else { <nl> fprintf ( stderr , " Unknown command : % s \ n " , cmd . c_str ( ) ) ; <nl> return empty_multi_graph_node_ ; <nl> void TFStats : : AddRunMeta ( int64 step , std : : unique_ptr < RunMetadata > run_meta ) { <nl> } <nl> <nl> if ( has_gpu_scheduling & & ! has_gpu_stream ) { <nl> - miss_gpu_stream_ = true ; <nl> + miss_accelerator_stream_ = true ; <nl> } <nl> } <nl> <nl> - void TFStats : : MaybeReportMissingTrace ( ) const { <nl> - if ( miss_gpu_stream_ ) { <nl> - fprintf ( stderr , <nl> - " \ n \ nFound accelerator operation but misses accelerator " <nl> - " stream stats ! \ n \ n " <nl> - " It ' s likely a gpu tracing issue rather than tf - profiler issue . \ n " <nl> - " If you found your operation missing accelerator time , " <nl> - " consider filing a bug to xprof - dev @ ! \ n \ n " ) ; <nl> - } <nl> + string TFStats : : MaybeReportMissingTrace ( ) const { <nl> + string report = " " ; <nl> + if ( miss_accelerator_stream_ ) { <nl> + report + = <nl> + " \ n \ nFound accelerator operation but misses accelerator " <nl> + " stream stats ! \ n \ n " <nl> + " It ' s likely a gpu tracing issue rather than tf - profiler issue . \ n " <nl> + " If you found your operation missing accelerator time , " <nl> + " consider filing a bug to xprof - dev @ ! \ n \ n " ; <nl> + } <nl> + return report ; <nl> } <nl> <nl> void TFStats : : SerializeToString ( string * content ) { <nl> void TFStats : : SerializeToString ( string * content ) { <nl> } <nl> <nl> profile . set_has_trace ( has_code_traces_ ) ; <nl> + profile . set_miss_accelerator_stream ( miss_accelerator_stream_ ) ; <nl> for ( int64 s : steps_ ) { <nl> profile . add_steps ( s ) ; <nl> } <nl> void TFStats : : WriteProfile ( const string & filename ) { <nl> } <nl> <nl> bool TFStats : : Validate ( const Options & opts ) const { <nl> - MaybeReportMissingTrace ( ) ; <nl> if ( opts . step > = 0 & & steps_ . find ( opts . step ) = = steps_ . end ( ) ) { <nl> fprintf ( stderr , <nl> " Options - step = % lld not found . \ nAvailable steps : " , opts . step ) ; <nl> mmm a / tensorflow / core / profiler / internal / tfprof_stats . h <nl> ppp b / tensorflow / core / profiler / internal / tfprof_stats . h <nl> class TFStats { <nl> / / For test purpose only . <nl> void AddNodeForTest ( int64 step , std : : unique_ptr < TFGraphNode > node ) ; <nl> <nl> - void MaybeReportMissingTrace ( ) const ; <nl> - <nl> private : <nl> bool Validate ( const Options & opts ) const ; <nl> + string MaybeReportMissingTrace ( ) const ; <nl> <nl> std : : set < int64 > steps_ ; <nl> bool has_code_traces_ ; <nl> - bool miss_gpu_stream_ ; <nl> + bool miss_accelerator_stream_ ; <nl> std : : unique_ptr < TFScope > scope_view_ ; <nl> std : : unique_ptr < TFGraph > graph_view_ ; <nl> std : : unique_ptr < TFCode > code_view_ ; <nl> mmm a / tensorflow / core / profiler / internal / tfprof_utils . cc <nl> ppp b / tensorflow / core / profiler / internal / tfprof_utils . cc <nl> void PrintHelp ( ) { <nl> fflush ( stdout ) ; <nl> } <nl> <nl> + static const char * const kTotalMicrosHelp = <nl> + " total execution time : Sum of accelerator execution time and cpu execution " <nl> + " time . " ; <nl> + static const char * const kAccMicrosHelp = <nl> + " accelerator execution time : Time spent executing on the accelerator . " <nl> + " This is normally measured by the actual hardware library . " ; <nl> + static const char * const kCPUHelp = <nl> + " cpu execution time : The time from the start to the end of the operation . " <nl> + " It ' s the sum of actual cpu run time plus the time that it spends waiting " <nl> + " if part of computation is launched asynchronously . " ; <nl> + static const char * const kBytes = <nl> + " requested bytes : The memory requested by the operation , accumulatively . " ; <nl> + static const char * const kPeakBytes = <nl> + " peak bytes : The peak amount of memory that the operation is holding at " <nl> + " some point . " ; <nl> + static const char * const kResidualBytes = <nl> + " residual bytes : The memory not de - allocated after the operation finishes . " ; <nl> + static const char * const kOutputBytes = <nl> + " output bytes : The memory that is output from the operation ( not " <nl> + " necessarilty allocated by the operation ) " ; <nl> + static const char * const kOccurrence = <nl> + " occurrence : The number of times it occurs " ; <nl> + static const char * const kInputShapes = <nl> + " input shape : The shape of input tensors " ; <nl> + static const char * const kDevice = " device : which device is placed on . " ; <nl> + static const char * const kFloatOps = <nl> + " flops : Number of float operations . Note : Please read the implementation " <nl> + " for the math behind it . " ; <nl> + static const char * const kParams = <nl> + " param : Number of parameters ( in the Variable ) . " ; <nl> + static const char * const kTensorValue = " tensor_value : Not supported now . " ; <nl> + static const char * const kOpTypes = <nl> + " op_types : The attributes of the operation , includes the Kernel name " <nl> + " device placed on and user - defined strings . " ; <nl> + <nl> + static const char * const kScope = <nl> + " scope : The nodes in the model graph are organized by their names , which " <nl> + " is hierarchical like filesystem . " ; <nl> + static const char * const kGraph = <nl> + " graph : The nodes in the model graph are organized by their operation " <nl> + " input and output . " ; <nl> + static const char * const kCode = <nl> + " code : When python trace is available , the nodes are python lines and " <nl> + " their are organized by the python call stack . " ; <nl> + static const char * const kOp = <nl> + " op : The nodes are operation kernel type , such as MatMul , Conv2D . Graph " <nl> + " nodes belonging to the same type are aggregated together . " ; <nl> + static const char * const kAdvise = <nl> + " advise : Automatically profile and discover issues . ( Experimental ) " ; <nl> + static const char * const kSet = <nl> + " set : Set a value for an option for future use . " ; <nl> + static const char * const kHelp = " help : Print helping messages . " ; <nl> + <nl> + string QueryDoc ( const string & cmd , const Options & opts ) { <nl> + string cmd_help = " " ; <nl> + if ( cmd = = kCmds [ 0 ] ) { <nl> + cmd_help = kScope ; <nl> + } else if ( cmd = = kCmds [ 1 ] ) { <nl> + cmd_help = kScope ; <nl> + } else if ( cmd = = kCmds [ 2 ] ) { <nl> + cmd_help = kCode ; <nl> + } else if ( cmd = = kCmds [ 3 ] ) { <nl> + cmd_help = kOp ; <nl> + } else if ( cmd = = kCmds [ 4 ] ) { <nl> + cmd_help = kAdvise ; <nl> + } else if ( cmd = = kCmds [ 5 ] ) { <nl> + cmd_help = kSet ; <nl> + } else if ( cmd = = kCmds [ 6 ] ) { <nl> + cmd_help = kHelp ; <nl> + } else { <nl> + cmd_help = " Unknown command : " + cmd ; <nl> + } <nl> + <nl> + std : : vector < string > helps ; <nl> + for ( const string & s : opts . select ) { <nl> + if ( s = = kShown [ 0 ] ) { <nl> + helps . push_back ( kBytes ) ; <nl> + } else if ( s = = kShown [ 1 ] ) { <nl> + helps . push_back ( strings : : StrCat ( kTotalMicrosHelp , " \ n " , kCPUHelp , " \ n " , <nl> + kAccMicrosHelp ) ) ; <nl> + } else if ( s = = kShown [ 2 ] ) { <nl> + helps . push_back ( kParams ) ; <nl> + } else if ( s = = kShown [ 3 ] ) { <nl> + helps . push_back ( kFloatOps ) ; <nl> + } else if ( s = = kShown [ 4 ] ) { <nl> + helps . push_back ( kTensorValue ) ; <nl> + } else if ( s = = kShown [ 5 ] ) { <nl> + helps . push_back ( kDevice ) ; <nl> + } else if ( s = = kShown [ 6 ] ) { <nl> + helps . push_back ( kOpTypes ) ; <nl> + } else if ( s = = kShown [ 7 ] ) { <nl> + helps . push_back ( kOccurrence ) ; <nl> + } else if ( s = = kShown [ 8 ] ) { <nl> + helps . push_back ( kInputShapes ) ; <nl> + } else if ( s = = kShown [ 9 ] ) { <nl> + helps . push_back ( kAccMicrosHelp ) ; <nl> + } else if ( s = = kShown [ 10 ] ) { <nl> + helps . push_back ( kCPUHelp ) ; <nl> + } else if ( s = = kShown [ 11 ] ) { <nl> + helps . push_back ( kPeakBytes ) ; <nl> + } else if ( s = = kShown [ 12 ] ) { <nl> + helps . push_back ( kResidualBytes ) ; <nl> + } else if ( s = = kShown [ 13 ] ) { <nl> + helps . push_back ( kOutputBytes ) ; <nl> + } else { <nl> + helps . push_back ( " Unknown select : " + s ) ; <nl> + } <nl> + } <nl> + return strings : : StrCat ( " \ nDoc : \ n " , cmd_help , " \ n " , <nl> + str_util : : Join ( helps , " \ n " ) , " \ n \ n " ) ; <nl> + } <nl> + <nl> } / / namespace tfprof <nl> } / / namespace tensorflow <nl> mmm a / tensorflow / core / profiler / internal / tfprof_utils . h <nl> ppp b / tensorflow / core / profiler / internal / tfprof_utils . h <nl> Status ReadProtoFile ( Env * env , const string & fname , T * proto , <nl> <nl> void PrintHelp ( ) ; <nl> <nl> + / / Generate helper message based on the command and options . <nl> + string QueryDoc ( const string & cmd , const Options & opts ) ; <nl> + <nl> } / / namespace tfprof <nl> } / / namespace tensorflow <nl> <nl> mmm a / tensorflow / core / profiler / tfprof_log . proto <nl> ppp b / tensorflow / core / profiler / tfprof_log . proto <nl> message ProfileProto { <nl> map < int64 , ProfileNode > nodes = 1 ; <nl> / / Whether or not has code traces . <nl> bool has_trace = 2 ; <nl> + / / Whether or not the TF device tracer fails to return accelerator <nl> + / / information ( which could lead to 0 accelerator execution time ) . <nl> + bool miss_accelerator_stream = 5 ; <nl> / / Traced steps . <nl> repeated int64 steps = 3 ; <nl> <nl> mmm a / tensorflow / go / op / wrappers . go <nl> ppp b / tensorflow / go / op / wrappers . go <nl> func Neg ( scope * Scope , x tf . Output ) ( y tf . Output ) { <nl> return op . Output ( 0 ) <nl> } <nl> <nl> + / / Writes a ` Summary ` protocol buffer with a histogram . <nl> + / / <nl> + / / The generated <nl> + / / [ ` Summary ` ] ( https : / / www . tensorflow . org / code / tensorflow / core / framework / summary . proto ) <nl> + / / has one summary value containing a histogram for ` values ` . <nl> + / / <nl> + / / This op reports an ` InvalidArgument ` error if any value is not finite . <nl> + / / <nl> + / / Arguments : <nl> + / / writer : A handle to a summary writer . <nl> + / / step : The step to write the summary for . <nl> + / / tag : Scalar . Tag to use for the ` Summary . Value ` . <nl> + / / values : Any shape . Values to use to build the histogram . <nl> + / / <nl> + / / Returns the created operation . <nl> + func WriteHistogramSummary ( scope * Scope , writer tf . Output , step tf . Output , tag tf . Output , values tf . Output ) ( o * tf . Operation ) { <nl> + if scope . Err ( ) ! = nil { <nl> + return <nl> + } <nl> + opspec : = tf . OpSpec { <nl> + Type : " WriteHistogramSummary " , <nl> + Input : [ ] tf . Input { <nl> + writer , step , tag , values , <nl> + } , <nl> + } <nl> + return scope . AddOperation ( opspec ) <nl> + } <nl> + <nl> / / Adds two ` SparseTensor ` objects to produce another ` SparseTensor ` . <nl> / / <nl> / / The input ` SparseTensor ` objects ' indices are assumed ordered in standard <nl> func MatrixExponential ( scope * Scope , input tf . Output ) ( output tf . Output ) { <nl> return op . Output ( 0 ) <nl> } <nl> <nl> + / / QueueDequeueUpToV2Attr is an optional argument to QueueDequeueUpToV2 . <nl> + type QueueDequeueUpToV2Attr func ( optionalAttr ) <nl> + <nl> + / / QueueDequeueUpToV2TimeoutMs sets the optional timeout_ms attribute to value . <nl> + / / <nl> + / / value : If the queue has fewer than n elements , this operation <nl> + / / will block for up to timeout_ms milliseconds . <nl> + / / Note : This option is not supported yet . <nl> + / / If not specified , defaults to - 1 <nl> + func QueueDequeueUpToV2TimeoutMs ( value int64 ) QueueDequeueUpToV2Attr { <nl> + return func ( m optionalAttr ) { <nl> + m [ " timeout_ms " ] = value <nl> + } <nl> + } <nl> + <nl> + / / Dequeues ` n ` tuples of one or more tensors from the given queue . <nl> + / / <nl> + / / This operation is not supported by all queues . If a queue does not support <nl> + / / DequeueUpTo , then an Unimplemented error is returned . <nl> + / / <nl> + / / If the queue is closed and there are more than 0 but less than ` n ` <nl> + / / elements remaining , then instead of returning an OutOfRange error like <nl> + / / QueueDequeueMany , less than ` n ` elements are returned immediately . If <nl> + / / the queue is closed and there are 0 elements left in the queue , then <nl> + / / an OutOfRange error is returned just like in QueueDequeueMany . <nl> + / / Otherwise the behavior is identical to QueueDequeueMany : <nl> + / / <nl> + / / This operation concatenates queue - element component tensors along the <nl> + / / 0th dimension to make a single component tensor . All of the components <nl> + / / in the dequeued tuple will have size n in the 0th dimension . <nl> + / / <nl> + / / This operation has ` k ` outputs , where ` k ` is the number of components in <nl> + / / the tuples stored in the given queue , and output ` i ` is the ith <nl> + / / component of the dequeued tuple . <nl> + / / <nl> + / / Arguments : <nl> + / / handle : The handle to a queue . <nl> + / / n : The number of tuples to dequeue . <nl> + / / component_types : The type of each component in a tuple . <nl> + / / <nl> + / / Returns One or more tensors that were dequeued as a tuple . <nl> + func QueueDequeueUpToV2 ( scope * Scope , handle tf . Output , n tf . Output , component_types [ ] tf . DataType , optional . . . QueueDequeueUpToV2Attr ) ( components [ ] tf . Output ) { <nl> + if scope . Err ( ) ! = nil { <nl> + return <nl> + } <nl> + attrs : = map [ string ] interface { } { " component_types " : component_types } <nl> + for _ , a : = range optional { <nl> + a ( attrs ) <nl> + } <nl> + opspec : = tf . OpSpec { <nl> + Type : " QueueDequeueUpToV2 " , <nl> + Input : [ ] tf . Input { <nl> + handle , n , <nl> + } , <nl> + Attrs : attrs , <nl> + } <nl> + op : = scope . AddOperation ( opspec ) <nl> + if scope . Err ( ) ! = nil { <nl> + return <nl> + } <nl> + var idx int <nl> + var err error <nl> + if components , idx , err = makeOutputList ( op , idx , " components " ) ; err ! = nil { <nl> + scope . UpdateErr ( " QueueDequeueUpToV2 " , err ) <nl> + return <nl> + } <nl> + return components <nl> + } <nl> + <nl> / / Computes the Cholesky decomposition of one or more square matrices . <nl> / / <nl> / / The input is a tensor of shape ` [ . . . , M , M ] ` whose inner - most 2 dimensions <nl> func TensorArrayCloseV2 ( scope * Scope , handle tf . Output ) ( o * tf . Operation ) { <nl> return scope . AddOperation ( opspec ) <nl> } <nl> <nl> - / / QueueDequeueUpToV2Attr is an optional argument to QueueDequeueUpToV2 . <nl> - type QueueDequeueUpToV2Attr func ( optionalAttr ) <nl> - <nl> - / / QueueDequeueUpToV2TimeoutMs sets the optional timeout_ms attribute to value . <nl> - / / <nl> - / / value : If the queue has fewer than n elements , this operation <nl> - / / will block for up to timeout_ms milliseconds . <nl> - / / Note : This option is not supported yet . <nl> - / / If not specified , defaults to - 1 <nl> - func QueueDequeueUpToV2TimeoutMs ( value int64 ) QueueDequeueUpToV2Attr { <nl> - return func ( m optionalAttr ) { <nl> - m [ " timeout_ms " ] = value <nl> - } <nl> - } <nl> - <nl> - / / Dequeues ` n ` tuples of one or more tensors from the given queue . <nl> - / / <nl> - / / This operation is not supported by all queues . If a queue does not support <nl> - / / DequeueUpTo , then an Unimplemented error is returned . <nl> - / / <nl> - / / If the queue is closed and there are more than 0 but less than ` n ` <nl> - / / elements remaining , then instead of returning an OutOfRange error like <nl> - / / QueueDequeueMany , less than ` n ` elements are returned immediately . If <nl> - / / the queue is closed and there are 0 elements left in the queue , then <nl> - / / an OutOfRange error is returned just like in QueueDequeueMany . <nl> - / / Otherwise the behavior is identical to QueueDequeueMany : <nl> - / / <nl> - / / This operation concatenates queue - element component tensors along the <nl> - / / 0th dimension to make a single component tensor . All of the components <nl> - / / in the dequeued tuple will have size n in the 0th dimension . <nl> - / / <nl> - / / This operation has ` k ` outputs , where ` k ` is the number of components in <nl> - / / the tuples stored in the given queue , and output ` i ` is the ith <nl> - / / component of the dequeued tuple . <nl> - / / <nl> - / / Arguments : <nl> - / / handle : The handle to a queue . <nl> - / / n : The number of tuples to dequeue . <nl> - / / component_types : The type of each component in a tuple . <nl> - / / <nl> - / / Returns One or more tensors that were dequeued as a tuple . <nl> - func QueueDequeueUpToV2 ( scope * Scope , handle tf . Output , n tf . Output , component_types [ ] tf . DataType , optional . . . QueueDequeueUpToV2Attr ) ( components [ ] tf . Output ) { <nl> - if scope . Err ( ) ! = nil { <nl> - return <nl> - } <nl> - attrs : = map [ string ] interface { } { " component_types " : component_types } <nl> - for _ , a : = range optional { <nl> - a ( attrs ) <nl> - } <nl> - opspec : = tf . OpSpec { <nl> - Type : " QueueDequeueUpToV2 " , <nl> - Input : [ ] tf . Input { <nl> - handle , n , <nl> - } , <nl> - Attrs : attrs , <nl> - } <nl> - op : = scope . AddOperation ( opspec ) <nl> - if scope . Err ( ) ! = nil { <nl> - return <nl> - } <nl> - var idx int <nl> - var err error <nl> - if components , idx , err = makeOutputList ( op , idx , " components " ) ; err ! = nil { <nl> - scope . UpdateErr ( " QueueDequeueUpToV2 " , err ) <nl> - return <nl> - } <nl> - return components <nl> - } <nl> - <nl> / / Computes inverse hyperbolic tangent of x element - wise . <nl> func Atanh ( scope * Scope , x tf . Output ) ( y tf . Output ) { <nl> if scope . Err ( ) ! = nil { <nl> func Concat ( scope * Scope , concat_dim tf . Output , values [ ] tf . Output ) ( output tf . O <nl> return op . Output ( 0 ) <nl> } <nl> <nl> - / / Writes a ` Summary ` protocol buffer with a histogram . <nl> - / / <nl> - / / The generated <nl> - / / [ ` Summary ` ] ( https : / / www . tensorflow . org / code / tensorflow / core / framework / summary . proto ) <nl> - / / has one summary value containing a histogram for ` values ` . <nl> - / / <nl> - / / This op reports an ` InvalidArgument ` error if any value is not finite . <nl> - / / <nl> - / / Arguments : <nl> - / / writer : A handle to a summary writer . <nl> - / / step : The step to write the summary for . <nl> - / / tag : Scalar . Tag to use for the ` Summary . Value ` . <nl> - / / values : Any shape . Values to use to build the histogram . <nl> - / / <nl> - / / Returns the created operation . <nl> - func WriteHistogramSummary ( scope * Scope , writer tf . Output , step tf . Output , tag tf . Output , values tf . Output ) ( o * tf . Operation ) { <nl> - if scope . Err ( ) ! = nil { <nl> - return <nl> - } <nl> - opspec : = tf . OpSpec { <nl> - Type : " WriteHistogramSummary " , <nl> - Input : [ ] tf . Input { <nl> - writer , step , tag , values , <nl> - } , <nl> - } <nl> - return scope . AddOperation ( opspec ) <nl> - } <nl> - <nl> / / Compute the lower regularized incomplete Gamma function ` Q ( a , x ) ` . <nl> / / <nl> / / The lower regularized incomplete Gamma function is defined as : <nl> mmm a / tensorflow / python / data / kernel_tests / dataset_constructor_op_test . py <nl> ppp b / tensorflow / python / data / kernel_tests / dataset_constructor_op_test . py <nl> def testSplitPipelineFailsWithPlacementError ( self ) : <nl> sess . run ( var_1 . initializer ) <nl> <nl> iterator = dataset . make_initializable_iterator ( ) <nl> + sess . run ( iterator . initializer ) <nl> <nl> with self . assertRaisesRegexp ( <nl> - errors . InvalidArgumentError , <nl> - " Trying to access resource located in device " ) : <nl> - sess . run ( iterator . initializer ) <nl> + errors . FailedPreconditionError , <nl> + " Error while reading resource variable Variable " ) : <nl> + sess . run ( iterator . get_next ( ) ) <nl> <nl> <nl> class DatasetConstructorBenchmark ( test . Benchmark ) : <nl> mmm a / tensorflow / python / data / kernel_tests / map_dataset_op_test . py <nl> ppp b / tensorflow / python / data / kernel_tests / map_dataset_op_test . py <nl> def testCaptureUninitializedVariableError ( self ) : <nl> . map ( lambda _ : counter_var . assign_add ( 1 ) ) <nl> . make_initializable_iterator ( ) ) <nl> init_op = iterator . initializer <nl> + get_next = iterator . get_next ( ) <nl> <nl> with self . test_session ( ) as sess : <nl> - with self . assertRaisesRegexp ( errors . FailedPreconditionError , <nl> - " Failed to capture resource " ) : <nl> - sess . run ( init_op ) <nl> + sess . run ( init_op ) <nl> + with self . assertRaises ( errors . NotFoundError ) : <nl> + sess . run ( get_next ) <nl> <nl> def testSeededStatefulOperatorIsProperlyStateful ( self ) : <nl> iterator = ( dataset_ops . Dataset . from_tensors ( 0 ) . repeat ( 10 ) <nl> mmm a / tensorflow / python / estimator / BUILD <nl> ppp b / tensorflow / python / estimator / BUILD <nl> py_library ( <nl> " : model_fn " , <nl> " : numpy_io " , <nl> " : prediction_keys " , <nl> + " : warm_starting_util " , <nl> " / / tensorflow / core : protos_all_py " , <nl> " / / tensorflow / python : array_ops " , <nl> " / / tensorflow / python : check_ops " , <nl> py_library ( <nl> " : model_fn " , <nl> " : run_config " , <nl> " : util " , <nl> + " : warm_starting_util " , <nl> " / / tensorflow / core : protos_all_py " , <nl> " / / tensorflow / python : client " , <nl> " / / tensorflow / python : control_flow_ops " , <nl> mmm a / tensorflow / python / estimator / canned / dnn . py <nl> ppp b / tensorflow / python / estimator / canned / dnn . py <nl> <nl> <nl> from tensorflow . python . estimator import estimator <nl> from tensorflow . python . estimator import model_fn <nl> + from tensorflow . python . estimator import warm_starting_util <nl> from tensorflow . python . estimator . canned import head as head_lib <nl> from tensorflow . python . estimator . canned import optimizers <nl> from tensorflow . python . feature_column import feature_column as feature_column_lib <nl> def dnn_logit_fn ( features , mode ) : <nl> partitioner = input_layer_partitioner ) : <nl> net = feature_column_lib . input_layer ( <nl> features = features , feature_columns = feature_columns ) <nl> - <nl> for layer_id , num_hidden_units in enumerate ( hidden_units ) : <nl> with variable_scope . variable_scope ( <nl> ' hiddenlayer_ % d ' % layer_id , values = ( net , ) ) as hidden_layer_scope : <nl> def dnn_logit_fn ( features , mode ) : <nl> kernel_initializer = init_ops . glorot_uniform_initializer ( ) , <nl> name = logits_scope ) <nl> _add_hidden_layer_summary ( logits , logits_scope . name ) <nl> + <nl> return logits <nl> <nl> return dnn_logit_fn <nl> <nl> <nl> - def _dnn_model_fn ( <nl> - features , labels , mode , head , hidden_units , feature_columns , <nl> - optimizer = ' Adagrad ' , activation_fn = nn . relu , dropout = None , <nl> - input_layer_partitioner = None , config = None ) : <nl> + def _dnn_model_fn ( features , <nl> + labels , <nl> + mode , <nl> + head , <nl> + hidden_units , <nl> + feature_columns , <nl> + optimizer = ' Adagrad ' , <nl> + activation_fn = nn . relu , <nl> + dropout = None , <nl> + input_layer_partitioner = None , <nl> + config = None ) : <nl> " " " Deep Neural Net model_fn . <nl> <nl> Args : <nl> def _dnn_model_fn ( <nl> if not isinstance ( features , dict ) : <nl> raise ValueError ( ' features should be a dictionary of ` Tensor ` s . ' <nl> ' Given type : { } ' . format ( type ( features ) ) ) <nl> + <nl> optimizer = optimizers . get_optimizer_instance ( <nl> optimizer , learning_rate = _LEARNING_RATE ) <nl> num_ps_replicas = config . num_ps_replicas if config else 0 <nl> class DNNClassifier ( estimator . Estimator ) : <nl> l1_regularization_strength = 0 . 001 <nl> ) ) <nl> <nl> + # Or estimator with warm - starting from a previous checkpoint . <nl> + estimator = DNNClassifier ( <nl> + feature_columns = [ categorical_feature_a_emb , categorical_feature_b_emb ] , <nl> + hidden_units = [ 1024 , 512 , 256 ] , <nl> + warm_start_from = " / path / to / checkpoint / dir " ) <nl> + <nl> # Input builders <nl> def input_fn_train : # returns x , y <nl> pass <nl> def input_fn_predict : # returns x , None <nl> @ end_compatibility <nl> " " " <nl> <nl> - def __init__ ( self , <nl> - hidden_units , <nl> - feature_columns , <nl> - model_dir = None , <nl> - n_classes = 2 , <nl> - weight_column = None , <nl> - label_vocabulary = None , <nl> - optimizer = ' Adagrad ' , <nl> - activation_fn = nn . relu , <nl> - dropout = None , <nl> - input_layer_partitioner = None , <nl> - config = None ) : <nl> + def __init__ ( <nl> + self , <nl> + hidden_units , <nl> + feature_columns , <nl> + model_dir = None , <nl> + n_classes = 2 , <nl> + weight_column = None , <nl> + label_vocabulary = None , <nl> + optimizer = ' Adagrad ' , <nl> + activation_fn = nn . relu , <nl> + dropout = None , <nl> + input_layer_partitioner = None , <nl> + config = None , <nl> + warm_start_from = None , <nl> + ) : <nl> " " " Initializes a ` DNNClassifier ` instance . <nl> <nl> Args : <nl> def __init__ ( self , <nl> input_layer_partitioner : Optional . Partitioner for input layer . Defaults <nl> to ` min_max_variable_partitioner ` with ` min_slice_size ` 64 < < 20 . <nl> config : ` RunConfig ` object to configure the runtime settings . <nl> + warm_start_from : A string filepath to a checkpoint to warm - start from , or <nl> + a ` WarmStartSettings ` object to fully configure warm - starting . If the <nl> + string filepath is provided instead of a ` WarmStartSettings ` , then all <nl> + weights are warm - started , and it is assumed that vocabularies and Tensor <nl> + names are unchanged . <nl> " " " <nl> if n_classes = = 2 : <nl> head = head_lib . _binary_logistic_head_with_sigmoid_cross_entropy_loss ( # pylint : disable = protected - access <nl> def __init__ ( self , <nl> head = head_lib . _multi_class_head_with_softmax_cross_entropy_loss ( # pylint : disable = protected - access <nl> n_classes , weight_column = weight_column , <nl> label_vocabulary = label_vocabulary ) <nl> + <nl> def _model_fn ( features , labels , mode , config ) : <nl> - return _dnn_model_fn ( <nl> + " " " Call the defined shared _dnn_model_fn and possibly warm - start . " " " <nl> + estimator_spec = _dnn_model_fn ( <nl> features = features , <nl> labels = labels , <nl> mode = mode , <nl> def _model_fn ( features , labels , mode , config ) : <nl> dropout = dropout , <nl> input_layer_partitioner = input_layer_partitioner , <nl> config = config ) <nl> + # pylint : disable = protected - access <nl> + warm_start_settings = warm_starting_util . _get_default_warm_start_settings ( <nl> + warm_start_from ) <nl> + if warm_start_settings : <nl> + warm_starting_util . _warm_start ( warm_start_settings ) <nl> + # pylint : enable = protected - access <nl> + <nl> + return estimator_spec <nl> + <nl> super ( DNNClassifier , self ) . __init__ ( <nl> model_fn = _model_fn , model_dir = model_dir , config = config ) <nl> <nl> class DNNRegressor ( estimator . Estimator ) : <nl> l1_regularization_strength = 0 . 001 <nl> ) ) <nl> <nl> + # Or estimator with warm - starting from a previous checkpoint . <nl> + estimator = DNNRegressor ( <nl> + feature_columns = [ categorical_feature_a_emb , categorical_feature_b_emb ] , <nl> + hidden_units = [ 1024 , 512 , 256 ] , <nl> + warm_start_from = " / path / to / checkpoint / dir " ) <nl> + <nl> # Input builders <nl> def input_fn_train : # returns x , y <nl> pass <nl> def input_fn_predict : # returns x , None <nl> @ end_compatibility <nl> " " " <nl> <nl> - def __init__ ( self , <nl> - hidden_units , <nl> - feature_columns , <nl> - model_dir = None , <nl> - label_dimension = 1 , <nl> - weight_column = None , <nl> - optimizer = ' Adagrad ' , <nl> - activation_fn = nn . relu , <nl> - dropout = None , <nl> - input_layer_partitioner = None , <nl> - config = None ) : <nl> + def __init__ ( <nl> + self , <nl> + hidden_units , <nl> + feature_columns , <nl> + model_dir = None , <nl> + label_dimension = 1 , <nl> + weight_column = None , <nl> + optimizer = ' Adagrad ' , <nl> + activation_fn = nn . relu , <nl> + dropout = None , <nl> + input_layer_partitioner = None , <nl> + config = None , <nl> + warm_start_from = None , <nl> + ) : <nl> " " " Initializes a ` DNNRegressor ` instance . <nl> <nl> Args : <nl> def __init__ ( self , <nl> input_layer_partitioner : Optional . Partitioner for input layer . Defaults <nl> to ` min_max_variable_partitioner ` with ` min_slice_size ` 64 < < 20 . <nl> config : ` RunConfig ` object to configure the runtime settings . <nl> + warm_start_from : A string filepath to a checkpoint to warm - start from , or <nl> + a ` WarmStartSettings ` object to fully configure warm - starting . If the <nl> + string filepath is provided instead of a ` WarmStartSettings ` , then all <nl> + weights are warm - started , and it is assumed that vocabularies and Tensor <nl> + names are unchanged . <nl> " " " <nl> + <nl> def _model_fn ( features , labels , mode , config ) : <nl> - return _dnn_model_fn ( <nl> + " " " Call the defined shared _dnn_model_fn and possibly warm - start . " " " <nl> + estimator_spec = _dnn_model_fn ( <nl> features = features , <nl> labels = labels , <nl> mode = mode , <nl> def _model_fn ( features , labels , mode , config ) : <nl> dropout = dropout , <nl> input_layer_partitioner = input_layer_partitioner , <nl> config = config ) <nl> + # pylint : disable = protected - access <nl> + warm_start_settings = warm_starting_util . _get_default_warm_start_settings ( <nl> + warm_start_from ) <nl> + if warm_start_settings : <nl> + warm_starting_util . _warm_start ( warm_start_settings ) <nl> + # pylint : enable = protected - access <nl> + <nl> + return estimator_spec <nl> + <nl> super ( DNNRegressor , self ) . __init__ ( <nl> model_fn = _model_fn , model_dir = model_dir , config = config ) <nl> mmm a / tensorflow / python / estimator / canned / dnn_linear_combined . py <nl> ppp b / tensorflow / python / estimator / canned / dnn_linear_combined . py <nl> <nl> import six <nl> <nl> from tensorflow . python . estimator import estimator <nl> + from tensorflow . python . estimator import warm_starting_util <nl> from tensorflow . python . estimator . canned import dnn <nl> from tensorflow . python . estimator . canned import head as head_lib <nl> from tensorflow . python . estimator . canned import linear <nl> def _add_layer_summary ( value , tag ) : <nl> summary . histogram ( ' % s / activation ' % tag , value ) <nl> <nl> <nl> - def _dnn_linear_combined_model_fn ( <nl> - features , labels , mode , head , <nl> - linear_feature_columns = None , linear_optimizer = ' Ftrl ' , <nl> - dnn_feature_columns = None , dnn_optimizer = ' Adagrad ' , dnn_hidden_units = None , <nl> - dnn_activation_fn = nn . relu , dnn_dropout = None , <nl> - input_layer_partitioner = None , config = None ) : <nl> + def _dnn_linear_combined_model_fn ( features , <nl> + labels , <nl> + mode , <nl> + head , <nl> + linear_feature_columns = None , <nl> + linear_optimizer = ' Ftrl ' , <nl> + dnn_feature_columns = None , <nl> + dnn_optimizer = ' Adagrad ' , <nl> + dnn_hidden_units = None , <nl> + dnn_activation_fn = nn . relu , <nl> + dnn_dropout = None , <nl> + input_layer_partitioner = None , <nl> + config = None ) : <nl> " " " Deep Neural Net and Linear combined model_fn . <nl> <nl> Args : <nl> def _dnn_linear_combined_model_fn ( <nl> if not linear_feature_columns and not dnn_feature_columns : <nl> raise ValueError ( <nl> ' Either linear_feature_columns or dnn_feature_columns must be defined . ' ) <nl> + <nl> num_ps_replicas = config . num_ps_replicas if config else 0 <nl> input_layer_partitioner = input_layer_partitioner or ( <nl> partitioned_variables . min_max_variable_partitioner ( <nl> class DNNLinearCombinedClassifier ( estimator . Estimator ) : <nl> categorical_feature_a_emb , categorical_feature_b_emb , <nl> numeric_feature ] , <nl> dnn_hidden_units = [ 1000 , 500 , 100 ] , <nl> - dnn_optimizer = tf . train . ProximalAdagradOptimizer ( . . . ) ) <nl> + dnn_optimizer = tf . train . ProximalAdagradOptimizer ( . . . ) , <nl> + # warm - start settings <nl> + warm_start_from = " / path / to / checkpoint / dir " ) <nl> <nl> # To apply L1 and L2 regularization , you can set optimizers as follows : <nl> tf . train . ProximalAdagradOptimizer ( <nl> def __init__ ( self , <nl> weight_column = None , <nl> label_vocabulary = None , <nl> input_layer_partitioner = None , <nl> - config = None ) : <nl> + config = None , <nl> + warm_start_from = None ) : <nl> " " " Initializes a DNNLinearCombinedClassifier instance . <nl> <nl> Args : <nl> def __init__ ( self , <nl> input_layer_partitioner : Partitioner for input layer . Defaults to <nl> ` min_max_variable_partitioner ` with ` min_slice_size ` 64 < < 20 . <nl> config : RunConfig object to configure the runtime settings . <nl> + warm_start_from : A string filepath to a checkpoint to warm - start from , or <nl> + a ` WarmStartSettings ` object to fully configure warm - starting . If the <nl> + string filepath is provided instead of a ` WarmStartSettings ` , then all <nl> + weights are warm - started , and it is assumed that vocabularies and Tensor <nl> + names are unchanged . <nl> <nl> Raises : <nl> ValueError : If both linear_feature_columns and dnn_features_columns are <nl> def __init__ ( self , <nl> n_classes , <nl> weight_column = weight_column , <nl> label_vocabulary = label_vocabulary ) <nl> + <nl> def _model_fn ( features , labels , mode , config ) : <nl> - return _dnn_linear_combined_model_fn ( <nl> + " " " Call the _dnn_linear_combined_model_fn and possibly warm - start . " " " <nl> + estimator_spec = _dnn_linear_combined_model_fn ( <nl> features = features , <nl> labels = labels , <nl> mode = mode , <nl> def _model_fn ( features , labels , mode , config ) : <nl> dnn_dropout = dnn_dropout , <nl> input_layer_partitioner = input_layer_partitioner , <nl> config = config ) <nl> + # pylint : disable = protected - access <nl> + warm_start_settings = warm_starting_util . _get_default_warm_start_settings ( <nl> + warm_start_from ) <nl> + if warm_start_settings : <nl> + warm_starting_util . _warm_start ( warm_start_settings ) <nl> + # pylint : enable = protected - access <nl> + <nl> + return estimator_spec <nl> <nl> super ( DNNLinearCombinedClassifier , self ) . __init__ ( <nl> model_fn = _model_fn , model_dir = model_dir , config = config ) <nl> class DNNLinearCombinedRegressor ( estimator . Estimator ) : <nl> categorical_feature_a_emb , categorical_feature_b_emb , <nl> numeric_feature ] , <nl> dnn_hidden_units = [ 1000 , 500 , 100 ] , <nl> - dnn_optimizer = tf . train . ProximalAdagradOptimizer ( . . . ) ) <nl> + dnn_optimizer = tf . train . ProximalAdagradOptimizer ( . . . ) , <nl> + # warm - start settings <nl> + warm_start_from = " / path / to / checkpoint / dir " ) <nl> <nl> # To apply L1 and L2 regularization , you can set optimizers as follows : <nl> tf . train . ProximalAdagradOptimizer ( <nl> def __init__ ( self , <nl> label_dimension = 1 , <nl> weight_column = None , <nl> input_layer_partitioner = None , <nl> - config = None ) : <nl> + config = None , <nl> + warm_start_from = None ) : <nl> " " " Initializes a DNNLinearCombinedRegressor instance . <nl> <nl> Args : <nl> def __init__ ( self , <nl> input_layer_partitioner : Partitioner for input layer . Defaults to <nl> ` min_max_variable_partitioner ` with ` min_slice_size ` 64 < < 20 . <nl> config : RunConfig object to configure the runtime settings . <nl> + warm_start_from : A string filepath to a checkpoint to warm - start from , or <nl> + a ` WarmStartSettings ` object to fully configure warm - starting . If the <nl> + string filepath is provided instead of a ` WarmStartSettings ` , then all <nl> + weights are warm - started , and it is assumed that vocabularies and Tensor <nl> + names are unchanged . <nl> <nl> Raises : <nl> ValueError : If both linear_feature_columns and dnn_features_columns are <nl> def __init__ ( self , <nl> ' must be defined . ' ) <nl> <nl> def _model_fn ( features , labels , mode , config ) : <nl> - return _dnn_linear_combined_model_fn ( <nl> + " " " Call the _dnn_linear_combined_model_fn and possibly warm - start . " " " <nl> + estimator_spec = _dnn_linear_combined_model_fn ( <nl> features = features , <nl> labels = labels , <nl> mode = mode , <nl> def _model_fn ( features , labels , mode , config ) : <nl> dnn_dropout = dnn_dropout , <nl> input_layer_partitioner = input_layer_partitioner , <nl> config = config ) <nl> + # pylint : disable = protected - access <nl> + warm_start_settings = warm_starting_util . _get_default_warm_start_settings ( <nl> + warm_start_from ) <nl> + if warm_start_settings : <nl> + warm_starting_util . _warm_start ( warm_start_settings ) <nl> + # pylint : enable = protected - access <nl> + <nl> + return estimator_spec <nl> <nl> super ( DNNLinearCombinedRegressor , self ) . __init__ ( <nl> model_fn = _model_fn , model_dir = model_dir , config = config ) <nl> mmm a / tensorflow / python / estimator / canned / dnn_linear_combined_test . py <nl> ppp b / tensorflow / python / estimator / canned / dnn_linear_combined_test . py <nl> <nl> <nl> from tensorflow . core . example import example_pb2 <nl> from tensorflow . core . example import feature_pb2 <nl> + from tensorflow . python . estimator import warm_starting_util <nl> from tensorflow . python . estimator . canned import dnn_linear_combined <nl> from tensorflow . python . estimator . canned import dnn_testing_utils <nl> from tensorflow . python . estimator . canned import linear_testing_utils <nl> <nl> from tensorflow . python . training import input as input_lib <nl> from tensorflow . python . training import optimizer as optimizer_lib <nl> <nl> + <nl> try : <nl> # pylint : disable = g - import - not - at - top <nl> import pandas as pd <nl> def test_dnn_and_linear_logits_are_added ( self ) : <nl> next ( est . predict ( input_fn = input_fn ) ) ) <nl> <nl> <nl> + class DNNLinearCombinedWarmStartingTest ( test . TestCase ) : <nl> + <nl> + def setUp ( self ) : <nl> + # Create a directory to save our old checkpoint and vocabularies to . <nl> + self . _ckpt_and_vocab_dir = tempfile . mkdtemp ( ) <nl> + <nl> + # Make a dummy input_fn . <nl> + def _input_fn ( ) : <nl> + features = { <nl> + ' age ' : [ [ 23 . ] , [ 31 . ] ] , <nl> + ' city ' : [ [ ' Palo Alto ' ] , [ ' Mountain View ' ] ] , <nl> + } <nl> + return features , [ 0 , 1 ] <nl> + <nl> + self . _input_fn = _input_fn <nl> + <nl> + def tearDown ( self ) : <nl> + # Clean up checkpoint / vocab dir . <nl> + writer_cache . FileWriterCache . clear ( ) <nl> + shutil . rmtree ( self . _ckpt_and_vocab_dir ) <nl> + <nl> + def test_classifier_basic_warm_starting ( self ) : <nl> + " " " Tests correctness of DNNLinearCombinedClassifier default warm - start . " " " <nl> + age = feature_column . numeric_column ( ' age ' ) <nl> + city = feature_column . embedding_column ( <nl> + feature_column . categorical_column_with_vocabulary_list ( <nl> + ' city ' , vocabulary_list = [ ' Mountain View ' , ' Palo Alto ' ] ) , <nl> + dimension = 5 ) <nl> + <nl> + # Create a DNNLinearCombinedClassifier and train to save a checkpoint . <nl> + dnn_lc_classifier = dnn_linear_combined . DNNLinearCombinedClassifier ( <nl> + linear_feature_columns = [ age ] , <nl> + dnn_feature_columns = [ city ] , <nl> + dnn_hidden_units = [ 256 , 128 ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + n_classes = 4 , <nl> + linear_optimizer = ' SGD ' , <nl> + dnn_optimizer = ' SGD ' ) <nl> + dnn_lc_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second DNNLinearCombinedClassifier , warm - started from the first . <nl> + # Use a learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t <nl> + # have accumulator values that change ) . <nl> + warm_started_dnn_lc_classifier = ( <nl> + dnn_linear_combined . DNNLinearCombinedClassifier ( <nl> + linear_feature_columns = [ age ] , <nl> + dnn_feature_columns = [ city ] , <nl> + dnn_hidden_units = [ 256 , 128 ] , <nl> + n_classes = 4 , <nl> + linear_optimizer = gradient_descent . GradientDescentOptimizer ( <nl> + learning_rate = 0 . 0 ) , <nl> + dnn_optimizer = gradient_descent . GradientDescentOptimizer ( <nl> + learning_rate = 0 . 0 ) , <nl> + warm_start_from = dnn_lc_classifier . model_dir ) ) <nl> + <nl> + warm_started_dnn_lc_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + for variable_name in warm_started_dnn_lc_classifier . get_variable_names ( ) : <nl> + self . assertAllClose ( <nl> + dnn_lc_classifier . get_variable_value ( variable_name ) , <nl> + warm_started_dnn_lc_classifier . get_variable_value ( variable_name ) ) <nl> + <nl> + def test_regressor_basic_warm_starting ( self ) : <nl> + " " " Tests correctness of DNNLinearCombinedRegressor default warm - start . " " " <nl> + age = feature_column . numeric_column ( ' age ' ) <nl> + city = feature_column . embedding_column ( <nl> + feature_column . categorical_column_with_vocabulary_list ( <nl> + ' city ' , vocabulary_list = [ ' Mountain View ' , ' Palo Alto ' ] ) , <nl> + dimension = 5 ) <nl> + <nl> + # Create a DNNLinearCombinedRegressor and train to save a checkpoint . <nl> + dnn_lc_regressor = dnn_linear_combined . DNNLinearCombinedRegressor ( <nl> + linear_feature_columns = [ age ] , <nl> + dnn_feature_columns = [ city ] , <nl> + dnn_hidden_units = [ 256 , 128 ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + linear_optimizer = ' SGD ' , <nl> + dnn_optimizer = ' SGD ' ) <nl> + dnn_lc_regressor . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second DNNLinearCombinedRegressor , warm - started from the first . <nl> + # Use a learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t <nl> + # have accumulator values that change ) . <nl> + warm_started_dnn_lc_regressor = ( <nl> + dnn_linear_combined . DNNLinearCombinedRegressor ( <nl> + linear_feature_columns = [ age ] , <nl> + dnn_feature_columns = [ city ] , <nl> + dnn_hidden_units = [ 256 , 128 ] , <nl> + linear_optimizer = gradient_descent . GradientDescentOptimizer ( <nl> + learning_rate = 0 . 0 ) , <nl> + dnn_optimizer = gradient_descent . GradientDescentOptimizer ( <nl> + learning_rate = 0 . 0 ) , <nl> + warm_start_from = dnn_lc_regressor . model_dir ) ) <nl> + <nl> + warm_started_dnn_lc_regressor . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + for variable_name in warm_started_dnn_lc_regressor . get_variable_names ( ) : <nl> + self . assertAllClose ( <nl> + dnn_lc_regressor . get_variable_value ( variable_name ) , <nl> + warm_started_dnn_lc_regressor . get_variable_value ( variable_name ) ) <nl> + <nl> + def test_warm_starting_selective_variables ( self ) : <nl> + " " " Tests selecting variables to warm - start . " " " <nl> + age = feature_column . numeric_column ( ' age ' ) <nl> + city = feature_column . embedding_column ( <nl> + feature_column . categorical_column_with_vocabulary_list ( <nl> + ' city ' , vocabulary_list = [ ' Mountain View ' , ' Palo Alto ' ] ) , <nl> + dimension = 5 ) <nl> + <nl> + # Create a DNNLinearCombinedClassifier and train to save a checkpoint . <nl> + dnn_lc_classifier = dnn_linear_combined . DNNLinearCombinedClassifier ( <nl> + linear_feature_columns = [ age ] , <nl> + dnn_feature_columns = [ city ] , <nl> + dnn_hidden_units = [ 256 , 128 ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + n_classes = 4 , <nl> + linear_optimizer = ' SGD ' , <nl> + dnn_optimizer = ' SGD ' ) <nl> + dnn_lc_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second DNNLinearCombinedClassifier , warm - started from the first . <nl> + # Use a learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t <nl> + # have accumulator values that change ) . <nl> + warm_started_dnn_lc_classifier = ( <nl> + dnn_linear_combined . DNNLinearCombinedClassifier ( <nl> + linear_feature_columns = [ age ] , <nl> + dnn_feature_columns = [ city ] , <nl> + dnn_hidden_units = [ 256 , 128 ] , <nl> + n_classes = 4 , <nl> + linear_optimizer = gradient_descent . GradientDescentOptimizer ( <nl> + learning_rate = 0 . 0 ) , <nl> + dnn_optimizer = gradient_descent . GradientDescentOptimizer ( <nl> + learning_rate = 0 . 0 ) , <nl> + # The provided regular expression will only warm - start the deep <nl> + # portion of the model . <nl> + warm_start_from = warm_starting_util . WarmStartSettings ( <nl> + ckpt_to_initialize_from = dnn_lc_classifier . model_dir , <nl> + vars_to_warm_start = ' . * ( dnn ) . * ' ) ) ) <nl> + <nl> + warm_started_dnn_lc_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + for variable_name in warm_started_dnn_lc_classifier . get_variable_names ( ) : <nl> + if ' dnn ' in variable_name : <nl> + self . assertAllClose ( <nl> + dnn_lc_classifier . get_variable_value ( variable_name ) , <nl> + warm_started_dnn_lc_classifier . get_variable_value ( variable_name ) ) <nl> + elif ' linear ' in variable_name : <nl> + linear_values = warm_started_dnn_lc_classifier . get_variable_value ( <nl> + variable_name ) <nl> + # Since they ' re not warm - started , the linear weights will be <nl> + # zero - initialized . <nl> + self . assertAllClose ( np . zeros_like ( linear_values ) , linear_values ) <nl> + <nl> + <nl> if __name__ = = ' __main__ ' : <nl> test . main ( ) <nl> mmm a / tensorflow / python / estimator / canned / dnn_test . py <nl> ppp b / tensorflow / python / estimator / canned / dnn_test . py <nl> def __init__ ( self , methodName = ' runTest ' ) : # pylint : disable = invalid - name <nl> dnn . _dnn_logit_fn_builder ) <nl> <nl> <nl> + class DNNWarmStartingTest ( dnn_testing_utils . BaseDNNWarmStartingTest , <nl> + test . TestCase ) : <nl> + <nl> + def __init__ ( self , methodName = ' runTest ' ) : # pylint : disable = invalid - name <nl> + test . TestCase . __init__ ( self , methodName ) <nl> + dnn_testing_utils . BaseDNNWarmStartingTest . __init__ ( self , _dnn_classifier_fn , <nl> + _dnn_regressor_fn ) <nl> + <nl> + <nl> class DNNClassifierEvaluateTest ( <nl> dnn_testing_utils . BaseDNNClassifierEvaluateTest , test . TestCase ) : <nl> <nl> mmm a / tensorflow / python / estimator / canned / dnn_testing_utils . py <nl> ppp b / tensorflow / python / estimator / canned / dnn_testing_utils . py <nl> <nl> from tensorflow . core . framework import summary_pb2 <nl> from tensorflow . python . client import session as tf_session <nl> from tensorflow . python . estimator import model_fn <nl> + from tensorflow . python . estimator import warm_starting_util <nl> from tensorflow . python . estimator . canned import head as head_lib <nl> from tensorflow . python . estimator . canned import metric_keys <nl> from tensorflow . python . estimator . canned import prediction_keys <nl> <nl> from tensorflow . python . ops import array_ops <nl> from tensorflow . python . ops import check_ops <nl> from tensorflow . python . ops import control_flow_ops <nl> + from tensorflow . python . ops import init_ops <nl> from tensorflow . python . ops import math_ops <nl> from tensorflow . python . ops import nn <nl> from tensorflow . python . ops import partitioned_variables <nl> <nl> from tensorflow . python . summary import summary as summary_lib <nl> from tensorflow . python . summary . writer import writer_cache <nl> from tensorflow . python . training import checkpoint_utils <nl> + from tensorflow . python . training import gradient_descent <nl> from tensorflow . python . training import monitored_session <nl> from tensorflow . python . training import optimizer <nl> from tensorflow . python . training import saver <nl> <nl> HIDDEN_BIASES_NAME_PATTERN = ' dnn / hiddenlayer_ % d / bias ' <nl> LOGITS_WEIGHTS_NAME = ' dnn / logits / kernel ' <nl> LOGITS_BIASES_NAME = ' dnn / logits / bias ' <nl> + OCCUPATION_EMBEDDING_NAME = ( ' dnn / input_from_feature_columns / input_layer / ' <nl> + ' occupation_embedding / embedding_weights ' ) <nl> + CITY_EMBEDDING_NAME = ( ' dnn / input_from_feature_columns / input_layer / ' <nl> + ' city_embedding / embedding_weights ' ) <nl> <nl> <nl> def assert_close ( expected , actual , rtol = 1e - 04 , message = ' ' , name = ' assert_close ' ) : <nl> def test_multi_feature_column_multi_dim_logits ( self ) : <nl> self . assertAllClose ( expected_logits , sess . run ( logits ) ) <nl> <nl> <nl> + class BaseDNNWarmStartingTest ( object ) : <nl> + <nl> + def __init__ ( self , _dnn_classifier_fn , _dnn_regressor_fn ) : <nl> + self . _dnn_classifier_fn = _dnn_classifier_fn <nl> + self . _dnn_regressor_fn = _dnn_regressor_fn <nl> + <nl> + def setUp ( self ) : <nl> + # Create a directory to save our old checkpoint and vocabularies to . <nl> + self . _ckpt_and_vocab_dir = tempfile . mkdtemp ( ) <nl> + <nl> + # Make a dummy input_fn . <nl> + def _input_fn ( ) : <nl> + features = { <nl> + ' city ' : [ [ ' Palo Alto ' ] , [ ' Mountain View ' ] ] , <nl> + ' locality ' : [ [ ' Palo Alto ' ] , [ ' Mountain View ' ] ] , <nl> + ' occupation ' : [ [ ' doctor ' ] , [ ' consultant ' ] ] <nl> + } <nl> + return features , [ 0 , 1 ] <nl> + <nl> + self . _input_fn = _input_fn <nl> + <nl> + def tearDown ( self ) : <nl> + # Clean up checkpoint / vocab dir . <nl> + writer_cache . FileWriterCache . clear ( ) <nl> + shutil . rmtree ( self . _ckpt_and_vocab_dir ) <nl> + <nl> + def assertAllNotClose ( self , t1 , t2 ) : <nl> + " " " Helper assert for arrays . " " " <nl> + sum_of_abs_diff = 0 . 0 <nl> + for x , y in zip ( t1 , t2 ) : <nl> + try : <nl> + for a , b in zip ( x , y ) : <nl> + sum_of_abs_diff + = abs ( b - a ) <nl> + except TypeError : <nl> + sum_of_abs_diff + = abs ( y - x ) <nl> + self . assertGreater ( sum_of_abs_diff , 0 ) <nl> + <nl> + def test_classifier_basic_warm_starting ( self ) : <nl> + " " " Tests correctness of DNNClassifier default warm - start . " " " <nl> + city = feature_column . embedding_column ( <nl> + feature_column . categorical_column_with_vocabulary_list ( <nl> + ' city ' , vocabulary_list = [ ' Mountain View ' , ' Palo Alto ' ] ) , <nl> + dimension = 5 ) <nl> + <nl> + # Create a DNNClassifier and train to save a checkpoint . <nl> + dnn_classifier = self . _dnn_classifier_fn ( <nl> + hidden_units = [ 256 , 128 ] , <nl> + feature_columns = [ city ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + n_classes = 4 , <nl> + optimizer = ' SGD ' ) <nl> + dnn_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second DNNClassifier , warm - started from the first . Use a <nl> + # learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t have <nl> + # accumulator values that change ) . <nl> + warm_started_dnn_classifier = self . _dnn_classifier_fn ( <nl> + hidden_units = [ 256 , 128 ] , <nl> + feature_columns = [ city ] , <nl> + n_classes = 4 , <nl> + optimizer = gradient_descent . GradientDescentOptimizer ( learning_rate = 0 . 0 ) , <nl> + warm_start_from = dnn_classifier . model_dir ) <nl> + <nl> + warm_started_dnn_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + for variable_name in warm_started_dnn_classifier . get_variable_names ( ) : <nl> + self . assertAllClose ( <nl> + dnn_classifier . get_variable_value ( variable_name ) , <nl> + warm_started_dnn_classifier . get_variable_value ( variable_name ) ) <nl> + <nl> + def test_regressor_basic_warm_starting ( self ) : <nl> + " " " Tests correctness of DNNRegressor default warm - start . " " " <nl> + city = feature_column . embedding_column ( <nl> + feature_column . categorical_column_with_vocabulary_list ( <nl> + ' city ' , vocabulary_list = [ ' Mountain View ' , ' Palo Alto ' ] ) , <nl> + dimension = 5 ) <nl> + <nl> + # Create a DNNRegressor and train to save a checkpoint . <nl> + dnn_regressor = self . _dnn_regressor_fn ( <nl> + hidden_units = [ 256 , 128 ] , <nl> + feature_columns = [ city ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + optimizer = ' SGD ' ) <nl> + dnn_regressor . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second DNNRegressor , warm - started from the first . Use a <nl> + # learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t have <nl> + # accumulator values that change ) . <nl> + warm_started_dnn_regressor = self . _dnn_regressor_fn ( <nl> + hidden_units = [ 256 , 128 ] , <nl> + feature_columns = [ city ] , <nl> + optimizer = gradient_descent . GradientDescentOptimizer ( learning_rate = 0 . 0 ) , <nl> + warm_start_from = dnn_regressor . model_dir ) <nl> + <nl> + warm_started_dnn_regressor . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + for variable_name in warm_started_dnn_regressor . get_variable_names ( ) : <nl> + self . assertAllClose ( <nl> + dnn_regressor . get_variable_value ( variable_name ) , <nl> + warm_started_dnn_regressor . get_variable_value ( variable_name ) ) <nl> + <nl> + def test_warm_starting_selective_variables ( self ) : <nl> + " " " Tests selecting variables to warm - start . " " " <nl> + city = feature_column . embedding_column ( <nl> + feature_column . categorical_column_with_vocabulary_list ( <nl> + ' city ' , vocabulary_list = [ ' Mountain View ' , ' Palo Alto ' ] ) , <nl> + dimension = 5 ) <nl> + <nl> + # Create a DNNClassifier and train to save a checkpoint . <nl> + dnn_classifier = self . _dnn_classifier_fn ( <nl> + hidden_units = [ 256 , 128 ] , <nl> + feature_columns = [ city ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + n_classes = 4 , <nl> + optimizer = ' SGD ' ) <nl> + dnn_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second DNNClassifier , warm - started from the first . Use a <nl> + # learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t have <nl> + # accumulator values that change ) . <nl> + warm_started_dnn_classifier = self . _dnn_classifier_fn ( <nl> + hidden_units = [ 256 , 128 ] , <nl> + feature_columns = [ city ] , <nl> + n_classes = 4 , <nl> + optimizer = gradient_descent . GradientDescentOptimizer ( learning_rate = 0 . 0 ) , <nl> + # The provided regular expression will only warm - start the city <nl> + # embedding , not the kernels and biases of the hidden weights . <nl> + warm_start_from = warm_starting_util . WarmStartSettings ( <nl> + ckpt_to_initialize_from = dnn_classifier . model_dir , <nl> + vars_to_warm_start = ' . * ( city ) . * ' ) ) <nl> + <nl> + warm_started_dnn_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + for variable_name in warm_started_dnn_classifier . get_variable_names ( ) : <nl> + if ' city ' in variable_name : <nl> + self . assertAllClose ( <nl> + dnn_classifier . get_variable_value ( variable_name ) , <nl> + warm_started_dnn_classifier . get_variable_value ( variable_name ) ) <nl> + elif ' bias ' in variable_name : <nl> + # Hidden layer biases are zero - initialized . <nl> + bias_values = warm_started_dnn_classifier . get_variable_value ( <nl> + variable_name ) <nl> + self . assertAllClose ( np . zeros_like ( bias_values ) , bias_values ) <nl> + elif ' kernel ' in variable_name : <nl> + # We can ' t override the glorot uniform initializer used for the kernels <nl> + # in the dense layers , so just make sure we ' re not getting the same <nl> + # values from the old checkpoint . <nl> + self . assertAllNotClose ( <nl> + dnn_classifier . get_variable_value ( variable_name ) , <nl> + warm_started_dnn_classifier . get_variable_value ( variable_name ) ) <nl> + <nl> + def test_warm_starting_with_vocab_remapping_and_partitioning ( self ) : <nl> + " " " Tests warm - starting with vocab remapping and partitioning . " " " <nl> + vocab_list = [ ' doctor ' , ' lawyer ' , ' consultant ' ] <nl> + vocab_file = os . path . join ( self . _ckpt_and_vocab_dir , ' occupation_vocab ' ) <nl> + with open ( vocab_file , ' w ' ) as f : <nl> + f . write ( ' \ n ' . join ( vocab_list ) ) <nl> + occupation = feature_column . embedding_column ( <nl> + feature_column . categorical_column_with_vocabulary_file ( <nl> + ' occupation ' , <nl> + vocabulary_file = vocab_file , <nl> + vocabulary_size = len ( vocab_list ) ) , <nl> + dimension = 2 ) <nl> + <nl> + # Create a DNNClassifier and train to save a checkpoint . <nl> + partitioner = partitioned_variables . fixed_size_partitioner ( num_shards = 2 ) <nl> + dnn_classifier = self . _dnn_classifier_fn ( <nl> + hidden_units = [ 256 , 128 ] , <nl> + feature_columns = [ occupation ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + n_classes = 4 , <nl> + optimizer = ' SGD ' , <nl> + input_layer_partitioner = partitioner ) <nl> + dnn_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second DNNClassifier , warm - started from the first . Use a <nl> + # learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t have <nl> + # accumulator values that change ) . Use a a new FeatureColumn with a <nl> + # different vocabulary for occupation . <nl> + new_vocab_list = [ ' doctor ' , ' consultant ' , ' engineer ' ] <nl> + new_vocab_file = os . path . join ( self . _ckpt_and_vocab_dir , <nl> + ' new_occupation_vocab ' ) <nl> + with open ( new_vocab_file , ' w ' ) as f : <nl> + f . write ( ' \ n ' . join ( new_vocab_list ) ) <nl> + new_occupation = feature_column . embedding_column ( <nl> + feature_column . categorical_column_with_vocabulary_file ( <nl> + ' occupation ' , <nl> + vocabulary_file = new_vocab_file , <nl> + vocabulary_size = len ( new_vocab_list ) ) , <nl> + dimension = 2 ) <nl> + # We can create our VocabInfo object from the new and old occupation <nl> + # FeatureColumn ' s . <nl> + occupation_vocab_info = warm_starting_util . VocabInfo ( <nl> + new_vocab = new_occupation . categorical_column . vocabulary_file , <nl> + new_vocab_size = new_occupation . categorical_column . vocabulary_size , <nl> + num_oov_buckets = new_occupation . categorical_column . num_oov_buckets , <nl> + old_vocab = occupation . categorical_column . vocabulary_file , <nl> + old_vocab_size = occupation . categorical_column . vocabulary_size , <nl> + # Can ' t use constant_initializer with load_and_remap . In practice , <nl> + # use a truncated normal initializer . <nl> + backup_initializer = init_ops . random_uniform_initializer ( <nl> + minval = 0 . 39 , maxval = 0 . 39 ) ) <nl> + warm_started_dnn_classifier = self . _dnn_classifier_fn ( <nl> + hidden_units = [ 256 , 128 ] , <nl> + feature_columns = [ occupation ] , <nl> + n_classes = 4 , <nl> + optimizer = gradient_descent . GradientDescentOptimizer ( learning_rate = 0 . 0 ) , <nl> + warm_start_from = warm_starting_util . WarmStartSettings ( <nl> + ckpt_to_initialize_from = dnn_classifier . model_dir , <nl> + var_name_to_vocab_info = { <nl> + OCCUPATION_EMBEDDING_NAME : occupation_vocab_info <nl> + } , <nl> + # Explicitly providing None here will only warm - start variables <nl> + # referenced in var_name_to_vocab_info ( no hidden weights will be <nl> + # warmstarted ) . <nl> + vars_to_warm_start = None ) , <nl> + input_layer_partitioner = partitioner ) <nl> + <nl> + warm_started_dnn_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + # ' doctor ' was ID - 0 and still ID - 0 . <nl> + self . assertAllClose ( <nl> + dnn_classifier . get_variable_value ( OCCUPATION_EMBEDDING_NAME ) [ 0 , : ] , <nl> + warm_started_dnn_classifier . get_variable_value ( <nl> + OCCUPATION_EMBEDDING_NAME ) [ 0 , : ] ) <nl> + # ' consultant ' was ID - 2 and now ID - 1 . <nl> + self . assertAllClose ( <nl> + dnn_classifier . get_variable_value ( OCCUPATION_EMBEDDING_NAME ) [ 2 , : ] , <nl> + warm_started_dnn_classifier . get_variable_value ( <nl> + OCCUPATION_EMBEDDING_NAME ) [ 1 , : ] ) <nl> + # ' engineer ' is a new entry and should be initialized with the <nl> + # backup_initializer in VocabInfo . <nl> + self . assertAllClose ( [ 0 . 39 ] * 2 , <nl> + warm_started_dnn_classifier . get_variable_value ( <nl> + OCCUPATION_EMBEDDING_NAME ) [ 2 , : ] ) <nl> + for variable_name in warm_started_dnn_classifier . get_variable_names ( ) : <nl> + if ' bias ' in variable_name : <nl> + # Hidden layer biases are zero - initialized . <nl> + bias_values = warm_started_dnn_classifier . get_variable_value ( <nl> + variable_name ) <nl> + self . assertAllClose ( np . zeros_like ( bias_values ) , bias_values ) <nl> + elif ' kernel ' in variable_name : <nl> + # We can ' t override the glorot uniform initializer used for the kernels <nl> + # in the dense layers , so just make sure we ' re not getting the same <nl> + # values from the old checkpoint . <nl> + self . assertAllNotClose ( <nl> + dnn_classifier . get_variable_value ( variable_name ) , <nl> + warm_started_dnn_classifier . get_variable_value ( variable_name ) ) <nl> + <nl> + def test_warm_starting_with_naming_change ( self ) : <nl> + " " " Tests warm - starting with a Tensor name remapping . " " " <nl> + locality = feature_column . embedding_column ( <nl> + feature_column . categorical_column_with_vocabulary_list ( <nl> + ' locality ' , vocabulary_list = [ ' Mountain View ' , ' Palo Alto ' ] ) , <nl> + dimension = 5 ) <nl> + <nl> + # Create a DNNClassifier and train to save a checkpoint . <nl> + dnn_classifier = self . _dnn_classifier_fn ( <nl> + hidden_units = [ 256 , 128 ] , <nl> + feature_columns = [ locality ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + n_classes = 4 , <nl> + optimizer = ' SGD ' ) <nl> + dnn_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second DNNClassifier , warm - started from the first . Use a <nl> + # learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t have <nl> + # accumulator values that change ) . <nl> + city = feature_column . embedding_column ( <nl> + feature_column . categorical_column_with_vocabulary_list ( <nl> + ' city ' , vocabulary_list = [ ' Mountain View ' , ' Palo Alto ' ] ) , <nl> + dimension = 5 ) <nl> + warm_started_dnn_classifier = self . _dnn_classifier_fn ( <nl> + hidden_units = [ 256 , 128 ] , <nl> + feature_columns = [ city ] , <nl> + n_classes = 4 , <nl> + optimizer = gradient_descent . GradientDescentOptimizer ( learning_rate = 0 . 0 ) , <nl> + # The ' city ' variable correspond to the ' locality ' variable in the <nl> + # previous model . <nl> + warm_start_from = warm_starting_util . WarmStartSettings ( <nl> + ckpt_to_initialize_from = dnn_classifier . model_dir , <nl> + var_name_to_prev_var_name = { <nl> + CITY_EMBEDDING_NAME : <nl> + CITY_EMBEDDING_NAME . replace ( ' city ' , ' locality ' ) <nl> + } ) ) <nl> + <nl> + warm_started_dnn_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + for variable_name in warm_started_dnn_classifier . get_variable_names ( ) : <nl> + if ' city ' in variable_name : <nl> + self . assertAllClose ( <nl> + dnn_classifier . get_variable_value ( <nl> + CITY_EMBEDDING_NAME . replace ( ' city ' , ' locality ' ) ) , <nl> + warm_started_dnn_classifier . get_variable_value ( CITY_EMBEDDING_NAME ) ) <nl> + else : <nl> + self . assertAllClose ( <nl> + dnn_classifier . get_variable_value ( variable_name ) , <nl> + warm_started_dnn_classifier . get_variable_value ( variable_name ) ) <nl> + <nl> + <nl> class BaseDNNClassifierEvaluateTest ( object ) : <nl> <nl> def __init__ ( self , dnn_classifier_fn ) : <nl> mmm a / tensorflow / python / estimator / canned / linear . py <nl> ppp b / tensorflow / python / estimator / canned / linear . py <nl> <nl> import six <nl> <nl> from tensorflow . python . estimator import estimator <nl> + from tensorflow . python . estimator import warm_starting_util <nl> from tensorflow . python . estimator . canned import head as head_lib <nl> from tensorflow . python . estimator . canned import optimizers <nl> from tensorflow . python . feature_column import feature_column as feature_column_lib <nl> + from tensorflow . python . ops import array_ops <nl> + from tensorflow . python . ops import nn <nl> from tensorflow . python . ops import partitioned_variables <nl> from tensorflow . python . ops import variable_scope <nl> + from tensorflow . python . summary import summary <nl> from tensorflow . python . training import ftrl <nl> from tensorflow . python . training import training_util <nl> <nl> def _get_default_optimizer ( feature_columns ) : <nl> return ftrl . FtrlOptimizer ( learning_rate = learning_rate ) <nl> <nl> <nl> + def _compute_fraction_of_zero ( cols_to_vars , units ) : <nl> + " " " Given a linear cols_to_vars dict , compute the fraction of zero weights . <nl> + <nl> + Args : <nl> + cols_to_vars : A dictionary mapping FeatureColumns to lists of tf . Variables <nl> + like one returned from feature_column_lib . linear_model . <nl> + units : Dimension of output ( e . g . 1 for binary ) . <nl> + <nl> + Returns : <nl> + The fraction of zeros ( sparsity ) in the linear model . <nl> + " " " <nl> + all_weight_vars = [ ] <nl> + for var_or_var_list in cols_to_vars . values ( ) : <nl> + # Skip empty - lists associated with columns that created no Variables . <nl> + if var_or_var_list : <nl> + all_weight_vars + = [ <nl> + array_ops . reshape ( var , [ - 1 , units ] ) for var in var_or_var_list <nl> + ] <nl> + return nn . zero_fraction ( array_ops . concat ( all_weight_vars , axis = 0 ) ) <nl> + <nl> + <nl> def _linear_logit_fn_builder ( units , feature_columns ) : <nl> " " " Function builder for a linear logit_fn . <nl> <nl> def linear_logit_fn ( features ) : <nl> Returns : <nl> A ` Tensor ` representing the logits . <nl> " " " <nl> - return feature_column_lib . linear_model ( <nl> - features = features , feature_columns = feature_columns , units = units ) <nl> + cols_to_vars = { } <nl> + logits = feature_column_lib . linear_model ( <nl> + features = features , <nl> + feature_columns = feature_columns , <nl> + units = units , <nl> + cols_to_vars = cols_to_vars ) <nl> + bias = cols_to_vars . pop ( ' bias ' ) <nl> + if units > 1 : <nl> + summary . histogram ( ' bias ' , bias ) <nl> + else : <nl> + # If units = = 1 , the bias value is a length - 1 list of a scalar Tensor , <nl> + # so we should provide a scalar summary . <nl> + summary . scalar ( ' bias ' , bias [ 0 ] [ 0 ] ) <nl> + summary . scalar ( ' fraction_of_zero_weights ' , <nl> + _compute_fraction_of_zero ( cols_to_vars , units ) ) <nl> + <nl> + return logits <nl> <nl> return linear_logit_fn <nl> <nl> def _linear_model_fn ( features , labels , mode , head , feature_columns , optimizer , <nl> if not isinstance ( features , dict ) : <nl> raise ValueError ( ' features should be a dictionary of ` Tensor ` s . ' <nl> ' Given type : { } ' . format ( type ( features ) ) ) <nl> + <nl> optimizer = optimizers . get_optimizer_instance ( <nl> optimizer or _get_default_optimizer ( feature_columns ) , <nl> learning_rate = _LEARNING_RATE ) <nl> class LinearClassifier ( estimator . Estimator ) : <nl> l1_regularization_strength = 0 . 001 <nl> ) ) <nl> <nl> + # Or estimator with warm - starting from a previous checkpoint . <nl> + estimator = LinearClassifier ( <nl> + feature_columns = [ categorical_column_a , <nl> + categorical_feature_a_x_categorical_feature_b ] , <nl> + warm_start_from = " / path / to / checkpoint / dir " ) <nl> + <nl> + <nl> # Input builders <nl> def input_fn_train : # returns x , y ( where y represents label ' s class index ) . <nl> . . . <nl> def __init__ ( self , <nl> label_vocabulary = None , <nl> optimizer = ' Ftrl ' , <nl> config = None , <nl> - partitioner = None ) : <nl> + partitioner = None , <nl> + warm_start_from = None ) : <nl> " " " Construct a ` LinearClassifier ` estimator object . <nl> <nl> Args : <nl> def __init__ ( self , <nl> to FTRL optimizer . <nl> config : ` RunConfig ` object to configure the runtime settings . <nl> partitioner : Optional . Partitioner for input layer . <nl> + warm_start_from : A string filepath to a checkpoint to warm - start from , or <nl> + a ` WarmStartSettings ` object to fully configure warm - starting . If the <nl> + string filepath is provided instead of a ` WarmStartSettings ` , then all <nl> + weights and biases are warm - started , and it is assumed that vocabularies <nl> + and Tensor names are unchanged . <nl> <nl> Returns : <nl> A ` LinearClassifier ` estimator . <nl> def __init__ ( self , <nl> head = head_lib . _multi_class_head_with_softmax_cross_entropy_loss ( # pylint : disable = protected - access <nl> n_classes , weight_column = weight_column , <nl> label_vocabulary = label_vocabulary ) <nl> + <nl> def _model_fn ( features , labels , mode , config ) : <nl> - return _linear_model_fn ( <nl> + " " " Call the defined shared _linear_model_fn and possibly warm - start . " " " <nl> + estimator_spec = _linear_model_fn ( <nl> features = features , <nl> labels = labels , <nl> mode = mode , <nl> def _model_fn ( features , labels , mode , config ) : <nl> optimizer = optimizer , <nl> partitioner = partitioner , <nl> config = config ) <nl> + # pylint : disable = protected - access <nl> + warm_start_settings = warm_starting_util . _get_default_warm_start_settings ( <nl> + warm_start_from ) <nl> + if warm_start_settings : <nl> + warm_starting_util . _warm_start ( warm_start_settings ) <nl> + # pylint : enable = protected - access <nl> + <nl> + return estimator_spec <nl> + <nl> super ( LinearClassifier , self ) . __init__ ( <nl> model_fn = _model_fn , <nl> model_dir = model_dir , <nl> class LinearRegressor ( estimator . Estimator ) : <nl> feature_columns = [ categorical_column_a , <nl> categorical_feature_a_x_categorical_feature_b ] ) <nl> <nl> + # Or estimator with warm - starting from a previous checkpoint . <nl> + estimator = LinearRegressor ( <nl> + feature_columns = [ categorical_column_a , <nl> + categorical_feature_a_x_categorical_feature_b ] , <nl> + warm_start_from = " / path / to / checkpoint / dir " ) <nl> + <nl> + <nl> # Input builders <nl> def input_fn_train : # returns x , y <nl> . . . <nl> def __init__ ( self , <nl> weight_column = None , <nl> optimizer = ' Ftrl ' , <nl> config = None , <nl> - partitioner = None ) : <nl> + partitioner = None , <nl> + warm_start_from = None ) : <nl> " " " Initializes a ` LinearRegressor ` instance . <nl> <nl> Args : <nl> def __init__ ( self , <nl> to FTRL optimizer . <nl> config : ` RunConfig ` object to configure the runtime settings . <nl> partitioner : Optional . Partitioner for input layer . <nl> + warm_start_from : A string filepath to a checkpoint to warm - start from , or <nl> + a ` WarmStartSettings ` object to fully configure warm - starting . If the <nl> + string filepath is provided instead of a ` WarmStartSettings ` , then all <nl> + weights and biases are warm - started , and it is assumed that vocabularies <nl> + and Tensor names are unchanged . <nl> " " " <nl> head = head_lib . _regression_head_with_mean_squared_error_loss ( # pylint : disable = protected - access <nl> label_dimension = label_dimension , weight_column = weight_column ) <nl> + <nl> def _model_fn ( features , labels , mode , config ) : <nl> - return _linear_model_fn ( <nl> + " " " Call the defined shared _linear_model_fn and possibly warm - start . " " " <nl> + estimator_spec = _linear_model_fn ( <nl> features = features , <nl> labels = labels , <nl> mode = mode , <nl> def _model_fn ( features , labels , mode , config ) : <nl> optimizer = optimizer , <nl> partitioner = partitioner , <nl> config = config ) <nl> + # pylint : disable = protected - access <nl> + warm_start_settings = warm_starting_util . _get_default_warm_start_settings ( <nl> + warm_start_from ) <nl> + if warm_start_settings : <nl> + warm_starting_util . _warm_start ( warm_start_settings ) <nl> + # pylint : enable = protected - access <nl> + <nl> + return estimator_spec <nl> + <nl> super ( LinearRegressor , self ) . __init__ ( <nl> model_fn = _model_fn , <nl> model_dir = model_dir , <nl> mmm a / tensorflow / python / estimator / canned / linear_test . py <nl> ppp b / tensorflow / python / estimator / canned / linear_test . py <nl> def __init__ ( self , methodName = ' runTest ' ) : # pylint : disable = invalid - name <nl> <nl> <nl> # Tests for Linear logit_fn . <nl> - <nl> - <nl> class LinearLogitFnTest ( linear_testing_utils . BaseLinearLogitFnTest , <nl> test . TestCase ) : <nl> <nl> def __init__ ( self , methodName = ' runTest ' ) : # pylint : disable = invalid - name <nl> linear_testing_utils . BaseLinearLogitFnTest . __init__ ( self ) <nl> <nl> <nl> + # Tests for warm - starting with Linear logit_fn . <nl> + class LinearWarmStartingTest ( linear_testing_utils . BaseLinearWarmStartingTest , <nl> + test . TestCase ) : <nl> + <nl> + def __init__ ( self , methodName = ' runTest ' ) : # pylint : disable = invalid - name <nl> + test . TestCase . __init__ ( self , methodName ) <nl> + linear_testing_utils . BaseLinearWarmStartingTest . __init__ ( <nl> + self , _linear_classifier_fn , _linear_regressor_fn ) <nl> + <nl> + <nl> if __name__ = = ' __main__ ' : <nl> test . main ( ) <nl> mmm a / tensorflow / python / estimator / canned / linear_testing_utils . py <nl> ppp b / tensorflow / python / estimator / canned / linear_testing_utils . py <nl> <nl> from tensorflow . python . client import session as tf_session <nl> from tensorflow . python . estimator import estimator <nl> from tensorflow . python . estimator import run_config <nl> + from tensorflow . python . estimator import warm_starting_util <nl> from tensorflow . python . estimator . canned import linear <nl> from tensorflow . python . estimator . canned import metric_keys <nl> from tensorflow . python . estimator . export import export <nl> <nl> from tensorflow . python . ops import check_ops <nl> from tensorflow . python . ops import control_flow_ops <nl> from tensorflow . python . ops import data_flow_ops <nl> + from tensorflow . python . ops import init_ops <nl> from tensorflow . python . ops import math_ops <nl> from tensorflow . python . ops import parsing_ops <nl> + from tensorflow . python . ops import partitioned_variables <nl> from tensorflow . python . ops import state_ops <nl> from tensorflow . python . ops import variable_scope <nl> - from tensorflow . python . ops import variables <nl> + from tensorflow . python . ops import variables as variables_lib <nl> from tensorflow . python . platform import gfile <nl> from tensorflow . python . platform import test <nl> from tensorflow . python . summary . writer import writer_cache <nl> from tensorflow . python . training import checkpoint_utils <nl> + from tensorflow . python . training import gradient_descent <nl> from tensorflow . python . training import input as input_lib <nl> - from tensorflow . python . training import optimizer <nl> + from tensorflow . python . training import optimizer as optimizer_lib <nl> from tensorflow . python . training import queue_runner <nl> from tensorflow . python . training import saver <nl> from tensorflow . python . training import session_run_hook <nl> <nl> # Names of variables created by model . <nl> AGE_WEIGHT_NAME = ' linear / linear_model / age / weights ' <nl> HEIGHT_WEIGHT_NAME = ' linear / linear_model / height / weights ' <nl> + OCCUPATION_WEIGHT_NAME = ' linear / linear_model / occupation / weights ' <nl> BIAS_NAME = ' linear / linear_model / bias_weights ' <nl> LANGUAGE_WEIGHT_NAME = ' linear / linear_model / language / weights ' <nl> <nl> def assert_close ( expected , actual , rtol = 1e - 04 , name = ' assert_close ' ) : <nl> <nl> <nl> def save_variables_to_ckpt ( model_dir ) : <nl> - init_all_op = [ variables . global_variables_initializer ( ) ] <nl> + init_all_op = [ variables_lib . global_variables_initializer ( ) ] <nl> with tf_session . Session ( ) as sess : <nl> sess . run ( init_all_op ) <nl> saver . Saver ( ) . save ( sess , os . path . join ( model_dir , ' model . ckpt ' ) ) <nl> def begin ( self ) : <nl> partitioned_weight = variable_scope . get_variable ( <nl> self . _var_name , shape = ( self . _var_dim , 1 ) ) <nl> self . _test_case . assertTrue ( <nl> - isinstance ( partitioned_weight , variables . PartitionedVariable ) ) <nl> + isinstance ( partitioned_weight , variables_lib . PartitionedVariable ) ) <nl> for part in partitioned_weight : <nl> self . _test_case . assertEqual ( self . _var_dim / / self . _partitions , <nl> part . get_shape ( ) [ 0 ] ) <nl> def tearDown ( self ) : <nl> <nl> def test_evaluation_for_simple_data ( self ) : <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( [ [ 11 . 0 ] ] , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( [ 2 . 0 ] , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> + variables_lib . Variable ( [ [ 11 . 0 ] ] , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( [ 2 . 0 ] , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> 100 , name = ops . GraphKeys . GLOBAL_STEP , dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> def test_evaluation_for_simple_data ( self ) : <nl> def test_evaluation_batch ( self ) : <nl> " " " Tests evaluation for batch_size = = 2 . " " " <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( [ [ 11 . 0 ] ] , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( [ 2 . 0 ] , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> + variables_lib . Variable ( [ [ 11 . 0 ] ] , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( [ 2 . 0 ] , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> 100 , name = ops . GraphKeys . GLOBAL_STEP , dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> def test_evaluation_batch ( self ) : <nl> def test_evaluation_weights ( self ) : <nl> " " " Tests evaluation with weights . " " " <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( [ [ 11 . 0 ] ] , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( [ 2 . 0 ] , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> + variables_lib . Variable ( [ [ 11 . 0 ] ] , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( [ 2 . 0 ] , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> 100 , name = ops . GraphKeys . GLOBAL_STEP , dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> def test_evaluation_for_multi_dimensions ( self ) : <nl> x_dim = 3 <nl> label_dim = 2 <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( <nl> + variables_lib . Variable ( <nl> [ [ 1 . 0 , 2 . 0 ] , [ 3 . 0 , 4 . 0 ] , [ 5 . 0 , 6 . 0 ] ] , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( [ 7 . 0 , 8 . 0 ] , name = BIAS_NAME ) <nl> - variables . Variable ( 100 , name = ' global_step ' , dtype = dtypes . int64 ) <nl> + variables_lib . Variable ( [ 7 . 0 , 8 . 0 ] , name = BIAS_NAME ) <nl> + variables_lib . Variable ( 100 , name = ' global_step ' , dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> linear_regressor = self . _linear_regressor_fn ( <nl> def test_evaluation_for_multi_dimensions ( self ) : <nl> <nl> def test_evaluation_for_multiple_feature_columns ( self ) : <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( [ [ 10 . 0 ] ] , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( [ [ 2 . 0 ] ] , name = HEIGHT_WEIGHT_NAME ) <nl> - variables . Variable ( [ 5 . 0 ] , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> + variables_lib . Variable ( [ [ 10 . 0 ] ] , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( [ [ 2 . 0 ] ] , name = HEIGHT_WEIGHT_NAME ) <nl> + variables_lib . Variable ( [ 5 . 0 ] , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> 100 , name = ops . GraphKeys . GLOBAL_STEP , dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> def tearDown ( self ) : <nl> def test_1d ( self ) : <nl> " " " Tests predict when all variables are one - dimensional . " " " <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( [ [ 10 . ] ] , name = ' linear / linear_model / x / weights ' ) <nl> - variables . Variable ( [ . 2 ] , name = BIAS_NAME ) <nl> - variables . Variable ( 100 , name = ' global_step ' , dtype = dtypes . int64 ) <nl> + variables_lib . Variable ( [ [ 10 . ] ] , name = ' linear / linear_model / x / weights ' ) <nl> + variables_lib . Variable ( [ . 2 ] , name = BIAS_NAME ) <nl> + variables_lib . Variable ( 100 , name = ' global_step ' , dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> linear_regressor = self . _linear_regressor_fn ( <nl> def testMultiDim ( self ) : <nl> x_dim = 4 <nl> feature_columns = ( feature_column_lib . numeric_column ( ' x ' , shape = ( x_dim , ) ) , ) <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( # shape = [ x_dim , label_dimension ] <nl> + variables_lib . Variable ( # shape = [ x_dim , label_dimension ] <nl> [ [ 1 . , 2 . , 3 . ] , [ 2 . , 3 . , 4 . ] , [ 3 . , 4 . , 5 . ] , [ 4 . , 5 . , 6 . ] ] , <nl> name = ' linear / linear_model / x / weights ' ) <nl> - variables . Variable ( # shape = [ label_dimension ] <nl> + variables_lib . Variable ( # shape = [ label_dimension ] <nl> [ . 2 , . 4 , . 6 ] , name = BIAS_NAME ) <nl> - variables . Variable ( 100 , name = ' global_step ' , dtype = dtypes . int64 ) <nl> + variables_lib . Variable ( 100 , name = ' global_step ' , dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> linear_regressor = self . _linear_regressor_fn ( <nl> def testMultiDim ( self ) : <nl> def testTwoFeatureColumns ( self ) : <nl> " " " Tests predict with two feature columns . " " " <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( [ [ 10 . ] ] , name = ' linear / linear_model / x0 / weights ' ) <nl> - variables . Variable ( [ [ 20 . ] ] , name = ' linear / linear_model / x1 / weights ' ) <nl> - variables . Variable ( [ . 2 ] , name = BIAS_NAME ) <nl> - variables . Variable ( 100 , name = ' global_step ' , dtype = dtypes . int64 ) <nl> + variables_lib . Variable ( [ [ 10 . ] ] , name = ' linear / linear_model / x0 / weights ' ) <nl> + variables_lib . Variable ( [ [ 20 . ] ] , name = ' linear / linear_model / x1 / weights ' ) <nl> + variables_lib . Variable ( [ . 2 ] , name = BIAS_NAME ) <nl> + variables_lib . Variable ( 100 , name = ' global_step ' , dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> linear_regressor = self . _linear_regressor_fn ( <nl> def _minimize ( loss , global_step = None , var_list = None ) : <nl> return control_flow_ops . no_op ( ) <nl> <nl> mock_optimizer = test . mock . NonCallableMock ( <nl> - spec = optimizer . Optimizer , <nl> - wraps = optimizer . Optimizer ( use_locking = False , name = ' my_optimizer ' ) ) <nl> + spec = optimizer_lib . Optimizer , <nl> + wraps = optimizer_lib . Optimizer ( use_locking = False , name = ' my_optimizer ' ) ) <nl> mock_optimizer . minimize = test . mock . MagicMock ( wraps = _minimize ) <nl> <nl> # NOTE : Estimator . params performs a deepcopy , which wreaks havoc with mocks . <nl> def testFromCheckpoint ( self ) : <nl> bias = 5 . 0 <nl> initial_global_step = 100 <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( [ [ age_weight ] ] , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( [ bias ] , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> + variables_lib . Variable ( [ [ age_weight ] ] , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( [ bias ] , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> initial_global_step , <nl> name = ops . GraphKeys . GLOBAL_STEP , <nl> dtype = dtypes . int64 ) <nl> def testFromCheckpointMultiBatch ( self ) : <nl> bias = 5 . 0 <nl> initial_global_step = 100 <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( [ [ age_weight ] ] , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( [ bias ] , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> + variables_lib . Variable ( [ [ age_weight ] ] , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( [ bias ] , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> initial_global_step , <nl> name = ops . GraphKeys . GLOBAL_STEP , <nl> dtype = dtypes . int64 ) <nl> def _minimize ( loss , global_step ) : <nl> return state_ops . assign_add ( global_step , 1 ) . op <nl> <nl> mock_optimizer = test . mock . NonCallableMock ( <nl> - spec = optimizer . Optimizer , <nl> - wraps = optimizer . Optimizer ( use_locking = False , name = ' my_optimizer ' ) ) <nl> + spec = optimizer_lib . Optimizer , <nl> + wraps = optimizer_lib . Optimizer ( use_locking = False , name = ' my_optimizer ' ) ) <nl> mock_optimizer . minimize = test . mock . MagicMock ( wraps = _minimize ) <nl> <nl> # NOTE : Estimator . params performs a deepcopy , which wreaks havoc with mocks . <nl> def _testFromCheckpoint ( self , n_classes ) : <nl> bias = [ - 35 . 0 ] if n_classes = = 2 else [ - 35 . 0 ] * n_classes <nl> initial_global_step = 100 <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( bias , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> - initial_global_step , name = ops . GraphKeys . GLOBAL_STEP , <nl> + variables_lib . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( bias , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> + initial_global_step , <nl> + name = ops . GraphKeys . GLOBAL_STEP , <nl> dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> def _testFromCheckpointFloatLabels ( self , n_classes ) : <nl> bias = [ - 35 . 0 ] <nl> initial_global_step = 100 <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( bias , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> - initial_global_step , name = ops . GraphKeys . GLOBAL_STEP , <nl> + variables_lib . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( bias , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> + initial_global_step , <nl> + name = ops . GraphKeys . GLOBAL_STEP , <nl> dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> def _testFromCheckpointMultiBatch ( self , n_classes ) : <nl> bias = [ - 35 . 0 ] if n_classes = = 2 else [ - 35 . 0 ] * n_classes <nl> initial_global_step = 100 <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( bias , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> - initial_global_step , name = ops . GraphKeys . GLOBAL_STEP , <nl> + variables_lib . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( bias , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> + initial_global_step , <nl> + name = ops . GraphKeys . GLOBAL_STEP , <nl> dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> def _test_evaluation_for_simple_data ( self , n_classes ) : <nl> bias = [ - 30 . 0 ] if n_classes = = 2 else [ - 30 . 0 ] * n_classes <nl> <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( bias , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> + variables_lib . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( bias , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> 100 , name = ops . GraphKeys . GLOBAL_STEP , dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> def _test_evaluation_batch ( self , n_classes ) : <nl> bias = [ - 35 . 0 ] if n_classes = = 2 else [ - 35 . 0 ] * n_classes <nl> initial_global_step = 100 <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( bias , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> - initial_global_step , name = ops . GraphKeys . GLOBAL_STEP , <nl> + variables_lib . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( bias , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> + initial_global_step , <nl> + name = ops . GraphKeys . GLOBAL_STEP , <nl> dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> def _test_evaluation_weights ( self , n_classes ) : <nl> bias = [ - 35 . 0 ] if n_classes = = 2 else [ - 35 . 0 ] * n_classes <nl> initial_global_step = 100 <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( bias , name = BIAS_NAME ) <nl> - variables . Variable ( <nl> - initial_global_step , name = ops . GraphKeys . GLOBAL_STEP , <nl> + variables_lib . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( bias , name = BIAS_NAME ) <nl> + variables_lib . Variable ( <nl> + initial_global_step , <nl> + name = ops . GraphKeys . GLOBAL_STEP , <nl> dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> def _testPredictions ( self , n_classes , label_vocabulary , label_output_fn ) : <nl> bias = [ 10 . 0 ] if n_classes = = 2 else [ 10 . 0 ] * n_classes <nl> <nl> with ops . Graph ( ) . as_default ( ) : <nl> - variables . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> - variables . Variable ( bias , name = BIAS_NAME ) <nl> - variables . Variable ( 100 , name = ' global_step ' , dtype = dtypes . int64 ) <nl> + variables_lib . Variable ( age_weight , name = AGE_WEIGHT_NAME ) <nl> + variables_lib . Variable ( bias , name = BIAS_NAME ) <nl> + variables_lib . Variable ( 100 , name = ' global_step ' , dtype = dtypes . int64 ) <nl> save_variables_to_ckpt ( self . _model_dir ) <nl> <nl> est = self . _linear_classifier_fn ( <nl> def test_basic_logit_correctness ( self ) : <nl> with ops . Graph ( ) . as_default ( ) : <nl> logit_fn = linear . _linear_logit_fn_builder ( units = 2 , feature_columns = [ age ] ) <nl> logits = logit_fn ( features = { ' age ' : [ [ 23 . ] , [ 31 . ] ] } ) <nl> - with variable_scope . variable_scope ( ' linear_model ' , reuse = True ) : <nl> - bias_var = variable_scope . get_variable ( ' bias_weights ' ) <nl> + bias_var = ops . get_collection ( ops . GraphKeys . GLOBAL_VARIABLES , <nl> + ' linear_model / bias_weights ' ) [ 0 ] <nl> age_var = ops . get_collection ( ops . GraphKeys . GLOBAL_VARIABLES , <nl> ' linear_model / age ' ) [ 0 ] <nl> with tf_session . Session ( ) as sess : <nl> - sess . run ( [ variables . global_variables_initializer ( ) ] ) <nl> + sess . run ( [ variables_lib . global_variables_initializer ( ) ] ) <nl> self . assertAllClose ( [ [ 0 . , 0 . ] , [ 0 . , 0 . ] ] , logits . eval ( ) ) <nl> sess . run ( bias_var . assign ( [ 10 . , 5 . ] ) ) <nl> self . assertAllClose ( [ [ 10 . , 5 . ] , [ 10 . , 5 . ] ] , logits . eval ( ) ) <nl> def test_basic_logit_correctness ( self ) : <nl> # [ 2 * 23 + 10 , 3 * 23 + 5 ] = [ 56 , 74 ] . <nl> # [ 2 * 31 + 10 , 3 * 31 + 5 ] = [ 72 , 98 ] <nl> self . assertAllClose ( [ [ 56 . , 74 . ] , [ 72 . , 98 . ] ] , logits . eval ( ) ) <nl> + <nl> + def test_compute_fraction_of_zero ( self ) : <nl> + " " " Tests the calculation of sparsity . " " " <nl> + age = feature_column_lib . numeric_column ( ' age ' ) <nl> + occupation = feature_column_lib . categorical_column_with_hash_bucket ( <nl> + ' occupation ' , hash_bucket_size = 5 ) <nl> + with ops . Graph ( ) . as_default ( ) : <nl> + cols_to_vars = { } <nl> + feature_column_lib . linear_model ( <nl> + features = { <nl> + ' age ' : [ [ 23 . ] , [ 31 . ] ] , <nl> + ' occupation ' : [ [ ' doctor ' ] , [ ' engineer ' ] ] <nl> + } , <nl> + feature_columns = [ age , occupation ] , <nl> + units = 3 , <nl> + cols_to_vars = cols_to_vars ) <nl> + cols_to_vars . pop ( ' bias ' ) <nl> + fraction_zero = linear . _compute_fraction_of_zero ( cols_to_vars , 3 ) <nl> + age_var = ops . get_collection ( ops . GraphKeys . GLOBAL_VARIABLES , <nl> + ' linear_model / age ' ) [ 0 ] <nl> + with tf_session . Session ( ) as sess : <nl> + sess . run ( [ variables_lib . global_variables_initializer ( ) ] ) <nl> + # Upon initialization , all variables will be zero . <nl> + self . assertAllClose ( 1 , fraction_zero . eval ( ) ) <nl> + <nl> + sess . run ( age_var . assign ( [ [ 2 . 0 , 0 . 0 , - 1 . 0 ] ] ) ) <nl> + # 1 of the 3 age weights are zero , and all of the 15 ( 5 hash buckets <nl> + # x 3 - dim output ) are zero . <nl> + self . assertAllClose ( 16 . / 18 . , fraction_zero . eval ( ) ) <nl> + <nl> + <nl> + class BaseLinearWarmStartingTest ( object ) : <nl> + <nl> + def __init__ ( self , _linear_classifier_fn , _linear_regressor_fn ) : <nl> + self . _linear_classifier_fn = _linear_classifier_fn <nl> + self . _linear_regressor_fn = _linear_regressor_fn <nl> + <nl> + def setUp ( self ) : <nl> + # Create a directory to save our old checkpoint and vocabularies to . <nl> + self . _ckpt_and_vocab_dir = tempfile . mkdtemp ( ) <nl> + <nl> + # Make a dummy input_fn . <nl> + def _input_fn ( ) : <nl> + features = { <nl> + ' age ' : [ [ 23 . ] , [ 31 . ] ] , <nl> + ' age_in_years ' : [ [ 23 . ] , [ 31 . ] ] , <nl> + ' occupation ' : [ [ ' doctor ' ] , [ ' consultant ' ] ] <nl> + } <nl> + return features , [ 0 , 1 ] <nl> + <nl> + self . _input_fn = _input_fn <nl> + <nl> + def tearDown ( self ) : <nl> + # Clean up checkpoint / vocab dir . <nl> + writer_cache . FileWriterCache . clear ( ) <nl> + shutil . rmtree ( self . _ckpt_and_vocab_dir ) <nl> + <nl> + def test_classifier_basic_warm_starting ( self ) : <nl> + " " " Tests correctness of LinearClassifier default warm - start . " " " <nl> + age = feature_column_lib . numeric_column ( ' age ' ) <nl> + <nl> + # Create a LinearClassifier and train to save a checkpoint . <nl> + linear_classifier = self . _linear_classifier_fn ( <nl> + feature_columns = [ age ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + n_classes = 4 , <nl> + optimizer = ' SGD ' ) <nl> + linear_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second LinearClassifier , warm - started from the first . Use a <nl> + # learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t have <nl> + # accumulator values that change ) . <nl> + warm_started_linear_classifier = self . _linear_classifier_fn ( <nl> + feature_columns = [ age ] , <nl> + n_classes = 4 , <nl> + optimizer = gradient_descent . GradientDescentOptimizer ( learning_rate = 0 . 0 ) , <nl> + warm_start_from = linear_classifier . model_dir ) <nl> + <nl> + warm_started_linear_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + for variable_name in warm_started_linear_classifier . get_variable_names ( ) : <nl> + self . assertAllClose ( <nl> + linear_classifier . get_variable_value ( variable_name ) , <nl> + warm_started_linear_classifier . get_variable_value ( variable_name ) ) <nl> + <nl> + def test_regressor_basic_warm_starting ( self ) : <nl> + " " " Tests correctness of LinearRegressor default warm - start . " " " <nl> + age = feature_column_lib . numeric_column ( ' age ' ) <nl> + <nl> + # Create a LinearRegressor and train to save a checkpoint . <nl> + linear_regressor = self . _linear_regressor_fn ( <nl> + feature_columns = [ age ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + optimizer = ' SGD ' ) <nl> + linear_regressor . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second LinearRegressor , warm - started from the first . Use a <nl> + # learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t have <nl> + # accumulator values that change ) . <nl> + warm_started_linear_regressor = self . _linear_regressor_fn ( <nl> + feature_columns = [ age ] , <nl> + optimizer = gradient_descent . GradientDescentOptimizer ( learning_rate = 0 . 0 ) , <nl> + warm_start_from = linear_regressor . model_dir ) <nl> + <nl> + warm_started_linear_regressor . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + for variable_name in warm_started_linear_regressor . get_variable_names ( ) : <nl> + self . assertAllClose ( <nl> + linear_regressor . get_variable_value ( variable_name ) , <nl> + warm_started_linear_regressor . get_variable_value ( variable_name ) ) <nl> + <nl> + def test_warm_starting_selective_variables ( self ) : <nl> + " " " Tests selecting variables to warm - start . " " " <nl> + age = feature_column_lib . numeric_column ( ' age ' ) <nl> + <nl> + # Create a LinearClassifier and train to save a checkpoint . <nl> + linear_classifier = self . _linear_classifier_fn ( <nl> + feature_columns = [ age ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + n_classes = 4 , <nl> + optimizer = ' SGD ' ) <nl> + linear_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second LinearClassifier , warm - started from the first . Use a <nl> + # learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t have <nl> + # accumulator values that change ) . <nl> + warm_started_linear_classifier = self . _linear_classifier_fn ( <nl> + feature_columns = [ age ] , <nl> + n_classes = 4 , <nl> + optimizer = gradient_descent . GradientDescentOptimizer ( learning_rate = 0 . 0 ) , <nl> + # The provided regular expression will only warm - start the age variable <nl> + # and not the bias . <nl> + warm_start_from = warm_starting_util . WarmStartSettings ( <nl> + ckpt_to_initialize_from = linear_classifier . model_dir , <nl> + vars_to_warm_start = ' . * ( age ) . * ' ) ) <nl> + <nl> + warm_started_linear_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + self . assertAllClose ( <nl> + linear_classifier . get_variable_value ( AGE_WEIGHT_NAME ) , <nl> + warm_started_linear_classifier . get_variable_value ( AGE_WEIGHT_NAME ) ) <nl> + # Bias should still be zero from initialization . <nl> + self . assertAllClose ( <nl> + [ 0 . 0 ] * 4 , warm_started_linear_classifier . get_variable_value ( BIAS_NAME ) ) <nl> + <nl> + def test_warm_starting_with_vocab_remapping_and_partitioning ( self ) : <nl> + " " " Tests warm - starting with vocab remapping and partitioning . " " " <nl> + vocab_list = [ ' doctor ' , ' lawyer ' , ' consultant ' ] <nl> + vocab_file = os . path . join ( self . _ckpt_and_vocab_dir , ' occupation_vocab ' ) <nl> + with open ( vocab_file , ' w ' ) as f : <nl> + f . write ( ' \ n ' . join ( vocab_list ) ) <nl> + occupation = feature_column_lib . categorical_column_with_vocabulary_file ( <nl> + ' occupation ' , <nl> + vocabulary_file = vocab_file , <nl> + vocabulary_size = len ( vocab_list ) ) <nl> + <nl> + # Create a LinearClassifier and train to save a checkpoint . <nl> + partitioner = partitioned_variables . fixed_size_partitioner ( num_shards = 2 ) <nl> + linear_classifier = self . _linear_classifier_fn ( <nl> + feature_columns = [ occupation ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + n_classes = 4 , <nl> + optimizer = ' SGD ' , <nl> + partitioner = partitioner ) <nl> + linear_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second LinearClassifier , warm - started from the first . Use a <nl> + # learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t have <nl> + # accumulator values that change ) . Use a a new FeatureColumn with a <nl> + # different vocabulary for occupation . <nl> + new_vocab_list = [ ' doctor ' , ' consultant ' , ' engineer ' ] <nl> + new_vocab_file = os . path . join ( self . _ckpt_and_vocab_dir , <nl> + ' new_occupation_vocab ' ) <nl> + with open ( new_vocab_file , ' w ' ) as f : <nl> + f . write ( ' \ n ' . join ( new_vocab_list ) ) <nl> + new_occupation = feature_column_lib . categorical_column_with_vocabulary_file ( <nl> + ' occupation ' , <nl> + vocabulary_file = new_vocab_file , <nl> + vocabulary_size = len ( new_vocab_list ) ) <nl> + # We can create our VocabInfo object from the new and old occupation <nl> + # FeatureColumn ' s . <nl> + occupation_vocab_info = warm_starting_util . VocabInfo ( <nl> + new_vocab = new_occupation . vocabulary_file , <nl> + new_vocab_size = new_occupation . vocabulary_size , <nl> + num_oov_buckets = new_occupation . num_oov_buckets , <nl> + old_vocab = occupation . vocabulary_file , <nl> + old_vocab_size = occupation . vocabulary_size , <nl> + # Can ' t use constant_initializer with load_and_remap . In practice , <nl> + # use a truncated normal initializer . <nl> + backup_initializer = init_ops . random_uniform_initializer ( <nl> + minval = 0 . 39 , maxval = 0 . 39 ) ) <nl> + warm_started_linear_classifier = self . _linear_classifier_fn ( <nl> + feature_columns = [ occupation ] , <nl> + n_classes = 4 , <nl> + optimizer = gradient_descent . GradientDescentOptimizer ( learning_rate = 0 . 0 ) , <nl> + warm_start_from = warm_starting_util . WarmStartSettings ( <nl> + ckpt_to_initialize_from = linear_classifier . model_dir , <nl> + var_name_to_vocab_info = { <nl> + OCCUPATION_WEIGHT_NAME : occupation_vocab_info <nl> + } , <nl> + # Explicitly providing None here will only warm - start variables <nl> + # referenced in var_name_to_vocab_info ( the bias will not be <nl> + # warm - started ) . <nl> + vars_to_warm_start = None ) , <nl> + partitioner = partitioner ) <nl> + <nl> + warm_started_linear_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + # ' doctor ' was ID - 0 and still ID - 0 . <nl> + self . assertAllClose ( <nl> + linear_classifier . get_variable_value ( OCCUPATION_WEIGHT_NAME ) [ 0 , : ] , <nl> + warm_started_linear_classifier . get_variable_value ( <nl> + OCCUPATION_WEIGHT_NAME ) [ 0 , : ] ) <nl> + # ' consultant ' was ID - 2 and now ID - 1 . <nl> + self . assertAllClose ( <nl> + linear_classifier . get_variable_value ( OCCUPATION_WEIGHT_NAME ) [ 2 , : ] , <nl> + warm_started_linear_classifier . get_variable_value ( <nl> + OCCUPATION_WEIGHT_NAME ) [ 1 , : ] ) <nl> + # ' engineer ' is a new entry and should be initialized with the <nl> + # backup_initializer in VocabInfo . <nl> + self . assertAllClose ( [ 0 . 39 ] * 4 , <nl> + warm_started_linear_classifier . get_variable_value ( <nl> + OCCUPATION_WEIGHT_NAME ) [ 2 , : ] ) <nl> + # Bias should still be zero ( from initialization logic ) . <nl> + self . assertAllClose ( <nl> + [ 0 . 0 ] * 4 , warm_started_linear_classifier . get_variable_value ( BIAS_NAME ) ) <nl> + <nl> + def test_warm_starting_with_naming_change ( self ) : <nl> + " " " Tests warm - starting with a Tensor name remapping . " " " <nl> + age_in_years = feature_column_lib . numeric_column ( ' age_in_years ' ) <nl> + <nl> + # Create a LinearClassifier and train to save a checkpoint . <nl> + linear_classifier = self . _linear_classifier_fn ( <nl> + feature_columns = [ age_in_years ] , <nl> + model_dir = self . _ckpt_and_vocab_dir , <nl> + n_classes = 4 , <nl> + optimizer = ' SGD ' ) <nl> + linear_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + <nl> + # Create a second LinearClassifier , warm - started from the first . Use a <nl> + # learning_rate = 0 . 0 optimizer to check values ( use SGD so we don ' t have <nl> + # accumulator values that change ) . <nl> + warm_started_linear_classifier = self . _linear_classifier_fn ( <nl> + feature_columns = [ feature_column_lib . numeric_column ( ' age ' ) ] , <nl> + n_classes = 4 , <nl> + optimizer = gradient_descent . GradientDescentOptimizer ( learning_rate = 0 . 0 ) , <nl> + # The ' age ' variable correspond to the ' age_in_years ' variable in the <nl> + # previous model . <nl> + warm_start_from = warm_starting_util . WarmStartSettings ( <nl> + ckpt_to_initialize_from = linear_classifier . model_dir , <nl> + var_name_to_prev_var_name = { <nl> + AGE_WEIGHT_NAME : AGE_WEIGHT_NAME . replace ( ' age ' , ' age_in_years ' ) <nl> + } ) ) <nl> + <nl> + warm_started_linear_classifier . train ( input_fn = self . _input_fn , max_steps = 1 ) <nl> + self . assertAllClose ( <nl> + linear_classifier . get_variable_value ( <nl> + AGE_WEIGHT_NAME . replace ( ' age ' , ' age_in_years ' ) ) , <nl> + warm_started_linear_classifier . get_variable_value ( AGE_WEIGHT_NAME ) ) <nl> + # The bias is also warm - started ( with no name remapping ) . <nl> + self . assertAllClose ( <nl> + linear_classifier . get_variable_value ( BIAS_NAME ) , <nl> + warm_started_linear_classifier . get_variable_value ( BIAS_NAME ) ) <nl> mmm a / tensorflow / python / estimator / estimator_lib . py <nl> ppp b / tensorflow / python / estimator / estimator_lib . py <nl> <nl> from tensorflow . python . estimator . training import EvalSpec <nl> from tensorflow . python . estimator . training import train_and_evaluate <nl> from tensorflow . python . estimator . training import TrainSpec <nl> + from tensorflow . python . estimator . warm_starting_util import VocabInfo <nl> + from tensorflow . python . estimator . warm_starting_util import WarmStartSettings <nl> <nl> <nl> from tensorflow . python . util . all_util import remove_undocumented <nl> <nl> ' Exporter ' , <nl> ' LatestExporter ' , <nl> ' FinalExporter ' , <nl> + <nl> + # Warm - starting <nl> + ' WarmStartSettings ' , <nl> + ' VocabInfo ' , <nl> ] <nl> <nl> remove_undocumented ( __name__ , allowed_exception_list = _allowed_symbols ) <nl> mmm a / tensorflow / python / estimator / warm_starting_util . py <nl> ppp b / tensorflow / python / estimator / warm_starting_util . py <nl> <nl> from tensorflow . python . training import saver <nl> <nl> <nl> - class _VocabInfo ( <nl> - collections . namedtuple ( " _VocabInfo " , [ <nl> + class VocabInfo ( <nl> + collections . namedtuple ( " VocabInfo " , [ <nl> " new_vocab " , <nl> " new_vocab_size " , <nl> " num_oov_buckets " , <nl> class _VocabInfo ( <nl> " old_vocab_size " , <nl> " backup_initializer " , <nl> ] ) ) : <nl> - " " " Vocabulary information for _WarmStartSettings . <nl> + " " " Vocabulary information for WarmStartSettings . <nl> + <nl> + See @ { tf . estimator . WarmStartSettings $ WarmStartSettings } for examples of using <nl> + VocabInfo to warm - start . <nl> <nl> Attributes : <nl> new_vocab : [ Required ] A path to the new vocabulary file ( used with the <nl> class _VocabInfo ( <nl> num_oov_buckets : [ Required ] An integer indicating how many OOV buckets are <nl> associated with the vocabulary . <nl> old_vocab : [ Required ] A path to the old vocabulary file ( used with the <nl> - checkpoint to be warmstarted from ) . <nl> + checkpoint to be warm - started from ) . <nl> old_vocab_size : [ Optional ] An integer indicating how many entries of the old <nl> vocabulary were used in the creation of the checkpoint . If not provided , <nl> the entire old vocabulary will be used . <nl> def __new__ ( cls , <nl> old_vocab , <nl> old_vocab_size = - 1 , <nl> backup_initializer = None ) : <nl> - return super ( _VocabInfo , cls ) . __new__ ( <nl> + return super ( VocabInfo , cls ) . __new__ ( <nl> cls , <nl> new_vocab , <nl> new_vocab_size , <nl> num_oov_buckets , <nl> old_vocab , <nl> old_vocab_size , <nl> - backup_initializer , ) <nl> + backup_initializer , <nl> + ) <nl> <nl> <nl> - class _WarmStartSettings ( <nl> - collections . namedtuple ( " _WarmStartSettings " , [ <nl> + class WarmStartSettings ( <nl> + collections . namedtuple ( " WarmStartSettings " , [ <nl> " ckpt_to_initialize_from " , <nl> - " vars_to_warmstart " , <nl> + " vars_to_warm_start " , <nl> " var_name_to_vocab_info " , <nl> " var_name_to_prev_var_name " , <nl> ] ) ) : <nl> " " " Settings for warm - starting in Estimators . <nl> <nl> - Attributes : <nl> - ckpt_to_initialize_from : [ Required ] A string specifying the directory with <nl> - checkpoint file ( s ) or path to checkpoint from which to warm - start the <nl> - model parameters . <nl> - vars_to_warmstart : [ Optional ] A regular expression that captures which <nl> - variables to warmstart ( see tf . get_collection ) . Defaults to ' . * ' , which <nl> - warmstarts all variables . If ` None ` is explicitly given , only variables <nl> - specified in ` var_name_to_vocab_info ` will be warmstarted . <nl> - var_name_to_vocab_info : [ Optional ] Dict of variable names ( strings ) to <nl> - _VocabInfo . The variable names should be " full " variables , not the names <nl> - of the partitions . If not explicitly provided , the variable is assumed to <nl> - have no vocabulary . <nl> - var_name_to_prev_var_name : [ Optional ] Dict of variable names ( strings ) to <nl> - name of the previously - trained variable in ` ckpt_to_initialize_from ` . If <nl> - not explicitly provided , the name of the variable is assumed to be same <nl> - between previous checkpoint and current model . <nl> + Example Use with canned ` DNNEstimator ` : <nl> <nl> - Example Use with canned DNNEstimator : <nl> - <nl> - # Feature columns defining transformations on inputs . <nl> + ` ` ` <nl> emb_vocab_file = tf . feature_column . embedding_column ( <nl> tf . feature_column . categorical_column_with_vocabulary_file ( <nl> " sc_vocab_file " , " new_vocab . txt " , vocab_size = 100 ) , <nl> class _WarmStartSettings ( <nl> dimension = 8 ) <nl> estimator = tf . estimator . DNNClassifier ( <nl> hidden_units = [ 128 , 64 ] , feature_columns = [ emb_vocab_file , emb_vocab_list ] , <nl> - warmstart_from = ws ) <nl> + warm_start_from = ws ) <nl> + ` ` ` <nl> + <nl> + where ` ws ` could be defined as : <nl> + <nl> + Warm - start all weights in the model ( input layer and hidden weights ) . <nl> + Either the directory or a specific checkpoint can be provided ( in the case <nl> + of the former , the latest checkpoint will be used ) : <nl> + <nl> + ` ` ` <nl> + ws = WarmStartSettings ( ckpt_to_initialize_from = " / tmp " ) <nl> + ws = WarmStartSettings ( ckpt_to_initialize_from = " / tmp / model - 1000 " ) <nl> + ` ` ` <nl> + <nl> + Warm - start only the embeddings ( input layer ) and their accumulator variables : <nl> + <nl> + ` ` ` <nl> + ws = WarmStartSettings ( ckpt_to_initialize_from = " / tmp " , <nl> + vars_to_warm_start = " . * input_layer . * " ) <nl> + ` ` ` <nl> <nl> - # where ws could be defined as : <nl> + Warm - start everything except the optimizer accumulator variables <nl> + ( DNN defaults to Adagrad ) : <nl> <nl> - # Warm - start all weights in the model ( input layer and hidden weights ) . <nl> - # Either the directory or a specific checkpoint can be provided ( in the case <nl> - # of the former , the latest checkpoint will be used ) . <nl> - ws = _WarmStartSettings ( ckpt_to_initialize_from = " / tmp " ) <nl> - ws = _WarmStartSettings ( ckpt_to_initialize_from = " / tmp / model - 1000 " ) <nl> + ` ` ` <nl> + ws = WarmStartSettings ( ckpt_to_initialize_from = " / tmp " , <nl> + vars_to_warm_start = " ^ ( ? ! . * ( Adagrad ) ) " ) <nl> + ` ` ` <nl> <nl> - # Warm - start only the embeddings ( input layer ) . <nl> - ws = _WarmStartSettings ( ckpt_to_initialize_from = " / tmp " , <nl> - vars_to_warmstart = " . * input_layer . * " ) <nl> + Warm - start all weights but the embedding parameters corresponding to <nl> + ` sc_vocab_file ` have a different vocab from the one used in the current <nl> + model : <nl> <nl> - # Warm - start all weights but the embedding parameters corresponding to <nl> - # " sc_vocab_file " have a different vocab from the one used in the current <nl> - # model . <nl> - vocab_info = ws_util . _VocabInfo ( <nl> + ` ` ` <nl> + vocab_info = ws_util . VocabInfo ( <nl> new_vocab = sc_vocab_file . vocabulary_file , <nl> new_vocab_size = sc_vocab_file . vocabulary_size , <nl> num_oov_buckets = sc_vocab_file . num_oov_buckets , <nl> old_vocab = " old_vocab . txt " <nl> ) <nl> - ws = _WarmStartSettings ( <nl> + ws = WarmStartSettings ( <nl> ckpt_to_initialize_from = " / tmp " , <nl> var_name_to_vocab_info = { <nl> " input_layer / sc_vocab_file_embedding / embedding_weights " : vocab_info <nl> } ) <nl> + ` ` ` <nl> <nl> - # Warm - start only " sc_vocab_file " embeddings ( and no other variables ) , which <nl> - # have a different vocab from the one used in the current model . <nl> - vocab_info = ws_util . _VocabInfo ( <nl> + Warm - start only ` sc_vocab_file ` embeddings ( and no other variables ) , which <nl> + have a different vocab from the one used in the current model : <nl> + <nl> + ` ` ` <nl> + vocab_info = ws_util . VocabInfo ( <nl> new_vocab = sc_vocab_file . vocabulary_file , <nl> new_vocab_size = sc_vocab_file . vocabulary_size , <nl> num_oov_buckets = sc_vocab_file . num_oov_buckets , <nl> old_vocab = " old_vocab . txt " <nl> ) <nl> - ws = _WarmStartSettings ( <nl> + ws = WarmStartSettings ( <nl> ckpt_to_initialize_from = " / tmp " , <nl> - vars_to_warmstart = None , <nl> + vars_to_warm_start = None , <nl> var_name_to_vocab_info = { <nl> " input_layer / sc_vocab_file_embedding / embedding_weights " : vocab_info <nl> } ) <nl> + ` ` ` <nl> + <nl> + Warm - start all weights but the parameters corresponding to ` sc_vocab_file ` <nl> + have a different vocab from the one used in current checkpoint , and only <nl> + 100 of those entries were used : <nl> <nl> - # Warm - start all weights but the parameters corresponding to " sc_vocab_file " <nl> - # have a different vocab from the one used in current checkpoint , and only <nl> - # 100 of those entries were used . <nl> - vocab_info = ws_util . _VocabInfo ( <nl> + ` ` ` <nl> + vocab_info = ws_util . VocabInfo ( <nl> new_vocab = sc_vocab_file . vocabulary_file , <nl> new_vocab_size = sc_vocab_file . vocabulary_size , <nl> num_oov_buckets = sc_vocab_file . num_oov_buckets , <nl> old_vocab = " old_vocab . txt " , <nl> old_vocab_size = 100 <nl> ) <nl> - ws = _WarmStartSettings ( <nl> + ws = WarmStartSettings ( <nl> ckpt_to_initialize_from = " / tmp " , <nl> var_name_to_vocab_info = { <nl> " input_layer / sc_vocab_file_embedding / embedding_weights " : vocab_info <nl> } ) <nl> + ` ` ` <nl> + <nl> + Warm - start all weights but the parameters corresponding to ` sc_vocab_file ` <nl> + have a different vocab from the one used in current checkpoint and the <nl> + parameters corresponding to ` sc_vocab_list ` have a different name from the <nl> + current checkpoint : <nl> <nl> - # Warm - start all weights but the parameters corresponding to " sc_vocab_file " <nl> - # have a different vocab from the one used in current checkpoint and the <nl> - # parameters corresponding to " sc_vocab_list " have a different name from the <nl> - # current checkpoint . <nl> - vocab_info = ws_util . _VocabInfo ( <nl> + ` ` ` <nl> + vocab_info = ws_util . VocabInfo ( <nl> new_vocab = sc_vocab_file . vocabulary_file , <nl> new_vocab_size = sc_vocab_file . vocabulary_size , <nl> num_oov_buckets = sc_vocab_file . num_oov_buckets , <nl> old_vocab = " old_vocab . txt " , <nl> old_vocab_size = 100 <nl> ) <nl> - ws = _WarmStartSettings ( <nl> + ws = WarmStartSettings ( <nl> ckpt_to_initialize_from = " / tmp " , <nl> var_name_to_vocab_info = { <nl> " input_layer / sc_vocab_file_embedding / embedding_weights " : vocab_info <nl> class _WarmStartSettings ( <nl> " input_layer / sc_vocab_list_embedding / embedding_weights " : <nl> " old_tensor_name " <nl> } ) <nl> + ` ` ` <nl> + <nl> + Attributes : <nl> + ckpt_to_initialize_from : [ Required ] A string specifying the directory with <nl> + checkpoint file ( s ) or path to checkpoint from which to warm - start the <nl> + model parameters . <nl> + vars_to_warm_start : [ Optional ] A regular expression that captures which <nl> + variables to warm - start ( see tf . get_collection ) . Defaults to ` ' . * ' ` , <nl> + which warm - starts all variables . If ` None ` is explicitly given , only <nl> + variables specified in ` var_name_to_vocab_info ` will be warm - started . <nl> + var_name_to_vocab_info : [ Optional ] Dict of variable names ( strings ) to <nl> + VocabInfo . The variable names should be " full " variables , not the names <nl> + of the partitions . If not explicitly provided , the variable is assumed to <nl> + have no vocabulary . <nl> + var_name_to_prev_var_name : [ Optional ] Dict of variable names ( strings ) to <nl> + name of the previously - trained variable in ` ckpt_to_initialize_from ` . If <nl> + not explicitly provided , the name of the variable is assumed to be same <nl> + between previous checkpoint and current model . <nl> " " " <nl> <nl> def __new__ ( cls , <nl> ckpt_to_initialize_from , <nl> - vars_to_warmstart = " . * " , <nl> + vars_to_warm_start = " . * " , <nl> var_name_to_vocab_info = None , <nl> var_name_to_prev_var_name = None ) : <nl> if not ckpt_to_initialize_from : <nl> raise ValueError ( <nl> - " ` ckpt_to_initialize_from ` MUST be set in _WarmStartSettings " ) <nl> - return super ( _WarmStartSettings , cls ) . __new__ ( <nl> + " ` ckpt_to_initialize_from ` MUST be set in WarmStartSettings " ) <nl> + return super ( WarmStartSettings , cls ) . __new__ ( <nl> cls , <nl> ckpt_to_initialize_from , <nl> - vars_to_warmstart , <nl> + vars_to_warm_start , <nl> var_name_to_vocab_info or { } , <nl> - var_name_to_prev_var_name or { } , ) <nl> + var_name_to_prev_var_name or { } , <nl> + ) <nl> <nl> <nl> def _is_variable ( x ) : <nl> def _infer_var_name ( var ) : <nl> return list ( name_to_var_dict . keys ( ) ) [ 0 ] <nl> <nl> <nl> - def _warmstart_var ( var , prev_ckpt , prev_tensor_name = None ) : <nl> + def _warm_start_var ( var , prev_ckpt , prev_tensor_name = None ) : <nl> " " " Warm - starts given variable from ` prev_tensor_name ` tensor in ` prev_ckpt ` . <nl> <nl> Args : <nl> def _warmstart_var ( var , prev_ckpt , prev_tensor_name = None ) : <nl> # pylint : disable = protected - access <nl> # Accesses protected members of tf . Variable to reset the variable ' s internal <nl> # state . <nl> - def _warmstart_var_with_vocab ( var , <nl> - current_vocab_path , <nl> - current_vocab_size , <nl> - prev_ckpt , <nl> - prev_vocab_path , <nl> - previous_vocab_size = - 1 , <nl> - current_oov_buckets = 0 , <nl> - prev_tensor_name = None , <nl> - initializer = None ) : <nl> + def _warm_start_var_with_vocab ( var , <nl> + current_vocab_path , <nl> + current_vocab_size , <nl> + prev_ckpt , <nl> + prev_vocab_path , <nl> + previous_vocab_size = - 1 , <nl> + current_oov_buckets = 0 , <nl> + prev_tensor_name = None , <nl> + initializer = None ) : <nl> " " " Warm - starts given variable from ` prev_tensor_name ` tensor in ` prev_ckpt ` . <nl> <nl> Use this method when the ` var ` is backed by vocabulary . This method stitches <nl> def _warmstart_var_with_vocab ( var , <nl> full_shape = slice_info . full_shape , <nl> var_offset = slice_info . var_offset ) <nl> <nl> - # TODO ( vihanjain ) : Support _WarmstartSettings where class vocabularies need <nl> + # TODO ( eddz ) : Support WarmStartSettings where class vocabularies need <nl> # remapping too . <nl> init = checkpoint_ops . _load_and_remap_matrix_initializer ( <nl> ckpt_path = checkpoint_utils . _get_checkpoint_filename ( prev_ckpt ) , <nl> def _warmstart_var_with_vocab ( var , <nl> # pylint : enable = protected - access <nl> <nl> <nl> - def _warmstart ( warmstart_settings ) : <nl> + def _warm_start ( warm_start_settings ) : <nl> " " " Warmstarts a model using the given settings . <nl> <nl> Currently , this is intended for use only in canned Estimators . Once made <nl> public , it can be used in any model_fn . <nl> <nl> Args : <nl> - warmstart_settings : An object of ` _WarmStartSettings ` . <nl> - <nl> + warm_start_settings : An object of ` WarmStartSettings ` . <nl> Raises : <nl> ValueError : If the WarmStartSettings contains prev_var_name or VocabInfo <nl> configuration for variable names that are not used . This is to ensure <nl> a stronger check for variable configuration than relying on users to <nl> examine the logs . <nl> " " " <nl> + logging . info ( " Warm - starting from : " , <nl> + warm_start_settings . ckpt_to_initialize_from ) <nl> # We have to deal with partitioned variables , since get_collection flattens <nl> # out the list . <nl> grouped_variables = { } <nl> - # Both warmstart_settings . vars_to_warmstart = ' . * ' and <nl> - # warmstart_settings . vars_to_warmstart = None will match everything here . <nl> - for v in ops . get_collection ( ops . GraphKeys . TRAINABLE_VARIABLES , <nl> - scope = warmstart_settings . vars_to_warmstart ) : <nl> + # Both warm_start_settings . vars_to_warm_start = ' . * ' and <nl> + # warm_start_settings . vars_to_warm_start = None will match everything here . <nl> + for v in ops . get_collection ( <nl> + ops . GraphKeys . TRAINABLE_VARIABLES , <nl> + scope = warm_start_settings . vars_to_warm_start ) : <nl> if not isinstance ( v , list ) : <nl> var_name = _infer_var_name ( [ v ] ) <nl> else : <nl> def _warmstart ( warmstart_settings ) : <nl> # var_name_to_vocab_info have been used . Err on the safer side by throwing an <nl> # exception if any are unused by the end of the loop . It is easy to misname <nl> # a variable during this configuration , in which case without this check , we <nl> - # would fail to warmstart silently . <nl> + # would fail to warm - start silently . <nl> prev_var_name_used = set ( ) <nl> vocab_info_used = set ( ) <nl> <nl> for var_name , variable in six . iteritems ( grouped_variables ) : <nl> - prev_var_name = warmstart_settings . var_name_to_prev_var_name . get ( var_name ) <nl> + prev_var_name = warm_start_settings . var_name_to_prev_var_name . get ( var_name ) <nl> if prev_var_name : <nl> prev_var_name_used . add ( var_name ) <nl> - vocab_info = warmstart_settings . var_name_to_vocab_info . get ( var_name ) <nl> + vocab_info = warm_start_settings . var_name_to_vocab_info . get ( var_name ) <nl> if vocab_info : <nl> vocab_info_used . add ( var_name ) <nl> logging . info ( <nl> def _warmstart ( warmstart_settings ) : <nl> vocab_info . num_oov_buckets , <nl> prev_var_name or " Unchanged " , <nl> vocab_info . backup_initializer or " zero - initialized " ) ) <nl> - _warmstart_var_with_vocab ( <nl> + _warm_start_var_with_vocab ( <nl> variable , <nl> current_vocab_path = vocab_info . new_vocab , <nl> current_vocab_size = vocab_info . new_vocab_size , <nl> - prev_ckpt = warmstart_settings . ckpt_to_initialize_from , <nl> + prev_ckpt = warm_start_settings . ckpt_to_initialize_from , <nl> prev_vocab_path = vocab_info . old_vocab , <nl> previous_vocab_size = vocab_info . old_vocab_size , <nl> current_oov_buckets = vocab_info . num_oov_buckets , <nl> prev_tensor_name = prev_var_name , <nl> initializer = vocab_info . backup_initializer ) <nl> else : <nl> - # For the special value of warmstart_settings . vars_to_warmstart = None , <nl> - # we only warmstart variables with explicitly specified vocabularies . <nl> - if warmstart_settings . vars_to_warmstart : <nl> + # For the special value of warm_start_settings . vars_to_warm_start = None , <nl> + # we only warm - start variables with explicitly specified vocabularies . <nl> + if warm_start_settings . vars_to_warm_start : <nl> logging . info ( " Warm - starting variable : { } ; prev_var_name : { } " . format ( <nl> var_name , prev_var_name or " Unchanged " ) ) <nl> # Because we use a default empty list in grouped_variables , single <nl> def _warmstart ( warmstart_settings ) : <nl> # for init_from_checkpoint logic to work correctly . <nl> if len ( variable ) = = 1 : <nl> variable = variable [ 0 ] <nl> - _warmstart_var ( variable , warmstart_settings . ckpt_to_initialize_from , <nl> - prev_var_name ) <nl> + _warm_start_var ( variable , warm_start_settings . ckpt_to_initialize_from , <nl> + prev_var_name ) <nl> <nl> prev_var_name_not_used = set ( <nl> - warmstart_settings . var_name_to_prev_var_name . keys ( ) ) - prev_var_name_used <nl> + warm_start_settings . var_name_to_prev_var_name . keys ( ) ) - prev_var_name_used <nl> vocab_info_not_used = set ( <nl> - warmstart_settings . var_name_to_vocab_info . keys ( ) ) - vocab_info_used <nl> + warm_start_settings . var_name_to_vocab_info . keys ( ) ) - vocab_info_used <nl> <nl> if prev_var_name_not_used : <nl> raise ValueError ( <nl> " You provided the following variables in " <nl> - " warmstart_settings . var_name_to_prev_var_name that were not used : { 0 } . " <nl> - " Perhaps you misspelled them ? Here is the list of viable variable " <nl> - " names : { 1 } " . format ( prev_var_name_not_used , grouped_variables . keys ( ) ) ) <nl> + " warm_start_settings . var_name_to_prev_var_name that were not used : " <nl> + " { 0 } . Perhaps you misspelled them ? Here is the list of viable " <nl> + " variable names : { 1 } " . format ( prev_var_name_not_used , <nl> + grouped_variables . keys ( ) ) ) <nl> if vocab_info_not_used : <nl> raise ValueError ( <nl> " You provided the following variables in " <nl> - " warmstart_settings . var_name_to_vocab_info that were not used : { 0 } . " <nl> + " warm_start_settings . var_name_to_vocab_info that were not used : { 0 } . " <nl> " Perhaps you misspelled them ? Here is the list of viable variable " <nl> " names : { 1 } " . format ( vocab_info_not_used , grouped_variables . keys ( ) ) ) <nl> + <nl> + <nl> + def _get_default_warm_start_settings ( warm_start_from ) : <nl> + " " " Returns default WarmStartSettings . <nl> + <nl> + Args : <nl> + warm_start_from : Either a string representing the filepath of a checkpoint <nl> + to initialize from , or an instance of WarmStartSettings . <nl> + <nl> + Returns : <nl> + Either None or an instance of WarmStartSettings . <nl> + <nl> + Raises : <nl> + ValueError : If warm_start_from is not None but is neither a string nor an <nl> + instance of WarmStartSettings . <nl> + " " " <nl> + if warm_start_from is None : <nl> + return None <nl> + if isinstance ( warm_start_from , six . string_types ) : <nl> + return WarmStartSettings ( ckpt_to_initialize_from = warm_start_from ) <nl> + elif isinstance ( warm_start_from , WarmStartSettings ) : <nl> + return warm_start_from <nl> + else : <nl> + raise ValueError ( " warm_start_from must be a string or a WarmStartSettings " ) <nl> mmm a / tensorflow / python / estimator / warm_starting_util_test . py <nl> ppp b / tensorflow / python / estimator / warm_starting_util_test . py <nl> def testWarmStartVar ( self ) : <nl> with self . test_session ( graph = g ) as sess : <nl> fruit_weights = variable_scope . get_variable ( <nl> " fruit_weights " , initializer = [ [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] ] ) <nl> - ws_util . _warmstart_var ( fruit_weights , self . get_temp_dir ( ) ) <nl> + ws_util . _warm_start_var ( fruit_weights , self . get_temp_dir ( ) ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> self . assertAllEqual ( prev_val , fruit_weights . eval ( sess ) ) <nl> <nl> def testWarmStartVarPrevVarPartitioned ( self ) : <nl> with self . test_session ( graph = g ) as sess : <nl> fruit_weights = variable_scope . get_variable ( <nl> " fruit_weights " , initializer = [ [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] ] ) <nl> - ws_util . _warmstart_var ( fruit_weights , self . get_temp_dir ( ) ) <nl> + ws_util . _warm_start_var ( fruit_weights , self . get_temp_dir ( ) ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> self . assertAllEqual ( prev_val , fruit_weights . eval ( sess ) ) <nl> <nl> def testWarmStartVarCurrentVarPartitioned ( self ) : <nl> partitioner = lambda shape , dtype : [ 2 , 1 ] ) <nl> self . assertTrue ( <nl> isinstance ( fruit_weights , variables . PartitionedVariable ) ) <nl> - ws_util . _warmstart_var ( fruit_weights , self . get_temp_dir ( ) ) <nl> + ws_util . _warm_start_var ( fruit_weights , self . get_temp_dir ( ) ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> fruit_weights = fruit_weights . _get_variable_list ( ) <nl> new_val = np . concatenate ( <nl> def testWarmStartVarBothVarsPartitioned ( self ) : <nl> partitioner = lambda shape , dtype : [ 2 , 1 ] ) <nl> self . assertTrue ( <nl> isinstance ( fruit_weights , variables . PartitionedVariable ) ) <nl> - ws_util . _warmstart_var ( <nl> + ws_util . _warm_start_var ( <nl> fruit_weights , <nl> self . get_temp_dir ( ) , <nl> prev_tensor_name = " old_scope / fruit_weights " ) <nl> def testWarmStartVarWithVocab ( self ) : <nl> with self . test_session ( graph = g ) as sess : <nl> fruit_weights = variable_scope . get_variable ( <nl> " fruit_weights " , initializer = [ [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] ] ) <nl> - ws_util . _warmstart_var_with_vocab ( fruit_weights , new_vocab_path , 5 , <nl> - self . get_temp_dir ( ) , prev_vocab_path ) <nl> + ws_util . _warm_start_var_with_vocab ( fruit_weights , new_vocab_path , 5 , <nl> + self . get_temp_dir ( ) , prev_vocab_path ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> self . assertAllEqual ( [ [ 2 . ] , [ 1 . 5 ] , [ 1 . ] , [ 0 . 5 ] , [ 0 . ] ] , <nl> fruit_weights . eval ( sess ) ) <nl> def testWarmStartVarWithVocabConstrainedOldVocabSize ( self ) : <nl> with self . test_session ( graph = g ) as sess : <nl> fruit_weights = variable_scope . get_variable ( <nl> " fruit_weights " , initializer = [ [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] ] ) <nl> - ws_util . _warmstart_var_with_vocab ( <nl> + ws_util . _warm_start_var_with_vocab ( <nl> fruit_weights , <nl> new_vocab_path , <nl> 5 , <nl> def testWarmStartVarWithVocabPrevVarPartitioned ( self ) : <nl> with self . test_session ( graph = g ) as sess : <nl> fruit_weights = variable_scope . get_variable ( <nl> " fruit_weights " , initializer = [ [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] ] ) <nl> - ws_util . _warmstart_var_with_vocab ( fruit_weights , new_vocab_path , 5 , <nl> - self . get_temp_dir ( ) , prev_vocab_path ) <nl> + ws_util . _warm_start_var_with_vocab ( fruit_weights , new_vocab_path , 5 , <nl> + self . get_temp_dir ( ) , prev_vocab_path ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> self . assertAllEqual ( [ [ 2 . ] , [ 1 . 5 ] , [ 1 . ] , [ 0 . 5 ] , [ 0 . ] ] , <nl> fruit_weights . eval ( sess ) ) <nl> def testWarmStartVarWithVocabCurrentVarPartitioned ( self ) : <nl> shape = [ 6 , 1 ] , <nl> initializer = [ [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] ] , <nl> partitioner = lambda shape , dtype : [ 2 , 1 ] ) <nl> - ws_util . _warmstart_var_with_vocab ( <nl> + ws_util . _warm_start_var_with_vocab ( <nl> fruit_weights , <nl> new_vocab_path , <nl> 5 , <nl> def testWarmStartVarWithVocabBothVarsPartitioned ( self ) : <nl> shape = [ 6 , 1 ] , <nl> initializer = [ [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] , [ 0 . ] ] , <nl> partitioner = lambda shape , dtype : [ 2 , 1 ] ) <nl> - ws_util . _warmstart_var_with_vocab ( fruit_weights , new_vocab_path , 6 , <nl> - self . get_temp_dir ( ) , prev_vocab_path ) <nl> + ws_util . _warm_start_var_with_vocab ( fruit_weights , new_vocab_path , 6 , <nl> + self . get_temp_dir ( ) , prev_vocab_path ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> self . assertTrue ( <nl> isinstance ( fruit_weights , variables . PartitionedVariable ) ) <nl> def testWarmStart_SparseColumnIntegerized ( self ) : <nl> self . assertAllEqual ( np . ones ( [ 10 , 1 ] ) , prev_int_val ) <nl> <nl> partitioner = lambda shape , dtype : [ 1 ] * len ( shape ) <nl> - # New graph , new session WITHOUT warmstarting . <nl> + # New graph , new session WITHOUT warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ sc_int ] , partitioner ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Without warmstarting , the weights should be initialized using default <nl> + # Without warm - starting , the weights should be initialized using default <nl> # initializer ( which is init_ops . zeros_initializer ) . <nl> self . _assert_cols_to_vars ( cols_to_vars , { sc_int : [ np . zeros ( [ 10 , 1 ] ) ] } , <nl> sess ) <nl> <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ sc_int ] , partitioner ) <nl> - ws_util . _warmstart ( ws_util . _WarmStartSettings ( <nl> - self . get_temp_dir ( ) , <nl> - vars_to_warmstart = " . * sc_int . * " ) ) <nl> + ws_util . _warm_start ( <nl> + ws_util . WarmStartSettings ( <nl> + self . get_temp_dir ( ) , vars_to_warm_start = " . * sc_int . * " ) ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . <nl> + # Verify weights were correctly warm - started . <nl> self . _assert_cols_to_vars ( cols_to_vars , { sc_int : [ prev_int_val ] } , sess ) <nl> <nl> def testWarmStart_SparseColumnHashed ( self ) : <nl> def testWarmStart_SparseColumnHashed ( self ) : <nl> " linear_model / sc_hash / weights " , shape = [ 15 , 1 ] , initializer = norms ( ) ) <nl> <nl> partitioner = lambda shape , dtype : [ 1 ] * len ( shape ) <nl> - # New graph , new session WITHOUT warmstarting . <nl> + # New graph , new session WITHOUT warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ sc_hash ] , partitioner ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Without warmstarting , the weights should be initialized using default <nl> + # Without warm - starting , the weights should be initialized using default <nl> # initializer ( which is init_ops . zeros_initializer ) . <nl> self . _assert_cols_to_vars ( cols_to_vars , { sc_hash : [ np . zeros ( [ 15 , 1 ] ) ] } , <nl> sess ) <nl> <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ sc_hash ] , partitioner ) <nl> - ws_util . _warmstart ( ws_util . _WarmStartSettings ( <nl> - self . get_temp_dir ( ) , <nl> - vars_to_warmstart = " . * sc_hash . * " ) ) <nl> + ws_util . _warm_start ( <nl> + ws_util . WarmStartSettings ( <nl> + self . get_temp_dir ( ) , vars_to_warm_start = " . * sc_hash . * " ) ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . <nl> + # Verify weights were correctly warm - started . <nl> self . _assert_cols_to_vars ( cols_to_vars , { sc_hash : [ prev_hash_val ] } , <nl> sess ) <nl> <nl> def testWarmStart_SparseColumnVocabulary ( self ) : <nl> " linear_model / sc_vocab / weights " , shape = [ 4 , 1 ] , initializer = ones ( ) ) <nl> <nl> partitioner = lambda shape , dtype : [ 1 ] * len ( shape ) <nl> - # New graph , new session WITHOUT warmstarting . <nl> + # New graph , new session WITHOUT warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ sc_vocab ] , partitioner ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Without warmstarting , the weights should be initialized using default <nl> + # Without warm - starting , the weights should be initialized using default <nl> # initializer ( which is init_ops . zeros_initializer ) . <nl> self . _assert_cols_to_vars ( cols_to_vars , { sc_vocab : [ np . zeros ( [ 4 , 1 ] ) ] } , <nl> sess ) <nl> <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ sc_vocab ] , partitioner ) <nl> # Since old vocab is not explicitly set in WarmStartSettings , the old <nl> # vocab is assumed to be same as new vocab . <nl> - ws_util . _warmstart ( ws_util . _WarmStartSettings ( <nl> - self . get_temp_dir ( ) , <nl> - vars_to_warmstart = " . * sc_vocab . * " ) ) <nl> + ws_util . _warm_start ( <nl> + ws_util . WarmStartSettings ( <nl> + self . get_temp_dir ( ) , vars_to_warm_start = " . * sc_vocab . * " ) ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . <nl> + # Verify weights were correctly warm - started . <nl> self . _assert_cols_to_vars ( cols_to_vars , { sc_vocab : [ prev_vocab_val ] } , <nl> sess ) <nl> <nl> def testWarmStart_ExplicitCheckpointFile ( self ) : <nl> " linear_model / sc_vocab / weights " , shape = [ 4 , 1 ] , initializer = ones ( ) ) <nl> <nl> partitioner = lambda shape , dtype : [ 1 ] * len ( shape ) <nl> - # New graph , new session WITHOUT warmstarting . <nl> + # New graph , new session WITHOUT warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ sc_vocab ] , partitioner ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Without warmstarting , the weights should be initialized using default <nl> + # Without warm - starting , the weights should be initialized using default <nl> # initializer ( which is init_ops . zeros_initializer ) . <nl> self . _assert_cols_to_vars ( cols_to_vars , { sc_vocab : [ np . zeros ( [ 4 , 1 ] ) ] } , <nl> sess ) <nl> <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ sc_vocab ] , partitioner ) <nl> # Since old vocab is not explicitly set in WarmStartSettings , the old <nl> # vocab is assumed to be same as new vocab . <nl> - ws_util . _warmstart ( ws_util . _WarmStartSettings ( <nl> - # Explicitly provide the file prefix instead of just the dir . <nl> - os . path . join ( self . get_temp_dir ( ) , " model - 0 " ) , <nl> - vars_to_warmstart = " . * sc_vocab . * " ) ) <nl> + ws_util . _warm_start ( <nl> + ws_util . WarmStartSettings ( <nl> + # Explicitly provide the file prefix instead of just the dir . <nl> + os . path . join ( self . get_temp_dir ( ) , " model - 0 " ) , <nl> + vars_to_warm_start = " . * sc_vocab . * " ) ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . <nl> + # Verify weights were correctly warm - started . <nl> self . _assert_cols_to_vars ( cols_to_vars , { sc_vocab : [ prev_vocab_val ] } , <nl> sess ) <nl> <nl> def testWarmStart_SparseColumnVocabularyConstrainedVocabSizes ( self ) : <nl> " linear_model / sc_vocab / weights " , shape = [ 2 , 1 ] , initializer = ones ( ) ) <nl> <nl> partitioner = lambda shape , dtype : [ 1 ] * len ( shape ) <nl> - # New graph , new session WITHOUT warmstarting . <nl> + # New graph , new session WITHOUT warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ sc_vocab ] , partitioner ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Without warmstarting , the weights should be initialized using default <nl> + # Without warm - starting , the weights should be initialized using default <nl> # initializer ( which is init_ops . zeros_initializer ) . <nl> self . _assert_cols_to_vars ( cols_to_vars , { sc_vocab : [ np . zeros ( [ 2 , 1 ] ) ] } , <nl> sess ) <nl> <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ sc_vocab ] , partitioner ) <nl> - vocab_info = ws_util . _VocabInfo ( <nl> + vocab_info = ws_util . VocabInfo ( <nl> new_vocab = sc_vocab . vocabulary_file , <nl> new_vocab_size = sc_vocab . vocabulary_size , <nl> num_oov_buckets = sc_vocab . num_oov_buckets , <nl> old_vocab = old_vocab_path , <nl> - old_vocab_size = old_vocab_size <nl> - ) <nl> - warmstart_settings = ws_util . _WarmStartSettings ( <nl> + old_vocab_size = old_vocab_size ) <nl> + warm_start_settings = ws_util . WarmStartSettings ( <nl> ckpt_to_initialize_from = self . get_temp_dir ( ) , <nl> - vars_to_warmstart = " . * sc_vocab . * " , <nl> + vars_to_warm_start = " . * sc_vocab . * " , <nl> var_name_to_vocab_info = { <nl> " linear_model / sc_vocab / weights " : vocab_info <nl> } ) <nl> - ws_util . _warmstart ( warmstart_settings ) <nl> + ws_util . _warm_start ( warm_start_settings ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . ' banana ' isn ' t in the <nl> + # Verify weights were correctly warm - started . ' banana ' isn ' t in the <nl> # first two entries of the old vocabulary , so it ' s newly initialized . <nl> self . _assert_cols_to_vars ( cols_to_vars , { sc_vocab : [ [ [ 1 ] , [ 0 ] ] ] } , sess ) <nl> <nl> def testWarmStart_BucketizedColumn ( self ) : <nl> initializer = norms ( ) ) <nl> <nl> partitioner = lambda shape , dtype : [ 1 ] * len ( shape ) <nl> - # New graph , new session WITHOUT warmstarting . <nl> + # New graph , new session WITHOUT warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ real_bucket ] , partitioner ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Without warmstarting , the weights should be initialized using default <nl> + # Without warm - starting , the weights should be initialized using default <nl> # initializer ( which is init_ops . zeros_initializer ) . <nl> self . _assert_cols_to_vars ( cols_to_vars , <nl> { real_bucket : [ np . zeros ( [ 5 , 1 ] ) ] } , sess ) <nl> <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( [ real_bucket ] , partitioner ) <nl> - ws_util . _warmstart ( ws_util . _WarmStartSettings ( <nl> - self . get_temp_dir ( ) , <nl> - vars_to_warmstart = " . * real_bucketized . * " ) ) <nl> + ws_util . _warm_start ( <nl> + ws_util . WarmStartSettings ( <nl> + self . get_temp_dir ( ) , vars_to_warm_start = " . * real_bucketized . * " ) ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . <nl> + # Verify weights were correctly warm - started . <nl> self . _assert_cols_to_vars ( cols_to_vars , <nl> { real_bucket : [ prev_bucket_val ] } , sess ) <nl> <nl> def testWarmStart_MultipleCols ( self ) : <nl> all_linear_cols = [ sc_int , sc_hash , sc_keys , sc_vocab , real_bucket , cross ] <nl> <nl> # Save checkpoint from which to warm - start . Also create a bias variable , <nl> - # so we can check that it ' s also warmstarted . <nl> + # so we can check that it ' s also warm - started . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> sc_int_weights = variable_scope . get_variable ( <nl> def testWarmStart_MultipleCols ( self ) : <nl> ] ) <nl> <nl> partitioner = lambda shape , dtype : [ 1 ] * len ( shape ) <nl> - # New graph , new session WITHOUT warmstarting . <nl> + # New graph , new session WITHOUT warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( all_linear_cols , partitioner ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Without warmstarting , all weights should be initialized using default <nl> + # Without warm - starting , all weights should be initialized using default <nl> # initializer ( which is init_ops . zeros_initializer ) . <nl> self . _assert_cols_to_vars ( cols_to_vars , { <nl> sc_int : [ np . zeros ( [ 10 , 1 ] ) ] , <nl> def testWarmStart_MultipleCols ( self ) : <nl> cross : [ np . zeros ( [ 20 , 1 ] ) ] , <nl> } , sess ) <nl> <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( all_linear_cols , partitioner ) <nl> - vocab_info = ws_util . _VocabInfo ( <nl> + vocab_info = ws_util . VocabInfo ( <nl> new_vocab = sc_vocab . vocabulary_file , <nl> new_vocab_size = sc_vocab . vocabulary_size , <nl> num_oov_buckets = sc_vocab . num_oov_buckets , <nl> - old_vocab = vocab_path <nl> - ) <nl> - ws_util . _warmstart ( <nl> - ws_util . _WarmStartSettings ( <nl> + old_vocab = vocab_path ) <nl> + ws_util . _warm_start ( <nl> + ws_util . WarmStartSettings ( <nl> self . get_temp_dir ( ) , <nl> var_name_to_vocab_info = { <nl> " linear_model / sc_vocab / weights " : vocab_info <nl> } ) ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . <nl> + # Verify weights were correctly warm - started . <nl> self . _assert_cols_to_vars ( cols_to_vars , { <nl> sc_int : [ prev_int_val ] , <nl> sc_hash : [ prev_hash_val ] , <nl> def _partitioner ( shape , dtype ) : # pylint : disable = unused - argument <nl> partitions [ 0 ] = min ( 2 , shape [ 0 ] . value ) <nl> return partitions <nl> <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( all_linear_cols , _partitioner ) <nl> - vocab_info = ws_util . _VocabInfo ( <nl> + vocab_info = ws_util . VocabInfo ( <nl> new_vocab = sc_vocab . vocabulary_file , <nl> new_vocab_size = sc_vocab . vocabulary_size , <nl> num_oov_buckets = sc_vocab . num_oov_buckets , <nl> - old_vocab = prev_vocab_path <nl> - ) <nl> - ws_settings = ws_util . _WarmStartSettings ( <nl> + old_vocab = prev_vocab_path ) <nl> + ws_settings = ws_util . WarmStartSettings ( <nl> self . get_temp_dir ( ) , <nl> - vars_to_warmstart = " . * ( sc_keys | sc_vocab ) . * " , <nl> + vars_to_warm_start = " . * ( sc_keys | sc_vocab ) . * " , <nl> var_name_to_vocab_info = { <nl> ws_util . _infer_var_name ( cols_to_vars [ sc_vocab ] ) : vocab_info <nl> } , <nl> def _partitioner ( shape , dtype ) : # pylint : disable = unused - argument <nl> ws_util . _infer_var_name ( cols_to_vars [ sc_keys ] ) : <nl> " some_other_name " <nl> } ) <nl> - ws_util . _warmstart ( ws_settings ) <nl> + ws_util . _warm_start ( ws_settings ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . Var corresponding to <nl> + # Verify weights were correctly warm - started . Var corresponding to <nl> # sc_hash should not be warm - started . Var corresponding to sc_vocab <nl> - # should be correctly warmstarted after vocab remapping . <nl> + # should be correctly warm - started after vocab remapping . <nl> self . _assert_cols_to_vars ( cols_to_vars , { <nl> sc_keys : <nl> np . split ( prev_keys_val , 2 ) , <nl> def testWarmStartMoreSettingsNoPartitioning ( self ) : <nl> self . _write_checkpoint ( sess ) <nl> prev_keys_val = sess . run ( sc_keys_weights ) <nl> <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( all_linear_cols , <nl> partitioner = None ) <nl> - vocab_info = ws_util . _VocabInfo ( <nl> + vocab_info = ws_util . VocabInfo ( <nl> new_vocab = sc_vocab . vocabulary_file , <nl> new_vocab_size = sc_vocab . vocabulary_size , <nl> num_oov_buckets = sc_vocab . num_oov_buckets , <nl> - old_vocab = prev_vocab_path <nl> - ) <nl> - ws_settings = ws_util . _WarmStartSettings ( <nl> + old_vocab = prev_vocab_path ) <nl> + ws_settings = ws_util . WarmStartSettings ( <nl> self . get_temp_dir ( ) , <nl> - vars_to_warmstart = " . * ( sc_keys | sc_vocab ) . * " , <nl> + vars_to_warm_start = " . * ( sc_keys | sc_vocab ) . * " , <nl> var_name_to_vocab_info = { <nl> ws_util . _infer_var_name ( cols_to_vars [ sc_vocab ] ) : vocab_info <nl> } , <nl> def testWarmStartMoreSettingsNoPartitioning ( self ) : <nl> ws_util . _infer_var_name ( cols_to_vars [ sc_keys ] ) : <nl> " some_other_name " <nl> } ) <nl> - ws_util . _warmstart ( ws_settings ) <nl> + ws_util . _warm_start ( ws_settings ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . Var corresponding to <nl> + # Verify weights were correctly warm - started . Var corresponding to <nl> # sc_hash should not be warm - started . Var corresponding to sc_vocab <nl> - # should be correctly warmstarted after vocab remapping . <nl> + # should be correctly warm - started after vocab remapping . <nl> self . _assert_cols_to_vars ( cols_to_vars , { <nl> sc_keys : [ prev_keys_val ] , <nl> sc_hash : [ np . zeros ( [ 15 , 1 ] ) ] , <nl> def _partitioner ( shape , dtype ) : # pylint : disable = unused - argument <nl> partitions [ 0 ] = min ( 2 , shape [ 0 ] . value ) <nl> return partitions <nl> <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = self . _create_linear_model ( all_linear_cols , _partitioner ) <nl> - vocab_info = ws_util . _VocabInfo ( <nl> + vocab_info = ws_util . VocabInfo ( <nl> new_vocab = sc_vocab . vocabulary_file , <nl> new_vocab_size = sc_vocab . vocabulary_size , <nl> num_oov_buckets = sc_vocab . num_oov_buckets , <nl> - old_vocab = prev_vocab_path <nl> - ) <nl> - ws_settings = ws_util . _WarmStartSettings ( <nl> + old_vocab = prev_vocab_path ) <nl> + ws_settings = ws_util . WarmStartSettings ( <nl> self . get_temp_dir ( ) , <nl> # The special value of None here will ensure that only the variable <nl> # specified in var_name_to_vocab_info ( sc_vocab embedding ) is <nl> - # warmstarted . <nl> - vars_to_warmstart = None , <nl> + # warm - started . <nl> + vars_to_warm_start = None , <nl> var_name_to_vocab_info = { <nl> ws_util . _infer_var_name ( cols_to_vars [ sc_vocab ] ) : vocab_info <nl> } , <nl> - # Even though this is provided , the None value for vars_to_warmstart <nl> - # overrides the logic , and this will not be warmstarted . <nl> + # Even though this is provided , the None value for <nl> + # vars_to_warm_start overrides the logic , and this will not be <nl> + # warm - started . <nl> var_name_to_prev_var_name = { <nl> ws_util . _infer_var_name ( cols_to_vars [ sc_keys ] ) : <nl> " some_other_name " <nl> } ) <nl> - ws_util . _warmstart ( ws_settings ) <nl> + ws_util . _warm_start ( ws_settings ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . Var corresponding to <nl> - # sc_vocab should be correctly warmstarted after vocab remapping , <nl> - # and neither of the other two should be warmstarted . . <nl> + # Verify weights were correctly warm - started . Var corresponding to <nl> + # sc_vocab should be correctly warm - started after vocab remapping , <nl> + # and neither of the other two should be warm - started . . <nl> self . _assert_cols_to_vars ( cols_to_vars , { <nl> sc_keys : [ np . zeros ( [ 2 , 1 ] ) , np . zeros ( [ 2 , 1 ] ) ] , <nl> sc_hash : [ np . zeros ( [ 8 , 1 ] ) , np . zeros ( [ 7 , 1 ] ) ] , <nl> def _partitioner ( shape , dtype ) : # pylint : disable = unused - argument <nl> categorical_column = sc_vocab , <nl> dimension = 2 ) <nl> all_deep_cols = [ emb_vocab_column ] <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = { } <nl> def _partitioner ( shape , dtype ) : # pylint : disable = unused - argument <nl> features = self . _create_dummy_inputs ( ) , <nl> feature_columns = all_deep_cols , <nl> cols_to_vars = cols_to_vars ) <nl> - vocab_info = ws_util . _VocabInfo ( <nl> + vocab_info = ws_util . VocabInfo ( <nl> new_vocab = sc_vocab . vocabulary_file , <nl> new_vocab_size = sc_vocab . vocabulary_size , <nl> num_oov_buckets = sc_vocab . num_oov_buckets , <nl> def _partitioner ( shape , dtype ) : # pylint : disable = unused - argument <nl> # Can ' t use constant_initializer with load_and_remap . In practice , <nl> # use a truncated normal initializer . <nl> backup_initializer = init_ops . random_uniform_initializer ( <nl> - minval = 0 . 42 , maxval = 0 . 42 ) <nl> - ) <nl> - ws_settings = ws_util . _WarmStartSettings ( <nl> + minval = 0 . 42 , maxval = 0 . 42 ) ) <nl> + ws_settings = ws_util . WarmStartSettings ( <nl> self . get_temp_dir ( ) , <nl> var_name_to_vocab_info = { <nl> - ws_util . _infer_var_name ( <nl> - cols_to_vars [ emb_vocab_column ] ) : vocab_info <nl> + ws_util . _infer_var_name ( cols_to_vars [ emb_vocab_column ] ) : <nl> + vocab_info <nl> } ) <nl> - ws_util . _warmstart ( ws_settings ) <nl> + ws_util . _warm_start ( ws_settings ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . Var corresponding to <nl> - # emb_vocab_column should be correctly warmstarted after vocab <nl> + # Verify weights were correctly warm - started . Var corresponding to <nl> + # emb_vocab_column should be correctly warm - started after vocab <nl> # remapping . Missing values are filled in with the EmbeddingColumn ' s <nl> # initializer . <nl> self . _assert_cols_to_vars ( <nl> def _partitioner ( shape , dtype ) : # pylint : disable = unused - argument <nl> categorical_column = sc_vocab , <nl> dimension = 2 ) <nl> all_deep_cols = [ emb_vocab ] <nl> - # New graph , new session with warmstarting . <nl> + # New graph , new session with warm - starting . <nl> with ops . Graph ( ) . as_default ( ) as g : <nl> with self . test_session ( graph = g ) as sess : <nl> cols_to_vars = { } <nl> def _partitioner ( shape , dtype ) : # pylint : disable = unused - argument <nl> cols_to_vars = cols_to_vars ) <nl> <nl> # Construct the vocab_info for the embedding weight . <nl> - vocab_info = ws_util . _VocabInfo ( <nl> + vocab_info = ws_util . VocabInfo ( <nl> new_vocab = sc_vocab . vocabulary_file , <nl> new_vocab_size = sc_vocab . vocabulary_size , <nl> num_oov_buckets = sc_vocab . num_oov_buckets , <nl> def _partitioner ( shape , dtype ) : # pylint : disable = unused - argument <nl> # Can ' t use constant_initializer with load_and_remap . In practice , <nl> # use a truncated normal initializer . <nl> backup_initializer = init_ops . random_uniform_initializer ( <nl> - minval = 0 . 42 , maxval = 0 . 42 ) <nl> - ) <nl> - ws_settings = ws_util . _WarmStartSettings ( <nl> + minval = 0 . 42 , maxval = 0 . 42 ) ) <nl> + ws_settings = ws_util . WarmStartSettings ( <nl> self . get_temp_dir ( ) , <nl> - vars_to_warmstart = " . * sc_vocab . * " , <nl> + vars_to_warm_start = " . * sc_vocab . * " , <nl> var_name_to_vocab_info = { <nl> " linear_model / sc_vocab_embedding / embedding_weights " : vocab_info <nl> } ) <nl> - ws_util . _warmstart ( ws_settings ) <nl> + ws_util . _warm_start ( ws_settings ) <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - # Verify weights were correctly warmstarted . Var corresponding to <nl> - # emb_vocab should be correctly warmstarted after vocab remapping . <nl> + # Verify weights were correctly warm - started . Var corresponding to <nl> + # emb_vocab should be correctly warm - started after vocab remapping . <nl> # Missing values are filled in with the EmbeddingColumn ' s initializer . <nl> self . _assert_cols_to_vars ( <nl> cols_to_vars , { <nl> def _partitioner ( shape , dtype ) : # pylint : disable = unused - argument <nl> } , sess ) <nl> <nl> def testErrorConditions ( self ) : <nl> - self . assertRaises ( ValueError , ws_util . _WarmStartSettings , None ) <nl> + self . assertRaises ( ValueError , ws_util . WarmStartSettings , None ) <nl> x = variable_scope . get_variable ( <nl> " x " , <nl> shape = [ 4 , 1 ] , <nl> initializer = ones ( ) , <nl> partitioner = lambda shape , dtype : [ 2 , 1 ] ) <nl> <nl> - # List of PartitionedVariable is invalid type when warmstarting with vocab . <nl> - self . assertRaises ( TypeError , ws_util . _warmstart_var_with_vocab , [ x ] , " / tmp " , <nl> - 5 , " / tmp " , " / tmp " ) <nl> + # List of PartitionedVariable is invalid type when warm - starting with vocab . <nl> + self . assertRaises ( TypeError , ws_util . _warm_start_var_with_vocab , [ x ] , <nl> + " / tmp " , 5 , " / tmp " , " / tmp " ) <nl> # Keys of type other than FeatureColumn . <nl> - self . assertRaises ( TypeError , ws_util . _warmstart , <nl> - { " StringType " : x } , ws_util . _WarmStartSettings ( " / tmp " ) ) <nl> + self . assertRaises ( TypeError , ws_util . _warm_start , { " StringType " : x } , <nl> + ws_util . WarmStartSettings ( " / tmp " ) ) <nl> <nl> # Unused variable names raises ValueError . <nl> with ops . Graph ( ) . as_default ( ) : <nl> def testErrorConditions ( self ) : <nl> partitioner = lambda shape , dtype : [ 2 , 1 ] ) <nl> self . _write_checkpoint ( sess ) <nl> <nl> - self . assertRaises ( ValueError , ws_util . _warmstart , <nl> - ws_util . _WarmStartSettings ( <nl> + self . assertRaises ( ValueError , ws_util . _warm_start , <nl> + ws_util . WarmStartSettings ( <nl> self . get_temp_dir ( ) , <nl> var_name_to_vocab_info = { <nl> - " y " : ws_util . _VocabInfo ( " " , 1 , 0 , " " ) <nl> + " y " : ws_util . VocabInfo ( " " , 1 , 0 , " " ) <nl> } ) ) <nl> - self . assertRaises ( ValueError , ws_util . _warmstart , <nl> - ws_util . _WarmStartSettings ( <nl> + self . assertRaises ( ValueError , ws_util . _warm_start , <nl> + ws_util . WarmStartSettings ( <nl> self . get_temp_dir ( ) , <nl> - var_name_to_prev_var_name = { " y " : " y2 " } ) ) <nl> + var_name_to_prev_var_name = { <nl> + " y " : " y2 " <nl> + } ) ) <nl> <nl> <nl> if __name__ = = " __main__ " : <nl> mmm a / tensorflow / python / kernel_tests / BUILD <nl> ppp b / tensorflow / python / kernel_tests / BUILD <nl> tf_py_test ( <nl> ] , <nl> ) <nl> <nl> + tf_py_test ( <nl> + name = " matrix_logarithm_op_test " , <nl> + size = " small " , <nl> + srcs = [ " matrix_logarithm_op_test . py " ] , <nl> + additional_deps = [ <nl> + " / / third_party / py / numpy " , <nl> + " / / tensorflow / python : client_testlib " , <nl> + " / / tensorflow / python : framework_for_generated_wrappers " , <nl> + " / / tensorflow / python : linalg_ops " , <nl> + ] , <nl> + ) <nl> + <nl> cuda_py_test ( <nl> name = " matrix_inverse_op_test " , <nl> size = " small " , <nl> mmm a / tensorflow / python / kernel_tests / matrix_exponential_op_test . py <nl> ppp b / tensorflow / python / kernel_tests / matrix_exponential_op_test . py <nl> def np_expm ( x ) : <nl> class ExponentialOpTest ( test . TestCase ) : <nl> <nl> def _verifyExponential ( self , x , np_type ) : <nl> - # TODO ( pfau ) : add matrix logarithm and test that it is inverse of expm . <nl> inp = x . astype ( np_type ) <nl> with self . test_session ( use_gpu = True ) : <nl> - # Verify that x ^ { - 1 } * x = = Identity matrix . <nl> tf_ans = gen_linalg_ops . _matrix_exponential ( inp ) <nl> if x . size = = 0 : <nl> np_ans = np . empty ( x . shape , dtype = np_type ) <nl> def testNonSquareMatrix ( self ) : <nl> gen_linalg_ops . _matrix_exponential ( np . array ( [ [ 1 . , 2 . , 3 . ] , [ 3 . , 4 . , 5 . ] ] ) ) <nl> <nl> def testWrongDimensions ( self ) : <nl> - # The input to the inverse should be at least a 2 - dimensional tensor . <nl> + # The input to the exponential should be at least a 2 - dimensional tensor . <nl> tensor3 = constant_op . constant ( [ 1 . , 2 . ] ) <nl> with self . assertRaises ( ValueError ) : <nl> gen_linalg_ops . _matrix_exponential ( tensor3 ) <nl> new file mode 100644 <nl> index 0000000000000 . . 18ed59828c15f <nl> mmm / dev / null <nl> ppp b / tensorflow / python / kernel_tests / matrix_logarithm_op_test . py <nl> <nl> + # Copyright 2017 The TensorFlow Authors . All Rights Reserved . <nl> + # <nl> + # Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + # you may not use this file except in compliance with the License . <nl> + # You may obtain a copy of the License at <nl> + # <nl> + # http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + # <nl> + # Unless required by applicable law or agreed to in writing , software <nl> + # distributed under the License is distributed on an " AS IS " BASIS , <nl> + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + # See the License for the specific language governing permissions and <nl> + # limitations under the License . <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + " " " Tests for tensorflow . ops . gen_linalg_ops . matrix_logarithm . " " " <nl> + <nl> + from __future__ import absolute_import <nl> + from __future__ import division <nl> + from __future__ import print_function <nl> + <nl> + <nl> + import numpy as np <nl> + <nl> + from tensorflow . python . client import session <nl> + from tensorflow . python . framework import constant_op <nl> + from tensorflow . python . framework import dtypes <nl> + from tensorflow . python . framework import ops <nl> + from tensorflow . python . ops import control_flow_ops <nl> + from tensorflow . python . ops import gen_linalg_ops <nl> + from tensorflow . python . ops import math_ops <nl> + from tensorflow . python . ops import random_ops <nl> + from tensorflow . python . ops import variables <nl> + from tensorflow . python . platform import test <nl> + <nl> + <nl> + class LogarithmOpTest ( test . TestCase ) : <nl> + <nl> + def _verifyLogarithm ( self , x , np_type ) : <nl> + inp = x . astype ( np_type ) <nl> + with self . test_session ( use_gpu = True ) : <nl> + # Verify that expm ( logm ( A ) ) = = A . <nl> + tf_ans = gen_linalg_ops . _matrix_exponential ( <nl> + gen_linalg_ops . _matrix_logarithm ( inp ) ) <nl> + out = tf_ans . eval ( ) <nl> + self . assertAllClose ( inp , out , rtol = 1e - 4 , atol = 1e - 3 ) <nl> + <nl> + def _verifyLogarithmComplex ( self , x ) : <nl> + for np_type in [ np . complex64 , np . complex128 ] : <nl> + self . _verifyLogarithm ( x , np_type ) <nl> + <nl> + def _makeBatch ( self , matrix1 , matrix2 ) : <nl> + matrix_batch = np . concatenate ( <nl> + [ np . expand_dims ( matrix1 , 0 ) , <nl> + np . expand_dims ( matrix2 , 0 ) ] ) <nl> + matrix_batch = np . tile ( matrix_batch , [ 2 , 3 , 1 , 1 ] ) <nl> + return matrix_batch <nl> + <nl> + def testNonsymmetric ( self ) : <nl> + # 2x2 matrices <nl> + matrix1 = np . array ( [ [ 1 . , 2 . ] , [ 3 . , 4 . ] ] ) <nl> + matrix2 = np . array ( [ [ 1 . , 3 . ] , [ 3 . , 5 . ] ] ) <nl> + matrix1 = matrix1 . astype ( np . complex64 ) <nl> + matrix1 + = 1j * matrix1 <nl> + matrix2 = matrix2 . astype ( np . complex64 ) <nl> + matrix2 + = 1j * matrix2 <nl> + self . _verifyLogarithmComplex ( matrix1 ) <nl> + self . _verifyLogarithmComplex ( matrix2 ) <nl> + # Complex batch <nl> + self . _verifyLogarithmComplex ( self . _makeBatch ( matrix1 , matrix2 ) ) <nl> + <nl> + def testSymmetricPositiveDefinite ( self ) : <nl> + # 2x2 matrices <nl> + matrix1 = np . array ( [ [ 2 . , 1 . ] , [ 1 . , 2 . ] ] ) <nl> + matrix2 = np . array ( [ [ 3 . , - 1 . ] , [ - 1 . , 3 . ] ] ) <nl> + matrix1 = matrix1 . astype ( np . complex64 ) <nl> + matrix1 + = 1j * matrix1 <nl> + matrix2 = matrix2 . astype ( np . complex64 ) <nl> + matrix2 + = 1j * matrix2 <nl> + self . _verifyLogarithmComplex ( matrix1 ) <nl> + self . _verifyLogarithmComplex ( matrix2 ) <nl> + # Complex batch <nl> + self . _verifyLogarithmComplex ( self . _makeBatch ( matrix1 , matrix2 ) ) <nl> + <nl> + def testNonSquareMatrix ( self ) : <nl> + # When the logarithm of a non - square matrix is attempted we should return <nl> + # an error <nl> + with self . assertRaises ( ValueError ) : <nl> + gen_linalg_ops . _matrix_logarithm ( <nl> + np . array ( [ [ 1 . , 2 . , 3 . ] , [ 3 . , 4 . , 5 . ] ] , dtype = np . complex64 ) ) <nl> + <nl> + def testWrongDimensions ( self ) : <nl> + # The input to the logarithm should be at least a 2 - dimensional tensor . <nl> + tensor3 = constant_op . constant ( [ 1 . , 2 . ] , dtype = dtypes . complex64 ) <nl> + with self . assertRaises ( ValueError ) : <nl> + gen_linalg_ops . _matrix_logarithm ( tensor3 ) <nl> + <nl> + def testEmpty ( self ) : <nl> + self . _verifyLogarithmComplex ( np . empty ( [ 0 , 2 , 2 ] , dtype = np . complex64 ) ) <nl> + self . _verifyLogarithmComplex ( np . empty ( [ 2 , 0 , 0 ] , dtype = np . complex64 ) ) <nl> + <nl> + def testRandomSmallAndLarge ( self ) : <nl> + np . random . seed ( 42 ) <nl> + for dtype in np . complex64 , np . complex128 : <nl> + for batch_dims in [ ( ) , ( 1 , ) , ( 3 , ) , ( 2 , 2 ) ] : <nl> + for size in 8 , 31 , 32 : <nl> + shape = batch_dims + ( size , size ) <nl> + matrix = np . random . uniform ( <nl> + low = - 1 . 0 , high = 1 . 0 , <nl> + size = np . prod ( shape ) ) . reshape ( shape ) . astype ( dtype ) <nl> + self . _verifyLogarithmComplex ( matrix ) <nl> + <nl> + def testConcurrentExecutesWithoutError ( self ) : <nl> + with self . test_session ( use_gpu = True ) as sess : <nl> + matrix1 = math_ops . cast ( <nl> + random_ops . random_normal ( [ 5 , 5 ] , seed = 42 ) , dtypes . complex64 ) <nl> + matrix2 = math_ops . cast ( <nl> + random_ops . random_normal ( [ 5 , 5 ] , seed = 42 ) , dtypes . complex64 ) <nl> + logm1 = gen_linalg_ops . _matrix_logarithm ( matrix1 ) <nl> + logm2 = gen_linalg_ops . _matrix_logarithm ( matrix2 ) <nl> + logm = sess . run ( [ logm1 , logm2 ] ) <nl> + self . assertAllEqual ( logm [ 0 ] , logm [ 1 ] ) <nl> + <nl> + <nl> + class MatrixLogarithmBenchmark ( test . Benchmark ) : <nl> + <nl> + shapes = [ <nl> + ( 4 , 4 ) , <nl> + ( 10 , 10 ) , <nl> + ( 16 , 16 ) , <nl> + ( 101 , 101 ) , <nl> + ( 256 , 256 ) , <nl> + ( 1000 , 1000 ) , <nl> + ( 1024 , 1024 ) , <nl> + ( 2048 , 2048 ) , <nl> + ( 513 , 4 , 4 ) , <nl> + ( 513 , 16 , 16 ) , <nl> + ( 513 , 256 , 256 ) , <nl> + ] <nl> + <nl> + def _GenerateMatrix ( self , shape ) : <nl> + batch_shape = shape [ : - 2 ] <nl> + shape = shape [ - 2 : ] <nl> + assert shape [ 0 ] = = shape [ 1 ] <nl> + n = shape [ 0 ] <nl> + matrix = np . ones ( shape ) . astype ( np . complex64 ) / ( <nl> + 2 . 0 * n ) + np . diag ( np . ones ( n ) . astype ( np . complex64 ) ) <nl> + return variables . Variable ( np . tile ( matrix , batch_shape + ( 1 , 1 ) ) ) <nl> + <nl> + def benchmarkMatrixLogarithmOp ( self ) : <nl> + for shape in self . shapes : <nl> + with ops . Graph ( ) . as_default ( ) , \ <nl> + session . Session ( ) as sess , \ <nl> + ops . device ( " / cpu : 0 " ) : <nl> + matrix = self . _GenerateMatrix ( shape ) <nl> + logm = gen_linalg_ops . _matrix_logarithm ( matrix ) <nl> + variables . global_variables_initializer ( ) . run ( ) <nl> + self . run_op_benchmark ( <nl> + sess , <nl> + control_flow_ops . group ( logm ) , <nl> + min_iters = 25 , <nl> + name = " matrix_logarithm_cpu_ { shape } " . format ( <nl> + shape = shape ) ) <nl> + <nl> + <nl> + if __name__ = = " __main__ " : <nl> + test . main ( ) <nl> mmm a / tensorflow / python / ops / hidden_ops . txt <nl> ppp b / tensorflow / python / ops / hidden_ops . txt <nl> BatchSelfAdjointEigV2 <nl> BatchSvd <nl> LogMatrixDeterminant <nl> MatrixExponential <nl> + MatrixLogarithm <nl> MatrixSolveLs <nl> SelfAdjointEig <nl> SelfAdjointEigV2 <nl> mmm a / tensorflow / python / ops / linalg / linalg_impl . py <nl> ppp b / tensorflow / python / ops / linalg / linalg_impl . py <nl> <nl> expm = gen_linalg_ops . _matrix_exponential <nl> eye = linalg_ops . eye <nl> inv = linalg_ops . matrix_inverse <nl> + logm = gen_linalg_ops . _matrix_logarithm <nl> lstsq = linalg_ops . matrix_solve_ls <nl> norm = linalg_ops . norm <nl> qr = linalg_ops . qr <nl> mmm a / tensorflow / python / ops / math_ops . py <nl> ppp b / tensorflow / python / ops / math_ops . py <nl> <nl> @ @ cholesky <nl> @ @ cholesky_solve <nl> @ @ matrix_exponential <nl> + @ @ matrix_logarithm <nl> @ @ matrix_solve <nl> @ @ matrix_triangular_solve <nl> @ @ matrix_solve_ls <nl> mmm a / tensorflow / python / profiler / internal / BUILD <nl> ppp b / tensorflow / python / profiler / internal / BUILD <nl> py_library ( <nl> name = " model_analyzer_testlib " , <nl> srcs = [ " model_analyzer_testlib . py " ] , <nl> srcs_version = " PY2AND3 " , <nl> + visibility = [ " / / visibility : public " ] , <nl> deps = [ <nl> " / / tensorflow / python : array_ops " , <nl> " / / tensorflow / python : framework_for_generated_wrappers " , <nl> mmm a / tensorflow / python / profiler / internal / model_analyzer_testlib . py <nl> ppp b / tensorflow / python / profiler / internal / model_analyzer_testlib . py <nl> def ProfilerFromFile ( profile_file ) : <nl> profiler = model_analyzer . Profiler . __new__ ( model_analyzer . Profiler ) <nl> yield profiler <nl> print_mdl . DeleteProfiler ( ) <nl> + <nl> + <nl> + def CheckAndRemoveDoc ( profile ) : <nl> + assert ' Doc : ' in profile <nl> + start_pos = profile . find ( ' Profile : ' ) <nl> + return profile [ start_pos + 9 : ] <nl> mmm a / tensorflow / python / profiler / model_analyzer_test . py <nl> ppp b / tensorflow / python / profiler / model_analyzer_test . py <nl> def testDumpToFile ( self ) : <nl> ' DW ( 3x3x3x6 , 162 / 162 params ) \ n ' <nl> ' DW2 ( 2x2x6x12 , 288 / 288 params ) \ n ' <nl> ' ScalarW ( 1 , 1 / 1 params ) \ n ' , <nl> - f . read ( ) ) <nl> + lib . CheckAndRemoveDoc ( f . read ( ) ) ) <nl> <nl> def testSelectEverythingDetail ( self ) : <nl> ops . reset_default_graph ( ) <nl> def testSelectEverythingDetail ( self ) : <nl> <nl> with gfile . Open ( outfile , ' r ' ) as f : <nl> # pylint : disable = line - too - long <nl> - dump_str = f . read ( ) <nl> + dump_str = lib . CheckAndRemoveDoc ( f . read ( ) ) <nl> outputs = dump_str . split ( ' \ n ' ) <nl> <nl> self . assertEqual ( outputs [ 0 ] , <nl> def testSelectEverythingDetail ( self ) : <nl> with lib . ProfilerFromFile ( profile_file ) as profiler : <nl> profiler . profile_name_scope ( options = opts ) <nl> with gfile . Open ( outfile , ' r ' ) as f : <nl> - self . assertEqual ( dump_str , f . read ( ) ) <nl> + self . assertEqual ( dump_str , lib . CheckAndRemoveDoc ( f . read ( ) ) ) <nl> <nl> def testSelectEverything ( self ) : <nl> ops . reset_default_graph ( ) <nl> def testSimpleCodeView ( self ) : <nl> # pylint : disable = line - too - long <nl> self . assertEqual ( <nl> ' node name | requested bytes | # parameters | # float_ops | assigned devices | in ' , <nl> - f . read ( ) [ 0 : 80 ] ) <nl> + lib . CheckAndRemoveDoc ( f . read ( ) ) [ 0 : 80 ] ) <nl> # pylint : enable = line - too - long <nl> <nl> def testComplexCodeView ( self ) : <nl> def testComplexCodeView ( self ) : <nl> with gfile . Open ( outfile , ' r ' ) as f : <nl> lines = f . read ( ) . split ( ' \ n ' ) <nl> result = ' \ n ' . join ( [ l [ : min ( len ( l ) , 80 ) ] for l in lines ] ) <nl> - self . assertEqual ( compat . as_bytes ( ' node name | # parameters | # float_ops \ n_TFProfRoot ( - - / 2 . 84k params , - - / 168 . 86k flops ) \ n model_analyzer_testlib . py : 63 : BuildFullModel ( 0 / 1 . 80k params , 0 / 45 . 37k flops ) \ n model_analyzer_testlib . py : 40 : BuildSmallModel ( 0 / 0 params , 0 / 0 flops ) \ n model_analyzer_testlib . py : 44 : BuildSmallModel ( 0 / 4 params , 0 / 8 flops ) \ n model_analyzer_testlib . py : 48 : BuildSmallModel ( 0 / 648 params , 0 / 1 . 30k flops ) \ n model_analyzer_testlib . py : 49 : BuildSmallModel ( 0 / 0 params , 0 / 23 . 33k flops ) \ n model_analyzer_testlib . py : 53 : BuildSmallModel ( 0 / 1 . 15k params , 0 / 2 . 30k flops ) \ n model_analyzer_testlib . py : 54 : BuildSmallModel ( 0 / 0 params , 0 / 18 . 43k flops ) \ n model_analyzer_testlib . py : 63 : BuildFullModel ( gradient ) ( 0 / 0 params , 0 / 67 . 39k f \ n model_analyzer_testlib . py : 49 : BuildSmallModel ( gradient ) ( 0 / 0 params , 0 / 46 . 66 \ n model_analyzer_testlib . py : 54 : BuildSmallModel ( gradient ) ( 0 / 0 params , 0 / 20 . 74 \ n model_analyzer_testlib . py : 67 : BuildFullModel ( 0 / 1 . 04k params , 0 / 18 . 58k flops ) \ n model_analyzer_testlib . py : 67 : BuildFullModel ( gradient ) ( 0 / 0 params , 0 / 37 . 00k f \ n model_analyzer_testlib . py : 69 : BuildFullModel ( 0 / 0 params , 0 / 0 flops ) \ n model_analyzer_testlib . py : 70 : BuildFullModel ( 0 / 0 params , 0 / 258 flops ) \ n model_analyzer_testlib . py : 70 : BuildFullModel ( gradient ) ( 0 / 0 params , 0 / 129 flop \ n model_analyzer_testlib . py : 72 : BuildFullModel ( 0 / 0 params , 0 / 141 flops ) \ n ' ) , <nl> - compat . as_bytes ( result ) ) <nl> + self . assertEqual ( <nl> + compat . as_bytes ( <nl> + ' node name | # parameters | # float_ops \ n_TFProfRoot ( - - / 2 . 84k params , - - / 168 . 86k flops ) \ n model_analyzer_testlib . py : 63 : BuildFullModel ( 0 / 1 . 80k params , 0 / 45 . 37k flops ) \ n model_analyzer_testlib . py : 40 : BuildSmallModel ( 0 / 0 params , 0 / 0 flops ) \ n model_analyzer_testlib . py : 44 : BuildSmallModel ( 0 / 4 params , 0 / 8 flops ) \ n model_analyzer_testlib . py : 48 : BuildSmallModel ( 0 / 648 params , 0 / 1 . 30k flops ) \ n model_analyzer_testlib . py : 49 : BuildSmallModel ( 0 / 0 params , 0 / 23 . 33k flops ) \ n model_analyzer_testlib . py : 53 : BuildSmallModel ( 0 / 1 . 15k params , 0 / 2 . 30k flops ) \ n model_analyzer_testlib . py : 54 : BuildSmallModel ( 0 / 0 params , 0 / 18 . 43k flops ) \ n model_analyzer_testlib . py : 63 : BuildFullModel ( gradient ) ( 0 / 0 params , 0 / 67 . 39k f \ n model_analyzer_testlib . py : 49 : BuildSmallModel ( gradient ) ( 0 / 0 params , 0 / 46 . 66 \ n model_analyzer_testlib . py : 54 : BuildSmallModel ( gradient ) ( 0 / 0 params , 0 / 20 . 74 \ n model_analyzer_testlib . py : 67 : BuildFullModel ( 0 / 1 . 04k params , 0 / 18 . 58k flops ) \ n model_analyzer_testlib . py : 67 : BuildFullModel ( gradient ) ( 0 / 0 params , 0 / 37 . 00k f \ n model_analyzer_testlib . py : 69 : BuildFullModel ( 0 / 0 params , 0 / 0 flops ) \ n model_analyzer_testlib . py : 70 : BuildFullModel ( 0 / 0 params , 0 / 258 flops ) \ n model_analyzer_testlib . py : 70 : BuildFullModel ( gradient ) ( 0 / 0 params , 0 / 129 flop \ n model_analyzer_testlib . py : 72 : BuildFullModel ( 0 / 0 params , 0 / 141 flops ) \ n ' <nl> + ) , compat . as_bytes ( lib . CheckAndRemoveDoc ( result ) ) ) <nl> <nl> self . assertLess ( 0 , tfprof_node . total_exec_micros ) <nl> self . assertEqual ( 2844 , tfprof_node . total_parameters ) <nl> def testOpView ( self ) : <nl> # pylint : disable = line - too - long <nl> self . assertEqual ( <nl> ' nodename | requestedbytes | peakbytes | residualbytes | outputbytes | totalexecutiontime | acceleratorexecutiontime | cpuexecutiontime | # parameters | opoccurrence ( run | defined ) | inputshapes ' , <nl> - f . read ( ) . replace ( ' \ t ' , ' ' ) . replace ( ' ' , ' ' ) [ 0 : 170 ] ) <nl> + lib . CheckAndRemoveDoc ( f . read ( ) ) . replace ( ' \ t ' , <nl> + ' ' ) . replace ( ' ' , ' ' ) [ 0 : 170 ] ) <nl> # pylint : enable = line - too - long <nl> <nl> total_children = 0 <nl> mmm a / tensorflow / tools / api / golden / tensorflow . estimator . - d - n - n - classifier . pbtxt <nl> ppp b / tensorflow / tools / api / golden / tensorflow . estimator . - d - n - n - classifier . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " __init__ " <nl> - argspec : " args = [ \ ' self \ ' , \ ' hidden_units \ ' , \ ' feature_columns \ ' , \ ' model_dir \ ' , \ ' n_classes \ ' , \ ' weight_column \ ' , \ ' label_vocabulary \ ' , \ ' optimizer \ ' , \ ' activation_fn \ ' , \ ' dropout \ ' , \ ' input_layer_partitioner \ ' , \ ' config \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' 2 \ ' , \ ' None \ ' , \ ' None \ ' , \ ' Adagrad \ ' , \ ' < function relu instance > \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' hidden_units \ ' , \ ' feature_columns \ ' , \ ' model_dir \ ' , \ ' n_classes \ ' , \ ' weight_column \ ' , \ ' label_vocabulary \ ' , \ ' optimizer \ ' , \ ' activation_fn \ ' , \ ' dropout \ ' , \ ' input_layer_partitioner \ ' , \ ' config \ ' , \ ' warm_start_from \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' 2 \ ' , \ ' None \ ' , \ ' None \ ' , \ ' Adagrad \ ' , \ ' < function relu instance > \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> } <nl> member_method { <nl> name : " evaluate " <nl> mmm a / tensorflow / tools / api / golden / tensorflow . estimator . - d - n - n - linear - combined - classifier . pbtxt <nl> ppp b / tensorflow / tools / api / golden / tensorflow . estimator . - d - n - n - linear - combined - classifier . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " __init__ " <nl> - argspec : " args = [ \ ' self \ ' , \ ' model_dir \ ' , \ ' linear_feature_columns \ ' , \ ' linear_optimizer \ ' , \ ' dnn_feature_columns \ ' , \ ' dnn_optimizer \ ' , \ ' dnn_hidden_units \ ' , \ ' dnn_activation_fn \ ' , \ ' dnn_dropout \ ' , \ ' n_classes \ ' , \ ' weight_column \ ' , \ ' label_vocabulary \ ' , \ ' input_layer_partitioner \ ' , \ ' config \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' None \ ' , \ ' Ftrl \ ' , \ ' None \ ' , \ ' Adagrad \ ' , \ ' None \ ' , \ ' < function relu instance > \ ' , \ ' None \ ' , \ ' 2 \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' model_dir \ ' , \ ' linear_feature_columns \ ' , \ ' linear_optimizer \ ' , \ ' dnn_feature_columns \ ' , \ ' dnn_optimizer \ ' , \ ' dnn_hidden_units \ ' , \ ' dnn_activation_fn \ ' , \ ' dnn_dropout \ ' , \ ' n_classes \ ' , \ ' weight_column \ ' , \ ' label_vocabulary \ ' , \ ' input_layer_partitioner \ ' , \ ' config \ ' , \ ' warm_start_from \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' None \ ' , \ ' Ftrl \ ' , \ ' None \ ' , \ ' Adagrad \ ' , \ ' None \ ' , \ ' < function relu instance > \ ' , \ ' None \ ' , \ ' 2 \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> } <nl> member_method { <nl> name : " evaluate " <nl> mmm a / tensorflow / tools / api / golden / tensorflow . estimator . - d - n - n - linear - combined - regressor . pbtxt <nl> ppp b / tensorflow / tools / api / golden / tensorflow . estimator . - d - n - n - linear - combined - regressor . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " __init__ " <nl> - argspec : " args = [ \ ' self \ ' , \ ' model_dir \ ' , \ ' linear_feature_columns \ ' , \ ' linear_optimizer \ ' , \ ' dnn_feature_columns \ ' , \ ' dnn_optimizer \ ' , \ ' dnn_hidden_units \ ' , \ ' dnn_activation_fn \ ' , \ ' dnn_dropout \ ' , \ ' label_dimension \ ' , \ ' weight_column \ ' , \ ' input_layer_partitioner \ ' , \ ' config \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' None \ ' , \ ' Ftrl \ ' , \ ' None \ ' , \ ' Adagrad \ ' , \ ' None \ ' , \ ' < function relu instance > \ ' , \ ' None \ ' , \ ' 1 \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' model_dir \ ' , \ ' linear_feature_columns \ ' , \ ' linear_optimizer \ ' , \ ' dnn_feature_columns \ ' , \ ' dnn_optimizer \ ' , \ ' dnn_hidden_units \ ' , \ ' dnn_activation_fn \ ' , \ ' dnn_dropout \ ' , \ ' label_dimension \ ' , \ ' weight_column \ ' , \ ' input_layer_partitioner \ ' , \ ' config \ ' , \ ' warm_start_from \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' None \ ' , \ ' Ftrl \ ' , \ ' None \ ' , \ ' Adagrad \ ' , \ ' None \ ' , \ ' < function relu instance > \ ' , \ ' None \ ' , \ ' 1 \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> } <nl> member_method { <nl> name : " evaluate " <nl> mmm a / tensorflow / tools / api / golden / tensorflow . estimator . - d - n - n - regressor . pbtxt <nl> ppp b / tensorflow / tools / api / golden / tensorflow . estimator . - d - n - n - regressor . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " __init__ " <nl> - argspec : " args = [ \ ' self \ ' , \ ' hidden_units \ ' , \ ' feature_columns \ ' , \ ' model_dir \ ' , \ ' label_dimension \ ' , \ ' weight_column \ ' , \ ' optimizer \ ' , \ ' activation_fn \ ' , \ ' dropout \ ' , \ ' input_layer_partitioner \ ' , \ ' config \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' 1 \ ' , \ ' None \ ' , \ ' Adagrad \ ' , \ ' < function relu instance > \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' hidden_units \ ' , \ ' feature_columns \ ' , \ ' model_dir \ ' , \ ' label_dimension \ ' , \ ' weight_column \ ' , \ ' optimizer \ ' , \ ' activation_fn \ ' , \ ' dropout \ ' , \ ' input_layer_partitioner \ ' , \ ' config \ ' , \ ' warm_start_from \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' 1 \ ' , \ ' None \ ' , \ ' Adagrad \ ' , \ ' < function relu instance > \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> } <nl> member_method { <nl> name : " evaluate " <nl> mmm a / tensorflow / tools / api / golden / tensorflow . estimator . - linear - classifier . pbtxt <nl> ppp b / tensorflow / tools / api / golden / tensorflow . estimator . - linear - classifier . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " __init__ " <nl> - argspec : " args = [ \ ' self \ ' , \ ' feature_columns \ ' , \ ' model_dir \ ' , \ ' n_classes \ ' , \ ' weight_column \ ' , \ ' label_vocabulary \ ' , \ ' optimizer \ ' , \ ' config \ ' , \ ' partitioner \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' 2 \ ' , \ ' None \ ' , \ ' None \ ' , \ ' Ftrl \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' feature_columns \ ' , \ ' model_dir \ ' , \ ' n_classes \ ' , \ ' weight_column \ ' , \ ' label_vocabulary \ ' , \ ' optimizer \ ' , \ ' config \ ' , \ ' partitioner \ ' , \ ' warm_start_from \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' 2 \ ' , \ ' None \ ' , \ ' None \ ' , \ ' Ftrl \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> } <nl> member_method { <nl> name : " evaluate " <nl> mmm a / tensorflow / tools / api / golden / tensorflow . estimator . - linear - regressor . pbtxt <nl> ppp b / tensorflow / tools / api / golden / tensorflow . estimator . - linear - regressor . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " __init__ " <nl> - argspec : " args = [ \ ' self \ ' , \ ' feature_columns \ ' , \ ' model_dir \ ' , \ ' label_dimension \ ' , \ ' weight_column \ ' , \ ' optimizer \ ' , \ ' config \ ' , \ ' partitioner \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' 1 \ ' , \ ' None \ ' , \ ' Ftrl \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' feature_columns \ ' , \ ' model_dir \ ' , \ ' label_dimension \ ' , \ ' weight_column \ ' , \ ' optimizer \ ' , \ ' config \ ' , \ ' partitioner \ ' , \ ' warm_start_from \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' 1 \ ' , \ ' None \ ' , \ ' Ftrl \ ' , \ ' None \ ' , \ ' None \ ' , \ ' None \ ' ] , " <nl> } <nl> member_method { <nl> name : " evaluate " <nl> new file mode 100644 <nl> index 0000000000000 . . a16e3aedae96e <nl> mmm / dev / null <nl> ppp b / tensorflow / tools / api / golden / tensorflow . estimator . - vocab - info . pbtxt <nl> <nl> + path : " tensorflow . estimator . VocabInfo " <nl> + tf_class { <nl> + is_instance : " < class \ ' tensorflow . python . estimator . warm_starting_util . VocabInfo \ ' > " <nl> + is_instance : " < class \ ' tensorflow . python . estimator . warm_starting_util . VocabInfo \ ' > " <nl> + is_instance : " < type \ ' tuple \ ' > " <nl> + member { <nl> + name : " backup_initializer " <nl> + mtype : " < type \ ' property \ ' > " <nl> + } <nl> + member { <nl> + name : " new_vocab " <nl> + mtype : " < type \ ' property \ ' > " <nl> + } <nl> + member { <nl> + name : " new_vocab_size " <nl> + mtype : " < type \ ' property \ ' > " <nl> + } <nl> + member { <nl> + name : " num_oov_buckets " <nl> + mtype : " < type \ ' property \ ' > " <nl> + } <nl> + member { <nl> + name : " old_vocab " <nl> + mtype : " < type \ ' property \ ' > " <nl> + } <nl> + member { <nl> + name : " old_vocab_size " <nl> + mtype : " < type \ ' property \ ' > " <nl> + } <nl> + member_method { <nl> + name : " __init__ " <nl> + } <nl> + member_method { <nl> + name : " count " <nl> + } <nl> + member_method { <nl> + name : " index " <nl> + } <nl> + } <nl> new file mode 100644 <nl> index 0000000000000 . . afdd6bb058353 <nl> mmm / dev / null <nl> ppp b / tensorflow / tools / api / golden / tensorflow . estimator . - warm - start - settings . pbtxt <nl> <nl> + path : " tensorflow . estimator . WarmStartSettings " <nl> + tf_class { <nl> + is_instance : " < class \ ' tensorflow . python . estimator . warm_starting_util . WarmStartSettings \ ' > " <nl> + is_instance : " < class \ ' tensorflow . python . estimator . warm_starting_util . WarmStartSettings \ ' > " <nl> + is_instance : " < type \ ' tuple \ ' > " <nl> + member { <nl> + name : " ckpt_to_initialize_from " <nl> + mtype : " < type \ ' property \ ' > " <nl> + } <nl> + member { <nl> + name : " var_name_to_prev_var_name " <nl> + mtype : " < type \ ' property \ ' > " <nl> + } <nl> + member { <nl> + name : " var_name_to_vocab_info " <nl> + mtype : " < type \ ' property \ ' > " <nl> + } <nl> + member { <nl> + name : " vars_to_warm_start " <nl> + mtype : " < type \ ' property \ ' > " <nl> + } <nl> + member_method { <nl> + name : " __init__ " <nl> + } <nl> + member_method { <nl> + name : " count " <nl> + } <nl> + member_method { <nl> + name : " index " <nl> + } <nl> + } <nl> mmm a / tensorflow / tools / api / golden / tensorflow . estimator . pbtxt <nl> ppp b / tensorflow / tools / api / golden / tensorflow . estimator . pbtxt <nl> tf_module { <nl> name : " TrainSpec " <nl> mtype : " < type \ ' type \ ' > " <nl> } <nl> + member { <nl> + name : " VocabInfo " <nl> + mtype : " < type \ ' type \ ' > " <nl> + } <nl> + member { <nl> + name : " WarmStartSettings " <nl> + mtype : " < type \ ' type \ ' > " <nl> + } <nl> member { <nl> name : " export " <nl> mtype : " < type \ ' module \ ' > " <nl> mmm a / tensorflow / tools / api / golden / tensorflow . linalg . pbtxt <nl> ppp b / tensorflow / tools / api / golden / tensorflow . linalg . pbtxt <nl> tf_module { <nl> name : " logdet " <nl> argspec : " args = [ \ ' matrix \ ' , \ ' name \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> } <nl> + member_method { <nl> + name : " logm " <nl> + argspec : " args = [ \ ' input \ ' , \ ' name \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + } <nl> member_method { <nl> name : " lstsq " <nl> argspec : " args = [ \ ' matrix \ ' , \ ' rhs \ ' , \ ' l2_regularizer \ ' , \ ' fast \ ' , \ ' name \ ' ] , varargs = None , keywords = None , defaults = [ \ ' 0 . 0 \ ' , \ ' True \ ' , \ ' None \ ' ] , " <nl>
|
Merge commit for internal changes
|
tensorflow/tensorflow
|
65fe8274885fe1a45ade60046f1d9c61a3358aa5
|
2018-01-18T16:56:58Z
|
mmm a / . gitignore <nl> ppp b / . gitignore <nl> projects / <nl> tools / tojs / user . cfg <nl> # . . . userconf . ini generated if running from tools / tojs <nl> tools / tojs / userconf . ini <nl> + tools / tolua / userconf . ini <nl> # . . . userconf . ini generated if running from tools / jenkins_scripts / mac / android / <nl> tools / jenkins_scripts / mac / android / userconf . ini <nl> <nl> mmm a / . gitmodules <nl> ppp b / . gitmodules <nl> <nl> path = tools / bindings - generator <nl> url = git : / / github . com / cocos2d / bindings - generator . git <nl> [ submodule " scripting / javascript / bindings / generated " ] <nl> - path = scripting / javascript / bindings / generated <nl> + path = scripting / auto - generated <nl> url = git : / / github . com / folecr / cocos2dx - autogen - bindings . git <nl> [ submodule " samples / Javascript / Shared " ] <nl> path = samples / Javascript / Shared <nl> mmm a / cocos2d_libs . xcodeproj / project . pbxproj . REMOVED . git - id <nl> ppp b / cocos2d_libs . xcodeproj / project . pbxproj . REMOVED . git - id <nl> @ @ - 1 + 1 @ @ <nl> - 027d1d69c91552623e04c46fd002c5976c4bb40c <nl> \ No newline at end of file <nl> + dcaf07070ad651b671d721564b6d1aa99ea03d0b <nl> \ No newline at end of file <nl> mmm a / plugin / samples / HelloAnalytics - JS / Classes / AppDelegate . cpp <nl> ppp b / plugin / samples / HelloAnalytics - JS / Classes / AppDelegate . cpp <nl> <nl> # include " cocos2d . h " <nl> # include " SimpleAudioEngine . h " <nl> # include " ScriptingCore . h " <nl> - # include " generated / jsb_cocos2dx_auto . hpp " <nl> - # include " generated / jsb_cocos2dx_extension_auto . hpp " <nl> + # include " jsb_cocos2dx_auto . hpp " <nl> + # include " jsb_cocos2dx_extension_auto . hpp " <nl> # include " cocos2d_specifics . hpp " <nl> # include " js_bindings_chipmunk_registration . h " <nl> # include " js_bindings_system_registration . h " <nl> mmm a / plugin / samples / HelloIAP - JS / Classes / AppDelegate . cpp <nl> ppp b / plugin / samples / HelloIAP - JS / Classes / AppDelegate . cpp <nl> <nl> # include " cocos2d . h " <nl> # include " SimpleAudioEngine . h " <nl> # include " ScriptingCore . h " <nl> - # include " generated / jsb_cocos2dx_auto . hpp " <nl> - # include " generated / jsb_cocos2dx_extension_auto . hpp " <nl> + # include " jsb_cocos2dx_auto . hpp " <nl> + # include " jsb_cocos2dx_extension_auto . hpp " <nl> # include " cocos2d_specifics . hpp " <nl> # include " js_bindings_chipmunk_registration . h " <nl> # include " js_bindings_system_registration . h " <nl> mmm a / samples / Cpp / AssetsManagerTest / Classes / AppDelegate . cpp <nl> ppp b / samples / Cpp / AssetsManagerTest / Classes / AppDelegate . cpp <nl> <nl> # include " cocos2d . h " <nl> # include " SimpleAudioEngine . h " <nl> # include " ScriptingCore . h " <nl> - # include " generated / jsb_cocos2dx_auto . hpp " <nl> + # include " jsb_cocos2dx_auto . hpp " <nl> # include " cocos2d_specifics . hpp " <nl> <nl> # if ( CC_TARGET_PLATFORM ! = CC_PLATFORM_WIN32 ) <nl> mmm a / samples / Cpp / AssetsManagerTest / proj . win32 / AssetsManagerTest . vcxproj <nl> ppp b / samples / Cpp / AssetsManagerTest / proj . win32 / AssetsManagerTest . vcxproj <nl> <nl> < / Midl > <nl> < ClCompile > <nl> < Optimization > Disabled < / Optimization > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; DEBUG ; _DEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_DEBUG = 1 ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> xcopy " $ ( ProjectDir ) . . \ Resources " " $ ( OutDir ) \ AssetsManagerTestRes \ " / e / Y < / Comma <nl> < ProxyFileName > res_p . c < / ProxyFileName > <nl> < / Midl > <nl> < ClCompile > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; NDEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < ExceptionHandling > <nl> < / ExceptionHandling > <nl> mmm a / samples / Javascript / CocosDragonJS / Classes / AppDelegate . cpp <nl> ppp b / samples / Javascript / CocosDragonJS / Classes / AppDelegate . cpp <nl> <nl> # include " cocos2d . h " <nl> # include " SimpleAudioEngine . h " <nl> # include " ScriptingCore . h " <nl> - # include " generated / jsb_cocos2dx_auto . hpp " <nl> - # include " generated / jsb_cocos2dx_extension_auto . hpp " <nl> + # include " jsb_cocos2dx_auto . hpp " <nl> + # include " jsb_cocos2dx_extension_auto . hpp " <nl> # include " jsb_cocos2dx_extension_manual . h " <nl> # include " cocos2d_specifics . hpp " <nl> # include " js_bindings_ccbreader . h " <nl> mmm a / samples / Javascript / CocosDragonJS / proj . win32 / CocosDragonJS . vcxproj <nl> ppp b / samples / Javascript / CocosDragonJS / proj . win32 / CocosDragonJS . vcxproj <nl> <nl> < / Midl > <nl> < ClCompile > <nl> < Optimization > Disabled < / Optimization > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; _DEBUG ; DEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_DEBUG = 1 ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> xcopy " $ ( ProjectDir ) . . \ . . \ Shared \ games \ CocosDragonJS \ Published files Android " " $ <nl> < ProxyFileName > testjs_p . c < / ProxyFileName > <nl> < / Midl > <nl> < ClCompile > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; NDEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; COCOS2D_JAVASCRIPT = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < ExceptionHandling > <nl> < / ExceptionHandling > <nl> mmm a / samples / Javascript / CrystalCraze / Classes / AppDelegate . cpp <nl> ppp b / samples / Javascript / CrystalCraze / Classes / AppDelegate . cpp <nl> <nl> # include " cocos2d . h " <nl> # include " SimpleAudioEngine . h " <nl> # include " ScriptingCore . h " <nl> - # include " generated / jsb_cocos2dx_auto . hpp " <nl> - # include " generated / jsb_cocos2dx_extension_auto . hpp " <nl> + # include " jsb_cocos2dx_auto . hpp " <nl> + # include " jsb_cocos2dx_extension_auto . hpp " <nl> # include " jsb_cocos2dx_extension_manual . h " <nl> # include " cocos2d_specifics . hpp " <nl> # include " js_bindings_ccbreader . h " <nl> mmm a / samples / Javascript / CrystalCraze / proj . win32 / CrystalCraze . vcxproj <nl> ppp b / samples / Javascript / CrystalCraze / proj . win32 / CrystalCraze . vcxproj <nl> <nl> < / Midl > <nl> < ClCompile > <nl> < Optimization > Disabled < / Optimization > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; _DEBUG ; DEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_DEBUG = 1 ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> xcopy " $ ( ProjectDir ) . . \ . . \ Shared \ games \ CrystalCraze \ Published - Android " " $ ( OutDir <nl> < ProxyFileName > testjs_p . c < / ProxyFileName > <nl> < / Midl > <nl> < ClCompile > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; NDEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; COCOS2D_JAVASCRIPT = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < ExceptionHandling > <nl> < / ExceptionHandling > <nl> mmm a / samples / Javascript / MoonWarriors / Classes / AppDelegate . cpp <nl> ppp b / samples / Javascript / MoonWarriors / Classes / AppDelegate . cpp <nl> <nl> # include " cocos2d . h " <nl> # include " SimpleAudioEngine . h " <nl> # include " ScriptingCore . h " <nl> - # include " generated / jsb_cocos2dx_auto . hpp " <nl> - # include " generated / jsb_cocos2dx_extension_auto . hpp " <nl> + # include " jsb_cocos2dx_auto . hpp " <nl> + # include " jsb_cocos2dx_extension_auto . hpp " <nl> # include " jsb_cocos2dx_extension_manual . h " <nl> # include " cocos2d_specifics . hpp " <nl> # include " js_bindings_ccbreader . h " <nl> mmm a / samples / Javascript / MoonWarriors / proj . win32 / MoonWarriors . vcxproj <nl> ppp b / samples / Javascript / MoonWarriors / proj . win32 / MoonWarriors . vcxproj <nl> <nl> < / Midl > <nl> < ClCompile > <nl> < Optimization > Disabled < / Optimization > <nl> - < AdditionalIncludeDirectories > . ; . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > . ; . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; _DEBUG ; DEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_DEBUG = 1 ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> xcopy " $ ( ProjectDir ) . . \ . . \ Shared \ games \ MoonWarriors " " $ ( OutDir ) \ MoonWarriorsRes \ <nl> < ProxyFileName > testjs_p . c < / ProxyFileName > <nl> < / Midl > <nl> < ClCompile > <nl> - < AdditionalIncludeDirectories > . ; . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > . ; . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; NDEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < ExceptionHandling > <nl> < / ExceptionHandling > <nl> mmm a / samples / Javascript / TestJavascript / Classes / AppDelegate . cpp <nl> ppp b / samples / Javascript / TestJavascript / Classes / AppDelegate . cpp <nl> <nl> # include " cocos2d . h " <nl> # include " SimpleAudioEngine . h " <nl> # include " ScriptingCore . h " <nl> - # include " generated / jsb_cocos2dx_auto . hpp " <nl> - # include " generated / jsb_cocos2dx_extension_auto . hpp " <nl> + # include " jsb_cocos2dx_auto . hpp " <nl> + # include " jsb_cocos2dx_extension_auto . hpp " <nl> # include " jsb_cocos2dx_extension_manual . h " <nl> # include " cocos2d_specifics . hpp " <nl> # include " js_bindings_chipmunk_registration . h " <nl> mmm a / samples / Javascript / TestJavascript / proj . win32 / TestJavascript . vcxproj <nl> ppp b / samples / Javascript / TestJavascript / proj . win32 / TestJavascript . vcxproj <nl> <nl> < / Midl > <nl> < ClCompile > <nl> < Optimization > Disabled < / Optimization > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; DEBUG ; _DEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_DEBUG = 1 ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> xcopy " $ ( ProjectDir ) . . \ . . \ Shared \ tests " " $ ( OutDir ) \ TestJavascriptRes \ " / e / Y < / Co <nl> < ProxyFileName > testjs_p . c < / ProxyFileName > <nl> < / Midl > <nl> < ClCompile > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; NDEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < ExceptionHandling > <nl> < / ExceptionHandling > <nl> mmm a / samples / Javascript / WatermelonWithMe / Classes / AppDelegate . cpp <nl> ppp b / samples / Javascript / WatermelonWithMe / Classes / AppDelegate . cpp <nl> <nl> # include " cocos2d . h " <nl> # include " SimpleAudioEngine . h " <nl> # include " ScriptingCore . h " <nl> - # include " generated / jsb_cocos2dx_auto . hpp " <nl> - # include " generated / jsb_cocos2dx_extension_auto . hpp " <nl> + # include " jsb_cocos2dx_auto . hpp " <nl> + # include " jsb_cocos2dx_extension_auto . hpp " <nl> # include " jsb_cocos2dx_extension_manual . h " <nl> # include " cocos2d_specifics . hpp " <nl> # include " js_bindings_chipmunk_registration . h " <nl> mmm a / samples / Javascript / WatermelonWithMe / proj . win32 / WatermelonWithMe . vcxproj <nl> ppp b / samples / Javascript / WatermelonWithMe / proj . win32 / WatermelonWithMe . vcxproj <nl> <nl> < / Midl > <nl> < ClCompile > <nl> < Optimization > Disabled < / Optimization > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; _DEBUG ; DEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_DEBUG = 1 ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> xcopy " $ ( ProjectDir ) . . \ . . \ Shared \ games \ WatermelonWithMe " " $ ( OutDir ) \ WatermelonWi <nl> < ProxyFileName > testjs_p . c < / ProxyFileName > <nl> < / Midl > <nl> < ClCompile > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; NDEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < ExceptionHandling > <nl> < / ExceptionHandling > <nl> mmm a / samples / Lua / HelloLua / proj . win32 / HelloLua . vcxproj <nl> ppp b / samples / Lua / HelloLua / proj . win32 / HelloLua . vcxproj <nl> <nl> < / Midl > <nl> < ClCompile > <nl> < Optimization > Disabled < / Optimization > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ cocos2dx_support ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ lua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ tolua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ src ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ lua - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ cocos2dx_support ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ lua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ tolua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ src ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; _DEBUG ; COCOS2D_DEBUG = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> <nl> < ProxyFileName > HelloLua_p . c < / ProxyFileName > <nl> < / Midl > <nl> < ClCompile > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ cocos2dx_support ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ lua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ tolua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ src ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ lua - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ cocos2dx_support ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ lua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ tolua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ src ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; NDEBUG ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < ExceptionHandling > <nl> < / ExceptionHandling > <nl> mmm a / samples / Lua / TestLua / proj . win32 / TestLua . win32 . vcxproj <nl> ppp b / samples / Lua / TestLua / proj . win32 / TestLua . win32 . vcxproj <nl> <nl> < / PropertyGroup > <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > <nl> < ClCompile > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ cocos2dx_support ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ lua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ tolua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ src ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ lua - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ cocos2dx_support ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ lua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ tolua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ src ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PrecompiledHeader > <nl> < / PrecompiledHeader > <nl> < WarningLevel > Level3 < / WarningLevel > <nl> xcopy / Y / Q " $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ libwebsockets \ win32 \ lib \ * . * " " $ ( O <nl> < / ItemDefinitionGroup > <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > <nl> < ClCompile > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ cocos2dx_support ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ lua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ tolua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ src ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ auto - generated \ lua - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ cocos2dx_support ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ lua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ tolua ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ scripting \ lua \ src ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PrecompiledHeader > <nl> < / PrecompiledHeader > <nl> < WarningLevel > Level3 < / WarningLevel > <nl> mmm a / samples / samples . xcodeproj / project . pbxproj . REMOVED . git - id <nl> ppp b / samples / samples . xcodeproj / project . pbxproj . REMOVED . git - id <nl> @ @ - 1 + 1 @ @ <nl> - 10b7b9eb9dd50e4480e377538b5a1fa7261b9029 <nl> \ No newline at end of file <nl> + 01ccea588d07b1419922fb6fd66502422184c2bd <nl> \ No newline at end of file <nl> new file mode 160000 <nl> index 000000000000 . . 5b4a4c5b94ba <nl> mmm / dev / null <nl> ppp b / scripting / auto - generated <nl> @ @ - 0 , 0 + 1 @ @ <nl> + Subproject commit 5b4a4c5b94ba4920a70900d47246612adcdc0ac5 <nl> mmm a / scripting / javascript / bindings / Android . mk <nl> ppp b / scripting / javascript / bindings / Android . mk <nl> LOCAL_SRC_FILES : = ScriptingCore . cpp \ <nl> jsb_opengl_functions . cpp \ <nl> jsb_opengl_manual . cpp \ <nl> jsb_opengl_registration . cpp \ <nl> - generated / jsb_cocos2dx_auto . cpp \ <nl> - generated / jsb_cocos2dx_extension_auto . cpp \ <nl> + . . / . . / auto - generated / js - bindings / jsb_cocos2dx_auto . cpp \ <nl> + . . / . . / auto - generated / js - bindings / jsb_cocos2dx_extension_auto . cpp \ <nl> XMLHTTPRequest . cpp \ <nl> jsb_websocket . cpp <nl> <nl> LOCAL_CFLAGS : = - DCOCOS2D_JAVASCRIPT <nl> LOCAL_EXPORT_CFLAGS : = - DCOCOS2D_JAVASCRIPT <nl> <nl> LOCAL_C_INCLUDES : = $ ( LOCAL_PATH ) \ <nl> - $ ( LOCAL_PATH ) / . . / . . / . . / CocosDenshion / include <nl> + $ ( LOCAL_PATH ) / . . / . . / . . / CocosDenshion / include \ <nl> + $ ( LOCAL_PATH ) / . . / . . / auto - generated / js - bindings <nl> <nl> LOCAL_EXPORT_C_INCLUDES : = $ ( LOCAL_PATH ) \ <nl> - $ ( LOCAL_PATH ) / generated <nl> + $ ( LOCAL_PATH ) / . . / . . / auto - generated / js - bindings <nl> <nl> LOCAL_WHOLE_STATIC_LIBRARIES : = spidermonkey_static <nl> LOCAL_WHOLE_STATIC_LIBRARIES + = cocos_extension_static <nl> mmm a / scripting / javascript / bindings / cocos2d_specifics . cpp . REMOVED . git - id <nl> ppp b / scripting / javascript / bindings / cocos2d_specifics . cpp . REMOVED . git - id <nl> @ @ - 1 + 1 @ @ <nl> - d4944c285d6219a01aa06f326168ae67d08b9cb0 <nl> \ No newline at end of file <nl> + 1a67569d3ade0153cccbfa71ca5ac5355d03fbd4 <nl> \ No newline at end of file <nl> deleted file mode 160000 <nl> index 2210cee9be0c . . 000000000000 <nl> mmm a / scripting / javascript / bindings / generated <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - Subproject commit 2210cee9be0c65daf3a1f02566e0f131728bce23 <nl> mmm a / scripting / javascript / bindings / proj . win32 / libJSBinding . vcxproj <nl> ppp b / scripting / javascript / bindings / proj . win32 / libJSBinding . vcxproj <nl> <nl> < / ProjectConfiguration > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> + < ClCompile Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_auto . cpp " / > <nl> + < ClCompile Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_extension_auto . cpp " / > <nl> < ClCompile Include = " . . \ cocos2d_specifics . cpp " / > <nl> < ClCompile Include = " . . \ cocosjs_manual_conversions . cpp " / > <nl> - < ClCompile Include = " . . \ generated \ jsb_cocos2dx_auto . cpp " / > <nl> - < ClCompile Include = " . . \ generated \ jsb_cocos2dx_extension_auto . cpp " / > <nl> < ClCompile Include = " . . \ jsb_cocos2dx_extension_manual . cpp " / > <nl> < ClCompile Include = " . . \ jsb_opengl_functions . cpp " / > <nl> < ClCompile Include = " . . \ jsb_opengl_manual . cpp " / > <nl> <nl> < ClCompile Include = " . . \ XMLHTTPRequest . cpp " / > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> + < ClInclude Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_auto . hpp " / > <nl> + < ClInclude Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_extension_auto . hpp " / > <nl> < ClInclude Include = " . . \ cocos2d_specifics . hpp " / > <nl> < ClInclude Include = " . . \ cocosjs_manual_conversions . h " / > <nl> - < ClInclude Include = " . . \ generated \ jsb_cocos2dx_auto . hpp " / > <nl> - < ClInclude Include = " . . \ generated \ jsb_cocos2dx_extension_auto . hpp " / > <nl> < ClInclude Include = " . . \ jsb_cocos2dx_extension_manual . h " / > <nl> < ClInclude Include = " . . \ jsb_helper . h " / > <nl> < ClInclude Include = " . . \ jsb_opengl_functions . h " / > <nl> <nl> < ClInclude Include = " . . \ XMLHTTPRequest . h " / > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> - < None Include = " . . \ generated \ jsb_cocos2dx_auto_api . js " / > <nl> - < None Include = " . . \ generated \ jsb_cocos2dx_extension_auto_api . js " / > <nl> + < None Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_auto_api . js " / > <nl> + < None Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_extension_auto_api . js " / > <nl> < None Include = " . . \ js \ jsb . js " / > <nl> < None Include = " . . \ js \ jsb_chipmunk . js " / > <nl> < None Include = " . . \ js \ jsb_cocos2d . js " / > <nl> <nl> < WarningLevel > Level3 < / WarningLevel > <nl> < Optimization > Disabled < / Optimization > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; _DEBUG ; _LIB ; DEBUG ; COCOS2D_DEBUG = 1 ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; $ ( ProjectDir ) . . ; $ ( ProjectDir ) . . \ . . \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions \ LocalStorage ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions \ network ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; $ ( ProjectDir ) . . ; $ ( ProjectDir ) . . \ . . \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions \ LocalStorage ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions \ network ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < DisableSpecificWarnings > 4068 ; 4101 ; 4800 ; 4251 ; 4244 ; % ( DisableSpecificWarnings ) < / DisableSpecificWarnings > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> xcopy / Y / Q " $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ sqlite3 \ libraries \ win32 \ * . * " " $ ( O <nl> < FunctionLevelLinking > true < / FunctionLevelLinking > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; NDEBUG ; _LIB ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; $ ( ProjectDir ) . . ; $ ( ProjectDir ) . . \ . . \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions \ LocalStorage ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions \ network ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ CocosDenshion \ include ; $ ( ProjectDir ) . . ; $ ( ProjectDir ) . . \ . . \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions \ LocalStorage ; $ ( ProjectDir ) . . \ . . \ . . \ . . \ extensions \ network ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < DisableSpecificWarnings > 4068 ; 4101 ; 4800 ; 4251 ; 4244 ; % ( DisableSpecificWarnings ) < / DisableSpecificWarnings > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < / ClCompile > <nl> mmm a / scripting / javascript / bindings / proj . win32 / libJSBinding . vcxproj . filters <nl> ppp b / scripting / javascript / bindings / proj . win32 / libJSBinding . vcxproj . filters <nl> <nl> < ClCompile Include = " . . \ js_bindings_system_registration . cpp " > <nl> < Filter > manual < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ generated \ jsb_cocos2dx_auto . cpp " > <nl> - < Filter > generated < / Filter > <nl> - < / ClCompile > <nl> - < ClCompile Include = " . . \ generated \ jsb_cocos2dx_extension_auto . cpp " > <nl> - < Filter > generated < / Filter > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ jsb_cocos2dx_extension_manual . cpp " > <nl> < Filter > manual < / Filter > <nl> < / ClCompile > <nl> <nl> < ClCompile Include = " . . \ jsb_websocket . cpp " > <nl> < Filter > manual < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_auto . cpp " > <nl> + < Filter > generated < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_extension_auto . cpp " > <nl> + < Filter > generated < / Filter > <nl> + < / ClCompile > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ClInclude Include = " . . \ cocos2d_specifics . hpp " > <nl> <nl> < ClInclude Include = " . . \ js_bindings_system_registration . h " > <nl> < Filter > manual < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " . . \ generated \ jsb_cocos2dx_auto . hpp " > <nl> - < Filter > generated < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " . . \ generated \ jsb_cocos2dx_extension_auto . hpp " > <nl> - < Filter > generated < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " . . \ jsb_cocos2dx_extension_manual . h " > <nl> < Filter > manual < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " . . \ jsb_helper . h " > <nl> < Filter > manual < / Filter > <nl> < / ClInclude > <nl> - < / ItemGroup > <nl> - < ItemGroup > <nl> - < None Include = " . . \ generated \ jsb_cocos2dx_extension_auto_api . js " > <nl> + < ClInclude Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_auto . hpp " > <nl> < Filter > generated < / Filter > <nl> - < / None > <nl> - < None Include = " . . \ generated \ jsb_cocos2dx_auto_api . js " > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_extension_auto . hpp " > <nl> < Filter > generated < / Filter > <nl> - < / None > <nl> + < / ClInclude > <nl> + < / ItemGroup > <nl> + < ItemGroup > <nl> < None Include = " . . \ js \ jsb . js " > <nl> < Filter > js < / Filter > <nl> < / None > <nl> <nl> < None Include = " . . \ js \ main . debug . js " > <nl> < Filter > js < / Filter > <nl> < / None > <nl> + < None Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_auto_api . js " > <nl> + < Filter > generated < / Filter > <nl> + < / None > <nl> + < None Include = " . . \ . . \ . . \ auto - generated \ js - bindings \ jsb_cocos2dx_extension_auto_api . js " > <nl> + < Filter > generated < / Filter > <nl> + < / None > <nl> < / ItemGroup > <nl> < / Project > <nl> \ No newline at end of file <nl> mmm a / scripting / lua / cocos2dx_support / CCLuaStack . cpp <nl> ppp b / scripting / lua / cocos2dx_support / CCLuaStack . cpp <nl> extern " C " { <nl> # include " tolua_fix . h " <nl> } <nl> <nl> - # include " LuaCocos2d . h " <nl> # include " Cocos2dxLuaLoader . h " <nl> <nl> # if ( CC_TARGET_PLATFORM = = CC_PLATFORM_IOS | | CC_TARGET_PLATFORM = = CC_PLATFORM_MAC ) <nl> deleted file mode 100644 <nl> index 7703975b3822 . . 000000000000 <nl> mmm a / scripting / lua / cocos2dx_support / LuaCocos2d . cpp . REMOVED . git - id <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - b301dd3607b8b0142ecf3fc016dd7dad2aa86094 <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index 5f45ab53ea25 . . 000000000000 <nl> mmm a / scripting / lua / cocos2dx_support / LuaCocos2d . h <nl> ppp / dev / null <nl> <nl> - # ifndef __LUACOCOS2D_H_ <nl> - # define __LUACOCOS2D_H_ <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - # include " tolua + + . h " <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - TOLUA_API int tolua_Cocos2d_open ( lua_State * tolua_S ) ; <nl> - <nl> - # endif / / __LUACOCOS2D_H_ <nl> deleted file mode 100644 <nl> index ba456b9a2db6 . . 000000000000 <nl> mmm a / scripting / lua / cocos2dx_support / generated / lua_cocos2dx_auto . cpp . REMOVED . git - id <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - 90eec5befefca388a591c3cf8dc10950588cec15 <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index 5dcc6b742c52 . . 000000000000 <nl> mmm a / scripting / lua / cocos2dx_support / generated / lua_cocos2dx_auto . hpp <nl> ppp / dev / null <nl> <nl> - # ifndef __cocos2dx_h__ <nl> - # define __cocos2dx_h__ <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - # include " tolua + + . h " <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - int register_all_cocos2dx ( lua_State * tolua_S ) ; <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - # endif / / __cocos2dx_h__ <nl> deleted file mode 100644 <nl> index 9fa10a1d50b2 . . 000000000000 <nl> mmm a / scripting / lua / cocos2dx_support / generated / lua_cocos2dx_auto_api . js . REMOVED . git - id <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - bc27ec5b64be9ac5530fd15fcc22cd8832504685 <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index 40c1f5360796 . . 000000000000 <nl> mmm a / scripting / lua / cocos2dx_support / generated / lua_cocos2dx_extension_auto . cpp . REMOVED . git - id <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - 0389c415199783d5bbcc1ee8882cc01220bc37f6 <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index a91e44ecea82 . . 000000000000 <nl> mmm a / scripting / lua / cocos2dx_support / generated / lua_cocos2dx_extension_auto . hpp <nl> ppp / dev / null <nl> <nl> - # ifndef __cocos2dx_extension_h__ <nl> - # define __cocos2dx_extension_h__ <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - # include " tolua + + . h " <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - int register_all_cocos2dx_extension ( lua_State * tolua_S ) ; <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - # endif / / __cocos2dx_extension_h__ <nl> deleted file mode 100644 <nl> index 5d80c436a656 . . 000000000000 <nl> mmm a / scripting / lua / cocos2dx_support / generated / lua_cocos2dx_extension_auto_api . js <nl> ppp / dev / null <nl> <nl> - / * * <nl> - * @ module cocos2dx_extension <nl> - * / <nl> - var cc = cc | | { } ; <nl> - <nl> - / * * <nl> - * @ class Control <nl> - * / <nl> - cc . Control = { <nl> - <nl> - / * * <nl> - * @ method setEnabled <nl> - * @ param { bool } <nl> - * / <nl> - setEnabled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getState <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : Control : : State " <nl> - * / <nl> - getState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isTouchInside <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Touch * } <nl> - * / <nl> - isTouchInside : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method sendActionsForControlEvents <nl> - * @ param { cocos2d : : extension : : Control : : EventType } <nl> - * / <nl> - sendActionsForControlEvents : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setSelected <nl> - * @ param { bool } <nl> - * / <nl> - setSelected : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method registerWithTouchDispatcher <nl> - * / <nl> - registerWithTouchDispatcher : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isEnabled <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isEnabled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setOpacityModifyRGB <nl> - * @ param { bool } <nl> - * / <nl> - setOpacityModifyRGB : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method needsLayout <nl> - * / <nl> - needsLayout : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method hasVisibleParents <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - hasVisibleParents : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isSelected <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isSelected : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method init <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - init : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setHighlighted <nl> - * @ param { bool } <nl> - * / <nl> - setHighlighted : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isOpacityModifyRGB <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isOpacityModifyRGB : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getTouchLocation <nl> - * @ return A value converted from C / C + + " cocos2d : : Point " <nl> - * @ param { cocos2d : : Touch * } <nl> - * / <nl> - getTouchLocation : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isHighlighted <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isHighlighted : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method create <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : Control * " <nl> - * / <nl> - create : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method Control <nl> - * @ constructor <nl> - * / <nl> - Control : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class CCBReader <nl> - * / <nl> - cc . _Reader = { <nl> - <nl> - / * * <nl> - * @ method addOwnerOutletName <nl> - * @ param { std : : string } <nl> - * / <nl> - addOwnerOutletName : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getOwnerCallbackNames <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getOwnerCallbackNames : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method addDocumentCallbackControlEvents <nl> - * @ param { cocos2d : : extension : : Control : : EventType } <nl> - * / <nl> - addDocumentCallbackControlEvents : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setCCBRootPath <nl> - * @ param { const char * } <nl> - * / <nl> - setCCBRootPath : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method addOwnerOutletNode <nl> - * @ param { cocos2d : : Node * } <nl> - * / <nl> - addOwnerOutletNode : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getOwnerCallbackNodes <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getOwnerCallbackNodes : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method readSoundKeyframesForSeq <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : extension : : CCBSequence * } <nl> - * / <nl> - readSoundKeyframesForSeq : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getCCBRootPath <nl> - * @ return A value converted from C / C + + " std : : string " <nl> - * / <nl> - getCCBRootPath : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getOwnerCallbackControlEvents <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getOwnerCallbackControlEvents : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getOwnerOutletNodes <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getOwnerOutletNodes : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method readUTF8 <nl> - * @ return A value converted from C / C + + " std : : string " <nl> - * / <nl> - readUTF8 : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method addOwnerCallbackControlEvents <nl> - * @ param { cocos2d : : extension : : Control : : EventType } <nl> - * / <nl> - addOwnerCallbackControlEvents : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getOwnerOutletNames <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getOwnerOutletNames : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setAnimationManager <nl> - * @ param { cocos2d : : extension : : CCBAnimationManager * } <nl> - * / <nl> - setAnimationManager : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method readCallbackKeyframesForSeq <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : extension : : CCBSequence * } <nl> - * / <nl> - readCallbackKeyframesForSeq : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getAnimationManagersForNodes <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getAnimationManagersForNodes : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getNodesWithAnimationManagers <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getNodesWithAnimationManagers : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getAnimationManager <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : CCBAnimationManager * " <nl> - * / <nl> - getAnimationManager : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setResolutionScale <nl> - * @ param { float } <nl> - * / <nl> - setResolutionScale : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class Scale9Sprite <nl> - * / <nl> - cc . Scale9Sprite = { <nl> - <nl> - / * * <nl> - * @ method resizableSpriteWithCapInsets <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : Scale9Sprite * " <nl> - * @ param { cocos2d : : Rect } <nl> - * / <nl> - resizableSpriteWithCapInsets : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setOpacityModifyRGB <nl> - * @ param { bool } <nl> - * / <nl> - setOpacityModifyRGB : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setContentSize <nl> - * @ param { cocos2d : : Size } <nl> - * / <nl> - setContentSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setInsetBottom <nl> - * @ param { float } <nl> - * / <nl> - setInsetBottom : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isOpacityModifyRGB <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isOpacityModifyRGB : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setOpacity <nl> - * @ param { unsigned char } <nl> - * / <nl> - setOpacity : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setInsetTop <nl> - * @ param { float } <nl> - * / <nl> - setInsetTop : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method updateDisplayedOpacity <nl> - * @ param { unsigned char } <nl> - * / <nl> - updateDisplayedOpacity : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method init <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - init : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setPreferredSize <nl> - * @ param { cocos2d : : Size } <nl> - * / <nl> - setPreferredSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getOpacity <nl> - * @ return A value converted from C / C + + " unsigned char " <nl> - * / <nl> - getOpacity : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setSpriteFrame <nl> - * @ param { cocos2d : : SpriteFrame * } <nl> - * / <nl> - setSpriteFrame : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getColor <nl> - * @ return A value converted from C / C + + " cocos2d : : Color3B " <nl> - * / <nl> - getColor : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getInsetBottom <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getInsetBottom : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getCapInsets <nl> - * @ return A value converted from C / C + + " cocos2d : : Rect " <nl> - * / <nl> - getCapInsets : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method updateWithBatchNode <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : SpriteBatchNode * } <nl> - * @ param { cocos2d : : Rect } <nl> - * @ param { bool } <nl> - * @ param { cocos2d : : Rect } <nl> - * / <nl> - updateWithBatchNode : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getInsetRight <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getInsetRight : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getOriginalSize <nl> - * @ return A value converted from C / C + + " cocos2d : : Size " <nl> - * / <nl> - getOriginalSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setColor <nl> - * @ param { cocos2d : : Color3B } <nl> - * / <nl> - setColor : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getInsetTop <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getInsetTop : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setInsetLeft <nl> - * @ param { float } <nl> - * / <nl> - setInsetLeft : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getPreferredSize <nl> - * @ return A value converted from C / C + + " cocos2d : : Size " <nl> - * / <nl> - getPreferredSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setCapInsets <nl> - * @ param { cocos2d : : Rect } <nl> - * / <nl> - setCapInsets : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getInsetLeft <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getInsetLeft : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method updateDisplayedColor <nl> - * @ param { cocos2d : : Color3B } <nl> - * / <nl> - updateDisplayedColor : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setInsetRight <nl> - * @ param { float } <nl> - * / <nl> - setInsetRight : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method Scale9Sprite <nl> - * @ constructor <nl> - * / <nl> - Scale9Sprite : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class ControlButton <nl> - * / <nl> - cc . ControlButton = { <nl> - <nl> - / * * <nl> - * @ method setTitleColorDispatchTable <nl> - * @ param { cocos2d : : Dictionary * } <nl> - * / <nl> - setTitleColorDispatchTable : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isPushed <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isPushed : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setSelected <nl> - * @ param { bool } <nl> - * / <nl> - setSelected : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setTitleLabelForState <nl> - * @ param { cocos2d : : Node * } <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - setTitleLabelForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchBegan <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchBegan : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setAdjustBackgroundImage <nl> - * @ param { bool } <nl> - * / <nl> - setAdjustBackgroundImage : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchEnded <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchEnded : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setHighlighted <nl> - * @ param { bool } <nl> - * / <nl> - setHighlighted : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setZoomOnTouchDown <nl> - * @ param { bool } <nl> - * / <nl> - setZoomOnTouchDown : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setBackgroundSpriteDispatchTable <nl> - * @ param { cocos2d : : Dictionary * } <nl> - * / <nl> - setBackgroundSpriteDispatchTable : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setTitleForState <nl> - * @ param { cocos2d : : String * } <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - setTitleForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getTitleDispatchTable <nl> - * @ return A value converted from C / C + + " cocos2d : : Dictionary * " <nl> - * / <nl> - getTitleDispatchTable : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setLabelAnchorPoint <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - setLabelAnchorPoint : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getPreferredSize <nl> - * @ return A value converted from C / C + + " cocos2d : : Size " <nl> - * / <nl> - getPreferredSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getLabelAnchorPoint <nl> - * @ return A value converted from C / C + + " cocos2d : : Point " <nl> - * / <nl> - getLabelAnchorPoint : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method initWithBackgroundSprite <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : extension : : Scale9Sprite * } <nl> - * / <nl> - initWithBackgroundSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getTitleTTFSizeForState <nl> - * @ return A value converted from C / C + + " float " <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - getTitleTTFSizeForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setTitleDispatchTable <nl> - * @ param { cocos2d : : Dictionary * } <nl> - * / <nl> - setTitleDispatchTable : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setOpacity <nl> - * @ param { unsigned char } <nl> - * / <nl> - setOpacity : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method init <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - init : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setTitleTTFForState <nl> - * @ param { const char * } <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - setTitleTTFForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setTitleTTFSizeForState <nl> - * @ param { float } <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - setTitleTTFSizeForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setTitleLabel <nl> - * @ param { cocos2d : : Node * } <nl> - * / <nl> - setTitleLabel : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchMoved <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchMoved : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getOpacity <nl> - * @ return A value converted from C / C + + " unsigned char " <nl> - * / <nl> - getOpacity : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getCurrentTitleColor <nl> - * @ return A value converted from C / C + + " cocos2d : : Color3B " <nl> - * / <nl> - getCurrentTitleColor : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getTitleColorDispatchTable <nl> - * @ return A value converted from C / C + + " cocos2d : : Dictionary * " <nl> - * / <nl> - getTitleColorDispatchTable : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setEnabled <nl> - * @ param { bool } <nl> - * / <nl> - setEnabled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setBackgroundSprite <nl> - * @ param { cocos2d : : extension : : Scale9Sprite * } <nl> - * / <nl> - setBackgroundSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getBackgroundSpriteForState <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : Scale9Sprite * " <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - getBackgroundSpriteForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getColor <nl> - * @ return A value converted from C / C + + " cocos2d : : Color3B " <nl> - * / <nl> - getColor : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setMargins <nl> - * @ param { int } <nl> - * @ param { int } <nl> - * / <nl> - setMargins : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method needsLayout <nl> - * / <nl> - needsLayout : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method initWithTitleAndFontNameAndFontSize <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { std : : string } <nl> - * @ param { const char * } <nl> - * @ param { float } <nl> - * / <nl> - initWithTitleAndFontNameAndFontSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getCurrentTitle <nl> - * @ return A value converted from C / C + + " cocos2d : : String * " <nl> - * / <nl> - getCurrentTitle : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getHorizontalOrigin <nl> - * @ return A value converted from C / C + + " int " <nl> - * / <nl> - getHorizontalOrigin : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getTitleTTFForState <nl> - * @ return A value converted from C / C + + " const char * " <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - getTitleTTFForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getBackgroundSprite <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : Scale9Sprite * " <nl> - * / <nl> - getBackgroundSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getTitleColorForState <nl> - * @ return A value converted from C / C + + " cocos2d : : Color3B " <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - getTitleColorForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setTitleColorForState <nl> - * @ param { cocos2d : : Color3B } <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - setTitleColorForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method doesAdjustBackgroundImage <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - doesAdjustBackgroundImage : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setBackgroundSpriteFrameForState <nl> - * @ param { cocos2d : : SpriteFrame * } <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - setBackgroundSpriteFrameForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setBackgroundSpriteForState <nl> - * @ param { cocos2d : : extension : : Scale9Sprite * } <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - setBackgroundSpriteForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setColor <nl> - * @ param { cocos2d : : Color3B } <nl> - * / <nl> - setColor : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getTitleLabelDispatchTable <nl> - * @ return A value converted from C / C + + " cocos2d : : Dictionary * " <nl> - * / <nl> - getTitleLabelDispatchTable : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method initWithLabelAndBackgroundSprite <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Node * } <nl> - * @ param { cocos2d : : extension : : Scale9Sprite * } <nl> - * / <nl> - initWithLabelAndBackgroundSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setPreferredSize <nl> - * @ param { cocos2d : : Size } <nl> - * / <nl> - setPreferredSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setTitleLabelDispatchTable <nl> - * @ param { cocos2d : : Dictionary * } <nl> - * / <nl> - setTitleLabelDispatchTable : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getTitleLabel <nl> - * @ return A value converted from C / C + + " cocos2d : : Node * " <nl> - * / <nl> - getTitleLabel : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchCancelled <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchCancelled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getVerticalMargin <nl> - * @ return A value converted from C / C + + " int " <nl> - * / <nl> - getVerticalMargin : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getBackgroundSpriteDispatchTable <nl> - * @ return A value converted from C / C + + " cocos2d : : Dictionary * " <nl> - * / <nl> - getBackgroundSpriteDispatchTable : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getTitleLabelForState <nl> - * @ return A value converted from C / C + + " cocos2d : : Node * " <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - getTitleLabelForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setTitleBMFontForState <nl> - * @ param { const char * } <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - setTitleBMFontForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getTitleBMFontForState <nl> - * @ return A value converted from C / C + + " const char * " <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - getTitleBMFontForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getZoomOnTouchDown <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - getZoomOnTouchDown : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getTitleForState <nl> - * @ return A value converted from C / C + + " cocos2d : : String * " <nl> - * @ param { cocos2d : : extension : : Control : : State } <nl> - * / <nl> - getTitleForState : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ControlButton <nl> - * @ constructor <nl> - * / <nl> - ControlButton : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class ScrollView <nl> - * / <nl> - cc . ScrollView = { <nl> - <nl> - / * * <nl> - * @ method isClippingToBounds <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isClippingToBounds : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setContainer <nl> - * @ param { cocos2d : : Node * } <nl> - * / <nl> - setContainer : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setContentOffsetInDuration <nl> - * @ param { cocos2d : : Point } <nl> - * @ param { float } <nl> - * / <nl> - setContentOffsetInDuration : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setZoomScaleInDuration <nl> - * @ param { float } <nl> - * @ param { float } <nl> - * / <nl> - setZoomScaleInDuration : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchBegan <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchBegan : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getContainer <nl> - * @ return A value converted from C / C + + " cocos2d : : Node * " <nl> - * / <nl> - getContainer : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchEnded <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchEnded : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getDirection <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : ScrollView : : Direction " <nl> - * / <nl> - getDirection : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getZoomScale <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getZoomScale : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method updateInset <nl> - * / <nl> - updateInset : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method initWithViewSize <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Size } <nl> - * @ param { cocos2d : : Node * } <nl> - * / <nl> - initWithViewSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method pause <nl> - * @ param { cocos2d : : Object * } <nl> - * / <nl> - pause : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setDirection <nl> - * @ param { cocos2d : : extension : : ScrollView : : Direction } <nl> - * / <nl> - setDirection : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setBounceable <nl> - * @ param { bool } <nl> - * / <nl> - setBounceable : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setContentOffset <nl> - * @ param { cocos2d : : Point } <nl> - * @ param { bool } <nl> - * / <nl> - setContentOffset : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isDragging <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isDragging : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method init <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - init : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isBounceable <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isBounceable : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getContentSize <nl> - * @ return A value converted from C / C + + " cocos2d : : Size " <nl> - * / <nl> - getContentSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchMoved <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchMoved : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setTouchEnabled <nl> - * @ param { bool } <nl> - * / <nl> - setTouchEnabled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getContentOffset <nl> - * @ return A value converted from C / C + + " cocos2d : : Point " <nl> - * / <nl> - getContentOffset : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method resume <nl> - * @ param { cocos2d : : Object * } <nl> - * / <nl> - resume : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setClippingToBounds <nl> - * @ param { bool } <nl> - * / <nl> - setClippingToBounds : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setViewSize <nl> - * @ param { cocos2d : : Size } <nl> - * / <nl> - setViewSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getViewSize <nl> - * @ return A value converted from C / C + + " cocos2d : : Size " <nl> - * / <nl> - getViewSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method maxContainerOffset <nl> - * @ return A value converted from C / C + + " cocos2d : : Point " <nl> - * / <nl> - maxContainerOffset : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setContentSize <nl> - * @ param { cocos2d : : Size } <nl> - * / <nl> - setContentSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isTouchMoved <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isTouchMoved : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isNodeVisible <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Node * } <nl> - * / <nl> - isNodeVisible : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchCancelled <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchCancelled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method minContainerOffset <nl> - * @ return A value converted from C / C + + " cocos2d : : Point " <nl> - * / <nl> - minContainerOffset : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method registerWithTouchDispatcher <nl> - * / <nl> - registerWithTouchDispatcher : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ScrollView <nl> - * @ constructor <nl> - * / <nl> - ScrollView : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class CCBAnimationManager <nl> - * / <nl> - cc . AnimationManager = { <nl> - <nl> - / * * <nl> - * @ method moveAnimationsFromNode <nl> - * @ param { cocos2d : : Node * } <nl> - * @ param { cocos2d : : Node * } <nl> - * / <nl> - moveAnimationsFromNode : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setAutoPlaySequenceId <nl> - * @ param { int } <nl> - * / <nl> - setAutoPlaySequenceId : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getDocumentCallbackNames <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getDocumentCallbackNames : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method actionForSoundChannel <nl> - * @ return A value converted from C / C + + " cocos2d : : Object * " <nl> - * @ param { cocos2d : : extension : : CCBSequenceProperty * } <nl> - * / <nl> - actionForSoundChannel : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setBaseValue <nl> - * @ param { cocos2d : : Object * } <nl> - * @ param { cocos2d : : Node * } <nl> - * @ param { const char * } <nl> - * / <nl> - setBaseValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getDocumentOutletNodes <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getDocumentOutletNodes : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method addNode <nl> - * @ param { cocos2d : : Node * } <nl> - * @ param { cocos2d : : Dictionary * } <nl> - * / <nl> - addNode : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getLastCompletedSequenceName <nl> - * @ return A value converted from C / C + + " std : : string " <nl> - * / <nl> - getLastCompletedSequenceName : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setRootNode <nl> - * @ param { cocos2d : : Node * } <nl> - * / <nl> - setRootNode : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method runAnimationsForSequenceNamedTweenDuration <nl> - * @ param { const char * } <nl> - * @ param { float } <nl> - * / <nl> - runAnimationsForSequenceNamedTweenDuration : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method addDocumentOutletName <nl> - * @ param { std : : string } <nl> - * / <nl> - addDocumentOutletName : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getSequences <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getSequences : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getRootContainerSize <nl> - * @ return A value converted from C / C + + " cocos2d : : Size " <nl> - * / <nl> - getRootContainerSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setDocumentControllerName <nl> - * @ param { std : : string } <nl> - * / <nl> - setDocumentControllerName : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getContainerSize <nl> - * @ return A value converted from C / C + + " cocos2d : : Size " <nl> - * @ param { cocos2d : : Node * } <nl> - * / <nl> - getContainerSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method actionForCallbackChannel <nl> - * @ return A value converted from C / C + + " cocos2d : : Object * " <nl> - * @ param { cocos2d : : extension : : CCBSequenceProperty * } <nl> - * / <nl> - actionForCallbackChannel : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getDocumentOutletNames <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getDocumentOutletNames : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method addDocumentCallbackControlEvents <nl> - * @ param { cocos2d : : extension : : Control : : EventType } <nl> - * / <nl> - addDocumentCallbackControlEvents : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method init <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - init : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getKeyframeCallbacks <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getKeyframeCallbacks : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getDocumentCallbackControlEvents <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getDocumentCallbackControlEvents : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setRootContainerSize <nl> - * @ param { cocos2d : : Size } <nl> - * / <nl> - setRootContainerSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method runAnimationsForSequenceIdTweenDuration <nl> - * @ param { int } <nl> - * @ param { float } <nl> - * / <nl> - runAnimationsForSequenceIdTweenDuration : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getRunningSequenceName <nl> - * @ return A value converted from C / C + + " const char * " <nl> - * / <nl> - getRunningSequenceName : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getAutoPlaySequenceId <nl> - * @ return A value converted from C / C + + " int " <nl> - * / <nl> - getAutoPlaySequenceId : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method addDocumentCallbackName <nl> - * @ param { std : : string } <nl> - * / <nl> - addDocumentCallbackName : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getRootNode <nl> - * @ return A value converted from C / C + + " cocos2d : : Node * " <nl> - * / <nl> - getRootNode : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method addDocumentOutletNode <nl> - * @ param { cocos2d : : Node * } <nl> - * / <nl> - addDocumentOutletNode : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getSequenceDuration <nl> - * @ return A value converted from C / C + + " float " <nl> - * @ param { const char * } <nl> - * / <nl> - getSequenceDuration : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method addDocumentCallbackNode <nl> - * @ param { cocos2d : : Node * } <nl> - * / <nl> - addDocumentCallbackNode : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method runAnimationsForSequenceNamed <nl> - * @ param { const char * } <nl> - * / <nl> - runAnimationsForSequenceNamed : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getSequenceId <nl> - * @ return A value converted from C / C + + " int " <nl> - * @ param { const char * } <nl> - * / <nl> - getSequenceId : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getDocumentCallbackNodes <nl> - * @ return A value converted from C / C + + " cocos2d : : Array * " <nl> - * / <nl> - getDocumentCallbackNodes : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setSequences <nl> - * @ param { cocos2d : : Array * } <nl> - * / <nl> - setSequences : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method debug <nl> - * / <nl> - debug : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getDocumentControllerName <nl> - * @ return A value converted from C / C + + " std : : string " <nl> - * / <nl> - getDocumentControllerName : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method CCBAnimationManager <nl> - * @ constructor <nl> - * / <nl> - CCBAnimationManager : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class ControlHuePicker <nl> - * / <nl> - cc . ControlHuePicker = { <nl> - <nl> - / * * <nl> - * @ method setEnabled <nl> - * @ param { bool } <nl> - * / <nl> - setEnabled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method initWithTargetAndPos <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Node * } <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - initWithTargetAndPos : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setHue <nl> - * @ param { float } <nl> - * / <nl> - setHue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getStartPos <nl> - * @ return A value converted from C / C + + " cocos2d : : Point " <nl> - * / <nl> - getStartPos : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getHue <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getHue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchBegan <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchBegan : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setBackground <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - setBackground : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setHuePercentage <nl> - * @ param { float } <nl> - * / <nl> - setHuePercentage : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getBackground <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getBackground : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchMoved <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchMoved : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getSlider <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getSlider : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getHuePercentage <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getHuePercentage : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setSlider <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - setSlider : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method create <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : ControlHuePicker * " <nl> - * @ param { cocos2d : : Node * } <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - create : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ControlHuePicker <nl> - * @ constructor <nl> - * / <nl> - ControlHuePicker : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class ControlSaturationBrightnessPicker <nl> - * / <nl> - cc . ControlSaturationBrightnessPicker = { <nl> - <nl> - / * * <nl> - * @ method getShadow <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getShadow : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method initWithTargetAndPos <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Node * } <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - initWithTargetAndPos : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getStartPos <nl> - * @ return A value converted from C / C + + " cocos2d : : Point " <nl> - * / <nl> - getStartPos : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getOverlay <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getOverlay : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setEnabled <nl> - * @ param { bool } <nl> - * / <nl> - setEnabled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getSlider <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getSlider : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getBackground <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getBackground : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getSaturation <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getSaturation : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getBrightness <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getBrightness : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method create <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : ControlSaturationBrightnessPicker * " <nl> - * @ param { cocos2d : : Node * } <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - create : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ControlSaturationBrightnessPicker <nl> - * @ constructor <nl> - * / <nl> - ControlSaturationBrightnessPicker : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class ControlColourPicker <nl> - * / <nl> - cc . ControlColourPicker = { <nl> - <nl> - / * * <nl> - * @ method setEnabled <nl> - * @ param { bool } <nl> - * / <nl> - setEnabled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getHuePicker <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : ControlHuePicker * " <nl> - * / <nl> - getHuePicker : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setColor <nl> - * @ param { cocos2d : : Color3B } <nl> - * / <nl> - setColor : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method hueSliderValueChanged <nl> - * @ param { cocos2d : : Object * } <nl> - * @ param { cocos2d : : extension : : Control : : EventType } <nl> - * / <nl> - hueSliderValueChanged : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getcolourPicker <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : ControlSaturationBrightnessPicker * " <nl> - * / <nl> - getcolourPicker : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setBackground <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - setBackground : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method init <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - init : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setcolourPicker <nl> - * @ param { cocos2d : : extension : : ControlSaturationBrightnessPicker * } <nl> - * / <nl> - setcolourPicker : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method colourSliderValueChanged <nl> - * @ param { cocos2d : : Object * } <nl> - * @ param { cocos2d : : extension : : Control : : EventType } <nl> - * / <nl> - colourSliderValueChanged : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setHuePicker <nl> - * @ param { cocos2d : : extension : : ControlHuePicker * } <nl> - * / <nl> - setHuePicker : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getBackground <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getBackground : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method create <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : ControlColourPicker * " <nl> - * / <nl> - create : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ControlColourPicker <nl> - * @ constructor <nl> - * / <nl> - ControlColourPicker : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class ControlPotentiometer <nl> - * / <nl> - cc . ControlPotentiometer = { <nl> - <nl> - / * * <nl> - * @ method setPreviousLocation <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - setPreviousLocation : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setProgressTimer <nl> - * @ param { cocos2d : : ProgressTimer * } <nl> - * / <nl> - setProgressTimer : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method potentiometerMoved <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - potentiometerMoved : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchEnded <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchEnded : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getMinimumValue <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getMinimumValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setThumbSprite <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - setThumbSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchMoved <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchMoved : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchBegan <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchBegan : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setEnabled <nl> - * @ param { bool } <nl> - * / <nl> - setEnabled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setValue <nl> - * @ param { float } <nl> - * / <nl> - setValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setMaximumValue <nl> - * @ param { float } <nl> - * / <nl> - setMaximumValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setMinimumValue <nl> - * @ param { float } <nl> - * / <nl> - setMinimumValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method potentiometerEnded <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - potentiometerEnded : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method distanceBetweenPointAndPoint <nl> - * @ return A value converted from C / C + + " float " <nl> - * @ param { cocos2d : : Point } <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - distanceBetweenPointAndPoint : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getProgressTimer <nl> - * @ return A value converted from C / C + + " cocos2d : : ProgressTimer * " <nl> - * / <nl> - getProgressTimer : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getMaximumValue <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getMaximumValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint <nl> - * @ return A value converted from C / C + + " float " <nl> - * @ param { cocos2d : : Point } <nl> - * @ param { cocos2d : : Point } <nl> - * @ param { cocos2d : : Point } <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isTouchInside <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Touch * } <nl> - * / <nl> - isTouchInside : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getValue <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method potentiometerBegan <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - potentiometerBegan : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getThumbSprite <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getThumbSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method initWithTrackSprite_ProgressTimer_ThumbSprite <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Sprite * } <nl> - * @ param { cocos2d : : ProgressTimer * } <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - initWithTrackSprite_ProgressTimer_ThumbSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getPreviousLocation <nl> - * @ return A value converted from C / C + + " cocos2d : : Point " <nl> - * / <nl> - getPreviousLocation : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method create <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : ControlPotentiometer * " <nl> - * @ param { const char * } <nl> - * @ param { const char * } <nl> - * @ param { const char * } <nl> - * / <nl> - create : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ControlPotentiometer <nl> - * @ constructor <nl> - * / <nl> - ControlPotentiometer : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class ControlSlider <nl> - * / <nl> - cc . ControlSlider = { <nl> - <nl> - / * * <nl> - * @ method locationFromTouch <nl> - * @ return A value converted from C / C + + " cocos2d : : Point " <nl> - * @ param { cocos2d : : Touch * } <nl> - * / <nl> - locationFromTouch : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setProgressSprite <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - setProgressSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getMaximumAllowedValue <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getMaximumAllowedValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getMinimumAllowedValue <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getMinimumAllowedValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getMinimumValue <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getMinimumValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setThumbSprite <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - setThumbSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setMinimumValue <nl> - * @ param { float } <nl> - * / <nl> - setMinimumValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setMinimumAllowedValue <nl> - * @ param { float } <nl> - * / <nl> - setMinimumAllowedValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setEnabled <nl> - * @ param { bool } <nl> - * / <nl> - setEnabled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setValue <nl> - * @ param { float } <nl> - * / <nl> - setValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setMaximumValue <nl> - * @ param { float } <nl> - * / <nl> - setMaximumValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method needsLayout <nl> - * / <nl> - needsLayout : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getBackgroundSprite <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getBackgroundSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method initWithSprites <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Sprite * } <nl> - * @ param { cocos2d : : Sprite * } <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - initWithSprites : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getMaximumValue <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getMaximumValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isTouchInside <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Touch * } <nl> - * / <nl> - isTouchInside : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getValue <nl> - * @ return A value converted from C / C + + " float " <nl> - * / <nl> - getValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getThumbSprite <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getThumbSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getProgressSprite <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getProgressSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setBackgroundSprite <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - setBackgroundSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setMaximumAllowedValue <nl> - * @ param { float } <nl> - * / <nl> - setMaximumAllowedValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ControlSlider <nl> - * @ constructor <nl> - * / <nl> - ControlSlider : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class ControlStepper <nl> - * / <nl> - cc . ControlStepper = { <nl> - <nl> - / * * <nl> - * @ method setMinusSprite <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - setMinusSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchBegan <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchBegan : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getMinusLabel <nl> - * @ return A value converted from C / C + + " cocos2d : : LabelTTF * " <nl> - * / <nl> - getMinusLabel : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setWraps <nl> - * @ param { bool } <nl> - * / <nl> - setWraps : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchEnded <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchEnded : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isContinuous <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isContinuous : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getMinusSprite <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getMinusSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method updateLayoutUsingTouchLocation <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - updateLayoutUsingTouchLocation : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setValueWithSendingEvent <nl> - * @ param { double } <nl> - * @ param { bool } <nl> - * / <nl> - setValueWithSendingEvent : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getPlusLabel <nl> - * @ return A value converted from C / C + + " cocos2d : : LabelTTF * " <nl> - * / <nl> - getPlusLabel : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method stopAutorepeat <nl> - * / <nl> - stopAutorepeat : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchMoved <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchMoved : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setMaximumValue <nl> - * @ param { double } <nl> - * / <nl> - setMaximumValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setPlusSprite <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - setPlusSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setMinusLabel <nl> - * @ param { cocos2d : : LabelTTF * } <nl> - * / <nl> - setMinusLabel : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setValue <nl> - * @ param { double } <nl> - * / <nl> - setValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setStepValue <nl> - * @ param { double } <nl> - * / <nl> - setStepValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getPlusSprite <nl> - * @ return A value converted from C / C + + " cocos2d : : Sprite * " <nl> - * / <nl> - getPlusSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method update <nl> - * @ param { float } <nl> - * / <nl> - update : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setMinimumValue <nl> - * @ param { double } <nl> - * / <nl> - setMinimumValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method startAutorepeat <nl> - * / <nl> - startAutorepeat : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method initWithMinusSpriteAndPlusSprite <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Sprite * } <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - initWithMinusSpriteAndPlusSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getValue <nl> - * @ return A value converted from C / C + + " double " <nl> - * / <nl> - getValue : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setPlusLabel <nl> - * @ param { cocos2d : : LabelTTF * } <nl> - * / <nl> - setPlusLabel : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method create <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : ControlStepper * " <nl> - * @ param { cocos2d : : Sprite * } <nl> - * @ param { cocos2d : : Sprite * } <nl> - * / <nl> - create : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ControlStepper <nl> - * @ constructor <nl> - * / <nl> - ControlStepper : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class ControlSwitch <nl> - * / <nl> - cc . ControlSwitch = { <nl> - <nl> - / * * <nl> - * @ method setEnabled <nl> - * @ param { bool } <nl> - * / <nl> - setEnabled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchBegan <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchBegan : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method isOn <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - isOn : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchCancelled <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchCancelled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchEnded <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchEnded : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchMoved <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchMoved : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method hasMoved <nl> - * @ return A value converted from C / C + + " bool " <nl> - * / <nl> - hasMoved : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method locationFromTouch <nl> - * @ return A value converted from C / C + + " cocos2d : : Point " <nl> - * @ param { cocos2d : : Touch * } <nl> - * / <nl> - locationFromTouch : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ControlSwitch <nl> - * @ constructor <nl> - * / <nl> - ControlSwitch : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class TableViewCell <nl> - * / <nl> - cc . TableViewCell = { <nl> - <nl> - / * * <nl> - * @ method reset <nl> - * / <nl> - reset : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setIdx <nl> - * @ param { unsigned int } <nl> - * / <nl> - setIdx : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setObjectID <nl> - * @ param { unsigned int } <nl> - * / <nl> - setObjectID : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getObjectID <nl> - * @ return A value converted from C / C + + " unsigned int " <nl> - * / <nl> - getObjectID : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getIdx <nl> - * @ return A value converted from C / C + + " unsigned int " <nl> - * / <nl> - getIdx : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method TableViewCell <nl> - * @ constructor <nl> - * / <nl> - TableViewCell : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class TableView <nl> - * / <nl> - cc . TableView = { <nl> - <nl> - / * * <nl> - * @ method updateCellAtIndex <nl> - * @ param { unsigned int } <nl> - * / <nl> - updateCellAtIndex : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setVerticalFillOrder <nl> - * @ param { cocos2d : : extension : : TableView : : VerticalFillOrder } <nl> - * / <nl> - setVerticalFillOrder : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method scrollViewDidZoom <nl> - * @ param { cocos2d : : extension : : ScrollView * } <nl> - * / <nl> - scrollViewDidZoom : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchBegan <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchBegan : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getVerticalFillOrder <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : TableView : : VerticalFillOrder " <nl> - * / <nl> - getVerticalFillOrder : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method removeCellAtIndex <nl> - * @ param { unsigned int } <nl> - * / <nl> - removeCellAtIndex : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method initWithViewSize <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Size } <nl> - * @ param { cocos2d : : Node * } <nl> - * / <nl> - initWithViewSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method scrollViewDidScroll <nl> - * @ param { cocos2d : : extension : : ScrollView * } <nl> - * / <nl> - scrollViewDidScroll : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method reloadData <nl> - * / <nl> - reloadData : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchCancelled <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchCancelled : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchEnded <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchEnded : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method ccTouchMoved <nl> - * @ param { cocos2d : : Touch * } <nl> - * @ param { cocos2d : : Event * } <nl> - * / <nl> - ccTouchMoved : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method _updateContentSize <nl> - * / <nl> - _updateContentSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method insertCellAtIndex <nl> - * @ param { unsigned int } <nl> - * / <nl> - insertCellAtIndex : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method cellAtIndex <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : TableViewCell * " <nl> - * @ param { unsigned int } <nl> - * / <nl> - cellAtIndex : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method dequeueCell <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : TableViewCell * " <nl> - * / <nl> - dequeueCell : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method TableView <nl> - * @ constructor <nl> - * / <nl> - TableView : function ( ) { } , <nl> - <nl> - } ; <nl> - <nl> - / * * <nl> - * @ class EditBox <nl> - * / <nl> - cc . EditBox = { <nl> - <nl> - / * * <nl> - * @ method setAnchorPoint <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - setAnchorPoint : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getText <nl> - * @ return A value converted from C / C + + " const char * " <nl> - * / <nl> - getText : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setPlaceholderFontName <nl> - * @ param { const char * } <nl> - * / <nl> - setPlaceholderFontName : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getPlaceHolder <nl> - * @ return A value converted from C / C + + " const char * " <nl> - * / <nl> - getPlaceHolder : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setFontName <nl> - * @ param { const char * } <nl> - * / <nl> - setFontName : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setPlaceholderFontSize <nl> - * @ param { int } <nl> - * / <nl> - setPlaceholderFontSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setInputMode <nl> - * @ param { cocos2d : : extension : : EditBox : : InputMode } <nl> - * / <nl> - setInputMode : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setPlaceholderFontColor <nl> - * @ param { cocos2d : : Color3B } <nl> - * / <nl> - setPlaceholderFontColor : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setFontColor <nl> - * @ param { cocos2d : : Color3B } <nl> - * / <nl> - setFontColor : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setPlaceholderFont <nl> - * @ param { const char * } <nl> - * @ param { int } <nl> - * / <nl> - setPlaceholderFont : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setFontSize <nl> - * @ param { int } <nl> - * / <nl> - setFontSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method initWithSizeAndBackgroundSprite <nl> - * @ return A value converted from C / C + + " bool " <nl> - * @ param { cocos2d : : Size } <nl> - * @ param { cocos2d : : extension : : Scale9Sprite * } <nl> - * / <nl> - initWithSizeAndBackgroundSprite : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setPlaceHolder <nl> - * @ param { const char * } <nl> - * / <nl> - setPlaceHolder : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setPosition <nl> - * @ param { cocos2d : : Point } <nl> - * / <nl> - setPosition : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setReturnType <nl> - * @ param { cocos2d : : extension : : EditBox : : KeyboardReturnType } <nl> - * / <nl> - setReturnType : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setInputFlag <nl> - * @ param { cocos2d : : extension : : EditBox : : InputFlag } <nl> - * / <nl> - setInputFlag : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method getMaxLength <nl> - * @ return A value converted from C / C + + " int " <nl> - * / <nl> - getMaxLength : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setText <nl> - * @ param { const char * } <nl> - * / <nl> - setText : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setMaxLength <nl> - * @ param { int } <nl> - * / <nl> - setMaxLength : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setContentSize <nl> - * @ param { cocos2d : : Size } <nl> - * / <nl> - setContentSize : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setFont <nl> - * @ param { const char * } <nl> - * @ param { int } <nl> - * / <nl> - setFont : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method setVisible <nl> - * @ param { bool } <nl> - * / <nl> - setVisible : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method create <nl> - * @ return A value converted from C / C + + " cocos2d : : extension : : EditBox * " <nl> - * @ param { cocos2d : : Size } <nl> - * @ param { cocos2d : : extension : : Scale9Sprite * } <nl> - * @ param { cocos2d : : extension : : Scale9Sprite * } <nl> - * @ param { cocos2d : : extension : : Scale9Sprite * } <nl> - * / <nl> - create : function ( ) { } , <nl> - <nl> - / * * <nl> - * @ method EditBox <nl> - * @ constructor <nl> - * / <nl> - EditBox : function ( ) { } , <nl> - <nl> - } ; <nl> mmm a / scripting / lua / proj . android / Android . mk <nl> ppp b / scripting / lua / proj . android / Android . mk <nl> LOCAL_SRC_FILES : = . . / cocos2dx_support / CCLuaBridge . cpp \ <nl> . . / cocos2dx_support / CCLuaStack . cpp \ <nl> . . / cocos2dx_support / CCLuaValue . cpp \ <nl> . . / cocos2dx_support / Cocos2dxLuaLoader . cpp \ <nl> - . . / cocos2dx_support / LuaCocos2d . cpp \ <nl> . . / cocos2dx_support / CCBProxy . cpp \ <nl> . . / cocos2dx_support / Lua_extensions_CCB . cpp \ <nl> . . / cocos2dx_support / Lua_web_socket . cpp \ <nl> LOCAL_SRC_FILES : = . . / cocos2dx_support / CCLuaBridge . cpp \ <nl> . . / cocos2dx_support / LuaScrollView . cpp \ <nl> . . / cocos2dx_support / LuaScriptHandlerMgr . cpp \ <nl> . . / cocos2dx_support / LuaBasicConversions . cpp \ <nl> - . . / cocos2dx_support / generated / lua_cocos2dx_auto . cpp \ <nl> - . . / cocos2dx_support / generated / lua_cocos2dx_extension_auto . cpp \ <nl> + . . / . . / auto - generated / lua - bindings / lua_cocos2dx_auto . cpp \ <nl> + . . / . . / auto - generated / lua - bindings / lua_cocos2dx_extension_auto . cpp \ <nl> . . / cocos2dx_support / lua_cocos2dx_manual . cpp \ <nl> . . / cocos2dx_support / lua_cocos2dx_extension_manual . cpp \ <nl> . . / cocos2dx_support / lua_cocos2dx_deprecated . cpp \ <nl> LOCAL_SRC_FILES : = . . / cocos2dx_support / CCLuaBridge . cpp \ <nl> . . / tolua / tolua_push . c \ <nl> . . / tolua / tolua_to . c \ <nl> . . / cocos2dx_support / tolua_fix . c <nl> - <nl> + <nl> LOCAL_EXPORT_C_INCLUDES : = $ ( LOCAL_PATH ) / . . / luajit / include \ <nl> $ ( LOCAL_PATH ) / . . / tolua \ <nl> - $ ( LOCAL_PATH ) / . . / cocos2dx_support <nl> - <nl> - <nl> + $ ( LOCAL_PATH ) / . . / cocos2dx_support \ <nl> + $ ( LOCAL_PATH ) / . . / . . / auto - generated / lua - bindings <nl> + <nl> + <nl> LOCAL_C_INCLUDES : = $ ( LOCAL_PATH ) / \ <nl> $ ( LOCAL_PATH ) / . . / luajit / include \ <nl> $ ( LOCAL_PATH ) / . . / tolua \ <nl> LOCAL_C_INCLUDES : = $ ( LOCAL_PATH ) / \ <nl> $ ( LOCAL_PATH ) / . . / . . / . . / CocosDenshion / include \ <nl> $ ( LOCAL_PATH ) / . . / . . / . . / extensions \ <nl> $ ( LOCAL_PATH ) / . . / cocos2dx_support \ <nl> - $ ( LOCAL_PATH ) / . . / cocos2dx_support / generated <nl> + $ ( LOCAL_PATH ) / . . / . . / auto - generated / lua - bindings <nl> <nl> <nl> LOCAL_WHOLE_STATIC_LIBRARIES : = luajit_static <nl> mmm a / scripting / lua / proj . emscripten / Makefile <nl> ppp b / scripting / lua / proj . emscripten / Makefile <nl> <nl> TARGET = liblua . so <nl> <nl> - INCLUDES + = - I . . - I . . / lua - I . . / tolua - I . . / cocos2dx_support - I . . / cocos2dx_support / generated \ <nl> + INCLUDES + = - I . . - I . . / lua - I . . / tolua - I . . / cocos2dx_support - I . . / . . / auto - generated / lua - bindings \ <nl> - I . . / Classes - I . . / . . / . . / CocosDenshion / include - I . . / . . / . . / extensions <nl> <nl> - SOURCES = . . / lua / lapi . o \ <nl> + SOURCES = . . / lua / lapi . c \ <nl> . . / lua / lauxlib . c \ <nl> . . / lua / lbaselib . c \ <nl> . . / lua / lcode . c \ <nl> SOURCES = . . / lua / lapi . o \ <nl> . . / tolua / tolua_push . c \ <nl> . . / tolua / tolua_to . c \ <nl> . . / cocos2dx_support / tolua_fix . c \ <nl> + . . / . . / auto - generated / lua - bindings / lua_cocos2dx_auto . cpp \ <nl> + . . / . . / auto - generated / lua - bindings / lua_cocos2dx_extension_auto . cpp \ <nl> . . / cocos2dx_support / CCLuaBridge . cpp \ <nl> . . / cocos2dx_support / CCLuaEngine . cpp \ <nl> . . / cocos2dx_support / CCLuaStack . cpp \ <nl> . . / cocos2dx_support / CCLuaValue . cpp \ <nl> . . / cocos2dx_support / Cocos2dxLuaLoader . cpp \ <nl> - . . / cocos2dx_support / LuaCocos2d . cpp \ <nl> . . / cocos2dx_support / CCBProxy . cpp \ <nl> . . / cocos2dx_support / Lua_extensions_CCB . cpp \ <nl> . . / cocos2dx_support / LuaOpengl . cpp \ <nl> . . / cocos2dx_support / LuaScrollView . cpp \ <nl> . . / cocos2dx_support / LuaScriptHandlerMgr . cpp \ <nl> . . / cocos2dx_support / LuaBasicConversions . cpp \ <nl> - . . / cocos2dx_support / generated / lua_cocos2dx_auto . cpp \ <nl> - . . / cocos2dx_support / generated / lua_cocos2dx_extension_auto . cpp \ <nl> . . / cocos2dx_support / lua_cocos2dx_manual . cpp \ <nl> . . / cocos2dx_support / lua_cocos2dx_extension_manual . cpp \ <nl> . . / cocos2dx_support / lua_cocos2dx_deprecated . cpp <nl> $ ( TARGET ) : $ ( OBJECTS ) $ ( CORE_MAKEFILE_LIST ) <nl> @ mkdir - p $ ( @ D ) <nl> $ ( CXX ) $ ( CXXFLAGS ) $ ( OBJECTS ) - shared - o $ @ $ ( SHAREDLIBS ) $ ( STATICLIBS ) <nl> <nl> + $ ( OBJ_DIR ) / % . o : . . / . . / % . cpp $ ( CORE_MAKEFILE_LIST ) <nl> + @ mkdir - p $ ( @ D ) <nl> + $ ( CXX ) $ ( CXXFLAGS ) $ ( INCLUDES ) $ ( DEFINES ) - c $ < - o $ @ <nl> + <nl> $ ( OBJ_DIR ) / % . o : . . / % . cpp $ ( CORE_MAKEFILE_LIST ) <nl> @ mkdir - p $ ( @ D ) <nl> $ ( CXX ) $ ( CXXFLAGS ) $ ( INCLUDES ) $ ( DEFINES ) - c $ < - o $ @ <nl> mmm a / scripting / lua / proj . linux / Makefile <nl> ppp b / scripting / lua / proj . linux / Makefile <nl> <nl> TARGET = liblua . so <nl> <nl> - INCLUDES + = - I . . - I . . / lua - I . . / tolua - I . . / cocos2dx_support - I . . / cocos2dx_support / generated \ <nl> + INCLUDES + = - I . . - I . . / lua - I . . / tolua - I . . / cocos2dx_support - I . . / . . / auto - generated / lua - bindings \ <nl> - I . . / Classes - I . . / . . / . . / CocosDenshion / include - I . . / . . / . . / extensions - I . . / . . / . . / external / chipmunk / include / chipmunk <nl> <nl> - SOURCES = . . / lua / lapi . o \ <nl> + SOURCES = . . / lua / lapi . c \ <nl> . . / lua / lauxlib . c \ <nl> . . / lua / lbaselib . c \ <nl> . . / lua / lcode . c \ <nl> SOURCES = . . / lua / lapi . o \ <nl> . . / tolua / tolua_push . c \ <nl> . . / tolua / tolua_to . c \ <nl> . . / cocos2dx_support / tolua_fix . c \ <nl> + . . / . . / auto - generated / lua - bindings / lua_cocos2dx_auto . cpp \ <nl> + . . / . . / auto - generated / lua - bindings / lua_cocos2dx_extension_auto . cpp \ <nl> . . / cocos2dx_support / CCLuaBridge . cpp \ <nl> . . / cocos2dx_support / CCLuaEngine . cpp \ <nl> . . / cocos2dx_support / CCLuaStack . cpp \ <nl> . . / cocos2dx_support / CCLuaValue . cpp \ <nl> . . / cocos2dx_support / Cocos2dxLuaLoader . cpp \ <nl> - . . / cocos2dx_support / LuaCocos2d . cpp \ <nl> . . / cocos2dx_support / CCBProxy . cpp \ <nl> . . / cocos2dx_support / Lua_extensions_CCB . cpp \ <nl> . . / cocos2dx_support / LuaOpengl . cpp \ <nl> . . / cocos2dx_support / LuaScrollView . cpp \ <nl> . . / cocos2dx_support / LuaScriptHandlerMgr . cpp \ <nl> . . / cocos2dx_support / LuaBasicConversions . cpp \ <nl> - . . / cocos2dx_support / generated / lua_cocos2dx_auto . cpp \ <nl> - . . / cocos2dx_support / generated / lua_cocos2dx_extension_auto . cpp \ <nl> . . / cocos2dx_support / lua_cocos2dx_manual . cpp \ <nl> . . / cocos2dx_support / lua_cocos2dx_extension_manual . cpp \ <nl> . . / cocos2dx_support / lua_cocos2dx_deprecated . cpp <nl> <nl> + <nl> include . . / . . / . . / cocos2dx / proj . linux / cocos2dx . mk <nl> <nl> TARGET : = $ ( LIB_DIR ) / $ ( TARGET ) <nl> $ ( TARGET ) : $ ( OBJECTS ) $ ( CORE_MAKEFILE_LIST ) <nl> @ mkdir - p $ ( @ D ) <nl> $ ( LOG_LINK ) $ ( CXX ) $ ( CXXFLAGS ) $ ( OBJECTS ) - shared - o $ @ $ ( SHAREDLIBS ) $ ( STATICLIBS ) <nl> <nl> + $ ( OBJ_DIR ) / % . o : . . / . . / % . cpp $ ( CORE_MAKEFILE_LIST ) <nl> + @ mkdir - p $ ( @ D ) <nl> + $ ( LOG_CXX ) $ ( CXX ) $ ( CXXFLAGS ) $ ( INCLUDES ) $ ( DEFINES ) - c $ < - o $ @ <nl> + <nl> $ ( OBJ_DIR ) / % . o : . . / % . cpp $ ( CORE_MAKEFILE_LIST ) <nl> @ mkdir - p $ ( @ D ) <nl> $ ( LOG_CXX ) $ ( CXX ) $ ( CXXFLAGS ) $ ( INCLUDES ) $ ( DEFINES ) - c $ < - o $ @ <nl> mmm a / scripting / lua / proj . win32 / liblua . vcxproj <nl> ppp b / scripting / lua / proj . win32 / liblua . vcxproj <nl> <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > <nl> < ClCompile > <nl> < Optimization > Disabled < / Optimization > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ CocosDenshion \ include ; $ ( ProjectDir ) . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ extensions \ network ; $ ( ProjectDir ) . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ tolua ; $ ( ProjectDir ) . . \ luajit \ include ; $ ( ProjectDir ) . . \ cocos2dx_support \ generated ; $ ( ProjectDir ) . . \ cocos2dx_support ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ CocosDenshion \ include ; $ ( ProjectDir ) . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ extensions \ network ; $ ( ProjectDir ) . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ tolua ; $ ( ProjectDir ) . . \ luajit \ include ; $ ( ProjectDir ) . . \ . . \ auto - generated \ lua - bindings ; $ ( ProjectDir ) . . \ cocos2dx_support ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; _DEBUG ; COCOS2D_DEBUG = 1 ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> xcopy / Y / Q " $ ( ProjectDir ) . . \ luajit \ win32 \ * . * " " $ ( OutDir ) " < / Command > <nl> < ClCompile > <nl> < Optimization > MaxSpeed < / Optimization > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ CocosDenshion \ include ; $ ( ProjectDir ) . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ extensions \ network ; $ ( ProjectDir ) . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ tolua ; $ ( ProjectDir ) . . \ luajit \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ pthread ; $ ( ProjectDir ) . . \ . . \ . . \ CocosDenshion \ include ; $ ( ProjectDir ) . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ extensions \ network ; $ ( ProjectDir ) . . \ . . \ . . \ external \ libwebsockets \ win32 \ include ; $ ( ProjectDir ) . . \ tolua ; $ ( ProjectDir ) . . \ luajit \ include ; $ ( ProjectDir ) . . \ . . \ auto - generated \ lua - bindings ; $ ( ProjectDir ) . . \ cocos2dx_support ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; NDEBUG ; _WINDOWS ; LIBLUA_EXPORTS ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < RuntimeLibrary > MultiThreadedDLL < / RuntimeLibrary > <nl> < FunctionLevelLinking > true < / FunctionLevelLinking > <nl> xcopy / Y / Q " $ ( ProjectDir ) . . \ luajit \ win32 \ * . * " " $ ( OutDir ) " < / Command > <nl> < / PreBuildEvent > <nl> < / ItemDefinitionGroup > <nl> < ItemGroup > <nl> + < ClCompile Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_auto . cpp " / > <nl> + < ClCompile Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_extension_auto . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ CCBProxy . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ CCLuaBridge . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ CCLuaEngine . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ CCLuaStack . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ CCLuaValue . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ Cocos2dxLuaLoader . cpp " / > <nl> - < ClCompile Include = " . . \ cocos2dx_support \ generated \ lua_cocos2dx_auto . cpp " / > <nl> - < ClCompile Include = " . . \ cocos2dx_support \ generated \ lua_cocos2dx_extension_auto . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ LuaBasicConversions . cpp " / > <nl> - < ClCompile Include = " . . \ cocos2dx_support \ LuaCocos2d . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ LuaOpengl . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ LuaScriptHandlerMgr . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ LuaScrollView . cpp " / > <nl> + < ClCompile Include = " . . \ cocos2dx_support \ lua_cocos2dx_deprecated . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ lua_cocos2dx_extension_manual . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ lua_cocos2dx_manual . cpp " / > <nl> < ClCompile Include = " . . \ cocos2dx_support \ Lua_extensions_CCB . cpp " / > <nl> xcopy / Y / Q " $ ( ProjectDir ) . . \ luajit \ win32 \ * . * " " $ ( OutDir ) " < / Command > <nl> < ClCompile Include = " . . \ tolua \ tolua_to . c " / > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> + < ClInclude Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_auto . hpp " / > <nl> + < ClInclude Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_extension_auto . hpp " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ CCBProxy . h " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ CCLuaBridge . h " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ CCLuaEngine . h " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ CCLuaStack . h " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ CCLuaValue . h " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ Cocos2dxLuaLoader . h " / > <nl> - < ClInclude Include = " . . \ cocos2dx_support \ generated \ lua_cocos2dx_auto . hpp " / > <nl> - < ClInclude Include = " . . \ cocos2dx_support \ generated \ lua_cocos2dx_extension_auto . hpp " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ LuaBasicConversions . h " / > <nl> - < ClInclude Include = " . . \ cocos2dx_support \ LuaCocos2d . h " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ LuaOpengl . h " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ LuaScriptHandlerMgr . h " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ LuaScrollView . h " / > <nl> + < ClInclude Include = " . . \ cocos2dx_support \ lua_cocos2dx_deprecated . h " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ lua_cocos2dx_extension_manual . h " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ lua_cocos2dx_manual . hpp " / > <nl> < ClInclude Include = " . . \ cocos2dx_support \ Lua_extensions_CCB . h " / > <nl> xcopy / Y / Q " $ ( ProjectDir ) . . \ luajit \ win32 \ * . * " " $ ( OutDir ) " < / Command > <nl> < ClInclude Include = " . . \ tolua \ tolua + + . h " / > <nl> < ClInclude Include = " . . \ tolua \ tolua_event . h " / > <nl> < / ItemGroup > <nl> + < ItemGroup > <nl> + < None Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_auto_api . js " / > <nl> + < None Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_extension_auto_api . js " / > <nl> + < / ItemGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> < ImportGroup Label = " ExtensionTargets " > <nl> < / ImportGroup > <nl> mmm a / scripting / lua / proj . win32 / liblua . vcxproj . filters <nl> ppp b / scripting / lua / proj . win32 / liblua . vcxproj . filters <nl> <nl> < ClCompile Include = " . . \ cocos2dx_support \ Cocos2dxLuaLoader . cpp " > <nl> < Filter > cocos2dx_support < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ cocos2dx_support \ LuaCocos2d . cpp " > <nl> - < Filter > cocos2dx_support < / Filter > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ cocos2dx_support \ tolua_fix . c " > <nl> < Filter > cocos2dx_support < / Filter > <nl> < / ClCompile > <nl> <nl> < ClCompile Include = " . . \ cocos2dx_support \ LuaBasicConversions . cpp " > <nl> < Filter > cocos2dx_support < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ cocos2dx_support \ generated \ lua_cocos2dx_auto . cpp " > <nl> + < ClCompile Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_auto . cpp " > <nl> < Filter > cocos2dx_support \ generated < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ cocos2dx_support \ generated \ lua_cocos2dx_extension_auto . cpp " > <nl> + < ClCompile Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_extension_auto . cpp " > <nl> < Filter > cocos2dx_support \ generated < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ cocos2dx_support \ lua_cocos2dx_deprecated . cpp " > <nl> + < Filter > cocos2dx_support < / Filter > <nl> + < / ClCompile > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ClInclude Include = " . . \ tolua \ tolua + + . h " > <nl> <nl> < ClInclude Include = " . . \ cocos2dx_support \ Cocos2dxLuaLoader . h " > <nl> < Filter > cocos2dx_support < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " . . \ cocos2dx_support \ LuaCocos2d . h " > <nl> - < Filter > cocos2dx_support < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " . . \ cocos2dx_support \ tolua_fix . h " > <nl> < Filter > cocos2dx_support < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " . . \ cocos2dx_support \ LuaBasicConversions . h " > <nl> < Filter > cocos2dx_support < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " . . \ cocos2dx_support \ generated \ lua_cocos2dx_auto . hpp " > <nl> + < ClInclude Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_auto . hpp " > <nl> < Filter > cocos2dx_support \ generated < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " . . \ cocos2dx_support \ generated \ lua_cocos2dx_extension_auto . hpp " > <nl> + < ClInclude Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_extension_auto . hpp " > <nl> < Filter > cocos2dx_support \ generated < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " . . \ cocos2dx_support \ lua_cocos2dx_deprecated . h " > <nl> + < Filter > cocos2dx_support < / Filter > <nl> + < / ClInclude > <nl> + < / ItemGroup > <nl> + < ItemGroup > <nl> + < None Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_auto_api . js " > <nl> + < Filter > cocos2dx_support \ generated < / Filter > <nl> + < / None > <nl> + < None Include = " . . \ . . \ auto - generated \ lua - bindings \ lua_cocos2dx_extension_auto_api . js " > <nl> + < Filter > cocos2dx_support \ generated < / Filter > <nl> + < / None > <nl> < / ItemGroup > <nl> < / Project > <nl> \ No newline at end of file <nl> mmm a / template / multi - platform - js / Classes / AppDelegate . cpp <nl> ppp b / template / multi - platform - js / Classes / AppDelegate . cpp <nl> <nl> # include " cocos2d . h " <nl> # include " SimpleAudioEngine . h " <nl> # include " ScriptingCore . h " <nl> - # include " generated / jsb_cocos2dx_auto . hpp " <nl> - # include " generated / jsb_cocos2dx_extension_auto . hpp " <nl> + # include " jsb_cocos2dx_auto . hpp " <nl> + # include " jsb_cocos2dx_extension_auto . hpp " <nl> # include " jsb_cocos2dx_extension_manual . h " <nl> # include " cocos2d_specifics . hpp " <nl> # include " js_bindings_chipmunk_registration . h " <nl> mmm a / template / multi - platform - js / proj . ios / HelloJavascript . xcodeproj / project . pbxproj <nl> ppp b / template / multi - platform - js / proj . ios / HelloJavascript . xcodeproj / project . pbxproj <nl> <nl> " $ ( SRCROOT ) / . . / . . / . . / cocos2dx / platform / ios " , <nl> " $ ( SRCROOT ) / . . / . . / . . / external / chipmunk / include / chipmunk " , <nl> " $ ( SRCROOT ) / . . / . . / . . / scripting / javascript / spidermonkey - ios / include " , <nl> + " $ ( SRCROOT ) / . . / . . / . . / scripting / auto - generated / js - bindings " , <nl> " $ ( SRCROOT ) / . . / . . / . . / scripting / javascript / bindings " , <nl> " $ ( SRCROOT ) / . . / . . / . . / extensions " , <nl> ) ; <nl> <nl> " $ ( SRCROOT ) / . . / . . / . . / cocos2dx / platform / ios " , <nl> " $ ( SRCROOT ) / . . / . . / . . / external / chipmunk / include / chipmunk " , <nl> " $ ( SRCROOT ) / . . / . . / . . / scripting / javascript / spidermonkey - ios / include " , <nl> + " $ ( SRCROOT ) / . . / . . / . . / scripting / auto - generated / js - bindings " , <nl> " $ ( SRCROOT ) / . . / . . / . . / scripting / javascript / bindings " , <nl> " $ ( SRCROOT ) / . . / . . / . . / extensions " , <nl> ) ; <nl> mmm a / template / multi - platform - js / proj . win32 / HelloJavascript . vcxproj <nl> ppp b / template / multi - platform - js / proj . win32 / HelloJavascript . vcxproj <nl> <nl> < / Midl > <nl> < ClCompile > <nl> < Optimization > Disabled < / Optimization > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; DEBUG ; _DEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_DEBUG = 1 ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> xcopy " $ ( ProjectDir ) . . \ Resources " " $ ( OutDir ) \ HelloJavascriptRes \ " / e / Y < / Command <nl> < ProxyFileName > game_p . c < / ProxyFileName > <nl> < / Midl > <nl> < ClCompile > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ javascript \ spidermonkey - win32 \ include ; $ ( ProjectDir ) . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ extensions ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ javascript \ bindings ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PreprocessorDefinitions > WIN32 ; _WINDOWS ; STRICT ; NDEBUG ; XP_WIN ; JS_HAVE___INTN ; JS_INTPTR_TYPE = int ; COCOS2D_JAVASCRIPT = 1 ; CC_ENABLE_CHIPMUNK_INTEGRATION = 1 ; _CRT_SECURE_NO_WARNINGS ; _SCL_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < ExceptionHandling > <nl> < / ExceptionHandling > <nl> mmm a / template / multi - platform - lua / proj . ios / HelloLua . xcodeproj / project . pbxproj <nl> ppp b / template / multi - platform - lua / proj . ios / HelloLua . xcodeproj / project . pbxproj <nl> <nl> 1AC3623816D47C5C000847F2 / * land . png in Resources * / = { isa = PBXBuildFile ; fileRef = 1AC3622C16D47C5C000847F2 / * land . png * / ; } ; <nl> 1AC3623916D47C5C000847F2 / * menu1 . png in Resources * / = { isa = PBXBuildFile ; fileRef = 1AC3622D16D47C5C000847F2 / * menu1 . png * / ; } ; <nl> 1AC3623A16D47C5C000847F2 / * menu2 . png in Resources * / = { isa = PBXBuildFile ; fileRef = 1AC3622E16D47C5C000847F2 / * menu2 . png * / ; } ; <nl> + 1ADB273817CCA0C200634B5E / * Cocos2d . lua in Resources * / = { isa = PBXBuildFile ; fileRef = 1ADB273717CCA0C200634B5E / * Cocos2d . lua * / ; } ; <nl> 1AF4C3F21786633E00122817 / * libchipmunk iOS . a in Frameworks * / = { isa = PBXBuildFile ; fileRef = 1AF4C3DF1786631700122817 / * libchipmunk iOS . a * / ; } ; <nl> 1AF4C3F31786633E00122817 / * libcocos2dx iOS . a in Frameworks * / = { isa = PBXBuildFile ; fileRef = 1AF4C3DB1786631700122817 / * libcocos2dx iOS . a * / ; } ; <nl> 1AF4C3F41786633E00122817 / * libcocos2dx - extensions iOS . a in Frameworks * / = { isa = PBXBuildFile ; fileRef = 1AF4C3DD1786631700122817 / * libcocos2dx - extensions iOS . a * / ; } ; <nl> <nl> 1AC3622C16D47C5C000847F2 / * land . png * / = { isa = PBXFileReference ; lastKnownFileType = image . png ; name = land . png ; path = . . / Resources / land . png ; sourceTree = " < group > " ; } ; <nl> 1AC3622D16D47C5C000847F2 / * menu1 . png * / = { isa = PBXFileReference ; lastKnownFileType = image . png ; name = menu1 . png ; path = . . / Resources / menu1 . png ; sourceTree = " < group > " ; } ; <nl> 1AC3622E16D47C5C000847F2 / * menu2 . png * / = { isa = PBXFileReference ; lastKnownFileType = image . png ; name = menu2 . png ; path = . . / Resources / menu2 . png ; sourceTree = " < group > " ; } ; <nl> + 1ADB273717CCA0C200634B5E / * Cocos2d . lua * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = text ; name = Cocos2d . lua ; path = . . / . . / . . / scripting / lua / script / Cocos2d . lua ; sourceTree = " < group > " ; } ; <nl> 1AF4C3B8178662A500122817 / * Prefix . pch * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = Prefix . pch ; sourceTree = " < group > " ; } ; <nl> 1AF4C3B91786631600122817 / * cocos2d_libs . xcodeproj * / = { isa = PBXFileReference ; lastKnownFileType = " wrapper . pb - project " ; name = cocos2d_libs . xcodeproj ; path = . . / . . / . . / cocos2d_libs . xcodeproj ; sourceTree = " < group > " ; } ; <nl> 1AF4C402178663F200122817 / * libz . dylib * / = { isa = PBXFileReference ; lastKnownFileType = " compiled . mach - o . dylib " ; name = libz . dylib ; path = usr / lib / libz . dylib ; sourceTree = SDKROOT ; } ; <nl> <nl> children = ( <nl> 1A0227A517A3AA3500B867AD / * AudioEngine . lua * / , <nl> 1A0227A617A3AA3500B867AD / * CCBReaderLoad . lua * / , <nl> + 1ADB273717CCA0C200634B5E / * Cocos2d . lua * / , <nl> 1A0227A717A3AA3500B867AD / * Cocos2dConstants . lua * / , <nl> 1A0227A817A3AA3500B867AD / * Deprecated . lua * / , <nl> 1A0227A917A3AA3500B867AD / * DrawPrimitives . lua * / , <nl> <nl> 1A0227B017A3AA3500B867AD / * DrawPrimitives . lua in Resources * / , <nl> 1A0227B117A3AA3500B867AD / * Opengl . lua in Resources * / , <nl> 1A0227B217A3AA3500B867AD / * OpenglConstants . lua in Resources * / , <nl> + 1ADB273817CCA0C200634B5E / * Cocos2d . lua in Resources * / , <nl> ) ; <nl> runOnlyForDeploymentPostprocessing = 0 ; <nl> } ; <nl> <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / cocos2dx / kazmath / include \ " " , <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / scripting / lua / tolua \ " " , <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / scripting / lua / luajit / include \ " " , <nl> + " \ " $ ( SRCROOT ) / . . / . . / . . / scripting / auto - generated / lua - bindings \ " " , <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / scripting / lua / cocos2dx_support \ " " , <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / cocos2dx / platform / ios \ " " , <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / cocos2dx / include \ " " , <nl> <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / cocos2dx / kazmath / include \ " " , <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / scripting / lua / tolua \ " " , <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / scripting / lua / luajit / include \ " " , <nl> + " \ " $ ( SRCROOT ) / . . / . . / . . / scripting / auto - generated / lua - bindings \ " " , <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / scripting / lua / cocos2dx_support \ " " , <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / cocos2dx / platform / ios \ " " , <nl> " \ " $ ( SRCROOT ) / . . / . . / . . / cocos2dx / include \ " " , <nl> mmm a / template / multi - platform - lua / proj . mac / HelloLua . xcodeproj / project . pbxproj <nl> ppp b / template / multi - platform - lua / proj . mac / HelloLua . xcodeproj / project . pbxproj <nl> <nl> 15A02F7517A64DFB0035E92B / * main . m in Sources * / = { isa = PBXBuildFile ; fileRef = 15A02F6F17A64DFB0035E92B / * main . m * / ; } ; <nl> 15A02F7B17A64E2A0035E92B / * InfoPlist . strings in Resources * / = { isa = PBXBuildFile ; fileRef = 15A02F7717A64E2A0035E92B / * InfoPlist . strings * / ; } ; <nl> 15A02F7C17A64E2A0035E92B / * MainMenu . xib in Resources * / = { isa = PBXBuildFile ; fileRef = 15A02F7917A64E2A0035E92B / * MainMenu . xib * / ; } ; <nl> + 1ADB273B17CCA0F500634B5E / * Cocos2d . lua in Resources * / = { isa = PBXBuildFile ; fileRef = 1ADB273A17CCA0F500634B5E / * Cocos2d . lua * / ; } ; <nl> / * End PBXBuildFile section * / <nl> <nl> / * Begin PBXContainerItemProxy section * / <nl> <nl> 15A02F7A17A64E2A0035E92B / * en * / = { isa = PBXFileReference ; lastKnownFileType = file . xib ; name = en ; path = MainMenu . xib ; sourceTree = " < group > " ; } ; <nl> 15A02F7D17A64EF30035E92B / * Prefix . pch * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = Prefix . pch ; sourceTree = " < group > " ; } ; <nl> 15A02FAA17A65D810035E92B / * OpenAL . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = OpenAL . framework ; path = System / Library / Frameworks / OpenAL . framework ; sourceTree = SDKROOT ; } ; <nl> + 1ADB273A17CCA0F500634B5E / * Cocos2d . lua * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = text ; path = Cocos2d . lua ; sourceTree = " < group > " ; } ; <nl> / * End PBXFileReference section * / <nl> <nl> / * Begin PBXFrameworksBuildPhase section * / <nl> <nl> children = ( <nl> 1501825217A74F8000E674E5 / * AudioEngine . lua * / , <nl> 1501825317A74F8000E674E5 / * CCBReaderLoad . lua * / , <nl> + 1ADB273A17CCA0F500634B5E / * Cocos2d . lua * / , <nl> 1501825417A74F8000E674E5 / * Cocos2dConstants . lua * / , <nl> 1501825517A74F8000E674E5 / * Deprecated . lua * / , <nl> 1501825617A74F8000E674E5 / * DrawPrimitives . lua * / , <nl> <nl> 1501825D17A74F8000E674E5 / * DrawPrimitives . lua in Resources * / , <nl> 1501825E17A74F8000E674E5 / * Opengl . lua in Resources * / , <nl> 1501825F17A74F8000E674E5 / * OpenglConstants . lua in Resources * / , <nl> + 1ADB273B17CCA0F500634B5E / * Cocos2d . lua in Resources * / , <nl> ) ; <nl> runOnlyForDeploymentPostprocessing = 0 ; <nl> } ; <nl> mmm a / template / multi - platform - lua / proj . win32 / HelloLua . vcxproj <nl> ppp b / template / multi - platform - lua / proj . win32 / HelloLua . vcxproj <nl> <nl> < / PropertyGroup > <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > <nl> < ClCompile > <nl> - < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ lua \ cocos2dx_support ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ lua \ lua ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ lua \ tolua ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ lua \ src ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ external ; $ ( ProjectDir ) . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ CocosDenshion \ include ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ lua \ cocos2dx_support ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ lua \ tolua ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ lua \ lua ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ Classes ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ auto - generated \ js - bindings ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ lua \ cocos2dx_support ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ lua \ lua ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ lua \ tolua ; $ ( ProjectDir ) . . \ . . \ . . \ scripting \ lua \ src ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ kazmath \ include ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 ; $ ( ProjectDir ) . . \ . . \ . . \ cocos2dx \ platform \ third_party \ win32 \ OGLES ; $ ( ProjectDir ) . . \ . . \ . . \ external ; $ ( ProjectDir ) . . \ . . \ . . \ external \ chipmunk \ include \ chipmunk ; $ ( ProjectDir ) . . \ . . \ . . \ CocosDenshion \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < PrecompiledHeader > <nl> < / PrecompiledHeader > <nl> < WarningLevel > Level3 < / WarningLevel > <nl> mmm a / tools / tojs / genbindings . sh <nl> ppp b / tools / tojs / genbindings . sh <nl> echo mmm <nl> # Generate bindings for cocos2dx <nl> echo " Generating bindings for cocos2dx . . . " <nl> set - x <nl> - LD_LIBRARY_PATH = $ { CLANG_ROOT } / lib $ PYTHON_BIN $ { CXX_GENERATOR_ROOT } / generator . py $ { TO_JS_ROOT } / cocos2dx . ini - s cocos2d - x - t spidermonkey - o $ { COCOS2DX_ROOT } / scripting / javascript / bindings / generated - n jsb_cocos2dx_auto <nl> + LD_LIBRARY_PATH = $ { CLANG_ROOT } / lib $ PYTHON_BIN $ { CXX_GENERATOR_ROOT } / generator . py $ { TO_JS_ROOT } / cocos2dx . ini - s cocos2d - x - t spidermonkey - o $ { COCOS2DX_ROOT } / scripting / auto - generated / js - bindings - n jsb_cocos2dx_auto <nl> <nl> echo " Generating bindings for cocos2dx_extension . . . " <nl> - LD_LIBRARY_PATH = $ { CLANG_ROOT } / lib $ PYTHON_BIN $ { CXX_GENERATOR_ROOT } / generator . py $ { TO_JS_ROOT } / cocos2dx_extension . ini - s cocos2dx_extension - t spidermonkey - o $ { COCOS2DX_ROOT } / scripting / javascript / bindings / generated - n jsb_cocos2dx_extension_auto <nl> + LD_LIBRARY_PATH = $ { CLANG_ROOT } / lib $ PYTHON_BIN $ { CXX_GENERATOR_ROOT } / generator . py $ { TO_JS_ROOT } / cocos2dx_extension . ini - s cocos2dx_extension - t spidermonkey - o $ { COCOS2DX_ROOT } / scripting / auto - generated / js - bindings - n jsb_cocos2dx_extension_auto <nl> mmm a / tools / tolua / genbindings . sh <nl> ppp b / tools / tolua / genbindings . sh <nl> echo mmm <nl> # Generate bindings for cocos2dx <nl> echo " Generating bindings for cocos2dx . . . " <nl> set - x <nl> - LD_LIBRARY_PATH = $ { CLANG_ROOT } / lib $ PYTHON_BIN $ { CXX_GENERATOR_ROOT } / generator . py $ { TO_JS_ROOT } / cocos2dx . ini - s cocos2d - x - t lua - o $ { COCOS2DX_ROOT } / scripting / lua / cocos2dx_support / generated - n lua_cocos2dx_auto <nl> + LD_LIBRARY_PATH = $ { CLANG_ROOT } / lib $ PYTHON_BIN $ { CXX_GENERATOR_ROOT } / generator . py $ { TO_JS_ROOT } / cocos2dx . ini - s cocos2d - x - t lua - o $ { COCOS2DX_ROOT } / scripting / auto - generated / lua - bindings - n lua_cocos2dx_auto <nl> <nl> echo " Generating bindings for cocos2dx_extension . . . " <nl> - LD_LIBRARY_PATH = $ { CLANG_ROOT } / lib $ PYTHON_BIN $ { CXX_GENERATOR_ROOT } / generator . py $ { TO_JS_ROOT } / cocos2dx_extension . ini - s cocos2dx_extension - t lua - o $ { COCOS2DX_ROOT } / scripting / lua / cocos2dx_support / generated - n lua_cocos2dx_extension_auto <nl> + LD_LIBRARY_PATH = $ { CLANG_ROOT } / lib $ PYTHON_BIN $ { CXX_GENERATOR_ROOT } / generator . py $ { TO_JS_ROOT } / cocos2dx_extension . ini - s cocos2dx_extension - t lua - o $ { COCOS2DX_ROOT } / scripting / auto - generated / lua - bindings - n lua_cocos2dx_extension_auto <nl> deleted file mode 100644 <nl> index 8282d99b5674 . . 000000000000 <nl> mmm a / tools / tolua / userconf . ini <nl> ppp / dev / null <nl> <nl> - [ DEFAULT ] <nl> - androidndkdir = / Users / cocos2d / MyWork / android / android - ndk - r8e <nl> - clangllvmdir = / Users / cocos2d / bin / clang + llvm - 3 . 3 <nl> - cocosdir = / Users / cocos2d / MyWork / cocos2d - x <nl> - cxxgeneratordir = / Users / cocos2d / MyWork / cocos2d - x / tools / bindings - generator <nl> - extra_flags = <nl> - <nl> mmm a / tools / travis - scripts / before - install . sh <nl> ppp b / tools / travis - scripts / before - install . sh <nl> elif [ " $ PLATFORM " x = " linux " x ] ; then <nl> sudo update - alternatives - - install / usr / bin / gcc gcc / usr / bin / gcc - 4 . 7 90 - - slave / usr / bin / g + + g + + / usr / bin / g + + - 4 . 7 <nl> g + + - - version <nl> bash $ COCOS2DX_ROOT / install - deps - linux . sh <nl> + install_android_ndk <nl> + install_llvm <nl> elif [ " $ PLATFORM " x = " nacl " x ] ; then <nl> install_nacl_sdk <nl> elif [ " $ PLATFORM " x = " android " x ] ; then <nl> elif [ " $ PLATFORM " x = " android " x ] ; then <nl> install_llvm <nl> elif [ " $ PLATFORM " x = " emscripten " x ] ; then <nl> sudo rm - rf / dev / shm & & sudo ln - s / run / shm / dev / shm <nl> + install_android_ndk <nl> install_llvm_3_2 <nl> elif [ " $ PLATFORM " x = " ios " x ] ; then <nl> install_android_ndk <nl> mmm a / tools / travis - scripts / generate - jsbindings . sh <nl> ppp b / tools / travis - scripts / generate - jsbindings . sh <nl> <nl> # ! / bin / bash <nl> <nl> - # Generate JS bindings for Cocos2D - X <nl> + # Generate JS and Lua bindings for Cocos2D - X <nl> # . . . using Android NDK system headers <nl> # . . . and automatically update submodule references <nl> # . . . and push these changes to remote repos <nl> <nl> # Dependencies <nl> # <nl> # For bindings generator : <nl> - # ( see . . / . . / . . / tojs / genbindings . sh <nl> + # ( see . . / . . / . . / tojs / genbindings . sh and . . / . . / . . / tolua / genbindings . sh <nl> # . . . for the defaults used if the environment is not customized ) <nl> # <nl> # * $ PYTHON_BIN <nl> <nl> DIR = " $ ( cd " $ ( dirname " $ { BASH_SOURCE [ 0 ] } " ) " & & pwd ) " <nl> COCOS2DX_ROOT = " $ DIR " / . . / . . <nl> TOJS_ROOT = $ COCOS2DX_ROOT / tools / tojs <nl> - GENERATED_WORKTREE = " $ COCOS2DX_ROOT " / scripting / javascript / bindings / generated <nl> + TOLUA_ROOT = $ COCOS2DX_ROOT / tools / tolua <nl> + GENERATED_WORKTREE = " $ COCOS2DX_ROOT " / scripting / auto - generated <nl> COMMITTAG = " [ AUTO ] " <nl> <nl> # Exit on error <nl> else <nl> sudo apt - get - - force - yes - - yes install python - yaml python - cheetah <nl> fi <nl> <nl> - if [ " $ GEN_JSB " x ! = " YES " x ] ; then <nl> + generate_bindings_glue_codes ( ) <nl> + { <nl> + echo " Create auto - generated jsbinding glue codes . " <nl> pushd " $ TOJS_ROOT " <nl> . / genbindings . sh <nl> popd <nl> + <nl> + echo " Create auto - generated luabinding glue codes . " <nl> + pushd " $ TOLUA_ROOT " <nl> + . / genbindings . sh <nl> + popd <nl> + } <nl> + <nl> + if [ " $ GEN_JSB " x ! = " YES " x ] ; then <nl> + generate_bindings_glue_codes <nl> exit 0 <nl> fi <nl> <nl> git config user . email $ { GH_EMAIL } <nl> git config user . name $ { GH_USER } <nl> popd <nl> <nl> - # Update submodule of auto - gen JSBinding repo . <nl> + # Update submodule of auto - gen Binding repo . <nl> pushd " $ GENERATED_WORKTREE " <nl> <nl> git checkout - B master <nl> - # Set git user for the submodule of ' scripting / javascript / bindings / generated ' <nl> + echo " Set git user for the submodule of $ { GENERATED_WORKTREE } " <nl> git config user . email $ { GH_EMAIL } <nl> git config user . name $ { GH_USER } <nl> # Set remotes <nl> git remote add upstream https : / / $ { GH_USER } : $ { GH_PASSWORD } @ github . com / folecr / coco <nl> <nl> echo " Delete all directories and files except ' . git ' and ' README ' . " <nl> ls - a | grep - E - v ^ \ [ . \ ] \ { 1 , 2 \ } $ | grep - E - v ^ \ . git $ | grep - E - v ^ README $ | xargs - I { } rm - rf { } <nl> - echo " Show files in scripting / javascript / bindings / generated folder . " <nl> + echo " Show files in $ { GENERATED_WORKTREE } folder . " <nl> ls - a <nl> popd <nl> <nl> <nl> <nl> # 1 . Generate JS bindings <nl> - pushd " $ TOJS_ROOT " <nl> - . / genbindings . sh <nl> - popd <nl> + generate_bindings_glue_codes <nl> <nl> echo <nl> echo Bindings generated successfully <nl> echo Using " $ ELAPSEDSECS " in the branch names for pseudo - uniqueness <nl> GENERATED_BRANCH = autogeneratedbindings_ " $ ELAPSEDSECS " <nl> <nl> <nl> - # 2 . In JSBindings repo , Check if there are any files that are different from the index <nl> + # 2 . In Bindings repo , Check if there are any files that are different from the index <nl> <nl> pushd " $ GENERATED_WORKTREE " <nl> <nl> fi <nl> # Exit on error <nl> set - e <nl> <nl> - # 3 . In JSBindings repo , Check out a branch named " autogeneratedbindings " and commit the auto generated bindings to it <nl> + # 3 . In Bindings repo , Check out a branch named " autogeneratedbindings " and commit the auto generated bindings to it <nl> git checkout - b " $ GENERATED_BRANCH " <nl> git add - - verbose . <nl> git add - - verbose - u . <nl> git commit - - verbose - m " $ COMMITTAG : autogenerated bindings " <nl> <nl> - # 4 . In JSBindings repo , Push the commit with generated bindings to " master " of the auto generated bindings repository <nl> + # 4 . In Bindings repo , Push the commit with generated bindings to " master " of the auto generated bindings repository <nl> git push - fq upstream " $ GENERATED_BRANCH " : $ { TRAVIS_BRANCH } _ $ { ELAPSEDSECS } 2 > / dev / null <nl> <nl> popd <nl> pushd " $ { DIR } " <nl> <nl> # 5 . In Cocos2D - X repo , Checkout a branch named " updategeneratedsubmodule " Update the submodule reference to point to the commit with generated bindings <nl> cd " $ { COCOS2DX_ROOT } " <nl> - git add scripting / javascript / bindings / generated <nl> + git add $ { GENERATED_WORKTREE } <nl> git checkout - b " $ COCOS_BRANCH " <nl> git commit - m " $ COMMITTAG : updating submodule reference to latest autogenerated bindings " <nl> # Set remotes <nl> mmm a / tools / travis - scripts / run - script . sh <nl> ppp b / tools / travis - scripts / run - script . sh <nl> if [ " $ GEN_JSB " x = " YES " x ] ; then <nl> elif [ " $ PLATFORM " x = " android " x ] ; then <nl> export NDK_ROOT = $ HOME / bin / android - ndk <nl> <nl> - # Generate jsbinding glue codes <nl> - echo " Generating jsbindings glue codes . . . " <nl> + # Generate binding glue codes <nl> + echo " Generating bindings glue codes . . . " <nl> cd $ COCOS2DX_ROOT / tools / travis - scripts <nl> . / generate - jsbindings . sh <nl> <nl> elif [ " $ PLATFORM " x = " nacl " x ] ; then <nl> cd $ COCOS2DX_ROOT <nl> make - j4 <nl> elif [ " $ PLATFORM " x = " linux " x ] ; then <nl> + # Generate binding glue codes <nl> + echo " Generating bindings glue codes . . . " <nl> + cd $ COCOS2DX_ROOT / tools / travis - scripts <nl> + . / generate - jsbindings . sh <nl> + <nl> cd $ COCOS2DX_ROOT <nl> make - j4 <nl> elif [ " $ PLATFORM " x = " emscripten " x ] ; then <nl> + # Generate binding glue codes <nl> + echo " Generating bindings glue codes . . . " <nl> + cd $ COCOS2DX_ROOT / tools / travis - scripts <nl> + . / generate - jsbindings . sh <nl> + <nl> cd $ COCOS2DX_ROOT <nl> export PYTHON = / usr / bin / python <nl> export LLVM = $ HOME / bin / clang + llvm - 3 . 2 / bin <nl>
|
Merge pull request from dumganhar / move - auto - generated
|
cocos2d/cocos2d-x
|
245dce7e9c68656ab7fa152a3c1b37a0a13e2055
|
2013-08-27T15:02:32Z
|
mmm a / docs / api / synopsis . md <nl> ppp b / docs / api / synopsis . md <nl> <nl> <nl> All [ node . js ' s built - in modules ] ( http : / / nodejs . org / api / ) are available in <nl> atom - shell , and third - party node modules are fully supported too ( including the <nl> - [ native modules ] ( . . / tutorial / use - native - node - modules . md ) ) . <nl> + [ native modules ] ( . . / tutorial / using - native - node - modules . md ) ) . <nl> <nl> Atom - shell also provides some extra built - in modules for developing native <nl> desktop applications . Some modules are only available on the browser side , some <nl>
|
Broken link in docs , api / synopsis
|
electron/electron
|
72d6a13e9e5f33d4811e558a1699d6ed04b93294
|
2015-02-19T17:03:05Z
|
mmm a / lib / Sema / CodeSynthesis . cpp <nl> ppp b / lib / Sema / CodeSynthesis . cpp <nl> void TypeChecker : : completePropertyBehaviorStorage ( VarDecl * VD , <nl> NormalProtocolConformance * BehaviorConformance , <nl> ArrayRef < Substitution > SelfInterfaceSubs , <nl> ArrayRef < Substitution > SelfContextSubs ) { <nl> + assert ( BehaviorStorage ) ; <nl> + assert ( BehaviorInitStorage ) ; <nl> + <nl> / / Substitute the storage type into the conforming context . <nl> auto sig = BehaviorConformance - > getProtocol ( ) - > getGenericSignatureOfContext ( ) ; <nl> <nl> mmm a / lib / Sema / TypeCheckDecl . cpp <nl> ppp b / lib / Sema / TypeCheckDecl . cpp <nl> static void checkVarBehavior ( VarDecl * decl , TypeChecker & TC ) { <nl> for ( auto found : lookup ) <nl> TC . diagnose ( found . Decl - > getLoc ( ) , <nl> diag : : found_candidate ) ; <nl> + continue ; <nl> } <nl> <nl> / / TODO : Support storage - backed behaviors in non - type contexts . <nl> mmm a / test / decl / var / behaviors . swift <nl> ppp b / test / decl / var / behaviors . swift <nl> protocol storageWithoutInit { <nl> extension storageWithoutInit { <nl> var value : Value { fatalError ( " " ) } <nl> <nl> - func initStorage ( ) - > Int { fatalError ( " signature is wrong " ) } / / expected - note { { found this candidate } } <nl> + func initStorage ( ) - > Int { fatalError ( " signature is wrong " ) } / / expected - note * { { found this candidate } } <nl> } <nl> <nl> struct Bar { <nl> var [ storageWithoutInit ] x : Int / / expected - error { { property behavior protocol has a ' storage ' requirement but does not have a static ' initStorage ' method with the expected type ' ( ) - > Self . Value ' } } <nl> } <nl> + class Bas { <nl> + var [ storageWithoutInit ] x : Int / / expected - error { { property behavior protocol has a ' storage ' requirement but does not have a static ' initStorage ' method with the expected type ' ( ) - > Self . Value ' } } <nl> + } <nl> <nl> protocol valueTypeMismatch { <nl> associatedtype Value <nl>
|
Sema : Fix crash when behavior protocol is missing ` initStorage ` requirement .
|
apple/swift
|
e49a50bbee836229369d916906cd9c1523765a32
|
2016-02-20T23:01:06Z
|
mmm a / src / mongo / db / catalog_raii . cpp <nl> ppp b / src / mongo / db / catalog_raii . cpp <nl> ReadSourceScope : : ~ ReadSourceScope ( ) { <nl> <nl> AutoGetOplog : : AutoGetOplog ( OperationContext * opCtx , OplogAccessMode mode , Date_t deadline ) <nl> : _shouldNotConflictWithSecondaryBatchApplicationBlock ( opCtx - > lockState ( ) ) { <nl> + auto lockMode = ( mode = = OplogAccessMode : : kRead ) ? MODE_IS : MODE_IX ; <nl> if ( mode = = OplogAccessMode : : kLogOp ) { <nl> / / Invariant that global lock is already held for kLogOp mode . <nl> invariant ( opCtx - > lockState ( ) - > isWriteLocked ( ) ) ; <nl> } else { <nl> - _globalLock . emplace ( opCtx , <nl> - mode = = OplogAccessMode : : kRead ? MODE_IS : MODE_IX , <nl> - deadline , <nl> - Lock : : InterruptBehavior : : kThrow ) ; <nl> + _globalLock . emplace ( opCtx , lockMode , deadline , Lock : : InterruptBehavior : : kThrow ) ; <nl> } <nl> <nl> / / Obtain database and collection intent locks for non - document - locking storage engines . <nl> if ( ! opCtx - > getServiceContext ( ) - > getStorageEngine ( ) - > supportsDocLocking ( ) ) { <nl> - auto lockMode = ( mode = = OplogAccessMode : : kRead ) ? MODE_IS : MODE_IX ; <nl> - <nl> - / / If mode is kLogOp , only acquire the database lock if it is not already held . <nl> - if ( mode ! = OplogAccessMode : : kLogOp | | <nl> - ! opCtx - > lockState ( ) - > isDbLockedForMode ( NamespaceString : : kLocalDb , lockMode ) ) { <nl> - _dbWriteLock . emplace ( opCtx , NamespaceString : : kLocalDb , lockMode , deadline ) ; <nl> - } <nl> - <nl> - / / If mode is kLogOp , only acquire the collection lock if it is not already held . <nl> - if ( mode ! = OplogAccessMode : : kLogOp | | <nl> - ! opCtx - > lockState ( ) - > isCollectionLockedForMode ( NamespaceString : : kRsOplogNamespace , <nl> - lockMode ) ) { <nl> - _collWriteLock . emplace ( opCtx , NamespaceString : : kRsOplogNamespace , lockMode , deadline ) ; <nl> - } <nl> + _dbWriteLock . emplace ( opCtx , NamespaceString : : kLocalDb , lockMode , deadline ) ; <nl> + _collWriteLock . emplace ( opCtx , NamespaceString : : kRsOplogNamespace , lockMode , deadline ) ; <nl> } <nl> _oplogInfo = repl : : LocalOplogInfo : : get ( opCtx ) ; <nl> _oplog = _oplogInfo - > getCollection ( ) ; <nl> mmm a / src / mongo / db / catalog_raii . h <nl> ppp b / src / mongo / db / catalog_raii . h <nl> class ReadSourceScope { <nl> * | OplogAccessMode | Global Lock | ' local ' DB Lock | ' oplog . rs ' Collection Lock | <nl> * + mmmmmmmmmmmmmmm - - + mmmmmmmmmmmm - + mmmmmmmmmmmmmmm - - + mmmmmmmmmmmmmmmmmmmmmmmmmmm - | <nl> * | kRead | MODE_IS | MODE_IS | MODE_IS | <nl> - * | kWrite | MODE_IX | MODE_IX | MODE_IX | <nl> + * | kWrite / kLogOp | MODE_IX | MODE_IX | MODE_IX | <nl> * <nl> * kLogOp is a special mode for replication operation logging and it behaves similar to kWrite . The <nl> * difference between kWrite and kLogOp is that kLogOp invariants that global IX lock is already <nl> - * held and would only acquire database and collection locks listed above for <nl> - * non - document - level - locking engine only if those locks are not already held . And it is the <nl> - * caller ' s responsibility to ensure those locks already held are still valid within the lifetime of <nl> - * this object . <nl> + * held . It is the caller ' s responsibility to ensure the global lock already held is still valid <nl> + * within the lifetime of this object . <nl> * <nl> * Any acquired locks may be released when this object goes out of scope , therefore the oplog <nl> * collection reference returned by this class should not be retained . <nl>
|
SERVER - 46930 : Fix AutoGetOplog for non - document - locking storage engines
|
mongodb/mongo
|
4c4cd897f09a85441ad60058b42ea1149b65d7de
|
2020-03-18T15:06:53Z
|
Binary files a / src / lang / qbittorrent_bg . qm and b / src / lang / qbittorrent_bg . qm differ <nl> mmm a / src / lang / qbittorrent_bg . ts <nl> ppp b / src / lang / qbittorrent_bg . ts <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> - < ! DOCTYPE TS > < TS version = " 1 . 1 " language = " bg " > <nl> + < ! DOCTYPE TS > < TS version = " 1 . 1 " > <nl> < context > <nl> < name > @ default < / name > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > b < / source > <nl> < comment > bytes < / comment > <nl> < translation type = " obsolete " > b < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > KB < / source > <nl> < translation type = " obsolete " > КB < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > MB < / source > <nl> < translation type = " obsolete " > MB < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > GB < / source > <nl> < translation type = " obsolete " > GB < / translation > <nl> < / message > <nl> <nl> < translation > Франция < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > chris @ dchris . eu < / source > <nl> < translation type = " obsolete " > chris @ dchris . eu < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > http : / / dchris . eu < / source > <nl> < translation type = " obsolete " > http : / / dchris . eu < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / about . ui " line = " 362 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Thanks To < / source > <nl> < translation type = " obsolete " > Благодарим на < / translation > <nl> < / message > <nl> <nl> < translation > & lt ; h3 & gt ; & lt ; b & gt ; qBittorrent & lt ; / b & gt ; & lt ; / h3 & gt ; < / translation > <nl> < / message > <nl> < message encoding = " UTF - 8 " > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > A bittorrent client using Qt4 and libtorrent , programmed in C + + . & lt ; br & gt ; <nl> & lt ; br & gt ; <nl> Copyright © 2006 by Christophe Dumez & lt ; br & gt ; <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> & lt ; br & gt ; & lt ; u & gt ; WEB - страница : & lt ; / u & gt ; & lt ; i & gt ; http : / / qbittorrent . sourceforge . net & lt ; / i & gt ; & lt ; br & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > qBittorrent Author < / source > <nl> < translation type = " obsolete " > Автор на qBittorrent < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < message > <nl> < location filename = " . . / about . ui " line = " 362 " / > <nl> < source > Thanks to < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Благодарим на < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < message > <nl> < location filename = " . . / allocationDlg . h " line = " 48 " / > <nl> < source > Upload limit : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Лимит качване : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / allocationDlg . h " line = " 50 " / > <nl> < source > Download limit : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Лимит сваляне : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / allocationDlg . h " line = " 122 " / > <nl> < source > Unlimited < / source > <nl> < comment > Unlimited ( bandwidth ) < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Неограничен < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / allocationDlg . h " line = " 126 " / > <nl> < source > KiB / s < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > KiB / с < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Kb / s < / source > <nl> < translation type = " obsolete " > Kb / с < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > връзки < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > to < / source > <nl> < translation type = " obsolete " > към < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Прокси Настройки < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / options . ui " line = " 1251 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Server IP : < / source > <nl> < translation type = " obsolete " > Сървър IP : < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Език < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Please choose your preferred language in the following list : < / source > <nl> < translation type = " obsolete " > Моля изберете предпочитан език от следния списък : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > English < / source > <nl> < translation type = " obsolete " > Английски < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > French < / source > <nl> < translation type = " obsolete " > Френски < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Simplified Chinese < / source > <nl> < translation type = " obsolete " > Опростен Китайски < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / options . ui " line = " 1658 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > OK < / source > <nl> < translation type = " obsolete " > ОК < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / options . ui " line = " 1665 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Cancel < / source > <nl> < translation type = " obsolete " > Прекъсни < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Language settings will take effect after restart . < / source > <nl> < translation type = " obsolete " > Езиковите настройки ще работят след рестартиране . < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Разреши търсене в директория ( автоматично добавя намерени торент - файлове ) < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Korean < / source > <nl> < translation type = " obsolete " > Корейски < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Spanish < / source > <nl> < translation type = " obsolete " > Испански < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > German < / source > <nl> < translation type = " obsolete " > Немски < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / options . ui " line = " 87 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Connection Settings < / source > <nl> < translation type = " obsolete " > Настройки на Връзката < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Процент на споделяне : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > 1 KB DL = < / source > <nl> < translation type = " obsolete " > 1 KB DL = < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > KB UP max . < / source > <nl> < translation type = " obsolete " > KB UP max . < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Настройки на Филтъра < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > ipfilter . dat URL or PATH : < / source > <nl> < translation type = " obsolete " > ipfilter . dat URL или PATH : < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Коментар < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / options . ui " line = " 1675 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Apply < / source > <nl> < translation type = " obsolete " > Приложи < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Премахни Обхват < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Catalan < / source > <nl> < translation type = " obsolete " > Каталонски < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Допълнения < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / options . ui " line = " 849 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Ask for confirmation on exit < / source > <nl> < translation type = " obsolete " > Искай потвърждение при изход < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Clear finished downloads on exit < / source > <nl> < translation type = " obsolete " > Изтрий свалените при изход < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Поведение < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > OSD < / source > <nl> < translation type = " obsolete " > OSD < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Always display OSD < / source > <nl> < translation type = " obsolete " > Винаги показвай OSD < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Display OSD only if window is minimized or iconified < / source > <nl> < translation type = " obsolete " > Покажи OSD само ако минимизиран или иконизиран < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Never display OSD < / source > <nl> < translation type = " obsolete " > Не показвай OSD < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > KB UP max . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > DHT ( Trackerless ) : < / source > <nl> < translation type = " obsolete " > DHT ( без Тракери ) : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Disable DHT ( Trackerless ) support < / source > <nl> < translation type = " obsolete " > Изключи DHT ( без Тракери ) поддръжката < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / options . ui " line = " 1255 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Automatically clear finished downloads < / source > <nl> < translation type = " obsolete " > Автоматично изтриване на завършили сваляния < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Път за съхранение по подразбиране < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / options . ui " line = " 1327 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Systray Messages < / source > <nl> < translation type = " obsolete " > Съобщения на Системата < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < message > <nl> < location filename = " . . / options . ui " line = " 78 " / > <nl> < source > Connection < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Връзка < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 511 " / > <nl> < source > Peer eXchange ( PeX ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Peer eXchange ( PeX ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 541 " / > <nl> < source > DHT ( trackerless ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > DHT ( без тракер ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 736 " / > <nl> < source > Torrent addition < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Добавяне на Торент < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 823 " / > <nl> < source > Main window < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Основен прозорец < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 872 " / > <nl> < source > Systray messages < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Системни съобщения < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1547 " / > <nl> < source > Directory scan < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Сканиране на директория < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1661 " / > <nl> < source > Style ( Look & apos ; n Feel ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Стил ( Виж и Чувствай ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1673 " / > <nl> < source > Plastique style ( KDE like ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Пластмасов стил ( подобен на KDE ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1683 " / > <nl> < source > Cleanlooks style ( GNOME like ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Изчистен стил ( подобен на GNOME ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1690 " / > <nl> < source > Motif style ( default Qt style on Unix systems ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Мотив стил ( стил по подразбиране на Qt на Юникс системи ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1697 " / > <nl> < source > CDE style ( Common Desktop Environment like ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Стил CDE ( подобен на обичайния стил на десктоп ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1707 " / > <nl> < source > MacOS style ( MacOSX only ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > MacOS стил ( само за MacOSX ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 835 " / > <nl> < source > Exit confirmation when the download list is not empty < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Потвърждение за изход когато листа за сваляне не е празен < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 862 " / > <nl> < source > Disable systray integration < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Изключи вмъкване в systray < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1717 " / > <nl> < source > WindowsXP style ( Windows XP only ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > WindowsXP стил ( само на Windows XP ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1237 " / > <nl> < source > Server IP or url : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > IP или URL на Сървъра : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1310 " / > <nl> < source > Proxy type : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Тип Прокси : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1318 " / > <nl> < source > HTTP < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > HTTP < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1323 " / > <nl> < source > SOCKS5 < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > SOCKS5 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1447 " / > <nl> < source > Affected connections < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Засегнати връзки < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1459 " / > <nl> < source > Use proxy for connections to trackers < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Използвай прокси за връзка към тракерите < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1475 " / > <nl> < source > Use proxy for connections to regular peers < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Ползвай прокси за свързване към стандартните връзки < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1491 " / > <nl> < source > Use proxy for connections to web seeds < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Използвай прокси за връзки към web донори < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 1507 " / > <nl> < source > Use proxy for DHT messages < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Използвай прокси за DHT съобщенията < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 627 " / > <nl> < source > Encryption < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Кодиране < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 655 " / > <nl> < source > Encryption state : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Състояние на кодиране : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 663 " / > <nl> < source > Enabled < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Включено < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 668 " / > <nl> < source > Forced < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Форсирано < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / options . ui " line = " 673 " / > <nl> < source > Disabled < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Изключено < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 55 " / > <nl> < source > Name < / source > <nl> < comment > i . e : file name < / comment > <nl> - < translation type = " unfinished " > Име < / translation > <nl> + < translation > Име < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 56 " / > <nl> < source > Size < / source > <nl> < comment > i . e : file size < / comment > <nl> - < translation type = " unfinished " > Размер < / translation > <nl> + < translation > Размер < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 57 " / > <nl> < source > Progress < / source > <nl> < comment > i . e : % downloaded < / comment > <nl> - < translation type = " unfinished " > Изпълнение < / translation > <nl> + < translation > Изпълнение < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 58 " / > <nl> < source > DL Speed < / source > <nl> < comment > i . e : Download speed < / comment > <nl> - < translation type = " unfinished " > DL Скорост < / translation > <nl> + < translation > DL Скорост < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 59 " / > <nl> < source > UP Speed < / source > <nl> < comment > i . e : Upload speed < / comment > <nl> - < translation type = " unfinished " > UP Скорост < / translation > <nl> + < translation > UP Скорост < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 60 " / > <nl> < source > Seeds / Leechs < / source > <nl> < comment > i . e : full / partial sources < / comment > <nl> - < translation type = " unfinished " > Даващи / Вземащи < / translation > <nl> + < translation > Даващи / Вземащи < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 61 " / > <nl> < source > Ratio < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Съотношение < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 62 " / > <nl> < source > ETA < / source > <nl> < comment > i . e : Estimated Time of Arrival / Time left < / comment > <nl> - < translation type = " unfinished " > ЕТА < / translation > <nl> + < translation > ЕТА < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 98 " / > <nl> < source > qBittorrent % 1 started . < / source > <nl> < comment > e . g : qBittorrent v0 . x started . < / comment > <nl> - < translation type = " unfinished " > qBittorrent % 1 стартиран . < / translation > <nl> + < translation > qBittorrent % 1 стартиран . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 99 " / > <nl> < source > Be careful , sharing copyrighted material without permission is against the law . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Внимание , споделяне на защитен от авторски права материал без разрешение е незаконно . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 123 " / > <nl> < source > & lt ; font color = & apos ; red & apos ; & gt ; % 1 & lt ; / font & gt ; & lt ; i & gt ; was blocked & lt ; / i & gt ; < / source > <nl> < comment > x . y . z . w was blocked < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > & lt ; font color = & apos ; red & apos ; & gt ; % 1 & lt ; / font & gt ; & lt ; i & gt ; бе блокиран & lt ; / i & gt ; < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 197 " / > <nl> < source > Fast resume data was rejected for torrent % 1 , checking again . . . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Бърза пауза бе отхвърлена за торент % 1 , нова проверка . . . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 201 " / > <nl> < source > Url seed lookup failed for url : % 1 , message : % 2 < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Url споделяне провалено за url : % 1 , съобщение : % 2 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 633 " / > <nl> < source > & apos ; % 1 & apos ; added to download list . < / source > <nl> < comment > & apos ; / home / y / xxx . torrent & apos ; was added to download list . < / comment > <nl> - < translation type = " unfinished " > & apos ; % 1 & apos ; добавен в листа за сваляне . < / translation > <nl> + < translation > & apos ; % 1 & apos ; добавен в листа за сваляне . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 635 " / > <nl> < source > & apos ; % 1 & apos ; resumed . ( fast resume ) < / source > <nl> < comment > & apos ; / home / y / xxx . torrent & apos ; was resumed . ( fast resume ) < / comment > <nl> - < translation type = " unfinished " > & apos ; % 1 & apos ; бе възстановен . ( бързо възстановяване ) < / translation > <nl> + < translation > & apos ; % 1 & apos ; бе възстановен . ( бързо възстановяване ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 643 " / > <nl> < source > & apos ; % 1 & apos ; is already in download list . < / source > <nl> < comment > e . g : & apos ; xxx . avi & apos ; is already in download list . < / comment > <nl> - < translation type = " unfinished " > & apos ; % 1 & apos ; вече е в листа за сваляне . < / translation > <nl> + < translation > & apos ; % 1 & apos ; вече е в листа за сваляне . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 647 " / > <nl> < source > Unable to decode torrent file : & apos ; % 1 & apos ; < / source > <nl> < comment > e . g : Unable to decode torrent file : & apos ; / home / y / xxx . torrent & apos ; < / comment > <nl> - < translation type = " unfinished " > Не мога да декодирам торент - файла : & apos ; % 1 & apos ; < / translation > <nl> + < translation > Не мога да декодирам торент - файла : & apos ; % 1 & apos ; < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 648 " / > <nl> < source > This file is either corrupted or this isn & apos ; t a torrent . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Този файла или е разрушен или не е торент . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 662 " / > <nl> < source > Couldn & apos ; t listen on any of the given ports . < / source > <nl> - < translation type = " unfinished " > Невъзможно изчакване от дадените портове . < / translation > <nl> + < translation > Невъзможно изчакване от дадените портове . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 686 " / > <nl> < source > Downloading & apos ; % 1 & apos ; , please wait . . . < / source > <nl> < comment > e . g : Downloading & apos ; xxx . torrent & apos ; , please wait . . . < / comment > <nl> - < translation type = " unfinished " > Сваляне на & apos ; % 1 & apos ; , моля изчакайте . . . < / translation > <nl> + < translation > Сваляне на & apos ; % 1 & apos ; , моля изчакайте . . . < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < message > <nl> < location filename = " . . / FinishedListDelegate . h " line = " 61 " / > <nl> < source > KiB / s < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > KiB / с < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> < name > FinishedTorrents < / name > <nl> < message > <nl> - < location filename = " . . / FinishedTorrents . cpp " line = " 209 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Finished < / source > <nl> < translation type = " obsolete " > Завършен < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < location filename = " . . / FinishedTorrents . cpp " line = " 41 " / > <nl> < source > Name < / source > <nl> < comment > i . e : file name < / comment > <nl> - < translation type = " unfinished " > Име < / translation > <nl> + < translation > Име < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / FinishedTorrents . cpp " line = " 42 " / > <nl> < source > Size < / source > <nl> < comment > i . e : file size < / comment > <nl> - < translation type = " unfinished " > Размер < / translation > <nl> + < translation > Размер < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / FinishedTorrents . cpp " line = " 43 " / > <nl> < source > Progress < / source > <nl> < comment > i . e : % downloaded < / comment > <nl> - < translation type = " unfinished " > Изпълнение < / translation > <nl> + < translation > Изпълнение < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / FinishedTorrents . cpp " line = " 38 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > DL Speed < / source > <nl> < comment > i . e : Download speed < / comment > <nl> < translation type = " obsolete " > DL Скорост < / translation > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < location filename = " . . / FinishedTorrents . cpp " line = " 44 " / > <nl> < source > UP Speed < / source > <nl> < comment > i . e : Upload speed < / comment > <nl> - < translation type = " unfinished " > UP Скорост < / translation > <nl> + < translation > UP Скорост < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / FinishedTorrents . cpp " line = " 45 " / > <nl> < source > Seeds / Leechs < / source > <nl> < comment > i . e : full / partial sources < / comment > <nl> - < translation type = " unfinished " > Даващи / Вземащи < / translation > <nl> + < translation > Даващи / Вземащи < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / FinishedTorrents . cpp " line = " 41 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Status < / source > <nl> < translation type = " obsolete " > Състояние < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / FinishedTorrents . cpp " line = " 42 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > ETA < / source > <nl> < comment > i . e : Estimated Time of Arrival / Time left < / comment > <nl> < translation type = " obsolete " > ЕТА < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / FinishedTorrents . cpp " line = " 102 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Finished < / source > <nl> < comment > i . e : Torrent has finished downloading < / comment > <nl> < translation type = " obsolete " > Завършен < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / FinishedTorrents . cpp " line = " 240 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > None < / source > <nl> < comment > i . e : No error message < / comment > <nl> < translation type = " obsolete " > Няма < / translation > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < message > <nl> < location filename = " . . / FinishedTorrents . cpp " line = " 46 " / > <nl> < source > Ratio < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Съотношение < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Отвори Торент Файлове < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > kb / s < / source > <nl> < translation type = " obsolete " > kb / с < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Unknown < / source > <nl> < translation type = " obsolete " > Неизвестен < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1161 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > This file is either corrupted or this isn & apos ; t a torrent . < / source > <nl> < translation type = " obsolete " > Файла или е разрушен или не е торент . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Are you sure you want to delete all files in download list ? < / source > <nl> < translation type = " obsolete " > Сигурни ли сте че искате да изтриете всички файлове от списъка за сваляне ? < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Сигурни ли сте че искате да изтриете избраните файлове от списъка за сваляне ? < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > paused < / source > <nl> < translation type = " obsolete " > прекъснат < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > started < / source > <nl> < translation type = " obsolete " > стартиран < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > kb / s < / source > <nl> < translation type = " obsolete " > kb / с < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 905 " / > <nl> < source > Finished < / source > <nl> - < translation type = " unfinished " > Завършен < / translation > <nl> + < translation > Завършен < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Checking . . . < / source > <nl> < translation type = " obsolete " > Проверка . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1411 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Connecting . . . < / source > <nl> < translation type = " obsolete " > Свързване . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 583 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Downloading . . . < / source > <nl> < translation type = " obsolete " > Сваляне . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Download list cleared . < / source > <nl> < translation type = " obsolete " > Списъка за сваляне е създаден . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > All Downloads Paused . < / source > <nl> < translation type = " obsolete " > Всички Сваляния са Прекъснати . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > All Downloads Resumed . < / source > <nl> < translation type = " obsolete " > Всички Сваляния са Възстановени . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > DL Speed : < / source > <nl> < translation type = " obsolete " > DL Скорост : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > started . < / source > <nl> < translation type = " obsolete " > стартиран . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > UP Speed : < / source > <nl> < translation type = " obsolete " > UP Скорост : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Couldn & apos ; t create the directory : < / source > <nl> < translation type = " obsolete " > Не мога да създам директория : < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Торент Файлове < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > already in download list . < / source > <nl> < comment > & lt ; file & gt ; already in download list . < / comment > <nl> < translation type = " obsolete " > вече е в списъка за сваляне . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > added to download list . < / source > <nl> < translation type = " obsolete " > е добавен в списъка за сваляне . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > resumed . ( fast resume ) < / source > <nl> < translation type = " obsolete " > възстановен . ( бързо възстановяване ) < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Unable to decode torrent file : < / source > <nl> < translation type = " obsolete " > Не мога да декодирам торент - файла : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > removed . < / source > <nl> < comment > & lt ; file & gt ; removed . < / comment > <nl> < translation type = " obsolete " > премахнат . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > paused . < / source > <nl> < comment > & lt ; file & gt ; paused . < / comment > <nl> < translation type = " obsolete " > прекъснат . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > resumed . < / source > <nl> < comment > & lt ; file & gt ; resumed . < / comment > <nl> < translation type = " obsolete " > възстановен . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > m < / source > <nl> < comment > minutes < / comment > <nl> < translation type = " obsolete " > м < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > h < / source > <nl> < comment > hours < / comment > <nl> < translation type = " obsolete " > ч < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > d < / source > <nl> < comment > days < / comment > <nl> < translation type = " obsolete " > д < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Listening on port : < / source > <nl> < translation type = " obsolete " > Очакване от порт : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > qBittorrent < / source > <nl> < translation type = " obsolete " > qBittorrent < / translation > <nl> < / message > <nl> Copyright © 2006 на Christophe Dumez & lt ; br & gt ; <nl> < translation > Сигурни ли сте ? - - qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & lt ; b & gt ; qBittorrent & lt ; / b & gt ; & lt ; br & gt ; DL Speed : < / source > <nl> < translation type = " obsolete " > & lt ; b & gt ; qBittorrent & lt ; / b & gt ; & lt ; br & gt ; DL Скорост : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > : : By Christophe Dumez : : Copyright ( c ) 2006 < / source > <nl> < translation type = " obsolete " > : От Christophe Dumez : : Copyright ( c ) 2006 < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & lt ; b & gt ; Connection Status : & lt ; / b & gt ; & lt ; br & gt ; Online < / source > <nl> < translation type = " obsolete " > & lt ; b & gt ; Състояние на Връзка : & lt ; / b & gt ; & lt ; br & gt ; Онлайн < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & lt ; b & gt ; Connection Status : & lt ; / b & gt ; & lt ; br & gt ; Firewalled ? & lt ; br & gt ; & lt ; i & gt ; No incoming connections . . . & lt ; / i & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; b & gt ; Състояние на Връзка : & lt ; / b & gt ; & lt ; br & gt ; С Firewall ? & lt ; br & gt ; & lt ; i & gt ; Няма входящи връзки . . . & lt ; / i & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & lt ; b & gt ; Connection Status : & lt ; / b & gt ; & lt ; br & gt ; Offline & lt ; br & gt ; & lt ; i & gt ; No peers found . . . & lt ; / i & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; b & gt ; Състояние на Връзка : & lt ; / b & gt ; & lt ; br & gt ; Офлайн & lt ; br & gt ; & lt ; i & gt ; Няма намерени peers . . . & lt ; / i & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > / s < / source > <nl> < comment > & lt ; unit & gt ; / seconds < / comment > <nl> < translation type = " obsolete " > / с < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > has finished downloading . < / source > <nl> < translation type = " obsolete " > е завършил свалянето . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1691 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Couldn & apos ; t listen on any of the given ports . < / source > <nl> < translation type = " obsolete " > Невъзможно изчакване от дадените портове . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > None < / source > <nl> < translation type = " obsolete " > Няма < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > KiB / s < / source > <nl> < translation type = " obsolete " > KiB / с < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Are you sure you want to quit ? - - qBittorrent < / source > <nl> < translation type = " obsolete " > Сигурни ли сте че искате да напуснете ? - - qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Are you sure you want to quit qbittorrent ? < / source > <nl> < translation type = " obsolete " > Сигурни ли сте че искате да напуснете qbittorrent ? < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > KiB / s < / source > <nl> < translation type = " obsolete " > KiB / с < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1450 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Please type a search pattern first < / source > <nl> < translation type = " obsolete " > Моля първо изберете тип на търсене < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > No seach engine selected < / source > <nl> < translation type = " obsolete " > Не е избрана търсачка < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1468 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > You must select at least one search engine . < / source > <nl> < translation type = " obsolete " > Трябва да изберете поне една търсачка . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Could not create search plugin . < / source > <nl> < translation type = " obsolete " > Невъзможно създаване на допълнение за търсене . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1508 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Searching . . . < / source > <nl> < translation type = " obsolete " > Търсене . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Error during search . . . < / source > <nl> < translation type = " obsolete " > Грешка при търсене . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Stopped < / source > <nl> < translation type = " obsolete " > Спрян < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Timed out < / source > <nl> < translation type = " obsolete " > Изтекъл срок < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Failed to download : < / source > <nl> < translation type = " obsolete " > Грешка при сваляне : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > A http download failed , reason : < / source > <nl> < translation type = " obsolete " > Сваляне от http грешно , причина : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Torrent file URL < / source > <nl> < translation type = " obsolete " > Торент файл URL < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Torrent file URL : < / source > <nl> < translation type = " obsolete " > Торент файл URL : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > I / O Error < / source > <nl> < translation type = " obsolete " > I / O Грешка < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Couldn & apos ; t create temporary file on hard drive . < / source > <nl> < translation type = " obsolete " > Невъзможно създаване на временен файл на диска . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Downloading using HTTP : < / source > <nl> < translation type = " obsolete " > Сваляне ползвайки HTTP : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search is finished < / source > <nl> < translation type = " obsolete " > Търсенето завърши < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1721 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > An error occured during search . . . < / source > <nl> < translation type = " obsolete " > Намерена грешка при търсенето . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1724 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search aborted < / source > <nl> < translation type = " obsolete " > Търсенето е прекъснато < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1727 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search returned no results < / source > <nl> < translation type = " obsolete " > Търсене без резултат < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search is Finished < / source > <nl> < translation type = " obsolete " > Търсенето е завършено < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1703 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search plugin update - - qBittorrent < / source > <nl> < translation type = " obsolete " > Обновяване на добавката за търсене - - qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1687 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search plugin can be updated , do you want to update it ? <nl> <nl> Changelog : <nl> Changelog : <nl> < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1701 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Sorry , update server is temporarily unavailable . < / source > <nl> < translation type = " obsolete " > Съжалявам , сървъра за обновяване е временно недостъпен . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1704 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Your search plugin is already up to date . < / source > <nl> < translation type = " obsolete " > Вашата добавка за търсене е вече обновена . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1544 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Results < / source > <nl> < translation type = " obsolete " > Резултати < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Name < / source > <nl> < translation type = " obsolete " > Име < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Size < / source > <nl> < translation type = " obsolete " > Размер < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Progress < / source > <nl> < translation type = " obsolete " > Изпълнение < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > DL Speed < / source > <nl> < translation type = " obsolete " > DL Скорост < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > UP Speed < / source > <nl> < translation type = " obsolete " > UP Скорост < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 134 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Status < / source > <nl> < translation type = " obsolete " > Състояние < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > ETA < / source > <nl> < translation type = " obsolete " > ЕТА < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Seeders < / source > <nl> < translation type = " obsolete " > Даващи < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Leechers < / source > <nl> < translation type = " obsolete " > Вземащи < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 207 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search engine < / source > <nl> < translation type = " obsolete " > Програма за търсене < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Stalled < / source > <nl> < comment > state of a torrent whose DL Speed is 0 < / comment > <nl> < translation type = " obsolete " > Отложен < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1477 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Paused < / source > <nl> < translation type = " obsolete " > Пауза < / translation > <nl> < / message > <nl> Please close the other one first . < / source > <nl> Моля , затворете първо другия процес . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Couldn & apos ; t download < / source > <nl> < comment > Couldn & apos ; t download & lt ; file & gt ; < / comment > <nl> < translation type = " obsolete " > Свалянето е невъзможно < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > reason : < / source > <nl> < comment > Reason why the download failed < / comment > <nl> < translation type = " obsolete " > причина : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Downloading < / source > <nl> < comment > Example : Downloading www . example . com / test . torrent < / comment > <nl> < translation type = " obsolete " > Сваляне < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Please wait . . . < / source > <nl> < translation type = " obsolete " > Моля , изчакайте . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 887 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Transfers < / source > <nl> < translation type = " obsolete " > Трансфери < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 660 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Are you sure you want to quit qBittorrent ? < / source > <nl> < translation type = " obsolete " > Сигурни ли сте че искате да напуснете qBittorrent ? < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1005 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Are you sure you want to delete the selected item ( s ) in download list and in hard drive ? < / source > <nl> < translation type = " obsolete " > Сигурни ли сте че искате да изтриете избраните файлове от списъка за сваляне и от твърдия диск ? < / translation > <nl> < / message > <nl> Please close the other one first . < / source > <nl> < translation > Свалянето завърши < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > has finished downloading . < / source > <nl> < comment > & lt ; filename & gt ; has finished downloading . < / comment > <nl> < translation type = " obsolete " > е завършил свалянето . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1718 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search Engine < / source > <nl> < translation type = " obsolete " > Търсачка < / translation > <nl> < / message > <nl> Please close the other one first . < / source > <nl> < translation > Няма връзки . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 124 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Name < / source > <nl> < comment > i . e : file name < / comment > <nl> < translation type = " obsolete " > Име < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 125 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Size < / source > <nl> < comment > i . e : file size < / comment > <nl> < translation type = " obsolete " > Размер < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 126 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Progress < / source > <nl> < comment > i . e : % downloaded < / comment > <nl> < translation type = " obsolete " > Изпълнение < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 127 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > DL Speed < / source > <nl> < comment > i . e : Download speed < / comment > <nl> < translation type = " obsolete " > DL Скорост < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 128 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > UP Speed < / source > <nl> < comment > i . e : Upload speed < / comment > <nl> < translation type = " obsolete " > UP Скорост < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 129 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Seeds / Leechs < / source > <nl> < comment > i . e : full / partial sources < / comment > <nl> < translation type = " obsolete " > Даващи / Вземащи < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 131 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > ETA < / source > <nl> < comment > i . e : Estimated Time of Arrival / Time left < / comment > <nl> < translation type = " obsolete " > ЕТА < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 205 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Seeders < / source > <nl> < comment > i . e : Number of full sources < / comment > <nl> < translation type = " obsolete " > Даващи < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 206 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Leechers < / source > <nl> < comment > i . e : Number of partial sources < / comment > <nl> < translation type = " obsolete " > Вземащи < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 203 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > qBittorrent % 1 started . < / source > <nl> < comment > e . g : qBittorrent v0 . x started . < / comment > <nl> < translation type = " obsolete " > qBittorrent % 1 стартиран . < / translation > <nl> Please close the other one first . < / source > <nl> < translation > UL Скорост % 1 KB / с < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 448 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Finished < / source > <nl> < comment > i . e : Torrent has finished downloading < / comment > <nl> < translation type = " obsolete " > Завършен < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 558 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Checking . . . < / source > <nl> < comment > i . e : Checking already downloaded parts . . . < / comment > <nl> < translation type = " obsolete " > Проверка . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 588 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Stalled < / source > <nl> < comment > i . e : State of a torrent whose download speed is 0kb / s < / comment > <nl> < translation type = " obsolete " > Отложен < / translation > <nl> Please close the other one first . < / source > <nl> < translation > & apos ; % 1 & apos ; бе премахнат . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1146 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & apos ; % 1 & apos ; added to download list . < / source > <nl> < comment > & apos ; / home / y / xxx . torrent & apos ; was added to download list . < / comment > <nl> < translation type = " obsolete " > & apos ; % 1 & apos ; добавен в листа за сваляне . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1148 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & apos ; % 1 & apos ; resumed . ( fast resume ) < / source > <nl> < comment > & apos ; / home / y / xxx . torrent & apos ; was resumed . ( fast resume ) < / comment > <nl> < translation type = " obsolete " > & apos ; % 1 & apos ; бе възстановен . ( бързо възстановяване ) < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1156 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & apos ; % 1 & apos ; is already in download list . < / source > <nl> < comment > e . g : & apos ; xxx . avi & apos ; is already in download list . < / comment > <nl> < translation type = " obsolete " > & apos ; % 1 & apos ; вече е в листа за сваляне . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1160 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Unable to decode torrent file : & apos ; % 1 & apos ; < / source > <nl> < comment > e . g : Unable to decode torrent file : & apos ; / home / y / xxx . torrent & apos ; < / comment > <nl> < translation type = " obsolete " > Не мога да декодирам торент - файла : & apos ; % 1 & apos ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1234 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > None < / source > <nl> < comment > i . e : No error message < / comment > <nl> < translation type = " obsolete " > Няма < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 956 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Listening on port : % 1 < / source > <nl> < comment > e . g : Listening on port : 1666 < / comment > <nl> < translation type = " obsolete " > Прослушване на порт : % 1 < / translation > <nl> Please close the other one first . < / source > <nl> < translation > & apos ; % 1 & apos ; е в пауза . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1388 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Connecting . . . < / source > <nl> < comment > i . e : Connecting to the tracker . . . < / comment > <nl> < translation type = " obsolete " > Свързване . . . < / translation > <nl> Please close the other one first . < / source > <nl> < translation > Намерена грешка при четене или записване на % 1 . Вероятно диска е пълен , свалянето е в пауза < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > An error occured ( full fisk ? ) , & apos ; % 1 & apos ; paused . < / source > <nl> < comment > e . g : An error occured ( full fisk ? ) , & apos ; xxx . avi & apos ; paused . < / comment > <nl> < translation type = " obsolete " > Намерена грешка ( пълен диск ? ) , & apos ; % 1 & apos ; е в пауза . < / translation > <nl> Please close the other one first . < / source > <nl> < translation > Няма входящи връзки . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1468 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > No search engine selected < / source > <nl> < translation type = " obsolete " > Не е избрана търсачка < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1700 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search plugin update < / source > <nl> < translation type = " obsolete " > Допълнението за търсене е обновено < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1729 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search has finished < / source > <nl> < translation type = " obsolete " > Търсенето завърши < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1733 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Results < / source > <nl> < comment > i . e : Search results < / comment > <nl> < translation type = " obsolete " > Резултати < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / GUI . cpp " line = " 1778 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Downloading & apos ; % 1 & apos ; , please wait . . . < / source > <nl> < comment > e . g : Downloading & apos ; xxx . torrent & apos ; , please wait . . . < / comment > <nl> < translation type = " obsolete " > Сваляне на & apos ; % 1 & apos ; , моля изчакайте . . . < / translation > <nl> Please close the other one first . < / source > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 139 " / > <nl> < source > Search < / source > <nl> - < translation type = " unfinished " > Търси < / translation > <nl> + < translation > Търси < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 143 " / > <nl> < source > RSS < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > RSS < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 788 " / > <nl> < source > qBittorrent is bind to port : % 1 < / source > <nl> < comment > e . g : qBittorrent is bind to port : 1666 < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > qBittorrent е свързан с порт : % 1 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 813 " / > <nl> < source > DHT support [ ON ] , port : % 1 < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > DHT поддръжка [ ВКЛ ] , порт : % 1 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 818 " / > <nl> < source > DHT support [ OFF ] < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > DHT поддръжка [ ИЗКЛ ] < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 848 " / > <nl> < source > PeX support [ ON ] < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > PeX поддръжка [ ВКЛ ] < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 851 " / > <nl> < source > PeX support [ OFF ] < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > PeX поддръжка [ ИЗКЛ ] < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 490 " / > <nl> < source > The download list is not empty . <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Листата за сваляне не е празна . <nl> + Сигурни ли сте че искате да напуснете qBittorrent ? < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 901 " / > <nl> < source > Downloads < / source > <nl> - < translation type = " unfinished " > Сваляне < / translation > <nl> + < translation > Сваляне < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 696 " / > <nl> < source > Are you sure you want to delete the selected item ( s ) in finished list ? < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Сигурни ли сте че искате да изтриете избраните файлове от списъка на завършените сваляния ? < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 822 " / > <nl> < source > UPnP support [ ON ] < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > UPnP поддръжка [ ВКЛ ] < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 832 " / > <nl> < source > Encryption support [ ON ] < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Поддръжка кодиране [ ВКЛ ] < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 837 " / > <nl> < source > Encryption support [ FORCED ] < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Поддръжка кодиране [ ФОРСИРАНА ] < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 842 " / > <nl> < source > Encryption support [ OFF ] < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Поддръжка кодиране [ ИЗКЛ ] < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 286 " / > <nl> < source > Alt + 1 < / source > <nl> < comment > shortcut to switch to first tab < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Alt + 1 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 288 " / > <nl> < source > Alt + 2 < / source > <nl> < comment > shortcut to switch to second tab < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Alt + 2 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 294 " / > <nl> < source > Alt + 4 < / source > <nl> < comment > shortcut to switch to fourth tab < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Alt + 4 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 362 " / > <nl> < source > Url download error < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Грешка при сваляне от Url < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 362 " / > <nl> < source > Couldn & apos ; t download file at url : % 1 , reason : % 2 . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Невъзможно сваляне на файл от url : % 1 , причина : % 2 . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 634 " / > <nl> < source > Are you sure you want to delete the selected item ( s ) from download list and from hard drive ? < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Сигурни ли сте че искате да изтриете избраните от списъка за сваляне или от твърдия диск ? < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 641 " / > <nl> < source > Are you sure you want to delete the selected item ( s ) from finished list and from hard drive ? < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Сигурни ли сте че искате да изтриете избраните от списъка на свалените или от твърдия диск ? < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 661 " / > <nl> < source > & apos ; % 1 & apos ; was removed permanently . < / source > <nl> < comment > & apos ; xxx . avi & apos ; was removed permanently . < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > & apos ; % 1 & apos ; бе премахнат завинаги . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 290 " / > <nl> < source > Alt + 3 < / source > <nl> < comment > shortcut to switch to third tab < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Alt + 3 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 292 " / > <nl> < source > Ctrl + F < / source > <nl> < comment > shortcut to switch to search tab < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Ctrl + F < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> < name > MainWindow < / name > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > qBittorrent : : By Christophe Dumez < / source > <nl> < translation type = " obsolete " > qBittorrent : : От Christophe Dumez < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 305 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Log : < / source > <nl> < translation type = " obsolete " > Log : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 77 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Total DL Speed : < / source > <nl> < translation type = " obsolete " > Обща DL Скорост : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Kb / s < / source > <nl> < translation type = " obsolete " > Kb / с < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 181 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Total UP Speed : < / source > <nl> < translation type = " obsolete " > Обща UP Скорост : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Name < / source > <nl> < translation type = " obsolete " > Име < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Size < / source > <nl> < translation type = " obsolete " > Размер < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > % DL < / source > <nl> < translation type = " obsolete " > % DL < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > DL Speed < / source > <nl> < translation type = " obsolete " > DL Скорост < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > UP Speed < / source > <nl> < translation type = " obsolete " > UP Скорост < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Status < / source > <nl> < translation type = " obsolete " > Състояние < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > ETA < / source > <nl> < translation type = " obsolete " > ЕТА < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 373 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & amp ; Options < / source > <nl> < translation type = " obsolete " > & amp ; Опции < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < message > <nl> < location filename = " . . / MainWindow . ui " line = " 221 " / > <nl> < source > Documentation < / source > <nl> - < translation type = " unfinished " > Документация < / translation > <nl> + < translation > Документация < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Connexion Status < / source > <nl> < translation type = " obsolete " > Състояние на Връзките < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Delete All < / source > <nl> < translation type = " obsolete " > Изтрий Всички < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Характеристики на Торента < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 36 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Downloads < / source > <nl> < translation type = " obsolete " > Сваляне < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 210 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > KiB / s < / source > <nl> < translation type = " obsolete " > KiB / с < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 488 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search < / source > <nl> < translation type = " obsolete " > Търси < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 465 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search Pattern : < / source > <nl> < translation type = " obsolete " > Тип на търсене : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 504 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Stop < / source > <nl> < translation type = " obsolete " > Спри < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 538 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Status : < / source > <nl> < translation type = " obsolete " > Състояние : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 568 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Stopped < / source > <nl> < translation type = " obsolete " > Спрян < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 386 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search Engines < / source > <nl> < translation type = " obsolete " > Търсачки < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 627 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Results : < / source > <nl> < translation type = " obsolete " > Резултати : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Seeds < / source > <nl> < translation type = " obsolete " > Споделящи < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Leechers < / source > <nl> < translation type = " obsolete " > Вземащи < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search Engine < / source > <nl> < translation type = " obsolete " > Търсачка < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 685 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Download < / source > <nl> < translation type = " obsolete " > Свали < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 695 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Clear < / source > <nl> < translation type = " obsolete " > Изтрий < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Connection Status < / source > <nl> < translation type = " obsolete " > Състояние на Връзка < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Създай торент < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Ratio : < / source > <nl> < translation type = " obsolete " > Отношение : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 715 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Update search plugin < / source > <nl> < translation type = " obsolete " > Обнови допълнението за търсене < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 135 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Session ratio : < / source > <nl> < translation type = " obsolete " > Процент сесия : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / MainWindow . ui " line = " 36 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Transfers < / source > <nl> < translation type = " obsolete " > Трансфери < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < message > <nl> < location filename = " . . / MainWindow . ui " line = " 211 " / > <nl> < source > Set upload limit < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Определи лимит качване < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / MainWindow . ui " line = " 216 " / > <nl> < source > Set download limit < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Определи лимит сваляне < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / MainWindow . ui " line = " 226 " / > <nl> < source > Set global download limit < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Определи общ лимит сваляне < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / MainWindow . ui " line = " 231 " / > <nl> < source > Set global upload limit < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Определи общ лимит качване < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / MainWindow . ui " line = " 63 " / > <nl> < source > Options < / source > <nl> - < translation type = " unfinished " > Опции < / translation > <nl> + < translation > Опции < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> < name > PropListDelegate < / name > <nl> < message > <nl> - < location filename = " . . / PropListDelegate . h " line = " 136 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > False < / source > <nl> < translation type = " obsolete " > Грешно < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / PropListDelegate . h " line = " 135 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > True < / source > <nl> < translation type = " obsolete " > Вярно < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / PropListDelegate . h " line = " 121 " / > <nl> < source > Ignored < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Игнорирано < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / PropListDelegate . h " line = " 122 " / > <nl> < source > Normal < / source > <nl> < comment > Normal ( priority ) < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Нормален < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / PropListDelegate . h " line = " 123 " / > <nl> < source > High < / source > <nl> < comment > High ( priority ) < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Висок < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / PropListDelegate . h " line = " 124 " / > <nl> < source > Maximum < / source > <nl> < comment > Maximum ( priority ) < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Максимален < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> < name > QTextEdit < / name > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Clear < / source > <nl> < translation type = " obsolete " > Изтрий < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 13 " / > <nl> < source > Search < / source > <nl> - < translation type = " unfinished " > Търси < / translation > <nl> + < translation > Търси < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 216 " / > <nl> < source > Delete < / source > <nl> - < translation type = " unfinished " > Изтрий < / translation > <nl> + < translation > Изтрий < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 221 " / > <nl> < source > Rename < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Преименувай < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 226 " / > <nl> < source > Refresh < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Обнови < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / rss . ui " line = " 219 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Create < / source > <nl> < translation type = " obsolete " > Образуване < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 97 " / > <nl> < source > Delete selected streams < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Изтрий маркираните потоци < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 119 " / > <nl> < source > Refresh RSS streams < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Обнови потоците RSS < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 141 " / > <nl> < source > Add a new RSS stream < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Добави нов поток RSS < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 182 " / > <nl> < source > & lt ; b & gt ; News : & lt ; / b & gt ; & lt ; i & gt ; ( double - click to open the link in your web browser ) & lt ; / i & gt ; < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > & lt ; b & gt ; Новини : & lt ; / b & gt ; & lt ; i & gt ; ( щракни двойно за отваряне на линка в браузъра ) & lt ; / i & gt ; < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 231 " / > <nl> < source > Add RSS stream < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Добави поток RSS < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 236 " / > <nl> < source > Refresh all streams < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Обнови всички потоци < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 51 " / > <nl> < source > RSS streams : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Потоци RSS : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . ui " line = " 56 " / > <nl> < source > 2 < / source > <nl> - < translation type = " unfinished " > 2 < / translation > <nl> + < translation > 2 < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 147 " / > <nl> < source > Please type a rss stream url < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Моля въведете url на поток rss < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 147 " / > <nl> < source > Stream URL : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Поток URL : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 102 " / > <nl> < source > Please choose a new name for this stream < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Моля изберете ново име за този поток < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 102 " / > <nl> < source > New stream name : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Ново име на потока : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 59 " / > <nl> < source > Are you sure ? - - qBittorrent < / source > <nl> - < translation type = " unfinished " > Сигурни ли сте ? - - qBittorrent < / translation > <nl> + < translation > Сигурни ли сте ? - - qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 60 " / > <nl> < source > & amp ; Yes < / source > <nl> - < translation type = " unfinished " > & amp ; Да < / translation > <nl> + < translation > & amp ; Да < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 60 " / > <nl> < source > & amp ; No < / source > <nl> - < translation type = " unfinished " > & amp ; Не < / translation > <nl> + < translation > & amp ; Не < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 59 " / > <nl> < source > Are you sure you want to delete this stream from the list ? < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Сигурни ли сте че искате да изтриете този поток от списъка ? < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 243 " / > <nl> < source > Description : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Описание : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 243 " / > <nl> < source > url : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > url : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 243 " / > <nl> < source > Last refresh : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Последно обновяване : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 154 " / > <nl> < source > qBittorrent < / source > <nl> - < translation type = " unfinished " > qBittorrent < / translation > <nl> + < translation > qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss_imp . cpp " line = " 155 " / > <nl> < source > This rss feed is already in the list . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Този rss feed е вече в списъка . < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < message > <nl> < location filename = " . . / rss . h " line = " 95 " / > <nl> < source > No description available < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Няма налично описание < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < location filename = " . . / rss . h " line = " 262 " / > <nl> < source > % 1 ago < / source > <nl> < comment > 10min ago < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > преди % 1 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / rss . h " line = " 261 " / > <nl> < source > Never < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Никога < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < location filename = " . . / searchEngine . cpp " line = " 50 " / > <nl> < source > Name < / source > <nl> < comment > i . e : file name < / comment > <nl> - < translation type = " unfinished " > Име < / translation > <nl> + < translation > Име < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 51 " / > <nl> < source > Size < / source > <nl> < comment > i . e : file size < / comment > <nl> - < translation type = " unfinished " > Размер < / translation > <nl> + < translation > Размер < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 52 " / > <nl> < source > Seeders < / source > <nl> < comment > i . e : Number of full sources < / comment > <nl> - < translation type = " unfinished " > Даващи < / translation > <nl> + < translation > Даващи < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 53 " / > <nl> < source > Leechers < / source > <nl> < comment > i . e : Number of partial sources < / comment > <nl> - < translation type = " unfinished " > Вземащи < / translation > <nl> + < translation > Вземащи < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 54 " / > <nl> < source > Search engine < / source > <nl> - < translation type = " unfinished " > Програма за търсене < / translation > <nl> + < translation > Програма за търсене < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 251 " / > <nl> < source > Empty search pattern < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Празен образец за търсене < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 251 " / > <nl> < source > Please type a search pattern first < / source > <nl> - < translation type = " unfinished " > Моля първо изберете тип на търсене < / translation > <nl> + < translation > Моля първо въведете образец за търсене < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 286 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > No search engine selected < / source > <nl> < translation type = " obsolete " > Не е избрана търсачка < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 286 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > You must select at least one search engine . < / source > <nl> < translation type = " obsolete " > Трябва да изберете поне една търсачка . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 460 " / > <nl> < source > Results < / source > <nl> - < translation type = " unfinished " > Резултати < / translation > <nl> + < translation > Резултати < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 286 " / > <nl> < source > Searching . . . < / source > <nl> - < translation type = " unfinished " > Търсене . . . < / translation > <nl> + < translation > Търсене . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 469 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search plugin update - - qBittorrent < / source > <nl> < translation type = " obsolete " > Обновяване на добавката за търсене - - qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 448 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search plugin can be updated , do you want to update it ? <nl> <nl> Changelog : <nl> Changelog : <nl> < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 449 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & amp ; Yes < / source > <nl> < translation type = " obsolete " > & amp ; Да < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 449 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & amp ; No < / source > <nl> < translation type = " obsolete " > & amp ; Не < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 465 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search plugin update < / source > <nl> < translation type = " obsolete " > Допълнението за търсене е обновено < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 465 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > qBittorrent < / source > <nl> < translation type = " obsolete " > qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 466 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Sorry , update server is temporarily unavailable . < / source > <nl> < translation type = " obsolete " > Съжалявам , сървъра за обновяване е временно недостъпен . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 470 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Your search plugin is already up to date . < / source > <nl> < translation type = " obsolete " > Вашата добавка за търсене е вече обновена . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 394 " / > <nl> < source > Search Engine < / source > <nl> - < translation type = " unfinished " > Търсачка < / translation > <nl> + < translation > Търсачка < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 405 " / > <nl> < source > Search has finished < / source > <nl> - < translation type = " unfinished " > Търсенето завърши < / translation > <nl> + < translation > Търсенето завърши < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 397 " / > <nl> < source > An error occured during search . . . < / source > <nl> - < translation type = " unfinished " > Намерена грешка при търсенето . . . < / translation > <nl> + < translation > Намерена грешка при търсенето . . . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 400 " / > <nl> < source > Search aborted < / source > <nl> - < translation type = " unfinished " > Търсенето е прекъснато < / translation > <nl> + < translation > Търсенето е прекъснато < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 403 " / > <nl> < source > Search returned no results < / source > <nl> - < translation type = " unfinished " > Търсене без резултат < / translation > <nl> + < translation > Търсене завършено без резултат < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 409 " / > <nl> < source > Results < / source > <nl> < comment > i . e : Search results < / comment > <nl> - < translation type = " unfinished " > Резултати < / translation > <nl> + < translation > Резултати < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 433 " / > <nl> Changelog : <nl> < context > <nl> < name > Ui < / name > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > I would like to thank the following people who volonteered to translate qBittorrent : < / source > <nl> < translation type = " obsolete " > Бих искал да благодаря на следните доброволци , превели qBittorrent : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Please contact me if you would like to translate qBittorrent to your own language . < / source > <nl> < translation type = " obsolete " > Моля , свържете се с мен ако искате да преведете qBittorrent на вашия език . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > I would like to thank sourceforge . net for hosting qBittorrent project . < / source > <nl> < translation type = " obsolete " > Искам да благодаря на sourceforge . net за поемането на хоста на проекта qBittorrent . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > qBittorrent < / source > <nl> < translation type = " obsolete " > qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & lt ; ul & gt ; & lt ; li & gt ; I would like to thank sourceforge . net for hosting qBittorrent project . & lt ; / li & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; ul & gt ; & lt ; li & gt ; Бих искал да благодаря на sourceforge . net за хоста на qBittorrent проекта . & lt ; / li & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & lt ; li & gt ; I also like to thank Jeffery Fernandez ( developer @ jefferyfernandez . id . au ) , our RPM packager , for his great work . & lt ; / li & gt ; & lt ; / ul & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; li & gt ; Бих искал също да благодаря на Jeffery Fernandez ( developer @ jefferyfernandez . id . au ) , нашия RPM packager , за неговата отлична работа . & lt ; / li & gt ; & lt ; / ul & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / about_imp . h " line = " 44 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > I would like to thank the following people who volunteered to translate qBittorrent : < / source > <nl> < translation type = " obsolete " > Бих искал да благодаря на следните доброволци , превели qBittorent : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / previewSelect . h " line = " 126 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Preview impossible < / source > <nl> < translation type = " obsolete " > Оглед невъзможен < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / previewSelect . h " line = " 126 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Sorry , we can & apos ; t preview this file < / source > <nl> < translation type = " obsolete " > Съжалявам , не можем да огледаме този файл < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / previewSelect . h " line = " 98 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Name < / source > <nl> < translation type = " obsolete " > Име < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / previewSelect . h " line = " 99 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Size < / source > <nl> < translation type = " obsolete " > Размер < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / previewSelect . h " line = " 100 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Progress < / source > <nl> < translation type = " obsolete " > Изпълнение < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / downloadFromURLImp . h " line = " 64 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > No URL entered < / source > <nl> < translation type = " obsolete " > Невъведен URL < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / downloadFromURLImp . h " line = " 64 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Please type at least one URL . < / source > <nl> < translation type = " obsolete " > Моля въведете поне един URL . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / about_imp . h " line = " 37 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > qBittorrent < / source > <nl> < translation type = " obsolete " > qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / about_imp . h " line = " 68 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Please contact me if you would like to translate qBittorrent into your own language . < / source > <nl> < translation type = " obsolete " > Моля , свържете се с мен ако искате да преведете qBittorrent на вашия език . < / translation > <nl> < / message > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / about_imp . h " line = " 43 " / > <nl> < source > qBittorrent < / source > <nl> - < translation type = " unfinished " > qBittorrent < / translation > <nl> + < translation > qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / about_imp . h " line = " 54 " / > <nl> < source > I would like to thank the following people who volunteered to translate qBittorrent : < / source > <nl> - < translation type = " unfinished " > Бих искал да благодаря на следните доброволци , превели qBittorent : < / translation > <nl> + < translation > Бих искал да благодаря на следните доброволци , превели qBittorent : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / about_imp . h " line = " 79 " / > <nl> < source > Please contact me if you would like to translate qBittorrent into your own language . < / source > <nl> - < translation type = " unfinished " > Моля , свържете се с мен ако искате да преведете qBittorrent на вашия език . < / translation > <nl> + < translation > Моля , свържете се с мен ако искате да преведете qBittorrent на вашия език . < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Changelog : <nl> < translation > Съдържание на Торента : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / addTorrentDialog . ui " line = " 95 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > File name < / source > <nl> < translation type = " obsolete " > Име файл < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / addTorrentDialog . ui " line = " 100 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > File size < / source > <nl> < translation type = " obsolete " > Файл размер < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / addTorrentDialog . ui " line = " 105 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Selected < / source > <nl> < translation type = " obsolete " > Избран < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Прекъсни < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > select < / source > <nl> < translation type = " obsolete " > избери < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / addTorrentDialog . ui " line = " 188 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Unselect < / source > <nl> < translation type = " obsolete " > Неизбран < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / addTorrentDialog . ui " line = " 183 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Select < / source > <nl> < translation type = " obsolete " > Избери < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / addTorrentDialog . ui " line = " 162 " / > <nl> < source > Ignored < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Игнорирано < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / addTorrentDialog . ui " line = " 167 " / > <nl> < source > Normal < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Нормален < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / addTorrentDialog . ui " line = " 172 " / > <nl> < source > High < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Висок < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / addTorrentDialog . ui " line = " 177 " / > <nl> < source > Maximum < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Максимален < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / bandwidth_limit . ui " line = " 13 " / > <nl> < source > Bandwidth allocation < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Разпределение на bandwidth < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / bandwidth_limit . ui " line = " 47 " / > <nl> < source > KiB / s < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > KiB / с < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> < name > createTorrentDialog < / name > <nl> < message > <nl> - < location filename = " . . / createtorrent . ui " line = " 51 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Create Torrent file < / source > <nl> < translation type = " obsolete " > Създай торент файл < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent . ui " line = " 517 " / > <nl> < source > Destination torrent file : < / source > <nl> - < translation type = " unfinished " > Торент файл получател : < / translation > <nl> + < translation > Торент файл получател : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent . ui " line = " 93 " / > <nl> Changelog : <nl> < translation type = " unfinished " > Входен файл или директория : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Comment : < / source > <nl> < translation type = " obsolete " > Коментар : < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Прекъсни < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Announce url ( Tracker ) : < / source > <nl> < translation type = " obsolete " > Предлагащ url ( Тракер ) : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / createtorrent . ui " line = " 176 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Directory < / source > <nl> < translation type = " obsolete " > Директория < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Инструмент за Създаване на Торент < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / createtorrent . ui " line = " 83 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & lt ; center & gt ; Destination torrent file : & lt ; / center & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; center & gt ; Торент файл получател : & lt ; / center & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / createtorrent . ui " line = " 99 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & lt ; center & gt ; Input file or directory : & lt ; / center & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; center & gt ; Входен файл или директория : & lt ; / center & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / createtorrent . ui " line = " 115 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & lt ; center & gt ; Announce url : & lt ; br & gt ; ( One per line ) & lt ; / center & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; center & gt ; Предлагащ URL : & lt ; br & gt ; ( По един на ред ) & lt ; / center & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / createtorrent . ui " line = " 125 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > & lt ; center & gt ; Comment : & lt ; / center & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; center & gt ; Коментар : & lt ; / center & gt ; < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent . ui " line = " 48 " / > <nl> < source > Torrent file creation < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Създаване на Торент файл < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " " line = " 7471221 " / > <nl> + < source > Input files or directories : < / source > <nl> + < translation type = " obsolete " > Входни файлове или директории : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent . ui " line = " 112 " / > <nl> < source > Announce urls ( trackers ) : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Предлагащи url ( тракери ) : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent . ui " line = " 147 " / > <nl> < source > Comment ( optional ) : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Коментар ( опция ) : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent . ui " line = " 489 " / > <nl> < source > Private ( won & apos ; t be distributed on trackerless network / DHT if enabled ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Частен ( не може да се разпространява по мрежа без тракер / DHT е включен ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent . ui " line = " 128 " / > <nl> < source > Web seeds urls ( optional ) : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > URL на даващи по Web ( опция ) : < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Changelog : <nl> < translation > Торент Файлове < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / createtorrent_imp . cpp " line = " 58 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Select input directory or file < / source > <nl> < translation type = " obsolete " > Избери входна директория или файл < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Моля първо напишете входящ път < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / createtorrent_imp . cpp " line = " 96 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Input path does not exist < / source > <nl> < translation type = " obsolete " > Входящият път не съществува < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Please type a correct input path first < / source > <nl> < translation type = " obsolete " > Моля първо напишете правилен входящ път < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Торента бе създаден успешно : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / createtorrent_imp . cpp " line = " 96 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Please type a valid input path first < / source > <nl> < translation type = " obsolete " > Моля първо напишете валиден входящ път < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent_imp . cpp " line = " 66 " / > <nl> < source > Select a folder to add to the torrent < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Изберете папка за добавяне към торента < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " " line = " 7471221 " / > <nl> + < source > Select files to add to the torrent < / source > <nl> + < translation type = " obsolete " > Изберете файлове за добавяне към торента < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent_imp . cpp " line = " 103 " / > <nl> < source > Please type an announce URL < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Моля въведете даващ URL < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent_imp . cpp " line = " 212 " / > <nl> < source > Torrent creation was unsuccessful , reason : % 1 < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Създаване на торент неуспешно , причина : % 1 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent_imp . cpp " line = " 104 " / > <nl> < source > Announce URL : < / source > <nl> < comment > Tracker URL < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Предлагащ URL : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent_imp . cpp " line = " 122 " / > <nl> < source > Please type a web seed url < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Моля въведете web даващ url < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent_imp . cpp " line = " 123 " / > <nl> < source > Web seed URL : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Web даващ URL : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / createtorrent_imp . cpp " line = " 75 " / > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / downloadFromURLImp . h " line = " 63 " / > <nl> < source > No URL entered < / source > <nl> - < translation type = " unfinished " > Невъведен URL < / translation > <nl> + < translation > Невъведен URL < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadFromURLImp . h " line = " 63 " / > <nl> < source > Please type at least one URL . < / source > <nl> - < translation type = " unfinished " > Моля въведете поне един URL . < / translation > <nl> + < translation > Моля въведете поне един URL . < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / download . ui " line = " 13 " / > <nl> < source > Search < / source > <nl> - < translation type = " unfinished " > Търси < / translation > <nl> + < translation > Търси < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 48 " / > <nl> < source > Total DL Speed : < / source > <nl> - < translation type = " unfinished " > Обща DL Скорост : < / translation > <nl> + < translation > Обща DL Скорост : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 181 " / > <nl> < source > KiB / s < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > KiB / с < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 106 " / > <nl> < source > Session ratio : < / source > <nl> - < translation type = " unfinished " > Процент сесия : < / translation > <nl> + < translation > Процент сесия : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 152 " / > <nl> < source > Total UP Speed : < / source > <nl> - < translation type = " unfinished " > Обща UP Скорост : < / translation > <nl> + < translation > Обща UP Скорост : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 246 " / > <nl> < source > Log < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Влез < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 280 " / > <nl> < source > IP filter < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > IP филтър < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 306 " / > <nl> < source > Start < / source > <nl> - < translation type = " unfinished " > Старт < / translation > <nl> + < translation > Старт < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 311 " / > <nl> < source > Pause < / source > <nl> - < translation type = " unfinished " > Пауза < / translation > <nl> + < translation > Пауза < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 316 " / > <nl> < source > Delete < / source > <nl> - < translation type = " unfinished " > Изтрий < / translation > <nl> + < translation > Изтрий < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 321 " / > <nl> < source > Clear < / source > <nl> - < translation type = " unfinished " > Изтрий < / translation > <nl> + < translation > Изтрий < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 326 " / > <nl> < source > Preview file < / source > <nl> - < translation type = " unfinished " > Огледай файла < / translation > <nl> + < translation > Огледай файла < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 331 " / > <nl> < source > Set upload limit < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Определи лимит качване < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 336 " / > <nl> < source > Set download limit < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Определи лимит сваляне < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 341 " / > <nl> < source > Delete Permanently < / source > <nl> - < translation type = " unfinished " > Изтрий завинаги < / translation > <nl> + < translation > Изтрий завинаги < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 346 " / > <nl> < source > Torrent Properties < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Характеристики на Торента < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 16 " / > <nl> < source > Search plugins < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Търси добавки < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 29 " / > <nl> < source > Installed search engines : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Инсталирани търсачки : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 49 " / > <nl> < source > Name < / source > <nl> - < translation type = " unfinished " > Име < / translation > <nl> + < translation > Име < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 54 " / > <nl> < source > Url < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Url < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 59 " / > <nl> < source > Enabled < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Включено < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 72 " / > <nl> < source > You can get new search engine plugins here : & lt ; a href = & quot ; http : plugins . qbittorrent . org & quot ; & gt ; http : / / plugins . qbittorrent . org & lt ; / a & gt ; < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Можете да вземете нови добавки за търсачката тук : & lt ; a href = & quot ; http : plugins . qbittorrent . org & quot ; & gt ; http : / / plugins . qbittorrent . org & lt ; / a & gt ; < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 81 " / > <nl> < source > Install a new one < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Инсталирай нов < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 88 " / > <nl> < source > Check for updates < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Провери за обновяване < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 95 " / > <nl> < source > Close < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Затвори < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 104 " / > <nl> < source > Enable < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Включи < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 109 " / > <nl> < source > Disable < / source > <nl> - < translation type = " unfinished " > Изключи < / translation > <nl> + < translation > Изключи < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 114 " / > <nl> < source > Uninstall < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Деинсталирай < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 287 " / > <nl> < source > True < / source > <nl> - < translation type = " unfinished " > Вярно < / translation > <nl> + < translation > Вярно < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 289 " / > <nl> < source > False < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Грешно < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 196 " / > <nl> < source > Uninstall warning < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Предупреждение за деинсталиране < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 196 " / > <nl> < source > Some plugins could not be uninstalled because they are included in qBittorrent . <nl> Only the ones you added yourself can be uninstalled . <nl> However , those plugins were disabled . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Някои добавки не могат да бъдат деинсталирани защото са част от qBittorrent . <nl> + Само добавените от вас могат да бъдат деинсталирани . <nl> + Обаче добавките бяха изключени . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 198 " / > <nl> < source > Uninstall success < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Успешно деинсталиране < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " " line = " 7471221 " / > <nl> + < source > All selected plugins were uninstalled successfuly < / source > <nl> + < translation type = " obsolete " > Всички избрани добавки бяха успешно деинсталирани < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 378 " / > <nl> < source > Select search plugins < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Избери добавки за търсене < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 379 " / > <nl> < source > qBittorrent search plugins < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > qBittorrent добавки за търсене < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 497 " / > <nl> < source > Search plugin install < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Инсталиране на добавка за търсене < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 524 " / > <nl> < source > qBittorrent < / source > <nl> - < translation type = " unfinished " > qBittorrent < / translation > <nl> + < translation > qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 330 " / > <nl> < source > A more recent version of % 1 search engine plugin is already installed . < / source > <nl> < comment > % 1 is the name of the search engine < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > По - нова версия на % 1 добавката за търсене вече е инсталирана . < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " " line = " 7471221 " / > <nl> + < source > % 1 search engine plugin was successfuly updated . < / source > <nl> + < comment > % 1 is the name of the search engine < / comment > <nl> + < translation type = " obsolete " > % 1 добавка на търсачката беше успешно обновена . < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " " line = " 7471221 " / > <nl> + < source > % 1 search engine plugin was successfuly installed . < / source > <nl> + < comment > % 1 is the name of the search engine < / comment > <nl> + < translation type = " obsolete " > % 1 добавка на търсачката беше успешно инсталирана . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 524 " / > <nl> < source > Search plugin update < / source > <nl> - < translation type = " unfinished " > Допълнението за търсене е обновено < / translation > <nl> + < translation > Добавката за търсене е обновена < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 516 " / > <nl> < source > Sorry , update server is temporarily unavailable . < / source > <nl> - < translation type = " unfinished " > Съжалявам , сървъра за обновяване е временно недостъпен . < / translation > <nl> + < translation > Съжалявам , сървъра за обновяване е временно недостъпен . < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " " line = " 7471221 " / > <nl> + < source > % 1 search plugin was successfuly updated . < / source > <nl> + < comment > % 1 is the name of the search engine < / comment > <nl> + < translation type = " obsolete " > % 1 добавка за търсене беше успешно обновена . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 524 " / > <nl> < source > Sorry , % 1 search plugin update failed . < / source > <nl> < comment > % 1 is the name of the search engine < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Съжалявам , % 1 обновяването на добавката бе неуспешно . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 426 " / > <nl> < source > All your plugins are already up to date . < / source > <nl> + < translation > Всички ваши добавки са вече обновени . < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / engineSelectDlg . cpp " line = " 198 " / > <nl> + < source > All selected plugins were uninstalled successfully < / source > <nl> < translation type = " unfinished " > < / translation > <nl> < / message > <nl> < message > <nl> However , those plugins were disabled . < / source > <nl> < comment > % 1 is the name of the search engine < / comment > <nl> < translation type = " unfinished " > < / translation > <nl> < / message > <nl> - < message > <nl> - < location filename = " . . / engineSelectDlg . cpp " line = " 198 " / > <nl> - < source > All selected plugins were uninstalled successfully < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> - < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 368 " / > <nl> < source > % 1 search engine plugin was successfully updated . < / source > <nl> However , those plugins were disabled . < / source > <nl> < translation > ТБ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > m < / source > <nl> < comment > minutes < / comment > <nl> < translation type = " obsolete " > м < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > h < / source > <nl> < comment > hours < / comment > <nl> < translation type = " obsolete " > ч < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > d < / source > <nl> < comment > days < / comment > <nl> < translation type = " obsolete " > д < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > h < / source > <nl> < comment > hours < / comment > <nl> < translation type = " obsolete " > ч < / translation > <nl> However , those plugins were disabled . < / source > <nl> < context > <nl> < name > options_imp < / name > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Options saved successfully ! < / source > <nl> < translation type = " obsolete " > Избора е съхранен успешно ! < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Choose Scan Directory < / source > <nl> < translation type = " obsolete " > Изберете Директория за Сканиране < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Choose save Directory < / source > <nl> < translation type = " obsolete " > Изберете Директория за Съхранение < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Choose ipfilter . dat file < / source > <nl> < translation type = " obsolete " > Изберете ipfilter . dat файл < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > I / O Error < / source > <nl> < translation type = " obsolete " > Грешка на Вход / Изход < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Couldn & apos ; t open : < / source > <nl> < translation type = " obsolete " > Не мога да отворя : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > in read mode . < / source > <nl> < translation type = " obsolete " > е в режим четене . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Invalid Line < / source > <nl> < translation type = " obsolete " > Грешен Ред < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Line < / source > <nl> < translation type = " obsolete " > Ред < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > is malformed . < / source > <nl> < translation type = " obsolete " > е повреден . < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > IP на Старт : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Incorrect IP < / source > <nl> < translation type = " obsolete " > Некоректно IP < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > This IP is incorrect . < / source > <nl> < translation type = " obsolete " > Това IP е некоректно . < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < message > <nl> < location filename = " . . / previewSelect . h " line = " 110 " / > <nl> < source > Preview impossible < / source > <nl> - < translation type = " unfinished " > Оглед невъзможен < / translation > <nl> + < translation > Оглед невъзможен < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / previewSelect . h " line = " 110 " / > <nl> < source > Sorry , we can & apos ; t preview this file < / source > <nl> - < translation type = " unfinished " > Съжалявам , не можем да огледаме този файл < / translation > <nl> + < translation > Съжалявам , не можем да огледаме този файл < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / previewSelect . h " line = " 84 " / > <nl> < source > Name < / source > <nl> - < translation type = " unfinished " > Име < / translation > <nl> + < translation > Име < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / previewSelect . h " line = " 85 " / > <nl> < source > Size < / source > <nl> - < translation type = " unfinished " > Размер < / translation > <nl> + < translation > Размер < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / previewSelect . h " line = " 86 " / > <nl> < source > Progress < / source > <nl> - < translation type = " unfinished " > Изпълнение < / translation > <nl> + < translation > Изпълнение < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> However , those plugins were disabled . < / source > <nl> < translation > Настройки на Торента < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Main Infos < / source > <nl> < translation type = " obsolete " > Главни Бележки < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / properties_imp . cpp " line = " 40 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > File Name < / source > <nl> < translation type = " obsolete " > Име Файл < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / properties . ui " line = " 315 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Current Session < / source > <nl> < translation type = " obsolete " > Текуща Сесия < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Total Uploaded : < / source > <nl> < translation type = " obsolete " > Общо Качени : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Total Downloaded : < / source > <nl> < translation type = " obsolete " > Общо Свалени : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Download state : < / source > <nl> < translation type = " obsolete " > Състояние Сваляне : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Current Tracker : < / source > <nl> < translation type = " obsolete " > Текущ Тракер : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Number of Peers : < / source > <nl> < translation type = " obsolete " > Брой на Донори : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Torrent Content < / source > <nl> < translation type = " obsolete " > Съдържание на Торента < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > OK < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Total Failed : < / source > <nl> < translation type = " obsolete " > Общо Неуспешни : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Finished < / source > <nl> < translation type = " obsolete " > Завършен < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Queued for checking < / source > <nl> < translation type = " obsolete " > В опашка за проверка < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Checking files < / source > <nl> < translation type = " obsolete " > Проверка на файловете < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Connecting to tracker < / source > <nl> < translation type = " obsolete " > Свързване с тракер < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Downloading Metadata < / source > <nl> < translation type = " obsolete " > Сваляне на Meta - данни < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Downloading < / source > <nl> < translation type = " obsolete " > Сваляне < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Seeding < / source > <nl> < translation type = " obsolete " > Споделяне < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Allocating < / source > <nl> < translation type = " obsolete " > Уточняване < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 72 " / > <nl> < source > Unknown < / source > <nl> - < translation type = " unfinished " > Неизвестен < / translation > <nl> + < translation > Неизвестен < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Complete : < / source > <nl> < translation type = " obsolete " > Завършен : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Partial : < / source > <nl> < translation type = " obsolete " > Частично : < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Размер < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / properties_imp . cpp " line = " 43 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Selected < / source > <nl> < translation type = " obsolete " > Избран < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / properties . ui " line = " 900 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Unselect < / source > <nl> < translation type = " obsolete " > Неизбран < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / properties . ui " line = " 907 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Select < / source > <nl> < translation type = " obsolete " > Избери < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / properties . ui " line = " 940 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > You can select here precisely which files you want to download in current torrent . < / source > <nl> < translation type = " obsolete " > Тук можете да изберете точно кои файлове искате да свалите от торента . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > False < / source > <nl> < translation type = " obsolete " > Грешка < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > True < / source > <nl> < translation type = " obsolete " > Вярно < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Основна информация < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Number of peers : < / source > <nl> < translation type = " obsolete " > Брой връзки : < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Съдържание на Торента < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Options < / source > <nl> < translation type = " obsolete " > Опции < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Сваляне в правилен ред ( по - бавен , но добър за оглед на файловете ) < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / properties . ui " line = " 432 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Share Ratio : < / source > <nl> < translation type = " obsolete " > Процент на споделяне : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Seeders : < / source > <nl> < translation type = " obsolete " > Даващи : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 1701999215 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Leechers : < / source > <nl> < translation type = " obsolete " > Вземащи : < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 81 " / > <nl> < source > Torrent infos < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Торент бележки < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 140 " / > <nl> < source > Creator : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Автор : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 159 " / > <nl> < source > Torrent hash : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Торент раздробяване : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 184 " / > <nl> < source > Comment : < / source > <nl> - < translation type = " unfinished " > Коментар : < / translation > <nl> + < translation > Коментар : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 304 " / > <nl> < source > Current session < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Текуща сесия < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 379 " / > <nl> < source > Share ratio : < / source > <nl> - < translation type = " unfinished " > Процент на споделяне : < / translation > <nl> + < translation > Процент на споделяне : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 481 " / > <nl> < source > Trackers < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Тракери < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 338 " / > <nl> < source > New tracker < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Нов тракер < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 339 " / > <nl> < source > New tracker url : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Нов тракер url : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 36 " / > <nl> < source > Priorities : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Предимства : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 36 " / > <nl> < source > Normal : normal priority . Download order is dependent on availability < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Нормално : нормално предимство . Поредицата за сваляне зависи от наличността < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 36 " / > <nl> < source > High : higher than normal priority . Pieces are preferred over pieces with the same availability , but not over pieces with lower availability < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Високо : по - високо от нормалното предимство . Частите с висока наличност са предпочитани пред тези с ниска наличност < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 36 " / > <nl> < source > Maximum : maximum priority , availability is disregarded , the piece is preferred over any other piece with lower priority < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Максимално : максимално предимство , наличността се игнорира , частта се предпочита пред всички останали с по - ниско предимство < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 47 " / > <nl> < source > File name < / source > <nl> - < translation type = " unfinished " > Име файл < / translation > <nl> + < translation > Име файл < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 220 " / > <nl> < source > Priority < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Предимство < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 382 " / > <nl> < source > qBittorrent < / source > <nl> - < translation type = " unfinished " > qBittorrent < / translation > <nl> + < translation > qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 383 " / > <nl> < source > Trackers list can & apos ; t be empty . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Листата на тракери не може да бъде празна . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 36 " / > <nl> < source > Ignored : file is not downloaded at all < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Игнорирано : файла изобщо не е свален < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 1057 " / > <nl> < source > Ignored < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Игнорирано < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 1062 " / > <nl> < source > Normal < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Нормален < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 1067 " / > <nl> < source > Maximum < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Максимален < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 1072 " / > <nl> < source > High < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Висок < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 827 " / > <nl> < source > Url seeds < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Url даващи < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 315 " / > <nl> < source > New url seed : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Нов url на даващ : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 321 " / > <nl> < source > This url seed is already in the list . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Този url на даващ е вече в списъка . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 140 " / > <nl> < source > None < / source > <nl> < comment > i . e : No error message < / comment > <nl> - < translation type = " unfinished " > Няма < / translation > <nl> + < translation > Няма < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties_imp . cpp " line = " 314 " / > <nl> < source > New url seed < / source > <nl> < comment > New HTTP source < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Нов url на даващ < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / properties . ui " line = " 845 " / > <nl> < source > The following url seeds are available for this torrent : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Следните url на даващи са налични за този торент : < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> However , those plugins were disabled . < / source > <nl> < message > <nl> < location filename = " . . / search . ui " line = " 76 " / > <nl> < source > Search < / source > <nl> - < translation type = " unfinished " > Търси < / translation > <nl> + < translation > Търси < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / search . ui " line = " 45 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Search Engines < / source > <nl> < translation type = " obsolete " > Търсачки < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / search . ui " line = " 53 " / > <nl> < source > Search Pattern : < / source > <nl> - < translation type = " unfinished " > Тип на търсене : < / translation > <nl> + < translation > Тип на търсене : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / search . ui " line = " 92 " / > <nl> < source > Stop < / source > <nl> - < translation type = " unfinished " > Спри < / translation > <nl> + < translation > Спри < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / search . ui " line = " 127 " / > <nl> < source > Status : < / source > <nl> - < translation type = " unfinished " > Състояние : < / translation > <nl> + < translation > Състояние : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / search . ui " line = " 157 " / > <nl> < source > Stopped < / source > <nl> - < translation type = " unfinished " > Спрян < / translation > <nl> + < translation > Спрян < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / search . ui " line = " 230 " / > <nl> < source > Results : < / source > <nl> - < translation type = " unfinished " > Резултати : < / translation > <nl> + < translation > Резултати : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / search . ui " line = " 297 " / > <nl> < source > Download < / source > <nl> - < translation type = " unfinished " > Свали < / translation > <nl> + < translation > Свали < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / search . ui " line = " 307 " / > <nl> < source > Clear < / source > <nl> - < translation type = " unfinished " > Изтрий < / translation > <nl> + < translation > Изтрий < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / search . ui " line = " 374 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > Update search plugin < / source > <nl> < translation type = " obsolete " > Обнови допълнението за търсене < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / search . ui " line = " 99 " / > <nl> < source > Search engines . . . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Търсачки . . . < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> However , those plugins were disabled . < / source > <nl> < message > <nl> < location filename = " . . / seeding . ui " line = " 13 " / > <nl> < source > Search < / source > <nl> - < translation type = " unfinished " > Търси < / translation > <nl> + < translation > Търси < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / seeding . ui " line = " 25 " / > <nl> < source > The following torrents are finished and shared : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Следните торенти са свалени и споделени : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / seeding . ui " line = " 47 " / > <nl> < source > & lt ; u & gt ; Note : & lt ; / u & gt ; It is important that you keep sharing your torrents after they are finished for the well being of the network . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > & lt ; u & gt ; Бележка : & lt ; / u & gt ; Важно е да споделяте вашите торенти след като са завършени за всички от мрежата . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / seeding . ui " line = " 54 " / > <nl> < source > Start < / source > <nl> - < translation type = " unfinished " > Старт < / translation > <nl> + < translation > Старт < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / seeding . ui " line = " 59 " / > <nl> < source > Pause < / source > <nl> - < translation type = " unfinished " > Пауза < / translation > <nl> + < translation > Пауза < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / seeding . ui " line = " 64 " / > <nl> < source > Delete < / source > <nl> - < translation type = " unfinished " > Изтрий < / translation > <nl> + < translation > Изтрий < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / seeding . ui " line = " 69 " / > <nl> < source > Delete Permanently < / source > <nl> - < translation type = " unfinished " > Изтрий завинаги < / translation > <nl> + < translation > Изтрий завинаги < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / seeding . ui " line = " 74 " / > <nl> < source > Torrent Properties < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Характеристики на Торента < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / seeding . ui " line = " 79 " / > <nl> < source > Preview file < / source > <nl> - < translation type = " unfinished " > Огледай файла < / translation > <nl> + < translation > Огледай файла < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / seeding . ui " line = " 84 " / > <nl> < source > Set upload limit < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Определи лимит качване < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> However , those plugins were disabled . < / source > <nl> < message > <nl> < location filename = " . . / downloadThread . h " line = " 58 " / > <nl> < source > Host is unreachable < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Хоста е недостъпен < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadThread . h " line = " 60 " / > <nl> < source > File was not found ( 404 ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Файла не е намерен ( 404 ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadThread . h " line = " 62 " / > <nl> < source > Connection was denied < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Връзката е отхвърлена < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadThread . h " line = " 64 " / > <nl> < source > Url is invalid < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Невалиден Url < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadThread . h " line = " 66 " / > <nl> < source > Connection forbidden ( 403 ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Връзката е забранена ( 403 ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadThread . h " line = " 68 " / > <nl> < source > Connection was not authorized ( 401 ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Нямате права за тази връзка ( 401 ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadThread . h " line = " 70 " / > <nl> < source > Content has moved ( 301 ) < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Съдържанието бе преместено ( 301 ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadThread . h " line = " 72 " / > <nl> < source > Connection failure < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Неуспешна връзка < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadThread . h " line = " 74 " / > <nl> < source > Connection was timed out < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Връзката изтече < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadThread . h " line = " 76 " / > <nl> < source > Incorrect network interface < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Неточен интерфейс на мрежата < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadThread . h " line = " 78 " / > <nl> < source > Unknown error < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Неизвестна грешка < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> < name > torrentAdditionDialog < / name > <nl> < message > <nl> - < location filename = " . . / torrentAddition . h " line = " 197 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > True < / source > <nl> < translation type = " obsolete " > Вярно < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Избери път за съхранение < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / torrentAddition . h " line = " 193 " / > <nl> + < location filename = " " line = " 7471221 " / > <nl> < source > False < / source > <nl> < translation type = " obsolete " > Грешка < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < message > <nl> < location filename = " . . / torrentAddition . h " line = " 65 " / > <nl> < source > File name < / source > <nl> - < translation type = " unfinished " > Име файл < / translation > <nl> + < translation > Име файл < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / torrentAddition . h " line = " 66 " / > <nl> < source > Size < / source > <nl> - < translation type = " unfinished " > Размер < / translation > <nl> + < translation > Размер < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / torrentAddition . h " line = " 67 " / > <nl> < source > Progress < / source > <nl> - < translation type = " unfinished " > Изпълнение < / translation > <nl> + < translation > Изпълнение < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / torrentAddition . h " line = " 211 " / > <nl> < source > Priority < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Предимство < / translation > <nl> < / message > <nl> < / context > <nl> < / TS > <nl> Binary files a / src / lang / qbittorrent_el . qm and b / src / lang / qbittorrent_el . qm differ <nl> mmm a / src / lang / qbittorrent_el . ts <nl> ppp b / src / lang / qbittorrent_el . ts <nl> <nl> < context > <nl> < name > @ default < / name > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > b < / source > <nl> < comment > bytes < / comment > <nl> < translation type = " obsolete " > b < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > KB < / source > <nl> < translation type = " obsolete " > KB < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > MB < / source > <nl> < translation type = " obsolete " > MB < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > GB < / source > <nl> < translation type = " obsolete " > GB < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > KB < / source > <nl> < comment > kilobytes < / comment > <nl> < translation type = " obsolete " > KB < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > MB < / source > <nl> < comment > megabytes < / comment > <nl> < translation type = " obsolete " > MB < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > GB < / source > <nl> < comment > gigabytes < / comment > <nl> < translation type = " obsolete " > GB < / translation > <nl> <nl> < translation > Γαλλία < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > chris @ dchris . eu < / source > <nl> < translation type = " obsolete " > chris @ dchris . eu < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > http : / / dchris . eu < / source > <nl> < translation type = " obsolete " > http : / / dchris . eu < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Thanks To < / source > <nl> < translation type = " obsolete " > Ευχαριστίες < / translation > <nl> < / message > <nl> <nl> < translation > & lt ; h3 & gt ; & lt ; b & gt ; qBittorrent & lt ; / b & gt ; & lt ; / h3 & gt ; < / translation > <nl> < / message > <nl> < message encoding = " UTF - 8 " > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > A bittorrent client using Qt4 and libtorrent , programmed in C + + . & lt ; br & gt ; <nl> & lt ; br & gt ; <nl> Copyright © 2006 by Christophe Dumez & lt ; br & gt ; <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> & lt ; br & gt ; & lt ; u & gt ; Ιστοσελίδα : & lt ; / u & gt ; & lt ; i & gt ; http : / / qbittorrent . sourceforge . net & lt ; / i & gt ; & lt ; br & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > qBittorrent Author < / source > <nl> < translation type = " obsolete " > qBittorrent Δημιουργός < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Kb / s < / source > <nl> < translation type = " obsolete " > Kb / s < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > συνδέσεις < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > to < / source > <nl> < translation type = " obsolete " > προς < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Ρυθμίσεις Proxy < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Server IP : < / source > <nl> < translation type = " obsolete " > IP Εξυπηρετητή : < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Γλώσσα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Please choose your preferred language in the following list : < / source > <nl> < translation type = " obsolete " > Παρακαλώ επιλέξτε την γλώσσα της προτίμησής σας από την παρακάτω λίστα : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > English < / source > <nl> < translation type = " obsolete " > Αγγλικά < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > French < / source > <nl> < translation type = " obsolete " > Γαλλικά < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Simplified Chinese < / source > <nl> < translation type = " obsolete " > Απλουστευμένα Κινέζικα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > OK < / source > <nl> < translation type = " obsolete " > Εντάξει < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Cancel < / source > <nl> < translation type = " obsolete " > Άκυρο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Language settings will take effect after restart . < / source > <nl> < translation type = " obsolete " > Οι ρυθμίσεις γλώσσας θα αλλάξουν μετά την επανεκίννηση . < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Ενεργοποίηση σάρωσης φακέλου ( αυτόματη προσθήκη αρχείων τορεντ ) < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Korean < / source > <nl> < translation type = " obsolete " > Κορεάτικα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Spanish < / source > <nl> < translation type = " obsolete " > Ισπανικά < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > German < / source > <nl> < translation type = " obsolete " > Γερμανικά < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Connection Settings < / source > <nl> < translation type = " obsolete " > Ρυθμίσεις Σύνδεσης < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Ποσοστό μοιράσματος : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > 1 KB DL = < / source > <nl> < translation type = " obsolete " > 1 KB DL = < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > KB UP max . < / source > <nl> < translation type = " obsolete " > Μέγ . KB Up . < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Ρυθμίσεις Φίλτρου < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > ipfilter . dat URL or PATH : < / source > <nl> < translation type = " obsolete " > ipfilter . dat Διεύθυνση ή διαδρομή : < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Σχόλιο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Apply < / source > <nl> < translation type = " obsolete " > Εφαρμογή < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Αφαίρεση Εύρους < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Catalan < / source > <nl> < translation type = " obsolete " > Καταλανικά < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > ipfilter . dat διαδρομή : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Clear finished downloads on exit < / source > <nl> < translation type = " obsolete " > Εκκαθάριση τελειωμένων κατεβασμάτων κατά την έξοδο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Ask for confirmation on exit < / source > <nl> < translation type = " obsolete " > Ερώτηση για επιβεβαίωση κατά την έξοδο < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Συμπεριφορά < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > OSD < / source > <nl> < translation type = " obsolete " > OSD < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Always display OSD < / source > <nl> < translation type = " obsolete " > Εμφάνιση πάντα OSD < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Display OSD only if window is minimized or iconified < / source > <nl> < translation type = " obsolete " > Εμφάνιση OSD μόνο αν το παράθυρο είναι ελαχιστοποιημένο ή εικονοποιημένο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Never display OSD < / source > <nl> < translation type = " obsolete " > Απόκρυψη OSD < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > KiB ανέβ . μέγ . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > DHT ( Trackerless ) : < / source > <nl> < translation type = " obsolete " > DHT ( χωρίς ηχνηλάτη ) : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Disable DHT ( Trackerless ) support < / source > <nl> < translation type = " obsolete " > Απενεργοποίηση υποστήριξης DHT ( χωρίς ηχνηλάτη ) < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Automatically clear finished downloads < / source > <nl> < translation type = " obsolete " > Αυτόματη εκκαθάριση ολοκληρωμένων κατεβασμάτων < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Προεπιλεγμένη διαδρομή αποθήκευσης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Systray Messages < / source > <nl> < translation type = " obsolete " > Μηνύματα Μπάρας Εργασιών < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 55 " / > <nl> < source > Name < / source > <nl> < comment > i . e : file name < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Όνομα < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 56 " / > <nl> < source > Size < / source > <nl> < comment > i . e : file size < / comment > <nl> - < translation type = " unfinished " > Μέγεθος < / translation > <nl> + < translation > Μέγεθος < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 57 " / > <nl> < source > Progress < / source > <nl> < comment > i . e : % downloaded < / comment > <nl> - < translation type = " unfinished " > Πρόοδος < / translation > <nl> + < translation > Πρόοδος < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 58 " / > <nl> < source > DL Speed < / source > <nl> < comment > i . e : Download speed < / comment > <nl> - < translation type = " unfinished " > DL Ταχύτητα < / translation > <nl> + < translation > DL Ταχύτητα < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 59 " / > <nl> < source > UP Speed < / source > <nl> < comment > i . e : Upload speed < / comment > <nl> - < translation type = " unfinished " > UP Ταχύτητα < / translation > <nl> + < translation > UP Ταχύτητα < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 60 " / > <nl> < source > Seeds / Leechs < / source > <nl> < comment > i . e : full / partial sources < / comment > <nl> - < translation type = " unfinished " > Διαμοιραστές / Συνδέσεις < / translation > <nl> + < translation > Διαμοιραστές / Συνδέσεις < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 61 " / > <nl> < source > Ratio < / source > <nl> - < translation type = " unfinished " > Αναλογία < / translation > <nl> + < translation > Αναλογία < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 62 " / > <nl> < source > ETA < / source > <nl> < comment > i . e : Estimated Time of Arrival / Time left < / comment > <nl> - < translation type = " unfinished " > Χρόνος που απομένει < / translation > <nl> + < translation > Χρόνος που απομένει < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 98 " / > <nl> < source > qBittorrent % 1 started . < / source > <nl> < comment > e . g : qBittorrent v0 . x started . < / comment > <nl> - < translation type = " unfinished " > Εκκινήθηκε το qBittorrent % 1 . < / translation > <nl> + < translation > Εκκινήθηκε το qBittorrent % 1 . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 99 " / > <nl> < source > Be careful , sharing copyrighted material without permission is against the law . < / source > <nl> - < translation type = " unfinished " > Προσοχή , η διακίνηση υλικού προστατευόμενου από πνευματικά δικαιώματα χωρίς άδεια είναι παράνομη . < / translation > <nl> + < translation > Προσοχή , η διακίνηση υλικού προστατευόμενου από πνευματικά δικαιώματα χωρίς άδεια είναι παράνομη . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 123 " / > <nl> < source > & lt ; font color = & apos ; red & apos ; & gt ; % 1 & lt ; / font & gt ; & lt ; i & gt ; was blocked & lt ; / i & gt ; < / source > <nl> < comment > x . y . z . w was blocked < / comment > <nl> - < translation type = " unfinished " > & lt ; font color = & apos ; red & apos ; & gt ; % 1 & lt ; / font & gt ; & lt ; i & gt ; αποκλείστηκε & lt ; / i & gt ; < / translation > <nl> + < translation > & lt ; font color = & apos ; red & apos ; & gt ; % 1 & lt ; / font & gt ; & lt ; i & gt ; αποκλείστηκε & lt ; / i & gt ; < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 197 " / > <nl> < source > Fast resume data was rejected for torrent % 1 , checking again . . . < / source > <nl> - < translation type = " unfinished " > Γρήγορη συνέχεια κατεβάσματος αρχείων απορρίφθηκε για το τορεντ % 1 , επανέλεγχος . . . < / translation > <nl> + < translation > Γρήγορη συνέχεια κατεβάσματος αρχείων απορρίφθηκε για το τορεντ % 1 , επανέλεγχος . . . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 201 " / > <nl> < source > Url seed lookup failed for url : % 1 , message : % 2 < / source > <nl> - < translation type = " unfinished " > Αποτυχία ελέγχου url μοιράσματος για το url : % 1 , μήνυμα : % 2 < / translation > <nl> + < translation > Αποτυχία ελέγχου url μοιράσματος για το url : % 1 , μήνυμα : % 2 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 633 " / > <nl> < source > & apos ; % 1 & apos ; added to download list . < / source > <nl> < comment > & apos ; / home / y / xxx . torrent & apos ; was added to download list . < / comment > <nl> - < translation type = " unfinished " > Το & apos ; % 1 & apos ; προστέθηκε στη λίστα κατεβάσματος . < / translation > <nl> + < translation > Το & apos ; % 1 & apos ; προστέθηκε στη λίστα κατεβάσματος . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 635 " / > <nl> < source > & apos ; % 1 & apos ; resumed . ( fast resume ) < / source > <nl> < comment > & apos ; / home / y / xxx . torrent & apos ; was resumed . ( fast resume ) < / comment > <nl> - < translation type = " unfinished " > Το & apos ; % 1 & apos ; ξανάρχισε . ( γρήγορη επανασύνδεση ) < / translation > <nl> + < translation > Το & apos ; % 1 & apos ; ξανάρχισε . ( γρήγορη επανασύνδεση ) < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 643 " / > <nl> < source > & apos ; % 1 & apos ; is already in download list . < / source > <nl> < comment > e . g : & apos ; xxx . avi & apos ; is already in download list . < / comment > <nl> - < translation type = " unfinished " > Το & apos ; % 1 & apos ; είναι ήδη στη λίστα κατεβάσματος . < / translation > <nl> + < translation > Το & apos ; % 1 & apos ; είναι ήδη στη λίστα κατεβάσματος . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 647 " / > <nl> < source > Unable to decode torrent file : & apos ; % 1 & apos ; < / source > <nl> < comment > e . g : Unable to decode torrent file : & apos ; / home / y / xxx . torrent & apos ; < / comment > <nl> - < translation type = " unfinished " > Αδύνατο να αποκωδικοποιηθεί το αρχείο τορεντ : & apos ; % 1 & apos ; < / translation > <nl> + < translation > Αδύνατο να αποκωδικοποιηθεί το αρχείο τορεντ : & apos ; % 1 & apos ; < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 648 " / > <nl> < source > This file is either corrupted or this isn & apos ; t a torrent . < / source > <nl> - < translation type = " unfinished " > Το αρχείο είτε είναι κατεστραμμένο , ή δεν ειναι ενα τορεντ . < / translation > <nl> + < translation > Το αρχείο είτε είναι κατεστραμμένο , ή δεν ειναι ενα τορεντ . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 662 " / > <nl> < source > Couldn & apos ; t listen on any of the given ports . < / source > <nl> - < translation type = " unfinished " > Δεν & quot ; ακροάστηκα & quot ; καμία σπό τις δωσμένες θύρες . < / translation > <nl> + < translation > Δεν & quot ; ακροάστηκα & quot ; καμία σπό τις δωσμένες θύρες . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / downloadingTorrents . cpp " line = " 686 " / > <nl> < source > Downloading & apos ; % 1 & apos ; , please wait . . . < / source > <nl> < comment > e . g : Downloading & apos ; xxx . torrent & apos ; , please wait . . . < / comment > <nl> - < translation type = " unfinished " > Κατέβασμα του & apos ; % 1 & apos ; , παρακαλώ περιμένετε . . . < / translation > <nl> + < translation > Κατέβασμα του & apos ; % 1 & apos ; , παρακαλώ περιμένετε . . . < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < context > <nl> < name > FinishedTorrents < / name > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Finished < / source > <nl> < translation type = " obsolete " > Τελείωσε < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Πρόοδος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > DL Speed < / source > <nl> < comment > i . e : Download speed < / comment > <nl> < translation type = " obsolete " > DL Ταχύτητα < / translation > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Διαμοιραστές / Συνδέσεις < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Status < / source > <nl> < translation type = " obsolete " > Κατάσταση < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > ETA < / source > <nl> < comment > i . e : Estimated Time of Arrival / Time left < / comment > <nl> < translation type = " obsolete " > Χρόνος που απομένει < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > None < / source > <nl> < comment > i . e : No error message < / comment > <nl> < translation type = " obsolete " > Κανένα < / translation > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Άνοιγμα Αρχείων τορεντ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > kb / s < / source > <nl> < translation type = " obsolete " > kb / s < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Unknown < / source > <nl> < translation type = " obsolete " > Άγνωστο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > This file is either corrupted or this isn & apos ; t a torrent . < / source > <nl> < translation type = " obsolete " > Το αρχείο είτε είναι κατεστραμμένο , ή δεν ειναι ενα τορεντ . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Are you sure you want to delete all files in download list ? < / source > <nl> < translation type = " obsolete " > Σίγουρα θέλετε να διαγράψετε όλα τα αρχεία στην λίστα κατεβάσματος ? < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Είστε σίγουρος οτι θέλετε να διαγράψετε το ( α ) επιλεγμλένα αντικείμενο ( α ) από την λίστα κατεβάσματος ? < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > paused < / source > <nl> < translation type = " obsolete " > έπαυσε < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > started < / source > <nl> < translation type = " obsolete " > άρχισε < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > kb / s < / source > <nl> < translation type = " obsolete " > kb / s < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Τελείωσε < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Checking . . . < / source > <nl> < translation type = " obsolete " > Έλεγχος . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Connecting . . . < / source > <nl> < translation type = " obsolete " > Σύνδεση . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Downloading . . . < / source > <nl> < translation type = " obsolete " > Κατέβασμα . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Download list cleared . < / source > <nl> < translation type = " obsolete " > Λίστα κατεβάσματος άδειασε . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > All Downloads Paused . < / source > <nl> < translation type = " obsolete " > Όλα τα Κατεβάσματα Σταμάτησαν . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > All Downloads Resumed . < / source > <nl> < translation type = " obsolete " > Όλα τα Κατεβάσματα συνέχισαν . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > DL Speed : < / source > <nl> < translation type = " obsolete " > Ταχύτητα Κατεβάσματος : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > started . < / source > <nl> < translation type = " obsolete " > ξεκίνησε . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > UP Speed : < / source > <nl> < translation type = " obsolete " > Ταχύτητα Ανεβάσματος : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Couldn & apos ; t create the directory : < / source > <nl> < translation type = " obsolete " > Δεν μπόρεσε να δημιουργηθεί η κατηγορία : < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Αρχεία Τορεντ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > already in download list . < / source > <nl> < comment > & lt ; file & gt ; already in download list . < / comment > <nl> < translation type = " obsolete " > ήδη ατην λίστα κατεβάσματος . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > added to download list . < / source > <nl> < translation type = " obsolete " > προστέθηκε στη λίστα κατεβάσματος . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > resumed . ( fast resume ) < / source > <nl> < translation type = " obsolete " > συνέχισε . ( γρήγορη συνέχεια ) < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Unable to decode torrent file : < / source > <nl> < translation type = " obsolete " > Αδύνατο να αποκωδικοποιηθεί το αρχείο τορεντ : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > removed . < / source > <nl> < comment > & lt ; file & gt ; removed . < / comment > <nl> < translation type = " obsolete " > αφαιρέθηκε . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > paused . < / source > <nl> < comment > & lt ; file & gt ; paused . < / comment > <nl> < translation type = " obsolete " > έπαυσε . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > resumed . < / source > <nl> < comment > & lt ; file & gt ; resumed . < / comment > <nl> < translation type = " obsolete " > συνέχισε . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > m < / source > <nl> < comment > minutes < / comment > <nl> < translation type = " obsolete " > λ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > h < / source > <nl> < comment > hours < / comment > <nl> < translation type = " obsolete " > ω < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > d < / source > <nl> < comment > days < / comment > <nl> < translation type = " obsolete " > μ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Listening on port : < / source > <nl> < translation type = " obsolete " > Ακρόαση στη θύρα : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > qBittorrent < / source > <nl> < translation type = " obsolete " > qBittorrent < / translation > <nl> < / message > <nl> Copyright © 2006 από τον Christophe Dumez & lt ; br & gt ; <nl> < translation > Είστε σίγουρος ? - - qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & lt ; b & gt ; qBittorrent & lt ; / b & gt ; & lt ; br & gt ; DL Speed : < / source > <nl> < translation type = " obsolete " > & lt ; b & gt ; qBittorrent & lt ; / b & gt ; & lt ; br & gt ; Ταχύτητα Κατεβάσματος : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > : : By Christophe Dumez : : Copyright ( c ) 2006 < / source > <nl> < translation type = " obsolete " > : : Από τον Christophe Dumez : : Copyright ( c ) 2006 < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & lt ; b & gt ; Connection Status : & lt ; / b & gt ; & lt ; br & gt ; Online < / source > <nl> < translation type = " obsolete " > & lt ; b & gt ; Κατάσταση Σύνδεσης : & lt ; / b & gt ; & lt ; br & gt ; Ενεργή < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & lt ; b & gt ; Connection Status : & lt ; / b & gt ; & lt ; br & gt ; Firewalled ? & lt ; br & gt ; & lt ; i & gt ; No incoming connections . . . & lt ; / i & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; b & gt ; Κατάσταση Σύνδεσης : & lt ; / b & gt ; & lt ; br & gt ; Με firewall ? & lt ; br & gt ; & lt ; i & gt ; Χωρίς εισερχόμενες συνδέσεις . . . & lt ; / i & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & lt ; b & gt ; Connection Status : & lt ; / b & gt ; & lt ; br & gt ; Offline & lt ; br & gt ; & lt ; i & gt ; No peers found . . . & lt ; / i & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; b & gt ; Κατάσταση Σύνδεσης : & lt ; / b & gt ; & lt ; br & gt ; Ανενεργή & lt ; br & gt ; & lt ; i & gt ; Χωρίς να έχουν βρεθεί συνδέσεις . . . & lt ; / i & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > / s < / source > <nl> < comment > & lt ; unit & gt ; / seconds < / comment > <nl> < translation type = " obsolete " > / s < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > has finished downloading . < / source > <nl> < translation type = " obsolete " > έχει τελειώσει το κατέβασμα . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Couldn & apos ; t listen on any of the given ports . < / source > <nl> < translation type = " obsolete " > Δεν & quot ; ακροάστηκα & quot ; καμία σπό τις δωσμένες θύρες . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > None < / source > <nl> < translation type = " obsolete " > Κανένα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Empty search pattern < / source > <nl> < translation type = " obsolete " > Κενό πρότυπο εύρεσης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Please type a search pattern first < / source > <nl> < translation type = " obsolete " > Παρακαλώ εισάγετε ένα σχέδιο εύρεσης πρώτα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > No seach engine selected < / source > <nl> < translation type = " obsolete " > Δεν έχει επιλεχθεί μηχανή αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > You must select at least one search engine . < / source > <nl> < translation type = " obsolete " > Πρέπει να επιλέξετε τουλάχιστο μια μηχανή αναζήτησης . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Searching . . . < / source > <nl> < translation type = " obsolete " > Αναζήτηση . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Could not create search plugin . < / source > <nl> < translation type = " obsolete " > Αδύνατο να δημιουργηθεί επέκταση αναζήτησης . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Stopped < / source > <nl> < translation type = " obsolete " > Σταμάτησε < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > I / O Error < / source > <nl> < translation type = " obsolete " > I / O Λάθος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Couldn & apos ; t create temporary file on hard drive . < / source > <nl> < translation type = " obsolete " > Αδύνατο να δημιουργηθεί προσωρινό αρχείο στον σκληρό δίσκο . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Torrent file URL < / source > <nl> < translation type = " obsolete " > URL αρχείου τορεντ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > KB / s < / source > <nl> < translation type = " obsolete " > KB / s < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > KB / s < / source > <nl> < translation type = " obsolete " > KB / s < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Downloading using HTTP : < / source > <nl> < translation type = " obsolete " > Κατέβασμα με χρήση HTTP : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Torrent file URL : < / source > <nl> < translation type = " obsolete " > URL αρχείου τορεντ : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > A http download failed . . . < / source > <nl> < translation type = " obsolete " > & apos ; Ενα κατέβασμα http απέτυχε . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > A http download failed , reason : < / source > <nl> < translation type = " obsolete " > & apos ; Ενα κατέβασμα http απέτυχε , αιτία : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Are you sure you want to quit ? - - qBittorrent < / source > <nl> < translation type = " obsolete " > Είστε σίγουρος οτι θέλετε να βγείτε ? - - qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Are you sure you want to quit qbittorrent ? < / source > <nl> < translation type = " obsolete " > Είστε σίγουρος οτι θέλετε να βγείτε από το qbittorrent ? < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Error during search . . . < / source > <nl> < translation type = " obsolete " > Σφάλμα κατά την αναζήτηση . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Timed out < / source > <nl> < translation type = " obsolete " > Προσωρινή διακοπή < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Failed to download : < / source > <nl> < translation type = " obsolete " > Αποτυχία κατεβάσματος : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > KiB / s < / source > <nl> < translation type = " obsolete " > KiB / s < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > KiB / s < / source > <nl> < translation type = " obsolete " > KiB / s < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > A http download failed , reason : < / source > <nl> < translation type = " obsolete " > Ένα κατέβασμα http απέτυχε , λόγος : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Stalled < / source > <nl> < translation type = " obsolete " > Αποτυχία λειτουργίας < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search is finished < / source > <nl> < translation type = " obsolete " > Αναζήτηση τελείωσε < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > An error occured during search . . . < / source > <nl> < translation type = " obsolete " > Σφάλμα κατά την εύρεση . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search aborted < / source > <nl> < translation type = " obsolete " > Αναζήτηση διεκόπη < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search returned no results < / source > <nl> < translation type = " obsolete " > Η αναζήτηση δεν έφερε αποτελέσματα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search is Finished < / source > <nl> < translation type = " obsolete " > Αναζήτηση τελείωσε < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search plugin update - - qBittorrent < / source > <nl> < translation type = " obsolete " > Αναβάθμιση plugin αναζήτησης - - qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search plugin can be updated , do you want to update it ? <nl> <nl> Changelog : <nl> Changelog : <nl> < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Sorry , update server is temporarily unavailable . < / source > <nl> < translation type = " obsolete " > Λυπούμαστε , ο εξηπυρετητής αναβάθμισης δεν είναι προσωρινά διαθέσιμος . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Your search plugin is already up to date . < / source > <nl> < translation type = " obsolete " > Το plugin αναζήτησης είναι ήδη αναβαθμισμένο . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Results < / source > <nl> < translation type = " obsolete " > Αποτελέσματα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Name < / source > <nl> < translation type = " obsolete " > Όνομα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Size < / source > <nl> < translation type = " obsolete " > Μέγεθος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Progress < / source > <nl> < translation type = " obsolete " > Πρόοδος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > DL Speed < / source > <nl> < translation type = " obsolete " > DL Ταχύτητα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > UP Speed < / source > <nl> < translation type = " obsolete " > UP Ταχύτητα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Status < / source > <nl> < translation type = " obsolete " > Κατάσταση < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > ETA < / source > <nl> < translation type = " obsolete " > Χρόνος που απομένει < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Seeders < / source > <nl> < translation type = " obsolete " > Διαμοιραστές < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Leechers < / source > <nl> < translation type = " obsolete " > Συνδέσεις < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search engine < / source > <nl> < translation type = " obsolete " > Μηχανή αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Stalled < / source > <nl> < comment > state of a torrent whose DL Speed is 0 < / comment > <nl> < translation type = " obsolete " > Αποτυχία λειτουργίας < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Paused < / source > <nl> < translation type = " obsolete " > Παύση < / translation > <nl> < / message > <nl> Please close the other one first . < / source > <nl> Παρακαλώ κλείστε την άλλη πρώτα . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Couldn & apos ; t download < / source > <nl> < comment > Couldn & apos ; t download & lt ; file & gt ; < / comment > <nl> < translation type = " obsolete " > Αδύνατο κατέβασμα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > reason : < / source > <nl> < comment > Reason why the download failed < / comment > <nl> < translation type = " obsolete " > αιτία : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Downloading < / source > <nl> < comment > Example : Downloading www . example . com / test . torrent < / comment > <nl> < translation type = " obsolete " > Κατέβασμα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Please wait . . . < / source > <nl> < translation type = " obsolete " > Παρακαλώ περιμένετε . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Transfers < / source > <nl> < translation type = " obsolete " > Μεταφορές < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Are you sure you want to quit qBittorrent ? < / source > <nl> < translation type = " obsolete " > Είστε σίγουρος / η οτι θέλετε να κλείσετε το qBittorrent ? < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Are you sure you want to delete the selected item ( s ) in download list and in hard drive ? < / source > <nl> < translation type = " obsolete " > Είστε σίγουρος / η οτι θέλετε να διαγράψετε το ( α ) επιλεγμένο ( α ) αντικείμενο ( α ) από τη λίστα κατεβάσματος και το σκληρό δίσκο ? < / translation > <nl> < / message > <nl> Please close the other one first . < / source > <nl> < translation > Το κατέβασμα τελείωσε < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > has finished downloading . < / source > <nl> < comment > & lt ; filename & gt ; has finished downloading . < / comment > <nl> < translation type = " obsolete " > έχει τελειώσει το κατέβασμα . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search Engine < / source > <nl> < translation type = " obsolete " > Μηχανή Αναζήτησης < / translation > <nl> < / message > <nl> Please close the other one first . < / source > <nl> < translation > Δεν βρέθηκαν συνδέσεις . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Name < / source > <nl> < comment > i . e : file name < / comment > <nl> < translation type = " obsolete " > Όνομα αρχείου < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Size < / source > <nl> < comment > i . e : file size < / comment > <nl> < translation type = " obsolete " > Μέγεθος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Progress < / source > <nl> < comment > i . e : % downloaded < / comment > <nl> < translation type = " obsolete " > Πρόοδος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > DL Speed < / source > <nl> < comment > i . e : Download speed < / comment > <nl> < translation type = " obsolete " > DL Ταχύτητα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > UP Speed < / source > <nl> < comment > i . e : Upload speed < / comment > <nl> < translation type = " obsolete " > UP Ταχύτητα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Seeds / Leechs < / source > <nl> < comment > i . e : full / partial sources < / comment > <nl> < translation type = " obsolete " > Διαμοιραστές / Συνδέσεις < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > ETA < / source > <nl> < comment > i . e : Estimated Time of Arrival / Time left < / comment > <nl> < translation type = " obsolete " > Χρόνος που απομένει < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Seeders < / source > <nl> < comment > i . e : Number of full sources < / comment > <nl> < translation type = " obsolete " > Διαμοιραστές < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Leechers < / source > <nl> < comment > i . e : Number of partial sources < / comment > <nl> < translation type = " obsolete " > Συνδέσεις < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > qBittorrent % 1 started . < / source > <nl> < comment > e . g : qBittorrent v0 . x started . < / comment > <nl> < translation type = " obsolete " > Εκκινήθηκε το qBittorrent % 1 . < / translation > <nl> Please close the other one first . < / source > <nl> < translation > Ταχύτητα Ανεβάσματος : % 1 KiB / s < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Finished < / source > <nl> < comment > i . e : Torrent has finished downloading < / comment > <nl> < translation type = " obsolete " > Τελείωσε < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Checking . . . < / source > <nl> < comment > i . e : Checking already downloaded parts . . . < / comment > <nl> < translation type = " obsolete " > Έλεγχος . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Stalled < / source > <nl> < comment > i . e : State of a torrent whose download speed is 0kb / s < / comment > <nl> < translation type = " obsolete " > Αποτυχία λειτουργίας < / translation > <nl> Please close the other one first . < / source > <nl> < translation > Το & apos ; % 1 & apos ; αφαιρέθηκε . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & apos ; % 1 & apos ; added to download list . < / source > <nl> < comment > & apos ; / home / y / xxx . torrent & apos ; was added to download list . < / comment > <nl> < translation type = " obsolete " > Το & apos ; % 1 & apos ; προστέθηκε στη λίστα κατεβάσματος . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & apos ; % 1 & apos ; resumed . ( fast resume ) < / source > <nl> < comment > & apos ; / home / y / xxx . torrent & apos ; was resumed . ( fast resume ) < / comment > <nl> < translation type = " obsolete " > Το & apos ; % 1 & apos ; ξανάρχισε . ( γρήγορη επανασύνδεση ) < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & apos ; % 1 & apos ; is already in download list . < / source > <nl> < comment > e . g : & apos ; xxx . avi & apos ; is already in download list . < / comment > <nl> < translation type = " obsolete " > Το & apos ; % 1 & apos ; είναι ήδη στη λίστα κατεβάσματος . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Unable to decode torrent file : & apos ; % 1 & apos ; < / source > <nl> < comment > e . g : Unable to decode torrent file : & apos ; / home / y / xxx . torrent & apos ; < / comment > <nl> < translation type = " obsolete " > Αδύνατο να αποκωδικοποιηθεί το αρχείο τορεντ : & apos ; % 1 & apos ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > None < / source > <nl> < comment > i . e : No error message < / comment > <nl> < translation type = " obsolete " > Κανένα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Listening on port : % 1 < / source > <nl> < comment > e . g : Listening on port : 1666 < / comment > <nl> < translation type = " obsolete " > Ακρόαση στη θύρα : % 1 < / translation > <nl> Please close the other one first . < / source > <nl> < translation > & apos ; % 1 & apos ; σε παύση . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Connecting . . . < / source > <nl> < comment > i . e : Connecting to the tracker . . . < / comment > <nl> < translation type = " obsolete " > Σύνδεση . . . < / translation > <nl> Please close the other one first . < / source > <nl> < translation > Ένα σφάλμα προέκυψε κατά την προσπάθεια ανάγνωσης ή εγγραφής του % 1 . Ο δίσκος είναι πιθανόν πλήρης , το κατέβασμα είναι σε παύση < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > An error occured ( full fisk ? ) , & apos ; % 1 & apos ; paused . < / source > <nl> < comment > e . g : An error occured ( full fisk ? ) , & apos ; xxx . avi & apos ; paused . < / comment > <nl> < translation type = " obsolete " > Ένα σφάλμα προέκυψε ( δίσκος πλήρης ? ) , το & apos ; % 1 & apos ; είναι σε παύση . < / translation > <nl> Please close the other one first . < / source > <nl> < translation > Καμία εισερχόμενη σύνδεση . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > No search engine selected < / source > <nl> < translation type = " obsolete " > Δεν έχει επιλεγεί μηχανή αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search plugin update < / source > <nl> < translation type = " obsolete " > Αναβάθμιση plugin αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search has finished < / source > <nl> < translation type = " obsolete " > Η αναζήτηση τελείωσε < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Results < / source > <nl> < comment > i . e : Search results < / comment > <nl> < translation type = " obsolete " > Αποτελέσματα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Downloading & apos ; % 1 & apos ; , please wait . . . < / source > <nl> < comment > e . g : Downloading & apos ; xxx . torrent & apos ; , please wait . . . < / comment > <nl> < translation type = " obsolete " > Κατέβασμα του & apos ; % 1 & apos ; , παρακαλώ περιμένετε . . . < / translation > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Υποστήριξη UPnP [ ΝΑΙ ] < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Be careful , sharing copyrighted material without permission is against the law . < / source > <nl> < translation type = " obsolete " > Προσοχή , η διακίνηση υλικού προστατευόμενου από πνευματικά δικαιώματα χωρίς άδεια είναι παράνομη . < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Υποστήριξη κρυπτογράφησης [ ΟΧΙ ] < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & lt ; font color = & apos ; red & apos ; & gt ; % 1 & lt ; / font & gt ; & lt ; i & gt ; was blocked & lt ; / i & gt ; < / source > <nl> < comment > x . y . z . w was blocked < / comment > <nl> < translation type = " obsolete " > & lt ; font color = & apos ; red & apos ; & gt ; % 1 & lt ; / font & gt ; & lt ; i & gt ; αποκλείστηκε & lt ; / i & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Ratio < / source > <nl> < translation type = " obsolete " > Αναλογία < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Alt + 2 < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Alt + 3 , Ctrl + F < / source > <nl> < comment > shortcut to switch to third tab ( search ) < / comment > <nl> < translation type = " obsolete " > Alt + 3 , Ctrl + F < / translation > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Αδύνατο κατέβασμα αρχείου από το url : % 1 , αιτία : % 2 . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Fast resume data was rejected for torrent % 1 , checking again . . . < / source > <nl> < translation type = " obsolete " > Γρήγορη συνέχεια κατεβάσματος αρχείων απορρίφθηκε για το τορεντ % 1 , επανέλεγχος . . . < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > & apos ; % 1 & apos ; διαγράφηκε για πάντα . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Url seed lookup failed for url : % 1 , message : % 2 < / source > <nl> < translation type = " obsolete " > Αποτυχία ελέγχου url μοιράσματος για το url : % 1 , μήνυμα : % 2 < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < location filename = " . . / GUI . cpp " line = " 290 " / > <nl> < source > Alt + 3 < / source > <nl> < comment > shortcut to switch to third tab < / comment > <nl> - < translation type = " unfinished " > Alt + 3 < / translation > <nl> + < translation > Alt + 3 < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / GUI . cpp " line = " 292 " / > <nl> < source > Ctrl + F < / source > <nl> < comment > shortcut to switch to search tab < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Ctrl + F < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> < name > MainWindow < / name > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > qBittorrent : : By Christophe Dumez < / source > <nl> < translation type = " obsolete " > qBittorrent : : Από τον Christophe Dumez < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Log : < / source > <nl> < translation type = " obsolete " > Ημερολόγιο : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Total DL Speed : < / source > <nl> < translation type = " obsolete " > Συνολική DL Ταχύτητα : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Kb / s < / source > <nl> < translation type = " obsolete " > Kb / s < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Total UP Speed : < / source > <nl> < translation type = " obsolete " > Συνολική UP Ταχύτητα : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Name < / source > <nl> < translation type = " obsolete " > Όνομα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Size < / source > <nl> < translation type = " obsolete " > Μέγεθος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > % DL < / source > <nl> < translation type = " obsolete " > % DL < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > DL Speed < / source > <nl> < translation type = " obsolete " > DL Ταχύτητα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > UP Speed < / source > <nl> < translation type = " obsolete " > UP Ταχύτητα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Status < / source > <nl> < translation type = " obsolete " > Κατάσταση < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > ETA < / source > <nl> < translation type = " obsolete " > Χρόνος που απομένει < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & amp ; Options < / source > <nl> < translation type = " obsolete " > & amp ; Ρυθμίσεις < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Έγγραφα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Connexion Status < / source > <nl> < translation type = " obsolete " > Κατάσταση Σύνδεσης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Delete All < / source > <nl> < translation type = " obsolete " > Σβήσιμο Όλων < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Ιδιότητες τορεντ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Connection Status < / source > <nl> < translation type = " obsolete " > Κατάσταση Σύνδεσης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Downloads < / source > <nl> < translation type = " obsolete " > Κατεβάσματα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search < / source > <nl> < translation type = " obsolete " > Αναζήτηση < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search Pattern : < / source > <nl> < translation type = " obsolete " > Πρότυπο εύρεσης : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Status : < / source > <nl> < translation type = " obsolete " > Κατάσταση : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Stopped < / source > <nl> < translation type = " obsolete " > Σταμάτησε < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search Engines < / source > <nl> < translation type = " obsolete " > Μηχανές Αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Results : < / source > <nl> < translation type = " obsolete " > Αποτελέσματα : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Stop < / source > <nl> < translation type = " obsolete " > Σταμάτησε < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Seeds < / source > <nl> < translation type = " obsolete " > Διαμοιραστές < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Leechers < / source > <nl> < translation type = " obsolete " > Συνδέσεις < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search Engine < / source > <nl> < translation type = " obsolete " > Μηχανή Αναζήτησης < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Κατέβασμα από URL < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Download < / source > <nl> < translation type = " obsolete " > Κατέβασμα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Clear < / source > <nl> < translation type = " obsolete " > Ξεκάθαρο / α < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > KiB / s < / source > <nl> < translation type = " obsolete " > KiB / s < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Δημιουργία τορεντ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Ratio : < / source > <nl> < translation type = " obsolete " > Αναλογία : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Update search plugin < / source > <nl> < translation type = " obsolete " > Αναβάθμιση plugin αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Session ratio : < / source > <nl> < translation type = " obsolete " > Ποσοστό συνεδρίας : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Transfers < / source > <nl> < translation type = " obsolete " > Μεταφορές < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Ρύθμιση ορίου κατεβάσματος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Log < / source > <nl> < translation type = " obsolete " > Αρχείο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > IP filter < / source > <nl> < translation type = " obsolete " > Φίλτρο ΙΡ < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < context > <nl> < name > PropListDelegate < / name > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > False < / source > <nl> < translation type = " obsolete " > Λανθασμένο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > True < / source > <nl> < translation type = " obsolete " > Σωστό < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < context > <nl> < name > QTextEdit < / name > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Clear < / source > <nl> < translation type = " obsolete " > Καθάρισε < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Ανανέωση < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Create < / source > <nl> < translation type = " obsolete " > Δημιουργία < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Παρακαλώ εισάγετε ένα σχέδιο εύρεσης πρώτα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 286 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > No search engine selected < / source > <nl> < translation type = " obsolete " > Δεν έχει επιλεγεί μηχανή αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 286 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > You must select at least one search engine . < / source > <nl> < translation type = " obsolete " > Πρέπει να επιλέξετε τουλάχιστο μια μηχανή αναζήτησης . < / translation > <nl> < / message > <nl> Are you sure you want to quit qBittorrent ? < / source > <nl> < translation > Αναζήτηση . . . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 469 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search plugin update - - qBittorrent < / source > <nl> < translation type = " obsolete " > Αναβάθμιση plugin αναζήτησης - - qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 448 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search plugin can be updated , do you want to update it ? <nl> <nl> Changelog : <nl> Changelog : <nl> < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 449 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & amp ; Yes < / source > <nl> < translation type = " obsolete " > & amp ; Ναι < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 449 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & amp ; No < / source > <nl> < translation type = " obsolete " > & amp ; Όχι < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 465 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search plugin update < / source > <nl> < translation type = " obsolete " > Αναβάθμιση plugin αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 465 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > qBittorrent < / source > <nl> < translation type = " obsolete " > qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 466 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Sorry , update server is temporarily unavailable . < / source > <nl> < translation type = " obsolete " > Λυπούμαστε , ο εξηπυρετητής αναβάθμισης δεν είναι προσωρινά διαθέσιμος . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 470 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Your search plugin is already up to date . < / source > <nl> < translation type = " obsolete " > Το plugin αναζήτησης είναι ήδη αναβαθμισμένο . < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Αποτελέσματα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 483 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search plugin download error < / source > <nl> < translation type = " obsolete " > Σφάλμα κατά το κατέβασμα plugin αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / searchEngine . cpp " line = " 483 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Couldn & apos ; t download search plugin update at url : % 1 , reason : % 2 . < / source > <nl> < translation type = " obsolete " > Αδύνατο κατέβασμα plugin αναζήτησης από το url : % 1 , αιτία : % 2 . < / translation > <nl> < / message > <nl> Changelog : <nl> < context > <nl> < name > Ui < / name > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > I would like to thank the following people who volonteered to translate qBittorrent : < / source > <nl> < translation type = " obsolete " > Θα ήθελα να ευχαριστήσω τους παρακάτω ανθρώπους που εθελοντικά μετέφρασαν το qBittorrent : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Please contact me if you would like to translate qBittorrent to your own language . < / source > <nl> < translation type = " obsolete " > Παρακαλώ επικοινωνήστε μαζί μου αν θα θέλατε να μεταφράσετε το qBittorrent στην δική σας γλώσσα . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > I would like to thank sourceforge . net for hosting qBittorrent project . < / source > <nl> < translation type = " obsolete " > Θα ήθελα να ευχαριστήσω το sourceforge . net για την φιλοξένηση του qBittorrent project . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > qBittorrent < / source > <nl> < translation type = " obsolete " > qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > I would like to thank the following people who volunteered to translate qBittorrent : < / source > <nl> < translation type = " obsolete " > Θα ήθελα να ευχαριστήσω τους παρακάτω ανθρώπους που εθελοντικά μετέφρασαν το qBittorrent : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & lt ; ul & gt ; & lt ; li & gt ; I would like to thank sourceforge . net for hosting qBittorrent project . & lt ; / li & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; ul & gt ; & lt ; li & gt ; Θα ήθελα να ευχαριστήσω το sourceforge . net για την φιλοξενία του qBittorrent project . & lt ; / li & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & lt ; li & gt ; I also like to thank Jeffery Fernandez ( developer @ jefferyfernandez . id . au ) , our RPM packager , for his great work . & lt ; / li & gt ; & lt ; / ul & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; li & gt ; Επίσης θα ήθελα να ευχαριστήσω τον Jeffery Fernandez ( developer @ jefferyfernandez . id . au ) , τον RPM packager μας , για την εξαιρετική δουλειά του . & lt ; / li & gt ; & lt ; / ul & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Preview impossible < / source > <nl> < translation type = " obsolete " > Προεπισκόπηση αδύνατη < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Sorry , we can & apos ; t preview this file < / source > <nl> < translation type = " obsolete " > Λυπούμαστε , δεν μπορεί να προεσκοπηθεί αυτό το αρχείο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Name < / source > <nl> < translation type = " obsolete " > Όνομα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Size < / source > <nl> < translation type = " obsolete " > Μέγεθος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Progress < / source > <nl> < translation type = " obsolete " > Πρόοδος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > No URL entered < / source > <nl> < translation type = " obsolete " > Δεν έχετε εισάγει URL < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Please type at least one URL . < / source > <nl> < translation type = " obsolete " > Παρακαλώ εισάγετε τουλάχιστο ένα URL . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > qBittorrent < / source > <nl> < translation type = " obsolete " > qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Please contact me if you would like to translate qBittorrent into your own language . < / source > <nl> < translation type = " obsolete " > Παρακαλώ επικοινωνήστε μαζί μου αν θα θέλατε να μεταφράσετε το qBittorrent στη δική σας γλώσσα . < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Περιεχόμενο τορεντ : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > File name < / source > <nl> < translation type = " obsolete " > Όνομα αρχείου < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > File size < / source > <nl> < translation type = " obsolete " > Μέγεθος αρχείου < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Selected < / source > <nl> < translation type = " obsolete " > Επιλεγμένο ( α ) < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Ακύρωση < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > select < / source > <nl> < translation type = " obsolete " > επιλογή < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Unselect < / source > <nl> < translation type = " obsolete " > Ακύρωση επιλογής < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Select < / source > <nl> < translation type = " obsolete " > Επιλογή < / translation > <nl> < / message > <nl> Changelog : <nl> < context > <nl> < name > createTorrentDialog < / name > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Create Torrent file < / source > <nl> < translation type = " obsolete " > Δημιουργία Αρχείου Τορεντ < / translation > <nl> < / message > <nl> Changelog : <nl> < translation type = " unfinished " > Τοποθετήστε αρχείο ή κατηγορία : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Comment : < / source > <nl> < translation type = " obsolete " > Σχόλια : < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Ακύρωση < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Announce url ( Tracker ) : < / source > <nl> < translation type = " obsolete " > Ανακοίνωση url ( Ιχνηλάτη ) : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Directory < / source > <nl> < translation type = " obsolete " > Φάκελος < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Εργαλείο Δημιουργίας Τορεντ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & lt ; center & gt ; Destination torrent file : & lt ; / center & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; center & gt ; Προορισμός αρχείου torrent : & lt ; / center & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & lt ; center & gt ; Input file or directory : & lt ; / center & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; center & gt ; Είσοδος αρχείου ή διαδρομής : & lt ; / center & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & lt ; center & gt ; Announce url : & lt ; br & gt ; ( One per line ) & lt ; / center & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; center & gt ; Ανακοινωτικό url : & lt ; br & gt ; ( Μια ανά γραμμή ) & lt ; / center & gt ; < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > & lt ; center & gt ; Comment : & lt ; / center & gt ; < / source > <nl> < translation type = " obsolete " > & lt ; center & gt ; Σχόλιο : & lt ; / center & gt ; < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Δημιουργία αρχείου τορεντ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / createtorrent . ui " line = " 93 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Input files or directories : < / source > <nl> < translation type = " obsolete " > Είσοδος αρχείων ή φακέλων : < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Αρχεία Τορεντ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Select input directory or file < / source > <nl> < translation type = " obsolete " > Επιλέξτε αρχείο ή κατηγορία εισόδου < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Παρακαλώ πληκτρολογήστε μία διαδρομή εισόδου πρώτα < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Input path does not exist < / source > <nl> < translation type = " obsolete " > Διαδρομή εισόδου δεν υπάρχει < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Please type a correct input path first < / source > <nl> < translation type = " obsolete " > Παρακαλώ πληκτρολογήστε έναν έγκυρο προορισμό διαδρομής πρώτα < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Τόρεντ δημιουργήθηκε επιτυχώς : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Please type a valid input path first < / source > <nl> < translation type = " obsolete " > Παρακαλώ πληκτρολογήστε μία έγκυρη διαδρομή εισόδου πρώτα < / translation > <nl> < / message > <nl> Changelog : <nl> < translation > Επιλέξτε ένα φάκελο για να προστεθεί το τορεντ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / createtorrent_imp . cpp " line = " 72 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Select files to add to the torrent < / source > <nl> < translation type = " obsolete " > Επιλέξτε αρχεία να προστεθούν στο τορεντ < / translation > <nl> < / message > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / download . ui " line = " 13 " / > <nl> < source > Search < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Αναζήτηση < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 48 " / > <nl> < source > Total DL Speed : < / source > <nl> - < translation type = " unfinished " > Συνολική DL Ταχύτητα : < / translation > <nl> + < translation > Συνολική DL Ταχύτητα : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 181 " / > <nl> < source > KiB / s < / source > <nl> - < translation type = " unfinished " > KiB / s < / translation > <nl> + < translation > KiB / s < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 106 " / > <nl> < source > Session ratio : < / source > <nl> - < translation type = " unfinished " > Ποσοστό συνεδρίας : < / translation > <nl> + < translation > Ποσοστό συνεδρίας : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 152 " / > <nl> < source > Total UP Speed : < / source > <nl> - < translation type = " unfinished " > Συνολική UP Ταχύτητα : < / translation > <nl> + < translation > Συνολική UP Ταχύτητα : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 246 " / > <nl> < source > Log < / source > <nl> - < translation type = " unfinished " > Αρχείο < / translation > <nl> + < translation > Αρχείο < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 280 " / > <nl> < source > IP filter < / source > <nl> - < translation type = " unfinished " > Φίλτρο ΙΡ < / translation > <nl> + < translation > Φίλτρο ΙΡ < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 306 " / > <nl> < source > Start < / source > <nl> - < translation type = " unfinished " > Έναρξη < / translation > <nl> + < translation > Έναρξη < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 311 " / > <nl> < source > Pause < / source > <nl> - < translation type = " unfinished " > Παύση < / translation > <nl> + < translation > Παύση < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 316 " / > <nl> < source > Delete < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Διαγραφή < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 321 " / > <nl> < source > Clear < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Εκκαθάριση < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 326 " / > <nl> < source > Preview file < / source > <nl> - < translation type = " unfinished " > Προεπισκόπηση αρχείου < / translation > <nl> + < translation > Προεπισκόπηση αρχείου < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 331 " / > <nl> < source > Set upload limit < / source > <nl> - < translation type = " unfinished " > Ρύθμιση ορίου ανεβάσματος < / translation > <nl> + < translation > Ρύθμιση ορίου ανεβάσματος < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 336 " / > <nl> < source > Set download limit < / source > <nl> - < translation type = " unfinished " > Ρύθμιση ορίου κατεβάσματος < / translation > <nl> + < translation > Ρύθμιση ορίου κατεβάσματος < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 341 " / > <nl> < source > Delete Permanently < / source > <nl> - < translation type = " unfinished " > Οριστική Διαγραφή < / translation > <nl> + < translation > Οριστική Διαγραφή < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / download . ui " line = " 346 " / > <nl> < source > Torrent Properties < / source > <nl> - < translation type = " unfinished " > Ιδιότητες τορεντ < / translation > <nl> + < translation > Ιδιότητες τορεντ < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 16 " / > <nl> < source > Search plugins < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Plugin αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 29 " / > <nl> < source > Installed search engines : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Εγκατεστημένες μηχανές αναζήτησης : < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 49 " / > <nl> < source > Name < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Όνομα < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 54 " / > <nl> < source > Url < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Url < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 59 " / > <nl> < source > Enabled < / source > <nl> - < translation type = " unfinished " > Ενεργοποιημένο < / translation > <nl> + < translation > Ενεργοποιημένο < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 72 " / > <nl> < source > You can get new search engine plugins here : & lt ; a href = & quot ; http : plugins . qbittorrent . org & quot ; & gt ; http : / / plugins . qbittorrent . org & lt ; / a & gt ; < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Μπορείτε να βρείτε νέα plugin αναζήτησης εδώ : & lt ; a href = & quot ; http : plugins . qbittorrent . org & quot ; & gt ; http : / / plugins . qbittorrent . org & lt ; / a & gt ; < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 81 " / > <nl> < source > Install a new one < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Εγκατάσταση ενός καινούριου < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 88 " / > <nl> < source > Check for updates < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Έλεγχος για αναβαθμίσεις < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 95 " / > <nl> < source > Close < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Κλείσιμο < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 104 " / > <nl> < source > Enable < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Ενεργοποίηση < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 109 " / > <nl> < source > Disable < / source > <nl> - < translation type = " unfinished " > Απενεργοποίηση < / translation > <nl> + < translation > Απενεργοποίηση < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 114 " / > <nl> < source > Uninstall < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Απεγκατάσταση < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 287 " / > <nl> < source > True < / source > <nl> - < translation type = " unfinished " > Σωστό < / translation > <nl> + < translation > Σωστό < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 289 " / > <nl> < source > False < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Λάθος < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 196 " / > <nl> < source > Uninstall warning < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Προειδοποίηση απεγκατάστασης < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 196 " / > <nl> < source > Some plugins could not be uninstalled because they are included in qBittorrent . <nl> Only the ones you added yourself can be uninstalled . <nl> However , those plugins were disabled . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Μερικά plugin δεν μπόρεσαν να απεγκατασταθούν διότι συμπεριλαμβάνονται στο qBittorrent . <nl> + Μόνο αυτά που προσθέσατε μόνος σας μπορούν να απεγκατασταθούν . <nl> + Ωστόσο , αυτά τα plugin απενεργοποιήθηκαν . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 198 " / > <nl> < source > Uninstall success < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Επιτυχής απεγκατάσταση < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " " line = " 135202580 " / > <nl> + < source > All selected plugins were uninstalled successfuly < / source > <nl> + < translation type = " obsolete " > Όλα τα επιλεγμένα plugin απεγκαταστήθηκαν επιτυχώς < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 378 " / > <nl> < source > Select search plugins < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Επιλέξτε plugin αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 379 " / > <nl> < source > qBittorrent search plugins < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > plugin αναζήτησης του qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 497 " / > <nl> < source > Search plugin install < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Εγκατάσταση plugin αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 524 " / > <nl> < source > qBittorrent < / source > <nl> - < translation type = " unfinished " > qBittorrent < / translation > <nl> + < translation > qBittorrent < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 330 " / > <nl> < source > A more recent version of % 1 search engine plugin is already installed . < / source > <nl> < comment > % 1 is the name of the search engine < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Μια πιο πρόσφατη έκδοση plugin αναζήτησης % 1 έχει ήδη εγκατασταθεί . < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " " line = " 135202580 " / > <nl> + < source > % 1 search engine plugin was successfuly updated . < / source > <nl> + < comment > % 1 is the name of the search engine < / comment > <nl> + < translation type = " obsolete " > Το plugin αναζήτησης % 1 αναβαθμίστηκε επιτυχώς . < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " " line = " 135202580 " / > <nl> + < source > % 1 search engine plugin was successfuly installed . < / source > <nl> + < comment > % 1 is the name of the search engine < / comment > <nl> + < translation type = " obsolete " > Το plugin αναζήτησης % 1 εγκαταστήθηκε επιτυχώς . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 524 " / > <nl> < source > Search plugin update < / source > <nl> - < translation type = " unfinished " > Αναβάθμιση plugin αναζήτησης < / translation > <nl> + < translation > Αναβάθμιση plugin αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 516 " / > <nl> < source > Sorry , update server is temporarily unavailable . < / source > <nl> - < translation type = " unfinished " > Λυπούμαστε , ο εξηπυρετητής αναβάθμισης δεν είναι προσωρινά διαθέσιμος . < / translation > <nl> + < translation > Λυπούμαστε , ο εξυπηρετητής αναβάθμισης δεν είναι προσωρινά διαθέσιμος . < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " " line = " 135202580 " / > <nl> + < source > % 1 search plugin was successfuly updated . < / source > <nl> + < comment > % 1 is the name of the search engine < / comment > <nl> + < translation type = " obsolete " > Το plugin αναζήτησης % 1 αναβαθμίστηκε επιτυχώς . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 524 " / > <nl> < source > Sorry , % 1 search plugin update failed . < / source > <nl> < comment > % 1 is the name of the search engine < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Λυπούμαστε , η αναβάθμιση του plugin αναζήτησης % 1 απέτυχε . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 426 " / > <nl> < source > All your plugins are already up to date . < / source > <nl> + < translation > Όλα τα plugin σας είναι ήδη αναβαθμισμένα . < / translation > <nl> + < / message > <nl> + < message > <nl> + < location filename = " . . / engineSelectDlg . cpp " line = " 198 " / > <nl> + < source > All selected plugins were uninstalled successfully < / source > <nl> < translation type = " unfinished " > < / translation > <nl> < / message > <nl> < message > <nl> However , those plugins were disabled . < / source > <nl> < comment > % 1 is the name of the search engine < / comment > <nl> < translation type = " unfinished " > < / translation > <nl> < / message > <nl> - < message > <nl> - < location filename = " . . / engineSelectDlg . cpp " line = " 198 " / > <nl> - < source > All selected plugins were uninstalled successfully < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> - < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 368 " / > <nl> < source > % 1 search engine plugin was successfully updated . < / source > <nl> However , those plugins were disabled . < / source > <nl> < translation > TiB < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > m < / source > <nl> < comment > minutes < / comment > <nl> < translation type = " obsolete " > λ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > h < / source > <nl> < comment > hours < / comment > <nl> < translation type = " obsolete " > ώ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > d < / source > <nl> < comment > days < / comment > <nl> < translation type = " obsolete " > μ < / translation > <nl> However , those plugins were disabled . < / source > <nl> < translation > Άγνωστος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > h < / source > <nl> < comment > hours < / comment > <nl> < translation type = " obsolete " > ώ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > d < / source > <nl> < comment > days < / comment > <nl> < translation type = " obsolete " > μ < / translation > <nl> However , those plugins were disabled . < / source > <nl> < context > <nl> < name > options_imp < / name > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Options saved successfully ! < / source > <nl> < translation type = " obsolete " > Οι ρυθμίσεις αποθηκεύτηκαν επιτυχώς ! < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Choose Scan Directory < / source > <nl> < translation type = " obsolete " > Επιλέξτε Φάκελο Σάρωσης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Choose save Directory < / source > <nl> < translation type = " obsolete " > Επιλέξτε Φάκελο Αποθήκευσης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Choose ipfilter . dat file < / source > <nl> < translation type = " obsolete " > Επιλέξτε αρχείο ipfilter . dat < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > I / O Error < / source > <nl> < translation type = " obsolete " > I / O Λάθος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Couldn & apos ; t open : < / source > <nl> < translation type = " obsolete " > Δεν άνοιξε : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > in read mode . < / source > <nl> < translation type = " obsolete " > σε φάση ανάγνωσης . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Invalid Line < / source > <nl> < translation type = " obsolete " > Άκυρη Γραμμή < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Line < / source > <nl> < translation type = " obsolete " > Η Γραμμή < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > is malformed . < / source > <nl> < translation type = " obsolete " > είναι κακοσχηματισμένη . < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Αρχή ΙΡ : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Incorrect IP < / source > <nl> < translation type = " obsolete " > Λάθος ΙΡ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > This IP is incorrect . < / source > <nl> < translation type = " obsolete " > Η ΙΡ είναι λάθος . < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Ιδιότητες τορεντ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Main Infos < / source > <nl> < translation type = " obsolete " > Κύριες Πληροφορίες < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > File Name < / source > <nl> < translation type = " obsolete " > Όνομα Αρχείου < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Current Session < / source > <nl> < translation type = " obsolete " > Παρούσα Περίοδος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Total Uploaded : < / source > <nl> < translation type = " obsolete " > Σύνολο Ανεβασμένων : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Total Downloaded : < / source > <nl> < translation type = " obsolete " > Σύνολο Κατεβασμένων : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Download state : < / source > <nl> < translation type = " obsolete " > Κατάσταση κατεβάσματος : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Current Tracker : < / source > <nl> < translation type = " obsolete " > Παρόν ιχνηλάτης : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Number of Peers : < / source > <nl> < translation type = " obsolete " > Αριθμός Συνδέσεων : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Torrent Content < / source > <nl> < translation type = " obsolete " > Περιεχόμενο τορεντ < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > OK < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Total Failed : < / source > <nl> < translation type = " obsolete " > Σύνολο Αποτυχημένων : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Finished < / source > <nl> < translation type = " obsolete " > Τελειωμένο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Queued for checking < / source > <nl> < translation type = " obsolete " > Στην ουρά για έλεγχο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Checking files < / source > <nl> < translation type = " obsolete " > Ελέγχει αρχεία < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Connecting to tracker < / source > <nl> < translation type = " obsolete " > Σύνδεση με ιχνηλάτη < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Downloading Metadata < / source > <nl> < translation type = " obsolete " > Κατέβασμα Metadata < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Downloading < / source > <nl> < translation type = " obsolete " > Κατεβάζει < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Seeding < / source > <nl> < translation type = " obsolete " > Μοιράζει < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Allocating < / source > <nl> < translation type = " obsolete " > Προσδιορίζει < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Άγνωστο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Complete : < / source > <nl> < translation type = " obsolete " > Ολόκληρο : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Partial : < / source > <nl> < translation type = " obsolete " > Μερικό : < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Μέγεθος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Selected < / source > <nl> < translation type = " obsolete " > Επιλεγμένο < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Unselect < / source > <nl> < translation type = " obsolete " > Απόρριψη < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Select < / source > <nl> < translation type = " obsolete " > Επιλογή < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > You can select here precisely which files you want to download in current torrent . < / source > <nl> < translation type = " obsolete " > Εδώ μπορείτε να επιλέξετε με ακρίβεια ποιά αρχεία θέλετε να κατεβάσετε στο παρόν τορεντ . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > False < / source > <nl> < translation type = " obsolete " > Λάθος < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > True < / source > <nl> < translation type = " obsolete " > Σωστό < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Γενικές πληροφορίες < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Number of peers : < / source > <nl> < translation type = " obsolete " > Αριθμός διαμοιραστών : < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Περιεχόμενο τορεντ < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Options < / source > <nl> < translation type = " obsolete " > Επιλογές < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Κατέβασμα στη σωστή σειρά ( πιο αργό αλλα καλό για προεπισκόπηση ) < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Share Ratio : < / source > <nl> < translation type = " obsolete " > Ποσοστό μοιράσματος : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Seeders : < / source > <nl> < translation type = " obsolete " > Διαμοιραστές : < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Leechers : < / source > <nl> < translation type = " obsolete " > Συνδέσεις : < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Αυτό το url μοιράσματος είναι ήδη στη λίστα . < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Hard - coded url seeds cannot be deleted . < / source > <nl> < translation type = " obsolete " > & quot ; Hard - coded & quot ; url μοιράσματος δεν μπορούν να διαγραφούν . < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Αναζήτηση < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / search . ui " line = " 45 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Search Engines < / source > <nl> < translation type = " obsolete " > Μηχανές Αναζήτησης < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Εκκαθάριση < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " . . / search . ui " line = " 374 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > Update search plugin < / source > <nl> < translation type = " obsolete " > Αναβάθμιση plugin αναζήτησης < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / search . ui " line = " 99 " / > <nl> < source > Search engines . . . < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Μηχανές αναζήτησης . . . < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> However , those plugins were disabled . < / source > <nl> < context > <nl> < name > torrentAdditionDialog < / name > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > True < / source > <nl> < translation type = " obsolete " > Σωστό < / translation > <nl> < / message > <nl> However , those plugins were disabled . < / source > <nl> < translation > Επιλέξτε διαδρομή αποθήκευσης < / translation > <nl> < / message > <nl> < message > <nl> - < location filename = " " line = " 7471221 " / > <nl> + < location filename = " " line = " 135202580 " / > <nl> < source > False < / source > <nl> < translation type = " obsolete " > Λάθος < / translation > <nl> < / message > <nl> mmm a / src / lang / qbittorrent_fr . ts <nl> ppp b / src / lang / qbittorrent_fr . ts <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < ! DOCTYPE TS > < TS version = " 1 . 1 " language = " fr " > <nl> - < defaultcodec > < / defaultcodec > <nl> < context > <nl> < name > @ default < / name > <nl> < message > <nl> Binary files a / src / lang / qbittorrent_it . qm and b / src / lang / qbittorrent_it . qm differ <nl> mmm a / src / lang / qbittorrent_it . ts <nl> ppp b / src / lang / qbittorrent_it . ts <nl> Sei sicuro di voler uscire da qBittorrent ? < / translation > <nl> < message > <nl> < location filename = " . . / PropListDelegate . h " line = " 121 " / > <nl> < source > Ignored < / source > <nl> - < translation > Ignorata < / translation > <nl> + < translation > Ignora < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / PropListDelegate . h " line = " 122 " / > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / searchEngine . cpp " line = " 433 " / > <nl> < source > Unknown < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Sconosciuto < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / addTorrentDialog . ui " line = " 162 " / > <nl> < source > Ignored < / source > <nl> - < translation > Ignorata < / translation > <nl> + < translation > Ignora < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / addTorrentDialog . ui " line = " 167 " / > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / createtorrent . ui " line = " 93 " / > <nl> < source > Input file or directory : < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > File o directory da aggiungere : < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / createtorrent_imp . cpp " line = " 75 " / > <nl> < source > Select a file to add to the torrent < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Selezionare un file da aggiungere al torrent < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl> Changelog : <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 59 " / > <nl> < source > Enabled < / source > <nl> - < translation > Attivata < / translation > <nl> + < translation > Attivato < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelect . ui " line = " 72 " / > <nl> Comunque , quei plugin sono stati disabilitati . < / translation > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 352 " / > <nl> < source > % 1 search engine plugin could not be updated , keeping old version . < / source > <nl> < comment > % 1 is the name of the search engine < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Non è stato possibile aggiornare % 1 , mantengo la versione attuale . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 357 " / > <nl> < source > % 1 search engine plugin could not be installed . < / source > <nl> < comment > % 1 is the name of the search engine < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Non è stato possibile installare il plugin di ricerca % 1 . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 198 " / > <nl> < source > All selected plugins were uninstalled successfully < / source > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Tutti i plugin selezionati sono stati disinstallati con successo < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 368 " / > <nl> < source > % 1 search engine plugin was successfully updated . < / source > <nl> < comment > % 1 is the name of the search engine < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Il plugin di ricerca % 1 è stato aggiornato con successo . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 497 " / > <nl> < source > % 1 search engine plugin was successfully installed . < / source > <nl> < comment > % 1 is the name of the search engine < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Il plugin di ricerca % 1 è stato installato con successo . < / translation > <nl> < / message > <nl> < message > <nl> < location filename = " . . / engineSelectDlg . cpp " line = " 499 " / > <nl> < source > % 1 search plugin was successfully updated . < / source > <nl> < comment > % 1 is the name of the search engine < / comment > <nl> - < translation type = " unfinished " > < / translation > <nl> + < translation > Il plugin di ricerca % 1 è stato aggiornato con successo . < / translation > <nl> < / message > <nl> < / context > <nl> < context > <nl>
|
- Updated Itralian , greek and bolgarian translations
|
qbittorrent/qBittorrent
|
ffedffcead687707469e44c7a0c1e6089fd94f34
|
2007-09-03T11:14:11Z
|
mmm a / fdbserver / LogSystemPeekCursor . actor . cpp <nl> ppp b / fdbserver / LogSystemPeekCursor . actor . cpp <nl> ACTOR Future < Void > resetChecker ( ILogSystem : : ServerPeekCursor * self , NetworkAddr <nl> return Void ( ) ; <nl> } <nl> <nl> - ACTOR Future < TLogPeekReply > recordRequestMetrics ( ILogSystem : : ServerPeekCursor * self , Future < TLogPeekReply > in , NetworkAddress addr ) { <nl> + ACTOR Future < TLogPeekReply > recordRequestMetrics ( ILogSystem : : ServerPeekCursor * self , NetworkAddress addr , Future < TLogPeekReply > in ) { <nl> try { <nl> state double startTime = now ( ) ; <nl> TLogPeekReply t = wait ( in ) ; <nl> ACTOR Future < Void > serverPeekParallelGetMore ( ILogSystem : : ServerPeekCursor * self <nl> try { <nl> if ( self - > parallelGetMore | | self - > onlySpilled ) { <nl> while ( self - > futureResults . size ( ) < SERVER_KNOBS - > PARALLEL_GET_MORE_REQUESTS & & self - > interf - > get ( ) . present ( ) ) { <nl> - self - > futureResults . push_back ( recordRequestMetrics ( self , self - > interf - > get ( ) . interf ( ) . peekMessages . getReply ( TLogPeekRequest ( self - > messageVersion . version , self - > tag , self - > returnIfBlocked , self - > onlySpilled , std : : make_pair ( self - > randomID , self - > sequence + + ) ) , taskID ) ) ) ; <nl> + self - > futureResults . push_back ( recordRequestMetrics ( self , self - > interf - > get ( ) . interf ( ) . peekMessages . getEndpoint ( ) . getPrimaryAddress ( ) , self - > interf - > get ( ) . interf ( ) . peekMessages . getReply ( TLogPeekRequest ( self - > messageVersion . version , self - > tag , self - > returnIfBlocked , self - > onlySpilled , std : : make_pair ( self - > randomID , self - > sequence + + ) ) , taskID ) ) ) ; <nl> } <nl> if ( self - > sequence = = std : : numeric_limits < decltype ( self - > sequence ) > : : max ( ) ) { <nl> throw timed_out ( ) ; <nl>
|
more compile fixes
|
apple/foundationdb
|
33c9b1374a530e699763203479560232aca133ec
|
2020-07-10T05:57:43Z
|
new file mode 100644 <nl> index 0000000000 . . 1c750b058c <nl> mmm / dev / null <nl> ppp b / code / data_structures / stack / reverse_stack / reverse_stack . c <nl> <nl> + / / C program to reverse a stack using recursion <nl> + # include < stdio . h > <nl> + # include < stdlib . h > <nl> + # define bool int <nl> + <nl> + / * structure of a stack node * / <nl> + struct sNode <nl> + { <nl> + char data ; <nl> + struct sNode * next ; <nl> + } ; <nl> + <nl> + / * Function Prototypes * / <nl> + void push ( struct sNode * * top_ref , int new_data ) ; <nl> + int pop ( struct sNode * * top_ref ) ; <nl> + bool isEmpty ( struct sNode * top ) ; <nl> + void print ( struct sNode * top ) ; <nl> + <nl> + / / Below is a recursive function that inserts an element <nl> + / / at the bottom of a stack . <nl> + void insertAtBottom ( struct sNode * * top_ref , int item ) <nl> + { <nl> + if ( isEmpty ( * top_ref ) ) <nl> + push ( top_ref , item ) ; <nl> + else <nl> + { <nl> + <nl> + / * Hold all items in Function Call Stack until we <nl> + reach end of the stack . When the stack becomes <nl> + empty , the isEmpty ( * top_ref ) becomes true , the <nl> + above if part is executed and the item is inserted <nl> + at the bottom * / <nl> + int temp = pop ( top_ref ) ; <nl> + insertAtBottom ( top_ref , item ) ; <nl> + <nl> + / * Once the item is inserted at the bottom , push all <nl> + the items held in Function Call Stack * / <nl> + push ( top_ref , temp ) ; <nl> + } <nl> + } <nl> + <nl> + / / Below is the function that reverses the given stack using <nl> + / / insertAtBottom ( ) <nl> + void reverse ( struct sNode * * top_ref ) <nl> + { <nl> + if ( ! isEmpty ( * top_ref ) ) <nl> + { <nl> + / * Hold all items in Function Call Stack until we <nl> + reach end of the stack * / <nl> + int temp = pop ( top_ref ) ; <nl> + reverse ( top_ref ) ; <nl> + <nl> + / * Insert all the items ( held in Function Call Stack ) <nl> + one by one from the bottom to top . Every item is <nl> + inserted at the bottom * / <nl> + insertAtBottom ( top_ref , temp ) ; <nl> + } <nl> + } <nl> + <nl> + / * Driveer program to test above functions * / <nl> + int main ( ) <nl> + { <nl> + struct sNode * s = NULL ; <nl> + push ( & s , 4 ) ; <nl> + push ( & s , 3 ) ; <nl> + push ( & s , 2 ) ; <nl> + push ( & s , 1 ) ; <nl> + <nl> + printf ( " \ n Original Stack " ) ; <nl> + print ( s ) ; <nl> + reverse ( & s ) ; <nl> + printf ( " \ n Reversed Stack " ) ; <nl> + print ( s ) ; <nl> + return 0 ; <nl> + } <nl> + <nl> + / * Function to check if the stack is empty * / <nl> + bool isEmpty ( struct sNode * top ) <nl> + { <nl> + return ( top = = NULL ) ? 1 : 0 ; <nl> + } <nl> + <nl> + / * Function to push an item to stack * / <nl> + void push ( struct sNode * * top_ref , int new_data ) <nl> + { <nl> + / * allocate node * / <nl> + struct sNode * new_node = <nl> + ( struct sNode * ) malloc ( sizeof ( struct sNode ) ) ; <nl> + <nl> + if ( new_node = = NULL ) <nl> + { <nl> + printf ( " Stack overflow \ n " ) ; <nl> + exit ( 0 ) ; <nl> + } <nl> + <nl> + / * put in the data * / <nl> + new_node - > data = new_data ; <nl> + <nl> + / * link the old list off the new node * / <nl> + new_node - > next = ( * top_ref ) ; <nl> + <nl> + / * move the head to point to the new node * / <nl> + ( * top_ref ) = new_node ; <nl> + } <nl> + <nl> + / * Function to pop an item from stack * / <nl> + int pop ( struct sNode * * top_ref ) <nl> + { <nl> + char res ; <nl> + struct sNode * top ; <nl> + <nl> + / * If stack is empty then error * / <nl> + if ( * top_ref = = NULL ) <nl> + { <nl> + printf ( " Stack overflow \ n " ) ; <nl> + exit ( 0 ) ; <nl> + } <nl> + else <nl> + { <nl> + top = * top_ref ; <nl> + res = top - > data ; <nl> + * top_ref = top - > next ; <nl> + free ( top ) ; <nl> + return res ; <nl> + } <nl> + } <nl> + <nl> + / * Functrion to pront a linked list * / <nl> + void print ( struct sNode * top ) <nl> + { <nl> + printf ( " \ n " ) ; <nl> + while ( top ! = NULL ) <nl> + { <nl> + printf ( " % d " , top - > data ) ; <nl> + top = top - > next ; <nl> + } <nl> + } <nl>
|
added stack revrse in c
|
OpenGenus/cosmos
|
dd4f284f10f120df2f1e393f6fc08d7a8591d4d6
|
2017-10-12T10:42:22Z
|
mmm a / src / assembler . h <nl> ppp b / src / assembler . h <nl> class RegisterBase { <nl> <nl> int bit ( ) const { return 1 < < code ( ) ; } <nl> <nl> - inline bool operator = = ( SubType other ) const { <nl> + inline constexpr bool operator = = ( SubType other ) const { <nl> return reg_code_ = = other . reg_code_ ; <nl> } <nl> - inline bool operator ! = ( SubType other ) const { return ! ( * this = = other ) ; } <nl> + inline constexpr bool operator ! = ( SubType other ) const { <nl> + return reg_code_ ! = other . reg_code_ ; <nl> + } <nl> <nl> protected : <nl> explicit constexpr RegisterBase ( int code ) : reg_code_ ( code ) { } <nl> mmm a / src / wasm / baseline / arm / liftoff - assembler - arm . h <nl> ppp b / src / wasm / baseline / arm / liftoff - assembler - arm . h <nl> void LiftoffAssembler : : Fill ( LiftoffRegister reg , uint32_t index ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> - # define UNIMPLEMENTED_I32_BINOP ( name ) \ <nl> - void LiftoffAssembler : : emit_i32_ # # name ( Register dst , Register lhs , \ <nl> - Register rhs ) { \ <nl> - UNIMPLEMENTED ( ) ; \ <nl> + # define UNIMPLEMENTED_GP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( Register dst , Register lhs , \ <nl> + Register rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_GP_UNOP ( name ) \ <nl> + bool LiftoffAssembler : : emit_ # # name ( Register dst , Register src ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_FP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( DoubleRegister dst , DoubleRegister lhs , \ <nl> + DoubleRegister rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> } <nl> <nl> - / / clang - format off <nl> - UNIMPLEMENTED_I32_BINOP ( add ) <nl> - UNIMPLEMENTED_I32_BINOP ( sub ) <nl> - UNIMPLEMENTED_I32_BINOP ( mul ) <nl> - UNIMPLEMENTED_I32_BINOP ( and ) <nl> - UNIMPLEMENTED_I32_BINOP ( or ) <nl> - UNIMPLEMENTED_I32_BINOP ( xor ) <nl> - UNIMPLEMENTED_I32_BINOP ( shl ) <nl> - UNIMPLEMENTED_I32_BINOP ( sar ) <nl> - UNIMPLEMENTED_I32_BINOP ( shr ) <nl> - / / clang - format on <nl> - <nl> - # undef UNIMPLEMENTED_I32_BINOP <nl> - <nl> - void LiftoffAssembler : : emit_i32_eqz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_ptrsize_add ( Register dst , Register lhs , <nl> - Register rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_add ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_sub ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_mul ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> + UNIMPLEMENTED_GP_BINOP ( i32_add ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sub ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_mul ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_and ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_or ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_xor ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shl ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sar ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shr ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_eqz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_clz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_ctz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_popcnt ) <nl> + UNIMPLEMENTED_GP_BINOP ( ptrsize_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_sub ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_mul ) <nl> + <nl> + # undef UNIMPLEMENTED_GP_BINOP <nl> + # undef UNIMPLEMENTED_GP_UNOP <nl> + # undef UNIMPLEMENTED_FP_BINOP <nl> <nl> void LiftoffAssembler : : emit_i32_test ( Register reg ) { UNIMPLEMENTED ( ) ; } <nl> <nl> void LiftoffAssembler : : DropStackSlotsAndRet ( uint32_t num_stack_slots ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> + void LiftoffAssembler : : PrepareCCall ( uint32_t num_params , const Register * args ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallRegParamAddr ( Register dst , uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallStackParamAddr ( uint32_t stack_param_idx , <nl> + uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : EmitCCall ( ExternalReference ext_ref , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> } / / namespace wasm <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / wasm / baseline / arm64 / liftoff - assembler - arm64 . h <nl> ppp b / src / wasm / baseline / arm64 / liftoff - assembler - arm64 . h <nl> void LiftoffAssembler : : Fill ( LiftoffRegister reg , uint32_t index ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> - # define UNIMPLEMENTED_I32_BINOP ( name ) \ <nl> - void LiftoffAssembler : : emit_i32_ # # name ( Register dst , Register lhs , \ <nl> - Register rhs ) { \ <nl> - UNIMPLEMENTED ( ) ; \ <nl> + # define UNIMPLEMENTED_GP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( Register dst , Register lhs , \ <nl> + Register rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_GP_UNOP ( name ) \ <nl> + bool LiftoffAssembler : : emit_ # # name ( Register dst , Register src ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_FP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( DoubleRegister dst , DoubleRegister lhs , \ <nl> + DoubleRegister rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> } <nl> <nl> - / / clang - format off <nl> - UNIMPLEMENTED_I32_BINOP ( add ) <nl> - UNIMPLEMENTED_I32_BINOP ( sub ) <nl> - UNIMPLEMENTED_I32_BINOP ( mul ) <nl> - UNIMPLEMENTED_I32_BINOP ( and ) <nl> - UNIMPLEMENTED_I32_BINOP ( or ) <nl> - UNIMPLEMENTED_I32_BINOP ( xor ) <nl> - UNIMPLEMENTED_I32_BINOP ( shl ) <nl> - UNIMPLEMENTED_I32_BINOP ( sar ) <nl> - UNIMPLEMENTED_I32_BINOP ( shr ) <nl> - / / clang - format on <nl> - <nl> - # undef UNIMPLEMENTED_I32_BINOP <nl> - <nl> - void LiftoffAssembler : : emit_i32_eqz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_ptrsize_add ( Register dst , Register lhs , <nl> - Register rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_add ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_sub ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_mul ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> + UNIMPLEMENTED_GP_BINOP ( i32_add ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sub ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_mul ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_and ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_or ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_xor ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shl ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sar ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shr ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_eqz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_clz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_ctz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_popcnt ) <nl> + UNIMPLEMENTED_GP_BINOP ( ptrsize_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_sub ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_mul ) <nl> + <nl> + # undef UNIMPLEMENTED_GP_BINOP <nl> + # undef UNIMPLEMENTED_GP_UNOP <nl> + # undef UNIMPLEMENTED_FP_BINOP <nl> <nl> void LiftoffAssembler : : emit_i32_test ( Register reg ) { UNIMPLEMENTED ( ) ; } <nl> <nl> void LiftoffAssembler : : DropStackSlotsAndRet ( uint32_t num_stack_slots ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> + void LiftoffAssembler : : PrepareCCall ( uint32_t num_params , const Register * args ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallRegParamAddr ( Register dst , uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallStackParamAddr ( uint32_t stack_param_idx , <nl> + uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : EmitCCall ( ExternalReference ext_ref , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> } / / namespace wasm <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / wasm / baseline / ia32 / liftoff - assembler - ia32 . h <nl> ppp b / src / wasm / baseline / ia32 / liftoff - assembler - ia32 . h <nl> static_assert ( kByteRegs . GetNumRegsSet ( ) = = 4 , " should have four byte regs " ) ; <nl> static_assert ( ( kByteRegs & kGpCacheRegList ) = = kByteRegs , <nl> " kByteRegs only contains gp cache registers " ) ; <nl> <nl> + / / Use this register to store the address of the last argument pushed on the <nl> + / / stack for a call to C . <nl> + static constexpr Register kCCallLastArgAddrReg = eax ; <nl> + <nl> } / / namespace liftoff <nl> <nl> static constexpr DoubleRegister kScratchDoubleReg = xmm7 ; <nl> void LiftoffAssembler : : emit_i32_shr ( Register dst , Register lhs , Register rhs ) { <nl> liftoff : : EmitShiftOperation ( this , dst , lhs , rhs , & Assembler : : shr_cl ) ; <nl> } <nl> <nl> - void LiftoffAssembler : : emit_i32_eqz ( Register dst , Register src ) { <nl> + bool LiftoffAssembler : : emit_i32_eqz ( Register dst , Register src ) { <nl> Register tmp_byte_reg = dst ; <nl> / / Only the lower 4 registers can be addressed as 8 - bit registers . <nl> if ( ! dst . is_byte_register ( ) ) { <nl> void LiftoffAssembler : : emit_i32_eqz ( Register dst , Register src ) { <nl> test ( src , src ) ; <nl> setcc ( zero , tmp_byte_reg ) ; <nl> movzx_b ( dst , tmp_byte_reg ) ; <nl> + return true ; <nl> } <nl> <nl> - void LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> + bool LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> Label nonzero_input ; <nl> Label continuation ; <nl> test ( src , src ) ; <nl> void LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> xor_ ( dst , 31 ) ; <nl> <nl> bind ( & continuation ) ; <nl> + return true ; <nl> } <nl> <nl> - void LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> + bool LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> Label nonzero_input ; <nl> Label continuation ; <nl> test ( src , src ) ; <nl> void LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> bsf ( dst , src ) ; <nl> <nl> bind ( & continuation ) ; <nl> + return true ; <nl> + } <nl> + <nl> + bool LiftoffAssembler : : emit_i32_popcnt ( Register dst , Register src ) { <nl> + if ( ! CpuFeatures : : IsSupported ( POPCNT ) ) return false ; <nl> + CpuFeatureScope scope ( this , POPCNT ) ; <nl> + popcnt ( dst , src ) ; <nl> + return true ; <nl> } <nl> <nl> void LiftoffAssembler : : emit_ptrsize_add ( Register dst , Register lhs , <nl> void LiftoffAssembler : : DropStackSlotsAndRet ( uint32_t num_stack_slots ) { <nl> ret ( static_cast < int > ( num_stack_slots * kPointerSize ) ) ; <nl> } <nl> <nl> + void LiftoffAssembler : : PrepareCCall ( uint32_t num_params , const Register * args ) { <nl> + for ( size_t param = 0 ; param < num_params ; + + param ) { <nl> + push ( args [ param ] ) ; <nl> + } <nl> + mov ( liftoff : : kCCallLastArgAddrReg , esp ) ; <nl> + constexpr Register kScratch = ebx ; <nl> + static_assert ( kScratch ! = liftoff : : kCCallLastArgAddrReg , " collision " ) ; <nl> + PrepareCallCFunction ( num_params , kScratch ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallRegParamAddr ( Register dst , uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + int offset = kPointerSize * static_cast < int > ( num_params - 1 - param_idx ) ; <nl> + lea ( dst , Operand ( liftoff : : kCCallLastArgAddrReg , offset ) ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallStackParamAddr ( uint32_t stack_param_idx , <nl> + uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + constexpr Register kScratch = ebx ; <nl> + static_assert ( kScratch ! = liftoff : : kCCallLastArgAddrReg , " collision " ) ; <nl> + int offset = kPointerSize * static_cast < int > ( num_params - 1 - param_idx ) ; <nl> + lea ( kScratch , Operand ( liftoff : : kCCallLastArgAddrReg , offset ) ) ; <nl> + mov ( Operand ( esp , param_idx * kPointerSize ) , kScratch ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : EmitCCall ( ExternalReference ext_ref , <nl> + uint32_t num_params ) { <nl> + CallCFunction ( ext_ref , static_cast < int > ( num_params ) ) ; <nl> + } <nl> + <nl> } / / namespace wasm <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / wasm / baseline / liftoff - assembler . cc <nl> ppp b / src / wasm / baseline / liftoff - assembler . cc <nl> void LiftoffAssembler : : SpillLocals ( ) { <nl> } <nl> } <nl> <nl> + void LiftoffAssembler : : SpillAllRegisters ( ) { <nl> + / / TODO ( clemensh ) : Don ' t update use counters in the loop , just reset them <nl> + / / afterwards . <nl> + for ( uint32_t i = 0 , e = cache_state_ . stack_height ( ) ; i < e ; + + i ) { <nl> + Spill ( i ) ; <nl> + } <nl> + } <nl> + <nl> void LiftoffAssembler : : PrepareCall ( wasm : : FunctionSig * sig , <nl> compiler : : CallDescriptor * call_desc ) { <nl> uint32_t num_params = static_cast < uint32_t > ( sig - > parameter_count ( ) ) ; <nl> void LiftoffAssembler : : PrepareCall ( wasm : : FunctionSig * sig , <nl> / / Input 0 is the call target . <nl> constexpr size_t kInputShift = 1 ; <nl> <nl> - StackTransferRecipe stack_transfers ( this ) ; <nl> - <nl> / / Spill all cache slots which are not being used as parameters . <nl> / / Don ' t update any register use counters , they will be reset later anyway . <nl> for ( uint32_t idx = 0 , end = cache_state_ . stack_height ( ) - num_params ; <nl> void LiftoffAssembler : : PrepareCall ( wasm : : FunctionSig * sig , <nl> slot . MakeStack ( ) ; <nl> } <nl> <nl> + StackTransferRecipe stack_transfers ( this ) ; <nl> + <nl> / / Now move all parameter values into the right slot for the call . <nl> / / Process parameters backward , such that we can just pop values from the <nl> / / stack . <nl> void LiftoffAssembler : : PrepareCall ( wasm : : FunctionSig * sig , <nl> cache_state_ . stack_state . pop_back ( ) ; <nl> } <nl> <nl> + / / Execute the stack transfers before filling the context register . <nl> + stack_transfers . Execute ( ) ; <nl> + <nl> / / Reset register use counters . <nl> cache_state_ . used_registers = { } ; <nl> memset ( cache_state_ . register_use_count , 0 , <nl> sizeof ( cache_state_ . register_use_count ) ) ; <nl> <nl> - / / Execute the stack transfers before filling the context register . <nl> - stack_transfers . Execute ( ) ; <nl> - <nl> / / Fill the wasm context into the right register . <nl> compiler : : LinkageLocation context_loc = <nl> call_desc - > GetInputLocation ( kInputShift ) ; <nl> mmm a / src / wasm / baseline / liftoff - assembler . h <nl> ppp b / src / wasm / baseline / liftoff - assembler . h <nl> class LiftoffAssembler : public TurboAssembler { <nl> <nl> void Spill ( uint32_t index ) ; <nl> void SpillLocals ( ) ; <nl> + void SpillAllRegisters ( ) ; <nl> <nl> / / Load parameters into the right registers / stack slots for the call . <nl> void PrepareCall ( wasm : : FunctionSig * , compiler : : CallDescriptor * ) ; <nl> class LiftoffAssembler : public TurboAssembler { <nl> inline void emit_i32_shr ( Register dst , Register lhs , Register rhs ) ; <nl> <nl> / / i32 unops . <nl> - inline void emit_i32_eqz ( Register dst , Register src ) ; <nl> - inline void emit_i32_clz ( Register dst , Register src ) ; <nl> - inline void emit_i32_ctz ( Register dst , Register src ) ; <nl> + inline bool emit_i32_eqz ( Register dst , Register src ) ; <nl> + inline bool emit_i32_clz ( Register dst , Register src ) ; <nl> + inline bool emit_i32_ctz ( Register dst , Register src ) ; <nl> + inline bool emit_i32_popcnt ( Register dst , Register src ) ; <nl> <nl> inline void emit_ptrsize_add ( Register dst , Register lhs , Register rhs ) ; <nl> <nl> class LiftoffAssembler : public TurboAssembler { <nl> <nl> / / Push a value to the stack ( will become a caller frame slot ) . <nl> inline void PushCallerFrameSlot ( const VarState & src , uint32_t src_index ) ; <nl> - <nl> inline void PushRegisters ( LiftoffRegList ) ; <nl> inline void PopRegisters ( LiftoffRegList ) ; <nl> <nl> inline void DropStackSlotsAndRet ( uint32_t num_stack_slots ) ; <nl> <nl> + / / Push arguments on the stack ( in the caller frame ) , then align the stack . <nl> + / / The address of the last argument will be stored to { arg_addr_dst } . Previous <nl> + / / arguments will be located at pointer sized buckets above that address . <nl> + inline void PrepareCCall ( uint32_t num_params , const Register * args ) ; <nl> + inline void SetCCallRegParamAddr ( Register dst , uint32_t param_idx , <nl> + uint32_t num_params ) ; <nl> + inline void SetCCallStackParamAddr ( uint32_t stack_param_idx , <nl> + uint32_t param_idx , uint32_t num_params ) ; <nl> + inline void EmitCCall ( ExternalReference ext_ref , uint32_t num_params ) ; <nl> + <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / End of platform - specific part . / / <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> mmm a / src / wasm / baseline / liftoff - compiler . cc <nl> ppp b / src / wasm / baseline / liftoff - compiler . cc <nl> class LiftoffCompiler { <nl> <nl> void EndControl ( Decoder * decoder , Control * c ) { } <nl> <nl> - void I32UnOp ( void ( LiftoffAssembler : : * emit_fn ) ( Register , Register ) ) { <nl> + void GenerateCCall ( Register res_reg , uint32_t num_args , <nl> + const Register * arg_regs , ExternalReference ext_ref ) { <nl> + static constexpr int kNumReturns = 1 ; <nl> + static constexpr int kMaxArgs = 2 ; <nl> + static constexpr MachineType kReps [ ] { <nl> + MachineType : : Uint32 ( ) , MachineType : : Pointer ( ) , MachineType : : Pointer ( ) } ; <nl> + static_assert ( arraysize ( kReps ) = = kNumReturns + kMaxArgs , " mismatch " ) ; <nl> + DCHECK_LE ( num_args , kMaxArgs ) ; <nl> + <nl> + MachineSignature sig ( kNumReturns , num_args , kReps ) ; <nl> + compiler : : CallDescriptor * desc = <nl> + compiler : : Linkage : : GetSimplifiedCDescriptor ( & compilation_zone_ , & sig ) ; <nl> + <nl> + / / Before making a call , spill all cache registers . <nl> + __ SpillAllRegisters ( ) ; <nl> + <nl> + / / Store arguments on our stack , then align the stack for calling to c . <nl> + uint32_t num_params = static_cast < uint32_t > ( desc - > ParameterCount ( ) ) ; <nl> + __ PrepareCCall ( num_params , arg_regs ) ; <nl> + <nl> + / / Set parameters ( in sp [ 0 ] , sp [ 8 ] , . . . ) . <nl> + uint32_t num_stack_params = 0 ; <nl> + for ( uint32_t param = 0 ; param < num_params ; + + param ) { <nl> + constexpr size_t kInputShift = 1 ; / / Input 0 is the call target . <nl> + <nl> + compiler : : LinkageLocation loc = <nl> + desc - > GetInputLocation ( param + kInputShift ) ; <nl> + if ( loc . IsRegister ( ) ) { <nl> + Register reg = Register : : from_code ( loc . AsRegister ( ) ) ; <nl> + / / Load address of that parameter to the register . <nl> + __ SetCCallRegParamAddr ( reg , param , num_params ) ; <nl> + } else { <nl> + DCHECK ( loc . IsCallerFrameSlot ( ) ) ; <nl> + __ SetCCallStackParamAddr ( num_stack_params , param , num_params ) ; <nl> + + + num_stack_params ; <nl> + } <nl> + } <nl> + <nl> + / / Now execute the call . <nl> + __ EmitCCall ( ext_ref , num_params ) ; <nl> + <nl> + / / Load return value . <nl> + compiler : : LinkageLocation return_loc = desc - > GetReturnLocation ( 0 ) ; <nl> + DCHECK ( return_loc . IsRegister ( ) ) ; <nl> + Register return_reg = Register : : from_code ( return_loc . AsRegister ( ) ) ; <nl> + if ( return_reg ! = res_reg ) { <nl> + __ Move ( LiftoffRegister ( res_reg ) , LiftoffRegister ( return_reg ) ) ; <nl> + } <nl> + } <nl> + <nl> + void I32UnOp ( bool ( LiftoffAssembler : : * emit_fn ) ( Register , Register ) , <nl> + ExternalReference ( * fallback_fn ) ( Isolate * ) ) { <nl> LiftoffRegList pinned_regs ; <nl> LiftoffRegister dst_reg = <nl> pinned_regs . set ( __ GetUnaryOpTargetRegister ( kGpReg ) ) ; <nl> LiftoffRegister src_reg = <nl> pinned_regs . set ( __ PopToRegister ( kGpReg , pinned_regs ) ) ; <nl> - ( asm_ - > * emit_fn ) ( dst_reg . gp ( ) , src_reg . gp ( ) ) ; <nl> + if ( ! emit_fn | | ! ( asm_ - > * emit_fn ) ( dst_reg . gp ( ) , src_reg . gp ( ) ) ) { <nl> + ExternalReference ext_ref = fallback_fn ( asm_ - > isolate ( ) ) ; <nl> + Register args [ ] = { src_reg . gp ( ) } ; <nl> + GenerateCCall ( dst_reg . gp ( ) , arraysize ( args ) , args , ext_ref ) ; <nl> + } <nl> __ PushRegister ( kWasmI32 , dst_reg ) ; <nl> } <nl> <nl> void UnOp ( Decoder * decoder , WasmOpcode opcode , FunctionSig * , <nl> const Value & value , Value * result ) { <nl> - # define CASE_UNOP ( opcode , type , fn ) \ <nl> - case WasmOpcode : : kExpr # # opcode : \ <nl> - type # # UnOp ( & LiftoffAssembler : : emit_ # # fn ) ; \ <nl> + # define CASE_UNOP ( opcode , type , fn , ext_ref_fn ) \ <nl> + case WasmOpcode : : kExpr # # opcode : \ <nl> + type # # UnOp ( & LiftoffAssembler : : emit_ # # fn , ext_ref_fn ) ; \ <nl> break ; <nl> switch ( opcode ) { <nl> - CASE_UNOP ( I32Eqz , I32 , i32_eqz ) <nl> - CASE_UNOP ( I32Clz , I32 , i32_clz ) <nl> - CASE_UNOP ( I32Ctz , I32 , i32_ctz ) <nl> + CASE_UNOP ( I32Eqz , I32 , i32_eqz , nullptr ) <nl> + CASE_UNOP ( I32Clz , I32 , i32_clz , nullptr ) <nl> + CASE_UNOP ( I32Ctz , I32 , i32_ctz , nullptr ) <nl> + CASE_UNOP ( I32Popcnt , I32 , i32_popcnt , <nl> + & ExternalReference : : wasm_word32_popcnt ) <nl> default : <nl> return unsupported ( decoder , WasmOpcodes : : OpcodeName ( opcode ) ) ; <nl> } <nl> mmm a / src / wasm / baseline / mips / liftoff - assembler - mips . h <nl> ppp b / src / wasm / baseline / mips / liftoff - assembler - mips . h <nl> void LiftoffAssembler : : Fill ( LiftoffRegister reg , uint32_t index ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> - # define UNIMPLEMENTED_I32_BINOP ( name ) \ <nl> - void LiftoffAssembler : : emit_i32_ # # name ( Register dst , Register lhs , \ <nl> - Register rhs ) { \ <nl> - UNIMPLEMENTED ( ) ; \ <nl> + # define UNIMPLEMENTED_GP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( Register dst , Register lhs , \ <nl> + Register rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_GP_UNOP ( name ) \ <nl> + bool LiftoffAssembler : : emit_ # # name ( Register dst , Register src ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_FP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( DoubleRegister dst , DoubleRegister lhs , \ <nl> + DoubleRegister rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> } <nl> <nl> - / / clang - format off <nl> - UNIMPLEMENTED_I32_BINOP ( add ) <nl> - UNIMPLEMENTED_I32_BINOP ( sub ) <nl> - UNIMPLEMENTED_I32_BINOP ( mul ) <nl> - UNIMPLEMENTED_I32_BINOP ( and ) <nl> - UNIMPLEMENTED_I32_BINOP ( or ) <nl> - UNIMPLEMENTED_I32_BINOP ( xor ) <nl> - UNIMPLEMENTED_I32_BINOP ( shl ) <nl> - UNIMPLEMENTED_I32_BINOP ( sar ) <nl> - UNIMPLEMENTED_I32_BINOP ( shr ) <nl> - / / clang - format on <nl> - <nl> - # undef UNIMPLEMENTED_I32_BINOP <nl> - <nl> - void LiftoffAssembler : : emit_i32_eqz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_ptrsize_add ( Register dst , Register lhs , <nl> - Register rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_add ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_sub ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_mul ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> + UNIMPLEMENTED_GP_BINOP ( i32_add ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sub ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_mul ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_and ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_or ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_xor ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shl ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sar ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shr ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_eqz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_clz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_ctz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_popcnt ) <nl> + UNIMPLEMENTED_GP_BINOP ( ptrsize_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_sub ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_mul ) <nl> + <nl> + # undef UNIMPLEMENTED_GP_BINOP <nl> + # undef UNIMPLEMENTED_GP_UNOP <nl> + # undef UNIMPLEMENTED_FP_BINOP <nl> <nl> void LiftoffAssembler : : emit_i32_test ( Register reg ) { UNIMPLEMENTED ( ) ; } <nl> <nl> void LiftoffAssembler : : DropStackSlotsAndRet ( uint32_t num_stack_slots ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> + void LiftoffAssembler : : PrepareCCall ( uint32_t num_params , const Register * args ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallRegParamAddr ( Register dst , uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallStackParamAddr ( uint32_t stack_param_idx , <nl> + uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : EmitCCall ( ExternalReference ext_ref , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> } / / namespace wasm <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / wasm / baseline / mips64 / liftoff - assembler - mips64 . h <nl> ppp b / src / wasm / baseline / mips64 / liftoff - assembler - mips64 . h <nl> void LiftoffAssembler : : Fill ( LiftoffRegister reg , uint32_t index ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> - # define UNIMPLEMENTED_I32_BINOP ( name ) \ <nl> - void LiftoffAssembler : : emit_i32_ # # name ( Register dst , Register lhs , \ <nl> - Register rhs ) { \ <nl> - UNIMPLEMENTED ( ) ; \ <nl> + # define UNIMPLEMENTED_GP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( Register dst , Register lhs , \ <nl> + Register rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_GP_UNOP ( name ) \ <nl> + bool LiftoffAssembler : : emit_ # # name ( Register dst , Register src ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_FP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( DoubleRegister dst , DoubleRegister lhs , \ <nl> + DoubleRegister rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> } <nl> <nl> - / / clang - format off <nl> - UNIMPLEMENTED_I32_BINOP ( add ) <nl> - UNIMPLEMENTED_I32_BINOP ( sub ) <nl> - UNIMPLEMENTED_I32_BINOP ( mul ) <nl> - UNIMPLEMENTED_I32_BINOP ( and ) <nl> - UNIMPLEMENTED_I32_BINOP ( or ) <nl> - UNIMPLEMENTED_I32_BINOP ( xor ) <nl> - UNIMPLEMENTED_I32_BINOP ( shl ) <nl> - UNIMPLEMENTED_I32_BINOP ( sar ) <nl> - UNIMPLEMENTED_I32_BINOP ( shr ) <nl> - / / clang - format on <nl> - <nl> - # undef UNIMPLEMENTED_I32_BINOP <nl> - <nl> - void LiftoffAssembler : : emit_i32_eqz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_ptrsize_add ( Register dst , Register lhs , <nl> - Register rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_add ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_sub ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_mul ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> + UNIMPLEMENTED_GP_BINOP ( i32_add ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sub ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_mul ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_and ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_or ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_xor ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shl ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sar ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shr ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_eqz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_clz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_ctz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_popcnt ) <nl> + UNIMPLEMENTED_GP_BINOP ( ptrsize_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_sub ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_mul ) <nl> + <nl> + # undef UNIMPLEMENTED_GP_BINOP <nl> + # undef UNIMPLEMENTED_GP_UNOP <nl> + # undef UNIMPLEMENTED_FP_BINOP <nl> <nl> void LiftoffAssembler : : emit_i32_test ( Register reg ) { UNIMPLEMENTED ( ) ; } <nl> <nl> void LiftoffAssembler : : DropStackSlotsAndRet ( uint32_t num_stack_slots ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> + void LiftoffAssembler : : PrepareCCall ( uint32_t num_params , const Register * args ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallRegParamAddr ( Register dst , uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallStackParamAddr ( uint32_t stack_param_idx , <nl> + uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : EmitCCall ( ExternalReference ext_ref , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> } / / namespace wasm <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / wasm / baseline / ppc / liftoff - assembler - ppc . h <nl> ppp b / src / wasm / baseline / ppc / liftoff - assembler - ppc . h <nl> void LiftoffAssembler : : Fill ( LiftoffRegister reg , uint32_t index ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> - # define UNIMPLEMENTED_I32_BINOP ( name ) \ <nl> - void LiftoffAssembler : : emit_i32_ # # name ( Register dst , Register lhs , \ <nl> - Register rhs ) { \ <nl> - UNIMPLEMENTED ( ) ; \ <nl> + # define UNIMPLEMENTED_GP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( Register dst , Register lhs , \ <nl> + Register rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_GP_UNOP ( name ) \ <nl> + bool LiftoffAssembler : : emit_ # # name ( Register dst , Register src ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_FP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( DoubleRegister dst , DoubleRegister lhs , \ <nl> + DoubleRegister rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> } <nl> <nl> - / / clang - format off <nl> - UNIMPLEMENTED_I32_BINOP ( add ) <nl> - UNIMPLEMENTED_I32_BINOP ( sub ) <nl> - UNIMPLEMENTED_I32_BINOP ( mul ) <nl> - UNIMPLEMENTED_I32_BINOP ( and ) <nl> - UNIMPLEMENTED_I32_BINOP ( or ) <nl> - UNIMPLEMENTED_I32_BINOP ( xor ) <nl> - UNIMPLEMENTED_I32_BINOP ( shl ) <nl> - UNIMPLEMENTED_I32_BINOP ( sar ) <nl> - UNIMPLEMENTED_I32_BINOP ( shr ) <nl> - / / clang - format on <nl> - <nl> - # undef UNIMPLEMENTED_I32_BINOP <nl> - <nl> - void LiftoffAssembler : : emit_i32_eqz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_ptrsize_add ( Register dst , Register lhs , <nl> - Register rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_add ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_sub ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_mul ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> + UNIMPLEMENTED_GP_BINOP ( i32_add ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sub ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_mul ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_and ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_or ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_xor ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shl ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sar ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shr ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_eqz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_clz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_ctz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_popcnt ) <nl> + UNIMPLEMENTED_GP_BINOP ( ptrsize_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_sub ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_mul ) <nl> + <nl> + # undef UNIMPLEMENTED_GP_BINOP <nl> + # undef UNIMPLEMENTED_GP_UNOP <nl> + # undef UNIMPLEMENTED_FP_BINOP <nl> <nl> void LiftoffAssembler : : emit_i32_test ( Register reg ) { UNIMPLEMENTED ( ) ; } <nl> <nl> void LiftoffAssembler : : DropStackSlotsAndRet ( uint32_t num_stack_slots ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> + void LiftoffAssembler : : PrepareCCall ( uint32_t num_params , const Register * args ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallRegParamAddr ( Register dst , uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallStackParamAddr ( uint32_t stack_param_idx , <nl> + uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : EmitCCall ( ExternalReference ext_ref , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> } / / namespace wasm <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / wasm / baseline / s390 / liftoff - assembler - s390 . h <nl> ppp b / src / wasm / baseline / s390 / liftoff - assembler - s390 . h <nl> void LiftoffAssembler : : Fill ( LiftoffRegister reg , uint32_t index ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> - # define UNIMPLEMENTED_I32_BINOP ( name ) \ <nl> - void LiftoffAssembler : : emit_i32_ # # name ( Register dst , Register lhs , \ <nl> - Register rhs ) { \ <nl> - UNIMPLEMENTED ( ) ; \ <nl> + # define UNIMPLEMENTED_GP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( Register dst , Register lhs , \ <nl> + Register rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_GP_UNOP ( name ) \ <nl> + bool LiftoffAssembler : : emit_ # # name ( Register dst , Register src ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> + } <nl> + # define UNIMPLEMENTED_FP_BINOP ( name ) \ <nl> + void LiftoffAssembler : : emit_ # # name ( DoubleRegister dst , DoubleRegister lhs , \ <nl> + DoubleRegister rhs ) { \ <nl> + UNIMPLEMENTED ( ) ; \ <nl> } <nl> <nl> - / / clang - format off <nl> - UNIMPLEMENTED_I32_BINOP ( add ) <nl> - UNIMPLEMENTED_I32_BINOP ( sub ) <nl> - UNIMPLEMENTED_I32_BINOP ( mul ) <nl> - UNIMPLEMENTED_I32_BINOP ( and ) <nl> - UNIMPLEMENTED_I32_BINOP ( or ) <nl> - UNIMPLEMENTED_I32_BINOP ( xor ) <nl> - UNIMPLEMENTED_I32_BINOP ( shl ) <nl> - UNIMPLEMENTED_I32_BINOP ( sar ) <nl> - UNIMPLEMENTED_I32_BINOP ( shr ) <nl> - / / clang - format on <nl> - <nl> - # undef UNIMPLEMENTED_I32_BINOP <nl> - <nl> - void LiftoffAssembler : : emit_i32_eqz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_ptrsize_add ( Register dst , Register lhs , <nl> - Register rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_add ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_sub ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> - <nl> - void LiftoffAssembler : : emit_f32_mul ( DoubleRegister dst , DoubleRegister lhs , <nl> - DoubleRegister rhs ) { <nl> - UNIMPLEMENTED ( ) ; <nl> - } <nl> + UNIMPLEMENTED_GP_BINOP ( i32_add ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sub ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_mul ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_and ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_or ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_xor ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shl ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_sar ) <nl> + UNIMPLEMENTED_GP_BINOP ( i32_shr ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_eqz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_clz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_ctz ) <nl> + UNIMPLEMENTED_GP_UNOP ( i32_popcnt ) <nl> + UNIMPLEMENTED_GP_BINOP ( ptrsize_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_add ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_sub ) <nl> + UNIMPLEMENTED_FP_BINOP ( f32_mul ) <nl> + <nl> + # undef UNIMPLEMENTED_GP_BINOP <nl> + # undef UNIMPLEMENTED_GP_UNOP <nl> + # undef UNIMPLEMENTED_FP_BINOP <nl> <nl> void LiftoffAssembler : : emit_i32_test ( Register reg ) { UNIMPLEMENTED ( ) ; } <nl> <nl> void LiftoffAssembler : : DropStackSlotsAndRet ( uint32_t num_stack_slots ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> + void LiftoffAssembler : : PrepareCCall ( uint32_t num_params , const Register * args ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallRegParamAddr ( Register dst , uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallStackParamAddr ( uint32_t stack_param_idx , <nl> + uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : EmitCCall ( ExternalReference ext_ref , <nl> + uint32_t num_params ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> } / / namespace wasm <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / wasm / baseline / x64 / liftoff - assembler - x64 . h <nl> ppp b / src / wasm / baseline / x64 / liftoff - assembler - x64 . h <nl> inline Operand GetStackSlot ( uint32_t index ) { <nl> / / TODO ( clemensh ) : Make this a constexpr variable once Operand is constexpr . <nl> inline Operand GetContextOperand ( ) { return Operand ( rbp , - 16 ) ; } <nl> <nl> + / / Use this register to store the address of the last argument pushed on the <nl> + / / stack for a call to C . <nl> + static constexpr Register kCCallLastArgAddrReg = rax ; <nl> + <nl> } / / namespace liftoff <nl> <nl> void LiftoffAssembler : : ReserveStackSpace ( uint32_t bytes ) { <nl> void LiftoffAssembler : : emit_i32_shr ( Register dst , Register lhs , Register rhs ) { <nl> liftoff : : EmitShiftOperation ( this , dst , lhs , rhs , & Assembler : : shrl_cl ) ; <nl> } <nl> <nl> - void LiftoffAssembler : : emit_i32_eqz ( Register dst , Register src ) { <nl> + bool LiftoffAssembler : : emit_i32_eqz ( Register dst , Register src ) { <nl> testl ( src , src ) ; <nl> setcc ( zero , dst ) ; <nl> movzxbl ( dst , dst ) ; <nl> + return true ; <nl> } <nl> <nl> - void LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> + bool LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> Label nonzero_input ; <nl> Label continuation ; <nl> testl ( src , src ) ; <nl> void LiftoffAssembler : : emit_i32_clz ( Register dst , Register src ) { <nl> xorl ( dst , Immediate ( 31 ) ) ; <nl> <nl> bind ( & continuation ) ; <nl> + return true ; <nl> } <nl> <nl> - void LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> + bool LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> Label nonzero_input ; <nl> Label continuation ; <nl> testl ( src , src ) ; <nl> void LiftoffAssembler : : emit_i32_ctz ( Register dst , Register src ) { <nl> bsfl ( dst , src ) ; <nl> <nl> bind ( & continuation ) ; <nl> + return true ; <nl> + } <nl> + <nl> + bool LiftoffAssembler : : emit_i32_popcnt ( Register dst , Register src ) { <nl> + if ( ! CpuFeatures : : IsSupported ( POPCNT ) ) return false ; <nl> + CpuFeatureScope scope ( this , POPCNT ) ; <nl> + popcntl ( dst , src ) ; <nl> + return true ; <nl> } <nl> <nl> void LiftoffAssembler : : emit_ptrsize_add ( Register dst , Register lhs , <nl> void LiftoffAssembler : : DropStackSlotsAndRet ( uint32_t num_stack_slots ) { <nl> ret ( static_cast < int > ( num_stack_slots * kPointerSize ) ) ; <nl> } <nl> <nl> + void LiftoffAssembler : : PrepareCCall ( uint32_t num_params , const Register * args ) { <nl> + for ( size_t param = 0 ; param < num_params ; + + param ) { <nl> + pushq ( args [ param ] ) ; <nl> + } <nl> + movq ( liftoff : : kCCallLastArgAddrReg , rsp ) ; <nl> + PrepareCallCFunction ( num_params ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallRegParamAddr ( Register dst , uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + int offset = kPointerSize * static_cast < int > ( num_params - 1 - param_idx ) ; <nl> + leaq ( dst , Operand ( liftoff : : kCCallLastArgAddrReg , offset ) ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : SetCCallStackParamAddr ( uint32_t stack_param_idx , <nl> + uint32_t param_idx , <nl> + uint32_t num_params ) { <nl> + / / On x64 , all C call arguments fit in registers . <nl> + UNREACHABLE ( ) ; <nl> + } <nl> + <nl> + void LiftoffAssembler : : EmitCCall ( ExternalReference ext_ref , <nl> + uint32_t num_params ) { <nl> + CallCFunction ( ext_ref , static_cast < int > ( num_params ) ) ; <nl> + } <nl> + <nl> } / / namespace wasm <nl> } / / namespace internal <nl> } / / namespace v8 <nl>
|
[ Liftoff ] Implement i32 . popcnt with C fallback
|
v8/v8
|
9b2a15b763f3262557acdde191461ad60e36e38a
|
2018-01-12T11:39:26Z
|
mmm a / src / mongo / db / exec / sbe / stages / traverse . cpp <nl> ppp b / src / mongo / db / exec / sbe / stages / traverse . cpp <nl> PlanState TraverseStage : : getNext ( ) { <nl> return trackPlanState ( state ) ; <nl> } <nl> <nl> - traverse ( _inFieldAccessor , & _outFieldOutputAccessor , 0 ) ; <nl> + [ [ maybe_unused ] ] auto earlyExit = traverse ( _inFieldAccessor , & _outFieldOutputAccessor , 0 ) ; <nl> <nl> return trackPlanState ( PlanState : : ADVANCED ) ; <nl> } <nl>
|
SERVER - 50833 Coverity analysis defect 115713 : Unchecked return value
|
mongodb/mongo
|
fef3d7d6ab799576de1c7efce10801a040984861
|
2020-09-21T22:46:41Z
|
mmm a / tensorflow / compiler / tf2xla / graph_compiler . cc <nl> ppp b / tensorflow / compiler / tf2xla / graph_compiler . cc <nl> Status PrepareArguments ( XlaOpKernelContext * ctx , Graph * graph , <nl> case XlaExpression : : Kind : : kResource : <nl> return errors : : Unimplemented ( <nl> " Resource as function argument is not yet implemented . " ) ; <nl> + case XlaExpression : : Kind : : kTensorList : <nl> + return errors : : Unimplemented ( <nl> + " TensorList as function argument is not yet implemented . " ) ; <nl> case XlaExpression : : Kind : : kInvalid : <nl> return errors : : InvalidArgument ( " Invalid function argument " ) ; <nl> } <nl> mmm a / tensorflow / compiler / tf2xla / kernels / tensor_list_ops . cc <nl> ppp b / tensorflow / compiler / tf2xla / kernels / tensor_list_ops . cc <nl> class TensorListReserveOp : public XlaOpKernel { <nl> tensor_shape . AppendShape ( element_shape ) ; <nl> <nl> xla : : XlaBuilder * b = ctx - > builder ( ) ; <nl> - ctx - > SetOutput ( 0 , xla : : Tuple ( b , { xla : : Broadcast ( XlaHelpers : : Zero ( b , dtype_ ) , <nl> - tensor_shape . dim_sizes ( ) ) , <nl> - xla : : ConstantR0 < int32 > ( b , 0 ) } ) ) ; <nl> + ctx - > SetTensorListOutput ( <nl> + 0 , xla : : Tuple ( b , { xla : : Broadcast ( XlaHelpers : : Zero ( b , dtype_ ) , <nl> + tensor_shape . dim_sizes ( ) ) , <nl> + xla : : ConstantR0 < int32 > ( b , 0 ) } ) ) ; <nl> } <nl> <nl> private : <nl> class EmptyTensorListOp : public XlaOpKernel { <nl> tensor_shape . AppendShape ( element_shape ) ; <nl> <nl> xla : : XlaBuilder * b = ctx - > builder ( ) ; <nl> - ctx - > SetOutput ( 0 , xla : : Tuple ( b , { xla : : Broadcast ( XlaHelpers : : Zero ( b , dtype_ ) , <nl> - tensor_shape . dim_sizes ( ) ) , <nl> - xla : : ConstantR0 < int32 > ( b , 0 ) } ) ) ; <nl> + ctx - > SetTensorListOutput ( <nl> + 0 , xla : : Tuple ( b , { xla : : Broadcast ( XlaHelpers : : Zero ( b , dtype_ ) , <nl> + tensor_shape . dim_sizes ( ) ) , <nl> + xla : : ConstantR0 < int32 > ( b , 0 ) } ) ) ; <nl> } <nl> <nl> private : <nl> class TensorListPushBackOp : public XlaOpKernel { <nl> <nl> void Compile ( XlaOpKernelContext * ctx ) override { <nl> xla : : XlaBuilder * b = ctx - > builder ( ) ; <nl> - xla : : XlaOp list = ctx - > Input ( 0 ) ; <nl> + xla : : XlaOp tl = ctx - > Input ( 0 ) ; <nl> TensorShape elem_shape = ctx - > InputShape ( 1 ) ; <nl> <nl> - xla : : XlaOp ta = xla : : GetTupleElement ( list , 0 ) ; <nl> - xla : : XlaOp index = xla : : GetTupleElement ( list , 1 ) ; <nl> + xla : : XlaOp ta = xla : : GetTupleElement ( tl , 0 ) ; <nl> + xla : : XlaOp index = xla : : GetTupleElement ( tl , 1 ) ; <nl> xla : : XlaOp value = ctx - > Input ( 1 ) ; <nl> <nl> / / start_indices of the DynamicUpdateSlice are [ index , 0 , 0 , . . . , 0 ] . <nl> class TensorListPushBackOp : public XlaOpKernel { <nl> <nl> / / TODO ( phawkins ) : We don ' t check the index is in bounds mmm there is no <nl> / / error mechanism in XLA . <nl> - ctx - > SetOutput ( <nl> + ctx - > SetTensorListOutput ( <nl> 0 , xla : : Tuple ( b , { xla : : DynamicUpdateSlice ( ta , update , start_indices ) , <nl> index + xla : : ConstantR0 < int32 > ( b , 1 ) } ) ) ; <nl> } <nl> class TensorListPopBackOp : public XlaOpKernel { <nl> / / Remove the leading ' 1 ' dimension . <nl> std : : vector < int64 > value_shape ( slice_shape . begin ( ) + 1 , slice_shape . end ( ) ) ; <nl> <nl> - ctx - > SetOutput ( 0 , xla : : Tuple ( b , { ta , index } ) ) ; <nl> + ctx - > SetTensorListOutput ( 0 , xla : : Tuple ( b , { ta , index } ) ) ; <nl> ctx - > SetOutput ( 1 , xla : : Reshape ( read , value_shape ) ) ; <nl> } <nl> <nl> mmm a / tensorflow / compiler / tf2xla / xla_compiler . cc <nl> ppp b / tensorflow / compiler / tf2xla / xla_compiler . cc <nl> Status BuildComputation ( <nl> output . shape = output . constant_value . shape ( ) ; <nl> break ; <nl> <nl> + case XlaExpression : : Kind : : kTensorList : <nl> + TF_FALLTHROUGH_INTENDED ; <nl> case XlaExpression : : Kind : : kXlaOp : { <nl> output . is_constant = false ; <nl> TF_ASSIGN_OR_RETURN ( output . shape , retval . GetShape ( ) ) ; <nl> mmm a / tensorflow / compiler / tf2xla / xla_expression . cc <nl> ppp b / tensorflow / compiler / tf2xla / xla_expression . cc <nl> XlaExpression XlaExpression : : XlaOp ( xla : : XlaOp value , DataType dtype ) { <nl> return e ; <nl> } <nl> <nl> + XlaExpression XlaExpression : : TensorList ( xla : : XlaOp tensor_list ) { <nl> + XlaExpression e ; <nl> + e . kind_ = Kind : : kTensorList ; <nl> + e . dtype_ = DT_VARIANT ; <nl> + e . handle_ = tensor_list ; <nl> + return e ; <nl> + } <nl> + <nl> XlaExpression XlaExpression : : Resource ( XlaResource * resource ) { <nl> XlaExpression e ; <nl> e . kind_ = Kind : : kResource ; <nl> string XlaExpression : : HumanString ( ) const { <nl> return " xla_op " ; <nl> case Kind : : kResource : <nl> return " resource " ; <nl> + case Kind : : kTensorList : <nl> + return " tensor_list " ; <nl> } <nl> } <nl> <nl> xla : : XlaOp XlaExpression : : AsXlaOp ( xla : : XlaBuilder * builder ) const { <nl> HostTensorToBorrowingLiteral ( constant_value_ , & literal ) ) ; <nl> return xla : : ConstantLiteral ( builder , literal ) ; <nl> } <nl> + case Kind : : kTensorList : <nl> + TF_FALLTHROUGH_INTENDED ; <nl> case Kind : : kXlaOp : <nl> if ( builder ! = handle_ . builder ( ) ) { <nl> return errors : : InvalidArgument ( <nl> xla : : StatusOr < absl : : optional < Tensor > > XlaExpression : : ResolveConstant ( <nl> return { constant_value ( ) } ; <nl> case Kind : : kXlaOp : <nl> break ; <nl> + case Kind : : kTensorList : <nl> + TF_FALLTHROUGH_INTENDED ; <nl> case Kind : : kResource : <nl> + TF_FALLTHROUGH_INTENDED ; <nl> case Kind : : kInvalid : <nl> return errors : : InvalidArgument ( <nl> " ResolveConstant called on XlaExpression : " , HumanString ( ) ) ; <nl> xla : : StatusOr < TensorShape > XlaExpression : : GetShape ( ) const { <nl> TF_RETURN_IF_ERROR ( XLAShapeToTensorShape ( xla_shape , & shape ) ) ; <nl> return shape ; <nl> } <nl> + case Kind : : kTensorList : <nl> + return TensorShape ( { } ) ; <nl> case Kind : : kResource : <nl> return TensorShape ( { } ) ; <nl> case Kind : : kInvalid : <nl> mmm a / tensorflow / compiler / tf2xla / xla_expression . h <nl> ppp b / tensorflow / compiler / tf2xla / xla_expression . h <nl> namespace tensorflow { <nl> / / * a constant tensor . <nl> / / * an xla : : XlaOp , representing a symbolic XLA value . <nl> / / * a resource , e . g . , a variable , represented as an XlaResource pointer . <nl> + / / * a tensor list , represented by a tuple of tensors and the list length . <nl> / / <nl> / / Constant tensors are mostly an optimization to avoid passing large constants <nl> / / to XLA , but are also sometimes used to represent tensors that have no XLA <nl> / / representation , for example , DT_STRING tensors . A canonical use case might be <nl> / / an error message string . <nl> + / / <nl> + / / Tensor lists are very similar to xla : : XlaOp , however they require some <nl> + / / specific logic around shape management since the tuples are not supported by <nl> + / / TensorFlow . <nl> class XlaExpression { <nl> public : <nl> enum class Kind { <nl> class XlaExpression { <nl> kConstant , <nl> kXlaOp , <nl> kResource , <nl> + kTensorList , <nl> } ; <nl> <nl> XlaExpression ( ) ; <nl> class XlaExpression { <nl> / / be derived from the XLA type . <nl> static XlaExpression XlaOp ( xla : : XlaOp value , DataType dtype ) ; <nl> <nl> + / / Builds a tensor list expression . <nl> + static XlaExpression TensorList ( xla : : XlaOp tensor_list ) ; <nl> + <nl> / / Builds a resource expression . <nl> static XlaExpression Resource ( XlaResource * resource ) ; <nl> <nl> class XlaExpression { <nl> <nl> DataType dtype_ = DT_INVALID ; <nl> <nl> - / / The XLA handle of the expression ' s computation , if kind_ = = kXlaOp . <nl> + / / The XLA handle of the expression ' s computation , if kind_ = = kXlaOp or <nl> + / / a tuple expression if kind_ = = kTensorList . <nl> xla : : XlaOp handle_ ; <nl> <nl> / / The value of the constant , if kind_ = = kConstant . <nl> mmm a / tensorflow / compiler / tf2xla / xla_op_kernel . cc <nl> ppp b / tensorflow / compiler / tf2xla / xla_op_kernel . cc <nl> TensorShape XlaOpKernelContext : : InputShape ( absl : : string_view name ) { <nl> } <nl> <nl> DataType XlaOpKernelContext : : input_type ( int index ) const { <nl> - return context_ - > input ( index ) . dtype ( ) ; <nl> + return context_ - > input_dtype ( index ) ; <nl> } <nl> <nl> DataType XlaOpKernelContext : : InputType ( absl : : string_view name ) { <nl> Status XlaOpKernelContext : : ConstantInputAsFloatScalar ( int index , double * out ) { <nl> static Status LiteralToInt64Vector ( const xla : : LiteralSlice & literal , <nl> std : : vector < int64 > * out ) { <nl> if ( literal . shape ( ) . rank ( ) ! = 1 ) { <nl> - return errors : : InvalidArgument ( " value is not 1D " ) ; <nl> + return errors : : InvalidArgument ( " value is not 1D , rank : " , <nl> + literal . shape ( ) . rank ( ) ) ; <nl> } <nl> int64 size = xla : : ShapeUtil : : ElementsIn ( literal . shape ( ) ) ; <nl> if ( literal . shape ( ) . element_type ( ) = = xla : : S32 ) { <nl> void XlaOpKernelContext : : SetConstantOutput ( int index , const Tensor & constant ) { <nl> SetOutputExpression ( index , XlaExpression : : Constant ( constant ) ) ; <nl> } <nl> <nl> + void XlaOpKernelContext : : SetTensorListOutput ( int index , <nl> + const xla : : XlaOp & handle ) { <nl> + SetOutputExpression ( index , XlaExpression : : TensorList ( handle ) ) ; <nl> + } <nl> + <nl> void XlaOpKernelContext : : SetResourceOutput ( int index , XlaResource * resource ) { <nl> SetOutputExpression ( index , XlaExpression : : Resource ( resource ) ) ; <nl> } <nl> mmm a / tensorflow / compiler / tf2xla / xla_op_kernel . h <nl> ppp b / tensorflow / compiler / tf2xla / xla_op_kernel . h <nl> class XlaOpKernelContext { <nl> / / Returns an XlaExpression describing the value of ' index ' . <nl> void SetOutputExpression ( int index , const XlaExpression & expression ) ; <nl> <nl> + / / Sets output ` index ` to the Tensor List ` handle ` . <nl> + void SetTensorListOutput ( int index , const xla : : XlaOp & handle ) ; <nl> + <nl> / / Status handling . <nl> void SetStatus ( const Status & status ) { context_ - > SetStatus ( status ) ; } <nl> Status status ( ) { return context_ - > status ( ) ; } <nl>
|
Add kTensorList kind to better support TensorLists
|
tensorflow/tensorflow
|
5f0709aec53f3c7d90368c6b6cf78d24a8fa5a7d
|
2019-01-25T19:14:52Z
|
mmm a / source / common / config / grpc_mux_subscription_impl . h <nl> ppp b / source / common / config / grpc_mux_subscription_impl . h <nl> class GrpcMuxSubscriptionImpl : public Subscription < ResourceType > , <nl> stats_ . update_success_ . inc ( ) ; <nl> stats_ . update_attempt_ . inc ( ) ; <nl> stats_ . version_ . set ( HashUtil : : xxHash64 ( version_info ) ) ; <nl> - ENVOY_LOG ( debug , " gRPC config for { } accepted with { } resources : { } " , type_url_ , <nl> - resources . size ( ) , RepeatedPtrUtil : : debugString ( typed_resources ) ) ; <nl> + ENVOY_LOG ( debug , " gRPC config for { } accepted with { } resources with version { } " , type_url_ , <nl> + resources . size ( ) , version_info ) ; <nl> + ENVOY_LOG ( trace , " resources : { } " , RepeatedPtrUtil : : debugString ( typed_resources ) ) ; <nl> } <nl> <nl> void onConfigUpdateFailed ( const EnvoyException * e ) override { <nl>
|
config : move logging of full response to trace logging ( )
|
envoyproxy/envoy
|
bcb670eb57c52dd67888a3a949c1e1b62248e269
|
2019-03-11T16:31:03Z
|
mmm a / tensorflow / core / grappler / optimizers / arithmetic_optimizer . h <nl> ppp b / tensorflow / core / grappler / optimizers / arithmetic_optimizer . h <nl> class ArithmeticOptimizer : public GraphOptimizer { <nl> bool convert_log1p = true ; <nl> bool convert_expm1 = true ; <nl> bool unary_ops_composition = true ; <nl> - bool remove_stack_strided_slice_same_axis = true ; <nl> + bool remove_stack_strided_slice_same_axis = false ; <nl> <nl> / / Choose which arithmetic optimizer stages will be enabled for a given <nl> / / optimization level by default . <nl>
|
Automated rollback of commit 0608a3f0dbbac03aeb84966d2ea9a24a694ebbce
|
tensorflow/tensorflow
|
64628112e2557cae43b7d5f479bf5be598663712
|
2018-10-12T22:30:04Z
|
mmm a / src / core / file_sys / archive . h <nl> ppp b / src / core / file_sys / archive . h <nl> class Archive : NonCopyable { <nl> * / <nl> virtual bool DeleteFile ( const FileSys : : Path & path ) const = 0 ; <nl> <nl> + / * * <nl> + * Rename a File specified by its path <nl> + * @ param src_path Source path relative to the archive <nl> + * @ param dest_path Destination path relative to the archive <nl> + * @ return Whether rename succeeded <nl> + * / <nl> + virtual bool RenameFile ( const FileSys : : Path & src_path , const FileSys : : Path & dest_path ) const = 0 ; <nl> + <nl> / * * <nl> * Delete a directory specified by its path <nl> * @ param path Path relative to the archive <nl> class Archive : NonCopyable { <nl> * / <nl> virtual bool CreateDirectory ( const Path & path ) const = 0 ; <nl> <nl> + / * * <nl> + * Rename a Directory specified by its path <nl> + * @ param src_path Source path relative to the archive <nl> + * @ param dest_path Destination path relative to the archive <nl> + * @ return Whether rename succeeded <nl> + * / <nl> + virtual bool RenameDirectory ( const FileSys : : Path & src_path , const FileSys : : Path & dest_path ) const = 0 ; <nl> + <nl> / * * <nl> * Open a directory specified by its path <nl> * @ param path Path relative to the archive <nl> mmm a / src / core / file_sys / archive_romfs . cpp <nl> ppp b / src / core / file_sys / archive_romfs . cpp <nl> bool Archive_RomFS : : DeleteFile ( const FileSys : : Path & path ) const { <nl> return false ; <nl> } <nl> <nl> + bool Archive_RomFS : : RenameFile ( const FileSys : : Path & src_path , const FileSys : : Path & dest_path ) const { <nl> + ERROR_LOG ( FILESYS , " Attempted to rename a file within ROMFS . " ) ; <nl> + return false ; <nl> + } <nl> + <nl> / * * <nl> * Delete a directory specified by its path <nl> * @ param path Path relative to the archive <nl> bool Archive_RomFS : : CreateDirectory ( const Path & path ) const { <nl> return false ; <nl> } <nl> <nl> + bool Archive_RomFS : : RenameDirectory ( const FileSys : : Path & src_path , const FileSys : : Path & dest_path ) const { <nl> + ERROR_LOG ( FILESYS , " Attempted to rename a file within ROMFS . " ) ; <nl> + return false ; <nl> + } <nl> + <nl> / * * <nl> * Open a directory specified by its path <nl> * @ param path Path relative to the archive <nl> mmm a / src / core / file_sys / archive_romfs . h <nl> ppp b / src / core / file_sys / archive_romfs . h <nl> class Archive_RomFS final : public Archive { <nl> * / <nl> bool DeleteFile ( const FileSys : : Path & path ) const override ; <nl> <nl> + / * * <nl> + * Rename a File specified by its path <nl> + * @ param src_path Source path relative to the archive <nl> + * @ param dest_path Destination path relative to the archive <nl> + * @ return Whether rename succeeded <nl> + * / <nl> + bool RenameFile ( const FileSys : : Path & src_path , const FileSys : : Path & dest_path ) const override ; <nl> + <nl> / * * <nl> * Delete a directory specified by its path <nl> * @ param path Path relative to the archive <nl> class Archive_RomFS final : public Archive { <nl> * / <nl> bool CreateDirectory ( const Path & path ) const override ; <nl> <nl> + / * * <nl> + * Rename a Directory specified by its path <nl> + * @ param src_path Source path relative to the archive <nl> + * @ param dest_path Destination path relative to the archive <nl> + * @ return Whether rename succeeded <nl> + * / <nl> + bool RenameDirectory ( const FileSys : : Path & src_path , const FileSys : : Path & dest_path ) const override ; <nl> + <nl> / * * <nl> * Open a directory specified by its path <nl> * @ param path Path relative to the archive <nl> mmm a / src / core / file_sys / archive_sdmc . cpp <nl> ppp b / src / core / file_sys / archive_sdmc . cpp <nl> bool Archive_SDMC : : DeleteFile ( const FileSys : : Path & path ) const { <nl> return FileUtil : : Delete ( GetMountPoint ( ) + path . AsString ( ) ) ; <nl> } <nl> <nl> + bool Archive_SDMC : : RenameFile ( const FileSys : : Path & src_path , const FileSys : : Path & dest_path ) const { <nl> + return FileUtil : : Rename ( GetMountPoint ( ) + src_path . AsString ( ) , GetMountPoint ( ) + dest_path . AsString ( ) ) ; <nl> + } <nl> + <nl> / * * <nl> * Delete a directory specified by its path <nl> * @ param path Path relative to the archive <nl> bool Archive_SDMC : : CreateDirectory ( const Path & path ) const { <nl> return FileUtil : : CreateDir ( GetMountPoint ( ) + path . AsString ( ) ) ; <nl> } <nl> <nl> + bool Archive_SDMC : : RenameDirectory ( const FileSys : : Path & src_path , const FileSys : : Path & dest_path ) const { <nl> + return FileUtil : : Rename ( GetMountPoint ( ) + src_path . AsString ( ) , GetMountPoint ( ) + dest_path . AsString ( ) ) ; <nl> + } <nl> + <nl> / * * <nl> * Open a directory specified by its path <nl> * @ param path Path relative to the archive <nl> mmm a / src / core / file_sys / archive_sdmc . h <nl> ppp b / src / core / file_sys / archive_sdmc . h <nl> class Archive_SDMC final : public Archive { <nl> * / <nl> bool DeleteFile ( const FileSys : : Path & path ) const override ; <nl> <nl> + / * * <nl> + * Rename a File specified by its path <nl> + * @ param src_path Source path relative to the archive <nl> + * @ param dest_path Destination path relative to the archive <nl> + * @ return Whether rename succeeded <nl> + * / <nl> + bool RenameFile ( const FileSys : : Path & src_path , const FileSys : : Path & dest_path ) const override ; <nl> + <nl> / * * <nl> * Delete a directory specified by its path <nl> * @ param path Path relative to the archive <nl> class Archive_SDMC final : public Archive { <nl> * / <nl> bool CreateDirectory ( const Path & path ) const override ; <nl> <nl> + / * * <nl> + * Rename a Directory specified by its path <nl> + * @ param src_path Source path relative to the archive <nl> + * @ param dest_path Destination path relative to the archive <nl> + * @ return Whether rename succeeded <nl> + * / <nl> + bool RenameDirectory ( const FileSys : : Path & src_path , const FileSys : : Path & dest_path ) const override ; <nl> + <nl> / * * <nl> * Open a directory specified by its path <nl> * @ param path Path relative to the archive <nl> mmm a / src / core / hle / kernel / archive . cpp <nl> ppp b / src / core / hle / kernel / archive . cpp <nl> ResultVal < Handle > OpenFileFromArchive ( Handle archive_handle , const FileSys : : Path <nl> return MakeResult < Handle > ( handle ) ; <nl> } <nl> <nl> - / * * <nl> - * Delete a File from an Archive <nl> - * @ param archive_handle Handle to an open Archive object <nl> - * @ param path Path to the File inside of the Archive <nl> - * @ return Whether deletion succeeded <nl> - * / <nl> - Result DeleteFileFromArchive ( Handle archive_handle , const FileSys : : Path & path ) { <nl> + ResultCode DeleteFileFromArchive ( Handle archive_handle , const FileSys : : Path & path ) { <nl> Archive * archive = Kernel : : g_object_pool . GetFast < Archive > ( archive_handle ) ; <nl> if ( archive = = nullptr ) <nl> - return - 1 ; <nl> + return InvalidHandle ( ErrorModule : : FS ) ; <nl> if ( archive - > backend - > DeleteFile ( path ) ) <nl> - return 0 ; <nl> - return - 1 ; <nl> + return RESULT_SUCCESS ; <nl> + return ResultCode ( ErrorDescription : : NoData , ErrorModule : : FS , / / TODO : verify description <nl> + ErrorSummary : : Canceled , ErrorLevel : : Status ) ; <nl> } <nl> <nl> - / * * <nl> - * Delete a Directory from an Archive <nl> - * @ param archive_handle Handle to an open Archive object <nl> - * @ param path Path to the Directory inside of the Archive <nl> - * @ return Whether deletion succeeded <nl> - * / <nl> - Result DeleteDirectoryFromArchive ( Handle archive_handle , const FileSys : : Path & path ) { <nl> + ResultCode RenameFileBetweenArchives ( Handle src_archive_handle , const FileSys : : Path & src_path , <nl> + Handle dest_archive_handle , const FileSys : : Path & dest_path ) { <nl> + Archive * src_archive = Kernel : : g_object_pool . GetFast < Archive > ( src_archive_handle ) ; <nl> + Archive * dest_archive = Kernel : : g_object_pool . GetFast < Archive > ( dest_archive_handle ) ; <nl> + if ( src_archive = = nullptr | | dest_archive = = nullptr ) <nl> + return InvalidHandle ( ErrorModule : : FS ) ; <nl> + if ( src_archive = = dest_archive ) { <nl> + if ( src_archive - > backend - > RenameFile ( src_path , dest_path ) ) <nl> + return RESULT_SUCCESS ; <nl> + } else { <nl> + / / TODO : Implement renaming across archives <nl> + return UnimplementedFunction ( ErrorModule : : FS ) ; <nl> + } <nl> + return ResultCode ( ErrorDescription : : NoData , ErrorModule : : FS , / / TODO : verify description <nl> + ErrorSummary : : NothingHappened , ErrorLevel : : Status ) ; <nl> + } <nl> + <nl> + ResultCode DeleteDirectoryFromArchive ( Handle archive_handle , const FileSys : : Path & path ) { <nl> Archive * archive = Kernel : : g_object_pool . GetFast < Archive > ( archive_handle ) ; <nl> if ( archive = = nullptr ) <nl> - return - 1 ; <nl> + return InvalidHandle ( ErrorModule : : FS ) ; <nl> if ( archive - > backend - > DeleteDirectory ( path ) ) <nl> - return 0 ; <nl> - return - 1 ; <nl> + return RESULT_SUCCESS ; <nl> + return ResultCode ( ErrorDescription : : NoData , ErrorModule : : FS , / / TODO : verify description <nl> + ErrorSummary : : Canceled , ErrorLevel : : Status ) ; <nl> } <nl> <nl> - / * * <nl> - * Create a Directory from an Archive <nl> - * @ param archive_handle Handle to an open Archive object <nl> - * @ param path Path to the Directory inside of the Archive <nl> - * @ return Whether creation succeeded <nl> - * / <nl> - Result CreateDirectoryFromArchive ( Handle archive_handle , const FileSys : : Path & path ) { <nl> + ResultCode CreateDirectoryFromArchive ( Handle archive_handle , const FileSys : : Path & path ) { <nl> Archive * archive = Kernel : : g_object_pool . GetFast < Archive > ( archive_handle ) ; <nl> if ( archive = = nullptr ) <nl> - return - 1 ; <nl> + return InvalidHandle ( ErrorModule : : FS ) ; <nl> if ( archive - > backend - > CreateDirectory ( path ) ) <nl> - return 0 ; <nl> - return - 1 ; <nl> + return RESULT_SUCCESS ; <nl> + return ResultCode ( ErrorDescription : : NoData , ErrorModule : : FS , / / TODO : verify description <nl> + ErrorSummary : : Canceled , ErrorLevel : : Status ) ; <nl> + } <nl> + <nl> + ResultCode RenameDirectoryBetweenArchives ( Handle src_archive_handle , const FileSys : : Path & src_path , <nl> + Handle dest_archive_handle , const FileSys : : Path & dest_path ) { <nl> + Archive * src_archive = Kernel : : g_object_pool . GetFast < Archive > ( src_archive_handle ) ; <nl> + Archive * dest_archive = Kernel : : g_object_pool . GetFast < Archive > ( dest_archive_handle ) ; <nl> + if ( src_archive = = nullptr | | dest_archive = = nullptr ) <nl> + return InvalidHandle ( ErrorModule : : FS ) ; <nl> + if ( src_archive = = dest_archive ) { <nl> + if ( src_archive - > backend - > RenameDirectory ( src_path , dest_path ) ) <nl> + return RESULT_SUCCESS ; <nl> + } else { <nl> + / / TODO : Implement renaming across archives <nl> + return UnimplementedFunction ( ErrorModule : : FS ) ; <nl> + } <nl> + return ResultCode ( ErrorDescription : : NoData , ErrorModule : : FS , / / TODO : verify description <nl> + ErrorSummary : : NothingHappened , ErrorLevel : : Status ) ; <nl> } <nl> <nl> / * * <nl> mmm a / src / core / hle / kernel / archive . h <nl> ppp b / src / core / hle / kernel / archive . h <nl> ResultVal < Handle > OpenFileFromArchive ( Handle archive_handle , const FileSys : : Path <nl> * @ param path Path to the File inside of the Archive <nl> * @ return Whether deletion succeeded <nl> * / <nl> - Result DeleteFileFromArchive ( Handle archive_handle , const FileSys : : Path & path ) ; <nl> + ResultCode DeleteFileFromArchive ( Handle archive_handle , const FileSys : : Path & path ) ; <nl> + <nl> + / * * <nl> + * Rename a File between two Archives <nl> + * @ param src_archive_handle Handle to the source Archive object <nl> + * @ param src_path Path to the File inside of the source Archive <nl> + * @ param dest_archive_handle Handle to the destination Archive object <nl> + * @ param dest_path Path to the File inside of the destination Archive <nl> + * @ return Whether rename succeeded <nl> + * / <nl> + ResultCode RenameFileBetweenArchives ( Handle src_archive_handle , const FileSys : : Path & src_path , <nl> + Handle dest_archive_handle , const FileSys : : Path & dest_path ) ; <nl> <nl> / * * <nl> * Delete a Directory from an Archive <nl> Result DeleteFileFromArchive ( Handle archive_handle , const FileSys : : Path & path ) ; <nl> * @ param path Path to the Directory inside of the Archive <nl> * @ return Whether deletion succeeded <nl> * / <nl> - Result DeleteDirectoryFromArchive ( Handle archive_handle , const FileSys : : Path & path ) ; <nl> + ResultCode DeleteDirectoryFromArchive ( Handle archive_handle , const FileSys : : Path & path ) ; <nl> <nl> / * * <nl> * Create a Directory from an Archive <nl> Result DeleteDirectoryFromArchive ( Handle archive_handle , const FileSys : : Path & pa <nl> * @ param path Path to the Directory inside of the Archive <nl> * @ return Whether creation of directory succeeded <nl> * / <nl> - Result CreateDirectoryFromArchive ( Handle archive_handle , const FileSys : : Path & path ) ; <nl> + ResultCode CreateDirectoryFromArchive ( Handle archive_handle , const FileSys : : Path & path ) ; <nl> + <nl> + / * * <nl> + * Rename a Directory between two Archives <nl> + * @ param src_archive_handle Handle to the source Archive object <nl> + * @ param src_path Path to the Directory inside of the source Archive <nl> + * @ param dest_archive_handle Handle to the destination Archive object <nl> + * @ param dest_path Path to the Directory inside of the destination Archive <nl> + * @ return Whether rename succeeded <nl> + * / <nl> + ResultCode RenameDirectoryBetweenArchives ( Handle src_archive_handle , const FileSys : : Path & src_path , <nl> + Handle dest_archive_handle , const FileSys : : Path & dest_path ) ; <nl> <nl> / * * <nl> * Open a Directory from an Archive <nl> mmm a / src / core / hle / service / fs_user . cpp <nl> ppp b / src / core / hle / service / fs_user . cpp <nl> void DeleteFile ( Service : : Interface * self ) { <nl> DEBUG_LOG ( KERNEL , " type = % d size = % d data = % s " , <nl> filename_type , filename_size , file_path . DebugStr ( ) . c_str ( ) ) ; <nl> <nl> - cmd_buff [ 1 ] = Kernel : : DeleteFileFromArchive ( archive_handle , file_path ) ; <nl> + cmd_buff [ 1 ] = Kernel : : DeleteFileFromArchive ( archive_handle , file_path ) . raw ; <nl> + <nl> + DEBUG_LOG ( KERNEL , " called " ) ; <nl> + } <nl> + <nl> + / * <nl> + * FS_User : : RenameFile service function <nl> + * Inputs : <nl> + * 2 : Source archive handle lower word <nl> + * 3 : Source archive handle upper word <nl> + * 4 : Source file path type <nl> + * 5 : Source file path size <nl> + * 6 : Dest archive handle lower word <nl> + * 7 : Dest archive handle upper word <nl> + * 8 : Dest file path type <nl> + * 9 : Dest file path size <nl> + * 11 : Source file path string data <nl> + * 13 : Dest file path string <nl> + * Outputs : <nl> + * 1 : Result of function , 0 on success , otherwise error code <nl> + * / <nl> + void RenameFile ( Service : : Interface * self ) { <nl> + u32 * cmd_buff = Service : : GetCommandBuffer ( ) ; <nl> + <nl> + / / TODO ( Link Mauve ) : cmd_buff [ 2 ] and cmd_buff [ 6 ] , aka archive handle lower word , aren ' t used according to <nl> + / / 3dmoo ' s or ctrulib ' s implementations . Triple check if it ' s really the case . <nl> + Handle src_archive_handle = static_cast < Handle > ( cmd_buff [ 3 ] ) ; <nl> + auto src_filename_type = static_cast < FileSys : : LowPathType > ( cmd_buff [ 4 ] ) ; <nl> + u32 src_filename_size = cmd_buff [ 5 ] ; <nl> + Handle dest_archive_handle = static_cast < Handle > ( cmd_buff [ 7 ] ) ; <nl> + auto dest_filename_type = static_cast < FileSys : : LowPathType > ( cmd_buff [ 8 ] ) ; <nl> + u32 dest_filename_size = cmd_buff [ 9 ] ; <nl> + u32 src_filename_ptr = cmd_buff [ 11 ] ; <nl> + u32 dest_filename_ptr = cmd_buff [ 13 ] ; <nl> + <nl> + FileSys : : Path src_file_path ( src_filename_type , src_filename_size , src_filename_ptr ) ; <nl> + FileSys : : Path dest_file_path ( dest_filename_type , dest_filename_size , dest_filename_ptr ) ; <nl> + <nl> + DEBUG_LOG ( KERNEL , " src_type = % d src_size = % d src_data = % s dest_type = % d dest_size = % d dest_data = % s " , <nl> + src_filename_type , src_filename_size , src_file_path . DebugStr ( ) . c_str ( ) , <nl> + dest_filename_type , dest_filename_size , dest_file_path . DebugStr ( ) . c_str ( ) ) ; <nl> + <nl> + cmd_buff [ 1 ] = Kernel : : RenameFileBetweenArchives ( src_archive_handle , src_file_path , dest_archive_handle , dest_file_path ) . raw ; <nl> <nl> DEBUG_LOG ( KERNEL , " called " ) ; <nl> } <nl> void DeleteDirectory ( Service : : Interface * self ) { <nl> DEBUG_LOG ( KERNEL , " type = % d size = % d data = % s " , <nl> dirname_type , dirname_size , dir_path . DebugStr ( ) . c_str ( ) ) ; <nl> <nl> - cmd_buff [ 1 ] = Kernel : : DeleteDirectoryFromArchive ( archive_handle , dir_path ) ; <nl> + cmd_buff [ 1 ] = Kernel : : DeleteDirectoryFromArchive ( archive_handle , dir_path ) . raw ; <nl> <nl> DEBUG_LOG ( KERNEL , " called " ) ; <nl> } <nl> static void CreateDirectory ( Service : : Interface * self ) { <nl> <nl> DEBUG_LOG ( KERNEL , " type = % d size = % d data = % s " , dirname_type , dirname_size , dir_path . DebugStr ( ) . c_str ( ) ) ; <nl> <nl> - cmd_buff [ 1 ] = Kernel : : CreateDirectoryFromArchive ( archive_handle , dir_path ) ; <nl> + cmd_buff [ 1 ] = Kernel : : CreateDirectoryFromArchive ( archive_handle , dir_path ) . raw ; <nl> <nl> DEBUG_LOG ( KERNEL , " called " ) ; <nl> } <nl> <nl> + / * <nl> + * FS_User : : RenameDirectory service function <nl> + * Inputs : <nl> + * 2 : Source archive handle lower word <nl> + * 3 : Source archive handle upper word <nl> + * 4 : Source dir path type <nl> + * 5 : Source dir path size <nl> + * 6 : Dest archive handle lower word <nl> + * 7 : Dest archive handle upper word <nl> + * 8 : Dest dir path type <nl> + * 9 : Dest dir path size <nl> + * 11 : Source dir path string data <nl> + * 13 : Dest dir path string <nl> + * Outputs : <nl> + * 1 : Result of function , 0 on success , otherwise error code <nl> + * / <nl> + void RenameDirectory ( Service : : Interface * self ) { <nl> + u32 * cmd_buff = Service : : GetCommandBuffer ( ) ; <nl> + <nl> + / / TODO ( Link Mauve ) : cmd_buff [ 2 ] and cmd_buff [ 6 ] , aka archive handle lower word , aren ' t used according to <nl> + / / 3dmoo ' s or ctrulib ' s implementations . Triple check if it ' s really the case . <nl> + Handle src_archive_handle = static_cast < Handle > ( cmd_buff [ 3 ] ) ; <nl> + auto src_dirname_type = static_cast < FileSys : : LowPathType > ( cmd_buff [ 4 ] ) ; <nl> + u32 src_dirname_size = cmd_buff [ 5 ] ; <nl> + Handle dest_archive_handle = static_cast < Handle > ( cmd_buff [ 7 ] ) ; <nl> + auto dest_dirname_type = static_cast < FileSys : : LowPathType > ( cmd_buff [ 8 ] ) ; <nl> + u32 dest_dirname_size = cmd_buff [ 9 ] ; <nl> + u32 src_dirname_ptr = cmd_buff [ 11 ] ; <nl> + u32 dest_dirname_ptr = cmd_buff [ 13 ] ; <nl> + <nl> + FileSys : : Path src_dir_path ( src_dirname_type , src_dirname_size , src_dirname_ptr ) ; <nl> + FileSys : : Path dest_dir_path ( dest_dirname_type , dest_dirname_size , dest_dirname_ptr ) ; <nl> + <nl> + DEBUG_LOG ( KERNEL , " src_type = % d src_size = % d src_data = % s dest_type = % d dest_size = % d dest_data = % s " , <nl> + src_dirname_type , src_dirname_size , src_dir_path . DebugStr ( ) . c_str ( ) , <nl> + dest_dirname_type , dest_dirname_size , dest_dir_path . DebugStr ( ) . c_str ( ) ) ; <nl> + <nl> + cmd_buff [ 1 ] = Kernel : : RenameDirectoryBetweenArchives ( src_archive_handle , src_dir_path , dest_archive_handle , dest_dir_path ) . raw ; <nl> + <nl> + DEBUG_LOG ( KERNEL , " called " ) ; <nl> + } <nl> + <nl> static void OpenDirectory ( Service : : Interface * self ) { <nl> u32 * cmd_buff = Service : : GetCommandBuffer ( ) ; <nl> <nl> const Interface : : FunctionInfo FunctionTable [ ] = { <nl> { 0x080201C2 , OpenFile , " OpenFile " } , <nl> { 0x08030204 , OpenFileDirectly , " OpenFileDirectly " } , <nl> { 0x08040142 , DeleteFile , " DeleteFile " } , <nl> - { 0x08050244 , nullptr , " RenameFile " } , <nl> + { 0x08050244 , RenameFile , " RenameFile " } , <nl> { 0x08060142 , DeleteDirectory , " DeleteDirectory " } , <nl> { 0x08070142 , nullptr , " DeleteDirectoryRecursively " } , <nl> { 0x08080202 , nullptr , " CreateFile " } , <nl> { 0x08090182 , CreateDirectory , " CreateDirectory " } , <nl> - { 0x080A0244 , nullptr , " RenameDirectory " } , <nl> + { 0x080A0244 , RenameDirectory , " RenameDirectory " } , <nl> { 0x080B0102 , OpenDirectory , " OpenDirectory " } , <nl> { 0x080C00C2 , OpenArchive , " OpenArchive " } , <nl> { 0x080D0144 , nullptr , " ControlArchive " } , <nl>
|
Merge pull request from archshift / renamexyz
|
yuzu-emu/yuzu
|
5056329a8003115f61859b97c2fc6ef2f460a0d3
|
2014-12-05T03:07:47Z
|
mmm a / tools / editor / editor_node . cpp <nl> ppp b / tools / editor / editor_node . cpp <nl> bool EditorNode : : _find_editing_changed_scene ( Node * p_from ) { <nl> <nl> <nl> void EditorNode : : add_io_error ( const String & p_error ) { <nl> - <nl> + CharString err_ut = p_error . utf8 ( ) ; <nl> + ERR_PRINT ( err_ut . get_data ( ) ) ; <nl> _load_error_notify ( singleton , p_error ) ; <nl> } <nl> <nl> mmm a / tools / editor / project_export . cpp <nl> ppp b / tools / editor / project_export . cpp <nl> Error ProjectExportDialog : : export_platform ( const String & p_platform , const Strin <nl> Ref < EditorExportPlatform > exporter = EditorImportExport : : get_singleton ( ) - > get_export_platform ( p_platform ) ; <nl> if ( exporter . is_null ( ) ) { <nl> ERR_PRINT ( " Invalid platform for export " ) ; <nl> + <nl> + List < StringName > platforms ; <nl> + EditorImportExport : : get_singleton ( ) - > get_export_platforms ( & platforms ) ; <nl> + print_line ( " Valid export plaftorms are : " ) ; <nl> + for ( List < StringName > : : Element * E = platforms . front ( ) ; E ; E = E - > next ( ) ) <nl> + print_line ( " \ " " + E - > get ( ) + " \ " " ) ; <nl> + <nl> + if ( p_quit_after ) { <nl> + OS : : get_singleton ( ) - > set_exit_code ( 255 ) ; <nl> + get_tree ( ) - > quit ( ) ; <nl> + } <nl> + <nl> return ERR_INVALID_PARAMETER ; <nl> } <nl> Error err = exporter - > export_project ( p_path , p_debug ) ; <nl>
|
Print errors to console when exporting
|
godotengine/godot
|
5dc9770febf18ec2716a897528927cefadd23ab6
|
2015-11-25T05:50:08Z
|
mmm a / tensorflow / core / kernels / BUILD <nl> ppp b / tensorflow / core / kernels / BUILD <nl> cc_library ( <nl> " @ cub_archive / / : cub " , <nl> ] ) + if_rocm ( [ <nl> " @ local_config_rocm / / rocm : rocprim " , <nl> - ] ) <nl> + ] ) , <nl> ) <nl> <nl> cc_library ( <nl> tf_kernel_library ( <nl> " where_op_gpu_impl_8 . cu . cc " , <nl> ] , <nl> deps = if_cuda_or_rocm ( [ <nl> - " : cuda_solvers " , <nl> - ] ) + [ " : gpu_prim_hdrs " , ] <nl> - + ARRAY_DEPS , <nl> + " : cuda_solvers " , <nl> + ] ) + [ " : gpu_prim_hdrs " ] + <nl> + ARRAY_DEPS , <nl> ) <nl> <nl> cc_library ( <nl> tf_kernel_library ( <nl> tf_kernel_library ( <nl> name = " generate_box_proposals_op " , <nl> gpu_srcs = [ " generate_box_proposals_op . cu . cc " ] , <nl> - deps = [ " : gpu_prim_hdrs " ] <nl> - + if_cuda ( [ <nl> + deps = [ " : gpu_prim_hdrs " ] + if_cuda ( [ <nl> " : non_max_suppression_op_gpu " , <nl> ] ) , <nl> ) <nl> tf_kernel_library ( <nl> name = " reduction_ops " , <nl> gpu_srcs = [ " reduction_gpu_kernels . cu . h " ] , <nl> prefix = " reduction_ops " , <nl> - deps = MATH_DEPS + <nl> - [ " : gpu_prim_hdrs " , <nl> - " : transpose_functor " ] , <nl> + deps = MATH_DEPS + [ <nl> + " : gpu_prim_hdrs " , <nl> + " : transpose_functor " , <nl> + ] , <nl> ) <nl> <nl> tf_kernel_library ( <nl> tf_kernel_library ( <nl> " / / tensorflow / core : lib " , <nl> " / / tensorflow / core : lib_internal " , <nl> " / / third_party / eigen3 " , <nl> - ] , <nl> + ] , <nl> ) <nl> <nl> tf_kernel_library ( <nl> name = " l2loss_op " , <nl> prefix = " l2loss_op " , <nl> deps = [ <nl> - " : reduction_ops " , <nl> " : gpu_prim_hdrs " , <nl> - " / / third_party / eigen3 " , <nl> + " : reduction_ops " , <nl> " / / tensorflow / core : framework " , <nl> " / / tensorflow / core : lib " , <nl> " / / tensorflow / core : lib_internal " , <nl> - " / / tensorflow / core : nn_grad " ] , <nl> + " / / tensorflow / core : nn_grad " , <nl> + " / / third_party / eigen3 " , <nl> + ] , <nl> ) <nl> <nl> tf_cuda_cc_test ( <nl>
|
Fix buildifier errors
|
tensorflow/tensorflow
|
0e0c2c734cefa77bf9992a512da71b65d9b8af2f
|
2020-03-26T22:48:35Z
|
mmm a / Marlin / src / core / language . h <nl> ppp b / Marlin / src / core / language . h <nl> <nl> # define MSG_KILL_BUTTON " KILL caused by KILL button / pin " <nl> <nl> / / temperature . cpp strings <nl> - # define MSG_PID_AUTOTUNE " PID Autotune " <nl> - # define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE " start " <nl> - # define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE " failed ! " <nl> + # define MSG_PID_AUTOTUNE_PREFIX " PID Autotune " <nl> + # define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE_PREFIX " start " <nl> + # define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE_PREFIX " failed ! " <nl> # define MSG_PID_BAD_EXTRUDER_NUM MSG_PID_AUTOTUNE_FAILED " Bad extruder number " <nl> # define MSG_PID_TEMP_TOO_HIGH MSG_PID_AUTOTUNE_FAILED " Temperature too high " <nl> # define MSG_PID_TIMEOUT MSG_PID_AUTOTUNE_FAILED " timeout " <nl> <nl> # define MSG_KI " Ki : " <nl> # define MSG_KD " Kd : " <nl> # define MSG_AT " @ : " <nl> - # define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished ! Put the last Kp , Ki and Kd constants from below into Configuration . h " <nl> + # define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE_PREFIX " finished ! Put the last Kp , Ki and Kd constants from below into Configuration . h " <nl> # define MSG_PID_DEBUG " PID_DEBUG " <nl> # define MSG_PID_DEBUG_INPUT " : Input " <nl> # define MSG_PID_DEBUG_OUTPUT " Output " <nl> <nl> * <nl> * / <nl> # if ENABLED ( NUMBER_TOOLS_FROM_0 ) <nl> + # define LCD_FIRST_TOOL ' 0 ' <nl> # define LCD_STR_N0 " 0 " <nl> # define LCD_STR_N1 " 1 " <nl> # define LCD_STR_N2 " 2 " <nl> <nl> # define LCD_STR_N4 " 4 " <nl> # define LCD_STR_N5 " 5 " <nl> # else <nl> + # define LCD_FIRST_TOOL ' 1 ' <nl> # define LCD_STR_N0 " 1 " <nl> # define LCD_STR_N1 " 2 " <nl> # define LCD_STR_N2 " 3 " <nl> mmm a / Marlin / src / lcd / language / language_en . h <nl> ppp b / Marlin / src / lcd / language / language_en . h <nl> namespace Language_en { <nl> PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT ( " Correction " ) ; <nl> PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT ( " Smoothing " ) ; <nl> } <nl> + <nl> + # if FAN_COUNT = = 1 <nl> + # define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED <nl> + # define MSG_FIRST_EXTRA_FAN_SPEED MSG_EXTRA_FAN_SPEED <nl> + # else <nl> + # define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED_1 <nl> + # define MSG_FIRST_EXTRA_FAN_SPEED MSG_EXTRA_FAN_SPEED_1 <nl> + # endif <nl> mmm a / Marlin / src / lcd / menu / menu_temperature . cpp <nl> ppp b / Marlin / src / lcd / menu / menu_temperature . cpp <nl> void menu_temperature ( ) { <nl> # if FAN_COUNT > 0 <nl> # if HAS_FAN0 <nl> editable . uint8 = thermalManager . fan_speed [ 0 ] ; <nl> - EDIT_ITEM_FAST ( percent , MSG_FAN_SPEED_1 , & editable . uint8 , 0 , 255 , [ ] ( ) { thermalManager . set_fan_speed ( 0 , editable . uint8 ) ; } ) ; <nl> + EDIT_ITEM_FAST ( percent , MSG_FIRST_FAN_SPEED , & editable . uint8 , 0 , 255 , [ ] ( ) { thermalManager . set_fan_speed ( 0 , editable . uint8 ) ; } ) ; <nl> # if ENABLED ( EXTRA_FAN_SPEED ) <nl> - EDIT_ITEM_FAST ( percent , MSG_EXTRA_FAN_SPEED_1 , & thermalManager . new_fan_speed [ 0 ] , 3 , 255 ) ; <nl> + EDIT_ITEM_FAST ( percent , MSG_FIRST_EXTRA_FAN_SPEED , & thermalManager . new_fan_speed [ 0 ] , 3 , 255 ) ; <nl> # endif <nl> # endif <nl> # if HAS_FAN1 <nl> mmm a / Marlin / src / lcd / menu / menu_tune . cpp <nl> ppp b / Marlin / src / lcd / menu / menu_tune . cpp <nl> void menu_tune ( ) { <nl> / / <nl> # if FAN_COUNT > 0 <nl> # if HAS_FAN0 <nl> - # if FAN_COUNT = = 1 <nl> - # define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED <nl> - # define MSG_FIRST_EXTRA_FAN_SPEED MSG_EXTRA_FAN_SPEED <nl> - # else <nl> - # define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED_1 <nl> - # define MSG_FIRST_EXTRA_FAN_SPEED MSG_EXTRA_FAN_SPEED_1 <nl> - # endif <nl> editable . uint8 = thermalManager . fan_speed [ 0 ] ; <nl> EDIT_ITEM_FAST ( percent , MSG_FIRST_FAN_SPEED , & editable . uint8 , 0 , 255 , [ ] ( ) { thermalManager . set_fan_speed ( 0 , editable . uint8 ) ; } ) ; <nl> # if ENABLED ( EXTRA_FAN_SPEED ) <nl>
|
Language changes
|
MarlinFirmware/Marlin
|
aaf018e5a07acfa3264de9eb10890f9b8c157c20
|
2019-10-29T21:20:35Z
|
mmm a / src / mongo / db / SConscript <nl> ppp b / src / mongo / db / SConscript <nl> serveronlyLibdeps = [ <nl> " $ BUILD_DIR / mongo / db / bson / dotted_path_support " , <nl> " $ BUILD_DIR / mongo / executor / network_interface_factory " , <nl> " $ BUILD_DIR / mongo / s / catalog / replset / sharding_catalog_client_impl " , <nl> + " $ BUILD_DIR / mongo / s / catalog / replset / sharding_catalog_manager_impl " , <nl> " $ BUILD_DIR / mongo / s / client / sharding_connection_hook " , <nl> " $ BUILD_DIR / mongo / s / coreshard " , <nl> " $ BUILD_DIR / mongo / s / serveronly " , <nl> mmm a / src / mongo / db / commands / conn_pool_stats . cpp <nl> ppp b / src / mongo / db / commands / conn_pool_stats . cpp <nl> <nl> # include " mongo / db / repl / replication_coordinator . h " <nl> # include " mongo / db / repl / replication_coordinator_global . h " <nl> # include " mongo / db / s / sharding_state . h " <nl> + # include " mongo / db / server_options . h " <nl> # include " mongo / executor / connection_pool_stats . h " <nl> # include " mongo / executor / network_interface_factory . h " <nl> # include " mongo / executor / task_executor_pool . h " <nl> + # include " mongo / s / catalog / sharding_catalog_manager . h " <nl> # include " mongo / s / client / shard_registry . h " <nl> # include " mongo / s / grid . h " <nl> <nl> class PoolStats final : public Command { <nl> auto grid = Grid : : get ( txn ) ; <nl> if ( grid - > shardRegistry ( ) ) { <nl> grid - > getExecutorPool ( ) - > appendConnectionStats ( & stats ) ; <nl> - grid - > catalogClient ( txn ) - > appendConnectionStats ( & stats ) ; <nl> + if ( serverGlobalParams . clusterRole = = ClusterRole : : ConfigServer ) { <nl> + grid - > catalogManager ( ) - > appendConnectionStats ( & stats ) ; <nl> + } <nl> } <nl> <nl> / / Output to a BSON object . <nl> mmm a / src / mongo / db / s / SConscript <nl> ppp b / src / mongo / db / s / SConscript <nl> env . CppUnitTest ( <nl> ' $ BUILD_DIR / mongo / db / serveronly ' , <nl> ' $ BUILD_DIR / mongo / executor / network_test_env ' , <nl> ' $ BUILD_DIR / mongo / executor / thread_pool_task_executor_test_fixture ' , <nl> - ' $ BUILD_DIR / mongo / s / catalog / sharding_catalog_client_mock ' , <nl> + ' $ BUILD_DIR / mongo / s / catalog / sharding_catalog_mock ' , <nl> ' $ BUILD_DIR / mongo / s / coreshard ' , <nl> ' $ BUILD_DIR / mongo / util / clock_source_mock ' , <nl> ' $ BUILD_DIR / mongo / util / net / message_port_mock ' , <nl> env . CppUnitTest ( <nl> ' $ BUILD_DIR / mongo / db / serveronly ' , <nl> ' $ BUILD_DIR / mongo / executor / network_test_env ' , <nl> ' $ BUILD_DIR / mongo / executor / thread_pool_task_executor_test_fixture ' , <nl> - ' $ BUILD_DIR / mongo / s / catalog / sharding_catalog_client_mock ' , <nl> + ' $ BUILD_DIR / mongo / s / catalog / sharding_catalog_mock ' , <nl> ' $ BUILD_DIR / mongo / s / coreshard ' , <nl> ' $ BUILD_DIR / mongo / util / clock_source_mock ' , <nl> ' $ BUILD_DIR / mongo / util / net / message_port_mock ' , <nl> mmm a / src / mongo / db / s / config / configsvr_add_shard_command . cpp <nl> ppp b / src / mongo / db / s / config / configsvr_add_shard_command . cpp <nl> <nl> # include " mongo / db / namespace_string . h " <nl> # include " mongo / db / repl / replica_set_config . h " <nl> # include " mongo / db / repl / replication_coordinator . h " <nl> - # include " mongo / s / catalog / sharding_catalog_client . h " <nl> + # include " mongo / s / catalog / sharding_catalog_manager . h " <nl> # include " mongo / s / catalog / type_shard . h " <nl> # include " mongo / s / grid . h " <nl> # include " mongo / s / request_types / add_shard_request_type . h " <nl> class ConfigSvrAddShardCommand : public Command { <nl> parsedRequest . hasMaxSize ( ) ? parsedRequest . getMaxSize ( ) <nl> : kMaxSizeMBDefault ) ; <nl> <nl> - StatusWith < string > addShardResult = grid . catalogClient ( txn ) - > addShard ( <nl> + StatusWith < string > addShardResult = Grid : : get ( txn ) - > catalogManager ( ) - > addShard ( <nl> txn , <nl> parsedRequest . hasName ( ) ? & parsedRequest . getName ( ) : nullptr , <nl> parsedRequest . getConnString ( ) , <nl> mmm a / src / mongo / db / s / sharding_initialization_mongod . cpp <nl> ppp b / src / mongo / db / s / sharding_initialization_mongod . cpp <nl> <nl> # include " mongo / client / connection_string . h " <nl> # include " mongo / client / remote_command_targeter . h " <nl> # include " mongo / client / remote_command_targeter_factory_impl . h " <nl> + # include " mongo / db / server_options . h " <nl> + # include " mongo / executor / task_executor . h " <nl> + # include " mongo / s / catalog / replset / sharding_catalog_manager_impl . h " <nl> # include " mongo / s / client / shard_factory . h " <nl> # include " mongo / s / client / shard_local . h " <nl> # include " mongo / s / client / shard_remote . h " <nl> Status initializeGlobalShardingStateForMongod ( const ConnectionString & configCS ) <nl> auto shardFactory = <nl> stdx : : make_unique < ShardFactory > ( std : : move ( buildersMap ) , std : : move ( targeterFactory ) ) ; <nl> <nl> - return initializeGlobalShardingState ( configCS , std : : move ( shardFactory ) , [ ] ( ) { <nl> - return stdx : : make_unique < rpc : : ShardingEgressMetadataHookForMongod > ( ) ; <nl> - } ) ; <nl> + return initializeGlobalShardingState ( <nl> + configCS , <nl> + std : : move ( shardFactory ) , <nl> + [ ] ( ) { return stdx : : make_unique < rpc : : ShardingEgressMetadataHookForMongod > ( ) ; } , <nl> + [ ] ( ShardingCatalogClient * catalogClient , std : : unique_ptr < executor : : TaskExecutor > executor ) <nl> + - > std : : unique_ptr < ShardingCatalogManager > { <nl> + if ( serverGlobalParams . clusterRole = = ClusterRole : : ConfigServer ) { <nl> + return stdx : : make_unique < ShardingCatalogManagerImpl > ( catalogClient , <nl> + std : : move ( executor ) ) ; <nl> + } else { <nl> + return nullptr ; / / Only config servers get a real ShardingCatalogManager <nl> + } <nl> + } ) ; <nl> } <nl> <nl> } / / namespace mongo <nl> mmm a / src / mongo / db / s / sharding_state_test . cpp <nl> ppp b / src / mongo / db / s / sharding_state_test . cpp <nl> <nl> # include " mongo / s / balancer / balancer_configuration . h " <nl> # include " mongo / s / catalog / catalog_cache . h " <nl> # include " mongo / s / catalog / sharding_catalog_client_mock . h " <nl> + # include " mongo / s / catalog / sharding_catalog_manager_mock . h " <nl> # include " mongo / s / client / shard_factory . h " <nl> # include " mongo / s / client / shard_registry . h " <nl> # include " mongo / s / client / shard_remote . h " <nl> void initGrid ( OperationContext * txn , const ConnectionString & configConnString ) { <nl> <nl> grid . init ( <nl> stdx : : make_unique < ShardingCatalogClientMock > ( ) , <nl> + stdx : : make_unique < ShardingCatalogManagerMock > ( ) , <nl> stdx : : make_unique < CatalogCache > ( ) , <nl> std : : move ( shardRegistry ) , <nl> stdx : : make_unique < ClusterCursorManager > ( txn - > getServiceContext ( ) - > getPreciseClockSource ( ) ) , <nl> mmm a / src / mongo / s / SConscript <nl> ppp b / src / mongo / s / SConscript <nl> env . Library ( <nl> ' $ BUILD_DIR / mongo / rpc / metadata ' , <nl> ' $ BUILD_DIR / mongo / s / catalog / dist_lock_manager_mock ' , <nl> ' $ BUILD_DIR / mongo / s / catalog / replset / sharding_catalog_client_impl ' , <nl> + ' $ BUILD_DIR / mongo / s / catalog / replset / sharding_catalog_manager_impl ' , <nl> ' $ BUILD_DIR / mongo / s / coreshard ' , <nl> ' $ BUILD_DIR / mongo / util / clock_source_mock ' , <nl> ' $ BUILD_DIR / mongo / util / net / message_port_mock ' , <nl> mmm a / src / mongo / s / catalog / SConscript <nl> ppp b / src / mongo / s / catalog / SConscript <nl> env . SConscript ( <nl> ) <nl> <nl> env . Library ( <nl> - target = ' sharding_catalog_client_mock ' , <nl> + target = ' sharding_catalog_mock ' , <nl> source = [ <nl> ' sharding_catalog_client_mock . cpp ' , <nl> + ' sharding_catalog_manager_mock . cpp ' , <nl> ] , <nl> LIBDEPS = [ <nl> ' dist_lock_manager_mock ' , <nl> mmm a / src / mongo / s / catalog / replset / SConscript <nl> ppp b / src / mongo / s / catalog / replset / SConscript <nl> env . CppUnitTest ( <nl> ' $ BUILD_DIR / mongo / executor / network_test_env ' , <nl> ' $ BUILD_DIR / mongo / executor / thread_pool_task_executor_test_fixture ' , <nl> ' $ BUILD_DIR / mongo / s / catalog / dist_lock_catalog_mock ' , <nl> - ' $ BUILD_DIR / mongo / s / catalog / sharding_catalog_client_mock ' , <nl> + ' $ BUILD_DIR / mongo / s / catalog / sharding_catalog_mock ' , <nl> ' $ BUILD_DIR / mongo / s / coreshard ' , <nl> ' $ BUILD_DIR / mongo / s / mongoscore ' , <nl> ' $ BUILD_DIR / mongo / s / sharding_test_fixture ' , <nl> env . Library ( <nl> ] , <nl> ) <nl> <nl> + env . Library ( <nl> + target = ' sharding_catalog_manager_impl ' , <nl> + source = [ <nl> + ' sharding_catalog_manager_impl . cpp ' , <nl> + ] , <nl> + LIBDEPS = [ <nl> + ' $ BUILD_DIR / mongo / db / repl / read_concern_args ' , <nl> + ' $ BUILD_DIR / mongo / executor / network_interface ' , <nl> + ' $ BUILD_DIR / mongo / s / client / sharding_client ' , <nl> + ] , <nl> + LIBDEPS_TAGS = [ <nl> + # Depends on coreshard , but that would be circular <nl> + ' incomplete ' , <nl> + ] , <nl> + ) <nl> + <nl> env . Library ( <nl> target = ' sharding_catalog_test_fixture ' , <nl> source = [ <nl> mmm a / src / mongo / s / catalog / replset / dist_lock_catalog_impl_test . cpp <nl> ppp b / src / mongo / s / catalog / replset / dist_lock_catalog_impl_test . cpp <nl> <nl> # include " mongo / s / catalog / catalog_cache . h " <nl> # include " mongo / s / catalog / replset / dist_lock_catalog_impl . h " <nl> # include " mongo / s / catalog / sharding_catalog_client_mock . h " <nl> + # include " mongo / s / catalog / sharding_catalog_manager_mock . h " <nl> # include " mongo / s / catalog / type_lockpings . h " <nl> # include " mongo / s / catalog / type_locks . h " <nl> # include " mongo / s / client / shard_factory . h " <nl> class DistLockCatalogFixture : public mongo : : unittest : : Test { <nl> _distLockCatalog = stdx : : make_unique < DistLockCatalogImpl > ( shardRegistry . get ( ) ) ; <nl> <nl> grid . init ( stdx : : make_unique < ShardingCatalogClientMock > ( ) , <nl> + stdx : : make_unique < ShardingCatalogManagerMock > ( ) , <nl> stdx : : make_unique < CatalogCache > ( ) , <nl> std : : move ( shardRegistry ) , <nl> std : : unique_ptr < ClusterCursorManager > { nullptr } , <nl> class DistLockCatalogFixture : public mongo : : unittest : : Test { <nl> <nl> std : : unique_ptr < executor : : NetworkTestEnv > _networkTestEnv ; <nl> <nl> - ShardingCatalogClientMock _catalogMgr ; <nl> - <nl> std : : unique_ptr < DistLockCatalogImpl > _distLockCatalog ; <nl> OperationContextNoop _txn ; <nl> } ; <nl> mmm a / src / mongo / s / catalog / replset / replset_dist_lock_manager_test . cpp <nl> ppp b / src / mongo / s / catalog / replset / replset_dist_lock_manager_test . cpp <nl> <nl> # include " mongo / s / catalog / catalog_cache . h " <nl> # include " mongo / s / catalog / dist_lock_catalog_mock . h " <nl> # include " mongo / s / catalog / sharding_catalog_client . h " <nl> + # include " mongo / s / catalog / sharding_catalog_manager . h " <nl> # include " mongo / s / catalog / type_lockpings . h " <nl> # include " mongo / s / catalog / type_locks . h " <nl> # include " mongo / s / client / shard_factory . h " <nl> class ReplSetDistLockManagerFixture : public mongo : : unittest : : Test { <nl> <nl> auto shardRegistry = stdx : : make_unique < ShardRegistry > ( std : : move ( shardFactory ) , configCS ) ; <nl> grid . init ( nullptr , <nl> + nullptr , <nl> nullptr , <nl> std : : move ( shardRegistry ) , <nl> nullptr , <nl> mmm a / src / mongo / s / catalog / replset / sharding_catalog_add_shard_test . cpp <nl> ppp b / src / mongo / s / catalog / replset / sharding_catalog_add_shard_test . cpp <nl> <nl> # include " mongo / db / s / type_shard_identity . h " <nl> # include " mongo / rpc / metadata / repl_set_metadata . h " <nl> # include " mongo / rpc / metadata / server_selection_metadata . h " <nl> - # include " mongo / s / catalog / replset / sharding_catalog_client_impl . h " <nl> # include " mongo / s / catalog / replset / sharding_catalog_test_fixture . h " <nl> + # include " mongo / s / catalog / sharding_catalog_manager . h " <nl> # include " mongo / s / catalog / type_changelog . h " <nl> # include " mongo / s / catalog / type_database . h " <nl> # include " mongo / s / catalog / type_shard . h " <nl> TEST_F ( AddShardTest , Standalone ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName ] { <nl> auto shardName = assertGet ( <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , <nl> - & expectedShardName , <nl> - assertGet ( ConnectionString : : parse ( " StandaloneHost : 12345 " ) ) , <nl> - 100 ) ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , <nl> + & expectedShardName , <nl> + assertGet ( ConnectionString : : parse ( " StandaloneHost : 12345 " ) ) , <nl> + 100 ) ) ; <nl> ASSERT_EQUALS ( expectedShardName , shardName ) ; <nl> } ) ; <nl> <nl> TEST_F ( AddShardTest , StandaloneGenerateName ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , shardTarget ] { <nl> auto shardName = assertGet ( <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , <nl> - nullptr , <nl> - assertGet ( ConnectionString : : parse ( shardTarget . toString ( ) ) ) , <nl> - 100 ) ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , <nl> + nullptr , <nl> + assertGet ( ConnectionString : : parse ( shardTarget . toString ( ) ) ) , <nl> + 100 ) ) ; <nl> ASSERT_EQUALS ( expectedShardName , shardName ) ; <nl> } ) ; <nl> <nl> TEST_F ( AddShardTest , AddSCCCConnectionStringAsShard ) { <nl> <nl> auto future = launchAsync ( [ this , invalidConn ] { <nl> const std : : string shardName ( " StandaloneShard " ) ; <nl> - auto status = catalogClient ( ) - > addShard ( operationContext ( ) , & shardName , invalidConn , 100 ) ; <nl> + auto status = catalogManager ( ) - > addShard ( operationContext ( ) , & shardName , invalidConn , 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : BadValue , status ) ; <nl> ASSERT_STRING_CONTAINS ( status . getStatus ( ) . reason ( ) , " Invalid connection string " ) ; <nl> } ) ; <nl> TEST_F ( AddShardTest , EmptyShardName ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , <nl> - & expectedShardName , <nl> - assertGet ( ConnectionString : : parse ( " StandaloneHost : 12345 " ) ) , <nl> - 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , <nl> + & expectedShardName , <nl> + assertGet ( ConnectionString : : parse ( " StandaloneHost : 12345 " ) ) , <nl> + 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : BadValue , status ) ; <nl> ASSERT_EQUALS ( " shard name cannot be empty " , status . getStatus ( ) . reason ( ) ) ; <nl> } ) ; <nl> TEST_F ( AddShardTest , UnreachableHost ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , <nl> - & expectedShardName , <nl> - assertGet ( ConnectionString : : parse ( " StandaloneHost : 12345 " ) ) , <nl> - 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , <nl> + & expectedShardName , <nl> + assertGet ( ConnectionString : : parse ( " StandaloneHost : 12345 " ) ) , <nl> + 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : HostUnreachable , status ) ; <nl> ASSERT_EQUALS ( " host unreachable " , status . getStatus ( ) . reason ( ) ) ; <nl> } ) ; <nl> TEST_F ( AddShardTest , AddMongosAsShard ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , <nl> - & expectedShardName , <nl> - assertGet ( ConnectionString : : parse ( " StandaloneHost : 12345 " ) ) , <nl> - 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , <nl> + & expectedShardName , <nl> + assertGet ( ConnectionString : : parse ( " StandaloneHost : 12345 " ) ) , <nl> + 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : RPCProtocolNegotiationFailed , status ) ; <nl> } ) ; <nl> <nl> TEST_F ( AddShardTest , AddExistingShardStandalone ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , shardTarget ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , <nl> - & expectedShardName , <nl> - assertGet ( ConnectionString : : parse ( shardTarget . toString ( ) ) ) , <nl> - 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , <nl> + & expectedShardName , <nl> + assertGet ( ConnectionString : : parse ( shardTarget . toString ( ) ) ) , <nl> + 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : OperationFailed , status ) ; <nl> ASSERT_STRING_CONTAINS ( status . getStatus ( ) . reason ( ) , <nl> " is already a member of the existing shard " ) ; <nl> TEST_F ( AddShardTest , AddExistingShardReplicaSet ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , connString ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : OperationFailed , status ) ; <nl> ASSERT_STRING_CONTAINS ( status . getStatus ( ) . reason ( ) , <nl> " is already a member of the existing shard " ) ; <nl> TEST_F ( AddShardTest , AddReplicaSetShardAsStandalone ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , shardTarget ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , <nl> - & expectedShardName , <nl> - assertGet ( ConnectionString : : parse ( shardTarget . toString ( ) ) ) , <nl> - 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , <nl> + & expectedShardName , <nl> + assertGet ( ConnectionString : : parse ( shardTarget . toString ( ) ) ) , <nl> + 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : OperationFailed , status ) ; <nl> ASSERT_STRING_CONTAINS ( status . getStatus ( ) . reason ( ) , " use replica set url format " ) ; <nl> } ) ; <nl> TEST_F ( AddShardTest , AddStandaloneHostShardAsReplicaSet ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , connString ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : OperationFailed , status ) ; <nl> ASSERT_STRING_CONTAINS ( status . getStatus ( ) . reason ( ) , " host did not return a set name " ) ; <nl> } ) ; <nl> TEST_F ( AddShardTest , ReplicaSetMistmatchedReplicaSetName ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , connString ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : OperationFailed , status ) ; <nl> ASSERT_STRING_CONTAINS ( status . getStatus ( ) . reason ( ) , " does not match the actual set name " ) ; <nl> } ) ; <nl> TEST_F ( AddShardTest , ShardIsCSRSConfigServer ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , connString ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : OperationFailed , status ) ; <nl> ASSERT_STRING_CONTAINS ( status . getStatus ( ) . reason ( ) , <nl> " as a shard since it is a config server " ) ; <nl> TEST_F ( AddShardTest , ReplicaSetMissingHostsProvidedInSeedList ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , connString ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : OperationFailed , status ) ; <nl> ASSERT_STRING_CONTAINS ( status . getStatus ( ) . reason ( ) , <nl> " host2 : 12345 does not belong to replica set " ) ; <nl> TEST_F ( AddShardTest , ShardNameIsConfig ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , connString ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : BadValue , status ) ; <nl> ASSERT_EQUALS ( status . getStatus ( ) . reason ( ) , <nl> " use of shard replica set with name ' config ' is not allowed " ) ; <nl> TEST_F ( AddShardTest , ShardContainsExistingDatabase ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , connString ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : OperationFailed , status ) ; <nl> ASSERT_STRING_CONTAINS ( <nl> status . getStatus ( ) . reason ( ) , <nl> TEST_F ( AddShardTest , ReAddExistingShard ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , connString ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> ASSERT_OK ( status ) ; <nl> } ) ; <nl> <nl> TEST_F ( AddShardTest , SuccessfullyAddReplicaSet ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , connString ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> ASSERT_OK ( status ) ; <nl> auto shardName = status . getValue ( ) ; <nl> ASSERT_EQUALS ( expectedShardName , shardName ) ; <nl> TEST_F ( AddShardTest , AddShardSucceedsEvenIfAddingDBsFromNewShardFails ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , connString ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , & expectedShardName , connString , 100 ) ; <nl> ASSERT_OK ( status ) ; <nl> auto shardName = status . getValue ( ) ; <nl> ASSERT_EQUALS ( expectedShardName , shardName ) ; <nl> TEST_F ( AddShardTest , ReplicaSetExtraHostsDiscovered ) { <nl> <nl> auto future = launchAsync ( [ this , expectedShardName , seedString ] { <nl> auto status = <nl> - catalogClient ( ) - > addShard ( operationContext ( ) , & expectedShardName , seedString , 100 ) ; <nl> + catalogManager ( ) - > addShard ( operationContext ( ) , & expectedShardName , seedString , 100 ) ; <nl> ASSERT_OK ( status ) ; <nl> auto shardName = status . getValue ( ) ; <nl> ASSERT_EQUALS ( expectedShardName , shardName ) ; <nl> mmm a / src / mongo / s / catalog / replset / sharding_catalog_client_impl . cpp <nl> ppp b / src / mongo / s / catalog / replset / sharding_catalog_client_impl . cpp <nl> Status _processBatchWriteResponse ( StatusWith < Shard : : CommandResponse > response , <nl> <nl> } / / namespace <nl> <nl> - StatusWith < ShardType > ShardingCatalogClientImpl : : _validateHostAsShard ( <nl> - OperationContext * txn , <nl> - ShardRegistry * shardRegistry , <nl> - const ConnectionString & connectionString , <nl> - const std : : string * shardProposedName ) { <nl> - if ( connectionString . type ( ) = = ConnectionString : : INVALID ) { <nl> - return { ErrorCodes : : BadValue , " Invalid connection string " } ; <nl> - } <nl> - <nl> - if ( shardProposedName & & shardProposedName - > empty ( ) ) { <nl> - return { ErrorCodes : : BadValue , " shard name cannot be empty " } ; <nl> - } <nl> - <nl> - / / TODO : Don ' t create a detached Shard object , create a detached RemoteCommandTargeter instead . <nl> - const std : : shared_ptr < Shard > shardConn { shardRegistry - > createConnection ( connectionString ) } ; <nl> - invariant ( shardConn ) ; <nl> - auto targeter = shardConn - > getTargeter ( ) ; <nl> - <nl> - / / Check whether any host in the connection is already part of the cluster . <nl> - shardRegistry - > reload ( txn ) ; <nl> - for ( const auto & hostAndPort : connectionString . getServers ( ) ) { <nl> - std : : shared_ptr < Shard > shard ; <nl> - shard = shardRegistry - > getShardNoReload ( hostAndPort . toString ( ) ) ; <nl> - if ( shard ) { <nl> - return { ErrorCodes : : OperationFailed , <nl> - str : : stream ( ) < < " ' " < < hostAndPort . toString ( ) < < " ' " <nl> - < < " is already a member of the existing shard ' " <nl> - < < shard - > getConnString ( ) . toString ( ) <nl> - < < " ' ( " <nl> - < < shard - > getId ( ) <nl> - < < " ) . " } ; <nl> - } <nl> - } <nl> - <nl> - / / Check for mongos and older version mongod connections , and whether the hosts <nl> - / / can be found for the user specified replset . <nl> - auto swCommandResponse = <nl> - _runCommandForAddShard ( txn , targeter . get ( ) , " admin " , BSON ( " isMaster " < < 1 ) ) ; <nl> - if ( ! swCommandResponse . isOK ( ) ) { <nl> - if ( swCommandResponse . getStatus ( ) = = ErrorCodes : : RPCProtocolNegotiationFailed ) { <nl> - / / Mongos to mongos commands are no longer supported in the wire protocol <nl> - / / ( because mongos does not support OP_COMMAND ) , similarly for a new mongos <nl> - / / and an old mongod . So the call will fail in such cases . <nl> - / / TODO : If / When mongos ever supports opCommands , this logic will break because <nl> - / / cmdStatus will be OK . <nl> - return { ErrorCodes : : RPCProtocolNegotiationFailed , <nl> - str : : stream ( ) < < shardConn - > toString ( ) <nl> - < < " does not recognize the RPC protocol being used . This is " <nl> - < < " likely because it contains a node that is a mongos or an old " <nl> - < < " version of mongod . " } ; <nl> - } else { <nl> - return swCommandResponse . getStatus ( ) ; <nl> - } <nl> - } <nl> - <nl> - / / Check for a command response error <nl> - auto resIsMasterStatus = std : : move ( swCommandResponse . getValue ( ) . commandStatus ) ; <nl> - if ( ! resIsMasterStatus . isOK ( ) ) { <nl> - return { resIsMasterStatus . code ( ) , <nl> - str : : stream ( ) < < " Error running isMaster against " < < shardConn - > toString ( ) < < " : " <nl> - < < causedBy ( resIsMasterStatus ) } ; <nl> - } <nl> - <nl> - auto resIsMaster = std : : move ( swCommandResponse . getValue ( ) . response ) ; <nl> - <nl> - / / Check whether there is a master . If there isn ' t , the replica set may not have been <nl> - / / initiated . If the connection is a standalone , it will return true for isMaster . <nl> - bool isMaster ; <nl> - Status status = bsonExtractBooleanField ( resIsMaster , " ismaster " , & isMaster ) ; <nl> - if ( ! status . isOK ( ) ) { <nl> - return Status ( status . code ( ) , <nl> - str : : stream ( ) < < " isMaster returned invalid ' ismaster ' " <nl> - < < " field when attempting to add " <nl> - < < connectionString . toString ( ) <nl> - < < " as a shard : " <nl> - < < status . reason ( ) ) ; <nl> - } <nl> - if ( ! isMaster ) { <nl> - return { ErrorCodes : : NotMaster , <nl> - str : : stream ( ) <nl> - < < connectionString . toString ( ) <nl> - < < " does not have a master . If this is a replica set , ensure that it has a " <nl> - < < " healthy primary and that the set has been properly initiated . " } ; <nl> - } <nl> - <nl> - const string providedSetName = connectionString . getSetName ( ) ; <nl> - const string foundSetName = resIsMaster [ " setName " ] . str ( ) ; <nl> - <nl> - / / Make sure the specified replica set name ( if any ) matches the actual shard ' s replica set <nl> - if ( providedSetName . empty ( ) & & ! foundSetName . empty ( ) ) { <nl> - return { ErrorCodes : : OperationFailed , <nl> - str : : stream ( ) < < " host is part of set " < < foundSetName < < " ; " <nl> - < < " use replica set url format " <nl> - < < " < setname > / < server1 > , < server2 > , . . . " } ; <nl> - } <nl> - <nl> - if ( ! providedSetName . empty ( ) & & foundSetName . empty ( ) ) { <nl> - return { ErrorCodes : : OperationFailed , <nl> - str : : stream ( ) < < " host did not return a set name ; " <nl> - < < " is the replica set still initializing ? " <nl> - < < resIsMaster } ; <nl> - } <nl> - <nl> - / / Make sure the set name specified in the connection string matches the one where its hosts <nl> - / / belong into <nl> - if ( ! providedSetName . empty ( ) & & ( providedSetName ! = foundSetName ) ) { <nl> - return { ErrorCodes : : OperationFailed , <nl> - str : : stream ( ) < < " the provided connection string ( " < < connectionString . toString ( ) <nl> - < < " ) does not match the actual set name " <nl> - < < foundSetName } ; <nl> - } <nl> - <nl> - / / Is it a config server ? <nl> - if ( resIsMaster . hasField ( " configsvr " ) ) { <nl> - return { ErrorCodes : : OperationFailed , <nl> - str : : stream ( ) < < " Cannot add " < < connectionString . toString ( ) <nl> - < < " as a shard since it is a config server " } ; <nl> - } <nl> - <nl> - / / If the shard is part of a replica set , make sure all the hosts mentioned in the connection <nl> - / / string are part of the set . It is fine if not all members of the set are mentioned in the <nl> - / / connection string , though . <nl> - if ( ! providedSetName . empty ( ) ) { <nl> - std : : set < string > hostSet ; <nl> - <nl> - BSONObjIterator iter ( resIsMaster [ " hosts " ] . Obj ( ) ) ; <nl> - while ( iter . more ( ) ) { <nl> - hostSet . insert ( iter . next ( ) . String ( ) ) ; / / host : port <nl> - } <nl> - <nl> - if ( resIsMaster [ " passives " ] . isABSONObj ( ) ) { <nl> - BSONObjIterator piter ( resIsMaster [ " passives " ] . Obj ( ) ) ; <nl> - while ( piter . more ( ) ) { <nl> - hostSet . insert ( piter . next ( ) . String ( ) ) ; / / host : port <nl> - } <nl> - } <nl> - <nl> - if ( resIsMaster [ " arbiters " ] . isABSONObj ( ) ) { <nl> - BSONObjIterator piter ( resIsMaster [ " arbiters " ] . Obj ( ) ) ; <nl> - while ( piter . more ( ) ) { <nl> - hostSet . insert ( piter . next ( ) . String ( ) ) ; / / host : port <nl> - } <nl> - } <nl> - <nl> - vector < HostAndPort > hosts = connectionString . getServers ( ) ; <nl> - for ( size_t i = 0 ; i < hosts . size ( ) ; i + + ) { <nl> - const string host = hosts [ i ] . toString ( ) ; / / host : port <nl> - if ( hostSet . find ( host ) = = hostSet . end ( ) ) { <nl> - return { ErrorCodes : : OperationFailed , <nl> - str : : stream ( ) < < " in seed list " < < connectionString . toString ( ) < < " , host " <nl> - < < host <nl> - < < " does not belong to replica set " <nl> - < < foundSetName <nl> - < < " ; found " <nl> - < < resIsMaster . toString ( ) } ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - string actualShardName ; <nl> - <nl> - if ( shardProposedName ) { <nl> - actualShardName = * shardProposedName ; <nl> - } else if ( ! foundSetName . empty ( ) ) { <nl> - / / Default it to the name of the replica set <nl> - actualShardName = foundSetName ; <nl> - } <nl> - <nl> - / / Disallow adding shard replica set with name ' config ' <nl> - if ( actualShardName = = " config " ) { <nl> - return { ErrorCodes : : BadValue , " use of shard replica set with name ' config ' is not allowed " } ; <nl> - } <nl> - <nl> - / / Retrieve the most up to date connection string that we know from the replica set monitor ( if <nl> - / / this is a replica set shard , otherwise it will be the same value as connectionString ) . <nl> - ConnectionString actualShardConnStr = shardConn - > getTargeter ( ) - > connectionString ( ) ; <nl> - <nl> - ShardType shard ; <nl> - shard . setName ( actualShardName ) ; <nl> - shard . setHost ( actualShardConnStr . toString ( ) ) ; <nl> - <nl> - return shard ; <nl> - } <nl> - <nl> - StatusWith < std : : vector < std : : string > > ShardingCatalogClientImpl : : _getDBNamesListFromShard ( <nl> - OperationContext * txn , ShardRegistry * shardRegistry , const ConnectionString & connectionString ) { <nl> - / / TODO : Don ' t create a detached Shard object , create a detached RemoteCommandTargeter instead . <nl> - const std : : shared_ptr < Shard > shardConn { <nl> - shardRegistry - > createConnection ( connectionString ) . release ( ) } ; <nl> - invariant ( shardConn ) ; <nl> - <nl> - auto swCommandResponse = _runCommandForAddShard ( <nl> - txn , shardConn - > getTargeter ( ) . get ( ) , " admin " , BSON ( " listDatabases " < < 1 ) ) ; <nl> - if ( ! swCommandResponse . isOK ( ) ) { <nl> - return swCommandResponse . getStatus ( ) ; <nl> - } <nl> - <nl> - auto cmdStatus = std : : move ( swCommandResponse . getValue ( ) . commandStatus ) ; <nl> - if ( ! cmdStatus . isOK ( ) ) { <nl> - return cmdStatus ; <nl> - } <nl> - <nl> - auto cmdResult = std : : move ( swCommandResponse . getValue ( ) . response ) ; <nl> - <nl> - vector < string > dbNames ; <nl> - <nl> - for ( const auto & dbEntry : cmdResult [ " databases " ] . Obj ( ) ) { <nl> - const string & dbName = dbEntry [ " name " ] . String ( ) ; <nl> - <nl> - if ( ! ( dbName = = " local " | | dbName = = " admin " ) ) { <nl> - dbNames . push_back ( dbName ) ; <nl> - } <nl> - } <nl> - <nl> - return dbNames ; <nl> - } <nl> - <nl> ShardingCatalogClientImpl : : ShardingCatalogClientImpl ( <nl> - std : : unique_ptr < DistLockManager > distLockManager , <nl> - std : : unique_ptr < executor : : TaskExecutor > addShardExecutor ) <nl> - : _distLockManager ( std : : move ( distLockManager ) ) , <nl> - _executorForAddShard ( std : : move ( addShardExecutor ) ) { } <nl> + std : : unique_ptr < DistLockManager > distLockManager ) <nl> + : _distLockManager ( std : : move ( distLockManager ) ) { } <nl> <nl> ShardingCatalogClientImpl : : ~ ShardingCatalogClientImpl ( ) = default ; <nl> <nl> Status ShardingCatalogClientImpl : : startup ( ) { <nl> } <nl> _started = true ; <nl> _distLockManager - > startUp ( ) ; <nl> - _executorForAddShard - > startup ( ) ; <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> void ShardingCatalogClientImpl : : shutDown ( OperationContext * txn ) { <nl> <nl> invariant ( _distLockManager ) ; <nl> _distLockManager - > shutDown ( txn ) ; <nl> - _executorForAddShard - > shutdown ( ) ; <nl> - _executorForAddShard - > join ( ) ; <nl> - } <nl> - <nl> - StatusWith < Shard : : CommandResponse > ShardingCatalogClientImpl : : _runCommandForAddShard ( <nl> - OperationContext * txn , <nl> - RemoteCommandTargeter * targeter , <nl> - const std : : string & dbName , <nl> - const BSONObj & cmdObj ) { <nl> - auto host = targeter - > findHost ( ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> - RemoteCommandTargeter : : selectFindHostMaxWaitTime ( txn ) ) ; <nl> - if ( ! host . isOK ( ) ) { <nl> - return host . getStatus ( ) ; <nl> - } <nl> - <nl> - executor : : RemoteCommandRequest request ( <nl> - host . getValue ( ) , dbName , cmdObj , rpc : : makeEmptyMetadata ( ) , Seconds ( 30 ) ) ; <nl> - StatusWith < executor : : RemoteCommandResponse > swResponse = <nl> - Status ( ErrorCodes : : InternalError , " Internal error running command " ) ; <nl> - <nl> - auto callStatus = _executorForAddShard - > scheduleRemoteCommand ( <nl> - request , [ & swResponse ] ( const executor : : TaskExecutor : : RemoteCommandCallbackArgs & args ) { <nl> - swResponse = args . response ; <nl> - } ) ; <nl> - if ( ! callStatus . isOK ( ) ) { <nl> - return callStatus . getStatus ( ) ; <nl> - } <nl> - <nl> - / / Block until the command is carried out <nl> - _executorForAddShard - > wait ( callStatus . getValue ( ) ) ; <nl> - <nl> - if ( ! swResponse . isOK ( ) ) { <nl> - if ( swResponse . getStatus ( ) . compareCode ( ErrorCodes : : ExceededTimeLimit ) ) { <nl> - LOG ( 0 ) < < " Operation for addShard timed out with status " < < swResponse . getStatus ( ) ; <nl> - } <nl> - return swResponse . getStatus ( ) ; <nl> - } <nl> - <nl> - BSONObj responseObj = swResponse . getValue ( ) . data . getOwned ( ) ; <nl> - BSONObj responseMetadata = swResponse . getValue ( ) . metadata . getOwned ( ) ; <nl> - Status commandStatus = getStatusFromCommandResult ( responseObj ) ; <nl> - Status writeConcernStatus = getWriteConcernStatusFromCommandResult ( responseObj ) ; <nl> - <nl> - return Shard : : CommandResponse ( std : : move ( responseObj ) , <nl> - std : : move ( responseMetadata ) , <nl> - std : : move ( commandStatus ) , <nl> - std : : move ( writeConcernStatus ) ) ; <nl> - } <nl> - <nl> - StatusWith < string > ShardingCatalogClientImpl : : addShard ( <nl> - OperationContext * txn , <nl> - const std : : string * shardProposedName , <nl> - const ConnectionString & shardConnectionString , <nl> - const long long maxSize ) { <nl> - / / Validate the specified connection string may serve as shard at all <nl> - auto shardStatus = <nl> - _validateHostAsShard ( txn , grid . shardRegistry ( ) , shardConnectionString , shardProposedName ) ; <nl> - if ( ! shardStatus . isOK ( ) ) { <nl> - / / TODO : This is a workaround for the case were we could have some bad shard being <nl> - / / requested to be added and we put that bad connection string on the global replica set <nl> - / / monitor registry . It needs to be cleaned up so that when a correct replica set is added , <nl> - / / it will be recreated . <nl> - ReplicaSetMonitor : : remove ( shardConnectionString . getSetName ( ) ) ; <nl> - return shardStatus . getStatus ( ) ; <nl> - } <nl> - <nl> - ShardType & shardType = shardStatus . getValue ( ) ; <nl> - <nl> - auto dbNamesStatus = _getDBNamesListFromShard ( txn , grid . shardRegistry ( ) , shardConnectionString ) ; <nl> - if ( ! dbNamesStatus . isOK ( ) ) { <nl> - return dbNamesStatus . getStatus ( ) ; <nl> - } <nl> - <nl> - / / Check that none of the existing shard candidate ' s dbs exist already <nl> - for ( const string & dbName : dbNamesStatus . getValue ( ) ) { <nl> - auto dbt = getDatabase ( txn , dbName ) ; <nl> - if ( dbt . isOK ( ) ) { <nl> - const auto & dbDoc = dbt . getValue ( ) . value ; <nl> - return Status ( ErrorCodes : : OperationFailed , <nl> - str : : stream ( ) < < " can ' t add shard " <nl> - < < " ' " <nl> - < < shardConnectionString . toString ( ) <nl> - < < " ' " <nl> - < < " because a local database ' " <nl> - < < dbName <nl> - < < " ' exists in another " <nl> - < < dbDoc . getPrimary ( ) ) ; <nl> - } else if ( dbt ! = ErrorCodes : : NamespaceNotFound ) { <nl> - return dbt . getStatus ( ) ; <nl> - } <nl> - } <nl> - <nl> - / / If a name for a shard wasn ' t provided , generate one <nl> - if ( shardType . getName ( ) . empty ( ) ) { <nl> - StatusWith < string > result = _generateNewShardName ( txn ) ; <nl> - if ( ! result . isOK ( ) ) { <nl> - return result . getStatus ( ) ; <nl> - } <nl> - shardType . setName ( result . getValue ( ) ) ; <nl> - } <nl> - <nl> - if ( maxSize > 0 ) { <nl> - shardType . setMaxSizeMB ( maxSize ) ; <nl> - } <nl> - <nl> - ShardIdentityType shardIdentity ; <nl> - shardIdentity . setConfigsvrConnString ( <nl> - Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigServerConnectionString ( ) ) ; <nl> - shardIdentity . setShardName ( shardType . getName ( ) ) ; <nl> - shardIdentity . setClusterId ( Grid : : get ( txn ) - > shardRegistry ( ) - > getClusterId ( ) ) ; <nl> - auto validateStatus = shardIdentity . validate ( ) ; <nl> - if ( ! validateStatus . isOK ( ) ) { <nl> - return validateStatus ; <nl> - } <nl> - <nl> - log ( ) < < " going to insert shardIdentity document into shard : " < < shardIdentity . toString ( ) ; <nl> - <nl> - auto updateRequest = shardIdentity . createUpsertForAddShard ( ) ; <nl> - BatchedCommandRequest commandRequest ( updateRequest . release ( ) ) ; <nl> - commandRequest . setNS ( NamespaceString : : kConfigCollectionNamespace ) ; <nl> - commandRequest . setWriteConcern ( kMajorityWriteConcern . toBSON ( ) ) ; <nl> - <nl> - const std : : shared_ptr < Shard > shardConn { <nl> - Grid : : get ( txn ) - > shardRegistry ( ) - > createConnection ( shardConnectionString ) } ; <nl> - invariant ( shardConn ) ; <nl> - auto targeter = shardConn - > getTargeter ( ) ; <nl> - <nl> - auto swCommandResponse = <nl> - _runCommandForAddShard ( txn , targeter . get ( ) , " admin " , commandRequest . toBSON ( ) ) ; <nl> - <nl> - if ( ! swCommandResponse . isOK ( ) ) { <nl> - return swCommandResponse . getStatus ( ) ; <nl> - } <nl> - <nl> - auto commandResponse = std : : move ( swCommandResponse . getValue ( ) ) ; <nl> - <nl> - BatchedCommandResponse batchResponse ; <nl> - auto batchResponseStatus = _processBatchWriteResponse ( commandResponse , & batchResponse ) ; <nl> - if ( ! batchResponseStatus . isOK ( ) ) { <nl> - return batchResponseStatus ; <nl> - } <nl> - <nl> - log ( ) < < " going to insert new entry for shard into config . shards : " < < shardType . toString ( ) ; <nl> - <nl> - Status result = insertConfigDocument ( txn , ShardType : : ConfigNS , shardType . toBSON ( ) ) ; <nl> - if ( ! result . isOK ( ) ) { <nl> - log ( ) < < " error adding shard : " < < shardType . toBSON ( ) < < " err : " < < result . reason ( ) ; <nl> - if ( result = = ErrorCodes : : DuplicateKey ) { <nl> - / / TODO ( SERVER - 24213 ) : adding a shard that already exists should be considered success , <nl> - / / however this approach does no validation that we are adding the shard with the same <nl> - / / options . It also does not protect against adding the same shard with a different <nl> - / / shard name and slightly different connection string . This is a temporary hack to <nl> - / / get the continuous stepdown suite passing . <nl> - warning ( ) < < " Received duplicate key error when inserting new shard with name " <nl> - < < shardType . getName ( ) < < " and connection string " <nl> - < < shardConnectionString . toString ( ) <nl> - < < " to config . shards collection . This most likely means that there was an " <nl> - " attempt to add a shard that already exists in the cluster " ; <nl> - return shardType . getName ( ) ; <nl> - } <nl> - return result ; <nl> - } <nl> - <nl> - / / Add all databases which were discovered on the new shard <nl> - for ( const string & dbName : dbNamesStatus . getValue ( ) ) { <nl> - DatabaseType dbt ; <nl> - dbt . setName ( dbName ) ; <nl> - dbt . setPrimary ( shardType . getName ( ) ) ; <nl> - dbt . setSharded ( false ) ; <nl> - <nl> - Status status = updateDatabase ( txn , dbName , dbt ) ; <nl> - if ( ! status . isOK ( ) ) { <nl> - log ( ) < < " adding shard " < < shardConnectionString . toString ( ) <nl> - < < " even though could not add database " < < dbName ; <nl> - } <nl> - } <nl> - <nl> - / / Record in changelog <nl> - BSONObjBuilder shardDetails ; <nl> - shardDetails . append ( " name " , shardType . getName ( ) ) ; <nl> - shardDetails . append ( " host " , shardConnectionString . toString ( ) ) ; <nl> - <nl> - logChange ( txn , " addShard " , " " , shardDetails . obj ( ) ) ; <nl> - <nl> - / / Ensure the added shard is visible to this process . <nl> - auto shardRegistry = Grid : : get ( txn ) - > shardRegistry ( ) ; <nl> - if ( ! shardRegistry - > getShard ( txn , shardType . getName ( ) ) ) { <nl> - return { ErrorCodes : : OperationFailed , <nl> - " Could not find shard metadata for shard after adding it . This most likely " <nl> - " indicates that the shard was removed immediately after it was added . " } ; <nl> - } <nl> - <nl> - return shardType . getName ( ) ; <nl> } <nl> <nl> Status ShardingCatalogClientImpl : : updateCollection ( OperationContext * txn , <nl> Status ShardingCatalogClientImpl : : _checkDbDoesNotExist ( OperationContext * txn , <nl> < < dbName ) ; <nl> } <nl> <nl> - StatusWith < std : : string > ShardingCatalogClientImpl : : _generateNewShardName ( OperationContext * txn ) { <nl> - BSONObjBuilder shardNameRegex ; <nl> - shardNameRegex . appendRegex ( ShardType : : name ( ) , " ^ shard " ) ; <nl> - <nl> - auto findStatus = _exhaustiveFindOnConfig ( txn , <nl> - kConfigReadSelector , <nl> - NamespaceString ( ShardType : : ConfigNS ) , <nl> - shardNameRegex . obj ( ) , <nl> - BSON ( ShardType : : name ( ) < < - 1 ) , <nl> - 1 ) ; <nl> - if ( ! findStatus . isOK ( ) ) { <nl> - return findStatus . getStatus ( ) ; <nl> - } <nl> - <nl> - const auto & docs = findStatus . getValue ( ) . value ; <nl> - <nl> - int count = 0 ; <nl> - if ( ! docs . empty ( ) ) { <nl> - const auto shardStatus = ShardType : : fromBSON ( docs . front ( ) ) ; <nl> - if ( ! shardStatus . isOK ( ) ) { <nl> - return shardStatus . getStatus ( ) ; <nl> - } <nl> - <nl> - std : : istringstream is ( shardStatus . getValue ( ) . getName ( ) . substr ( 5 ) ) ; <nl> - is > > count ; <nl> - count + + ; <nl> - } <nl> - <nl> - / / TODO fix so that we can have more than 10000 automatically generated shard names <nl> - if ( count < 9999 ) { <nl> - std : : stringstream ss ; <nl> - ss < < " shard " < < std : : setfill ( ' 0 ' ) < < std : : setw ( 4 ) < < count ; <nl> - return ss . str ( ) ; <nl> - } <nl> - <nl> - return Status ( ErrorCodes : : OperationFailed , " unable to generate new shard name " ) ; <nl> - } <nl> - <nl> Status ShardingCatalogClientImpl : : _createCappedConfigCollection ( OperationContext * txn , <nl> StringData collName , <nl> int cappedSize ) { <nl> Status ShardingCatalogClientImpl : : appendInfoForConfigServerDatabases ( OperationCo <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> - void ShardingCatalogClientImpl : : appendConnectionStats ( executor : : ConnectionPoolStats * stats ) { <nl> - _executorForAddShard - > appendConnectionStats ( stats ) ; <nl> - } <nl> - <nl> } / / namespace mongo <nl> mmm a / src / mongo / s / catalog / replset / sharding_catalog_client_impl . h <nl> ppp b / src / mongo / s / catalog / replset / sharding_catalog_client_impl . h <nl> class TaskExecutor ; <nl> * / <nl> class ShardingCatalogClientImpl final : public ShardingCatalogClient { <nl> public : <nl> - ShardingCatalogClientImpl ( std : : unique_ptr < DistLockManager > distLockManager , <nl> - std : : unique_ptr < executor : : TaskExecutor > addShardExecutor ) ; <nl> + explicit ShardingCatalogClientImpl ( std : : unique_ptr < DistLockManager > distLockManager ) ; <nl> virtual ~ ShardingCatalogClientImpl ( ) ; <nl> <nl> / * * <nl> class ShardingCatalogClientImpl final : public ShardingCatalogClient { <nl> <nl> Status enableSharding ( OperationContext * txn , const std : : string & dbName ) override ; <nl> <nl> - StatusWith < std : : string > addShard ( OperationContext * txn , <nl> - const std : : string * shardProposedName , <nl> - const ConnectionString & shardConnectionString , <nl> - const long long maxSize ) override ; <nl> - <nl> Status updateDatabase ( OperationContext * txn , <nl> const std : : string & dbName , <nl> const DatabaseType & db ) override ; <nl> class ShardingCatalogClientImpl final : public ShardingCatalogClient { <nl> Status appendInfoForConfigServerDatabases ( OperationContext * txn , <nl> BSONArrayBuilder * builder ) override ; <nl> <nl> - void appendConnectionStats ( executor : : ConnectionPoolStats * stats ) override ; <nl> - <nl> / * * <nl> * Runs a read command against the config server with majority read concern . <nl> * / <nl> class ShardingCatalogClientImpl final : public ShardingCatalogClient { <nl> * / <nl> Status _checkDbDoesNotExist ( OperationContext * txn , const std : : string & dbName , DatabaseType * db ) ; <nl> <nl> - / * * <nl> - * Generates a unique name to be given to a newly added shard . <nl> - * / <nl> - StatusWith < std : : string > _generateNewShardName ( OperationContext * txn ) ; <nl> - <nl> - / * * <nl> - * Validates that the specified connection string can serve as a shard server . In particular , <nl> - * this function checks that the shard can be contacted , that it is not already member of <nl> - * another sharded cluster and etc . <nl> - * <nl> - * @ param shardRegistry Shard registry to use for getting a targeter to the shard - to - be . <nl> - * @ param connectionString Connection string to be attempted as a shard host . <nl> - * @ param shardProposedName Optional proposed name for the shard . Can be omitted in which case <nl> - * a unique name for the shard will be generated from the shard ' s connection string . If it <nl> - * is not omitted , the value cannot be the empty string . <nl> - * <nl> - * On success returns a partially initialized ShardType object corresponding to the requested <nl> - * shard . It will have the hostName field set and optionally the name , if the name could be <nl> - * generated from either the proposed name or the connection string set name . The returned <nl> - * shard ' s name should be checked and if empty , one should be generated using some uniform <nl> - * algorithm . <nl> - * / <nl> - StatusWith < ShardType > _validateHostAsShard ( OperationContext * txn , <nl> - ShardRegistry * shardRegistry , <nl> - const ConnectionString & connectionString , <nl> - const std : : string * shardProposedName ) ; <nl> - <nl> - / * * <nl> - * Runs the listDatabases command on the specified host and returns the names of all databases <nl> - * it returns excluding those named local and admin , since they serve administrative purpose . <nl> - * / <nl> - StatusWith < std : : vector < std : : string > > _getDBNamesListFromShard ( <nl> - OperationContext * txn , <nl> - ShardRegistry * shardRegistry , <nl> - const ConnectionString & connectionString ) ; <nl> - <nl> / * * <nl> * Creates the specified collection name in the config database . <nl> * / <nl> class ShardingCatalogClientImpl final : public ShardingCatalogClient { <nl> const NamespaceString & ns , <nl> BSONObj query ) ; <nl> <nl> - / * * <nl> - * Runs a command against a " shard " that is not yet in the cluster and thus not present in the <nl> - * ShardRegistry . <nl> - * / <nl> - StatusWith < Shard : : CommandResponse > _runCommandForAddShard ( OperationContext * txn , <nl> - RemoteCommandTargeter * targeter , <nl> - const std : : string & dbName , <nl> - const BSONObj & cmdObj ) ; <nl> - <nl> StatusWith < repl : : OpTimeWith < std : : vector < BSONObj > > > _exhaustiveFindOnConfig ( <nl> OperationContext * txn , <nl> const ReadPreferenceSetting & readPref , <nl> class ShardingCatalogClientImpl final : public ShardingCatalogClient { <nl> / / Distributed lock manager singleton . <nl> std : : unique_ptr < DistLockManager > _distLockManager ; / / ( R ) <nl> <nl> - / / Executor specifically used for sending commands to servers that are in the process of being <nl> - / / added as shards . Does not have any connection hook set on it , thus it can be used to talk <nl> - / / to servers that are not yet in the ShardRegistry . <nl> - std : : unique_ptr < executor : : TaskExecutor > _executorForAddShard ; / / ( R ) <nl> - <nl> / / True if shutDown ( ) has been called . False , otherwise . <nl> bool _inShutdown = false ; / / ( M ) <nl> <nl> new file mode 100644 <nl> index 000000000000 . . 239d5e0c28d5 <nl> mmm / dev / null <nl> ppp b / src / mongo / s / catalog / replset / sharding_catalog_manager_impl . cpp <nl> <nl> + / * * <nl> + * Copyright ( C ) 2015 MongoDB Inc . <nl> + * <nl> + * This program is free software : you can redistribute it and / or modify <nl> + * it under the terms of the GNU Affero General Public License , version 3 , <nl> + * as published by the Free Software Foundation . <nl> + * <nl> + * This program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * GNU Affero General Public License for more details . <nl> + * <nl> + * You should have received a copy of the GNU Affero General Public License <nl> + * along with this program . If not , see < http : / / www . gnu . org / licenses / > . <nl> + * <nl> + * As a special exception , the copyright holders give permission to link the <nl> + * code of portions of this program with the OpenSSL library under certain <nl> + * conditions as described in each individual source file and distribute <nl> + * linked combinations including the program with the OpenSSL library . You <nl> + * must comply with the GNU Affero General Public License in all respects for <nl> + * all of the code used other than as permitted herein . If you modify file ( s ) <nl> + * with this exception , you may extend this exception to your version of the <nl> + * file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> + * delete this exception statement from your version . If you delete this <nl> + * exception statement from all source files in the program , then also delete <nl> + * it in the license file . <nl> + * / <nl> + <nl> + # define MONGO_LOG_DEFAULT_COMPONENT : : mongo : : logger : : LogComponent : : kSharding <nl> + <nl> + # include " mongo / platform / basic . h " <nl> + <nl> + # include " mongo / s / catalog / replset / sharding_catalog_manager_impl . h " <nl> + <nl> + # include < iomanip > <nl> + <nl> + # include " mongo / base / status . h " <nl> + # include " mongo / base / status_with . h " <nl> + # include " mongo / bson / bsonobjbuilder . h " <nl> + # include " mongo / bson / util / bson_extract . h " <nl> + # include " mongo / client / connection_string . h " <nl> + # include " mongo / client / read_preference . h " <nl> + # include " mongo / client / remote_command_targeter . h " <nl> + # include " mongo / client / replica_set_monitor . h " <nl> + # include " mongo / db / namespace_string . h " <nl> + # include " mongo / db / operation_context . h " <nl> + # include " mongo / db / s / type_shard_identity . h " <nl> + # include " mongo / executor / network_interface . h " <nl> + # include " mongo / executor / task_executor . h " <nl> + # include " mongo / rpc / get_status_from_command_result . h " <nl> + # include " mongo / s / catalog / sharding_catalog_client . h " <nl> + # include " mongo / s / catalog / type_database . h " <nl> + # include " mongo / s / catalog / type_shard . h " <nl> + # include " mongo / s / client / shard . h " <nl> + # include " mongo / s / client / shard_registry . h " <nl> + # include " mongo / s / grid . h " <nl> + # include " mongo / s / set_shard_version_request . h " <nl> + # include " mongo / s / write_ops / batched_command_request . h " <nl> + # include " mongo / s / write_ops / batched_command_response . h " <nl> + # include " mongo / util / log . h " <nl> + # include " mongo / util / mongoutils / str . h " <nl> + # include " mongo / util / net / hostandport . h " <nl> + <nl> + namespace mongo { <nl> + <nl> + using std : : string ; <nl> + using std : : vector ; <nl> + using str : : stream ; <nl> + <nl> + namespace { <nl> + <nl> + const ReadPreferenceSetting kConfigReadSelector ( ReadPreference : : Nearest , TagSet { } ) ; <nl> + <nl> + const WriteConcernOptions kMajorityWriteConcern ( WriteConcernOptions : : kMajority , <nl> + / / Note : Even though we ' re setting UNSET here , <nl> + / / kMajority implies JOURNAL if journaling is <nl> + / / supported by mongod and <nl> + / / writeConcernMajorityJournalDefault is set to true <nl> + / / in the ReplicaSetConfig . <nl> + WriteConcernOptions : : SyncMode : : UNSET , <nl> + Seconds ( 15 ) ) ; <nl> + <nl> + void toBatchError ( const Status & status , BatchedCommandResponse * response ) { <nl> + response - > clear ( ) ; <nl> + response - > setErrCode ( status . code ( ) ) ; <nl> + response - > setErrMessage ( status . reason ( ) ) ; <nl> + response - > setOk ( false ) ; <nl> + } <nl> + <nl> + / * * <nl> + * Takes the response from running a batch write command and writes the appropriate response into <nl> + * * batchResponse , while also returning the Status of the operation . <nl> + * / <nl> + Status _processBatchWriteResponse ( StatusWith < Shard : : CommandResponse > response , <nl> + BatchedCommandResponse * batchResponse ) { <nl> + Status status ( ErrorCodes : : InternalError , " status not set " ) ; <nl> + <nl> + if ( ! response . isOK ( ) ) { <nl> + status = response . getStatus ( ) ; <nl> + } else if ( ! response . getValue ( ) . commandStatus . isOK ( ) ) { <nl> + status = response . getValue ( ) . commandStatus ; <nl> + } else if ( ! response . getValue ( ) . writeConcernStatus . isOK ( ) ) { <nl> + status = response . getValue ( ) . writeConcernStatus ; <nl> + } else { <nl> + string errmsg ; <nl> + if ( ! batchResponse - > parseBSON ( response . getValue ( ) . response , & errmsg ) ) { <nl> + status = Status ( ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) < < " Failed to parse config server response : " < < errmsg ) ; <nl> + } else { <nl> + status = batchResponse - > toStatus ( ) ; <nl> + } <nl> + } <nl> + <nl> + if ( ! status . isOK ( ) ) { <nl> + toBatchError ( status , batchResponse ) ; <nl> + } <nl> + <nl> + return status ; <nl> + } <nl> + } / / namespace <nl> + <nl> + <nl> + ShardingCatalogManagerImpl : : ShardingCatalogManagerImpl ( <nl> + ShardingCatalogClient * catalogClient , std : : unique_ptr < executor : : TaskExecutor > addShardExecutor ) <nl> + : _catalogClient ( catalogClient ) , _executorForAddShard ( std : : move ( addShardExecutor ) ) { } <nl> + <nl> + ShardingCatalogManagerImpl : : ~ ShardingCatalogManagerImpl ( ) = default ; <nl> + <nl> + Status ShardingCatalogManagerImpl : : startup ( ) { <nl> + stdx : : lock_guard < stdx : : mutex > lk ( _mutex ) ; <nl> + if ( _started ) { <nl> + return Status : : OK ( ) ; <nl> + } <nl> + _started = true ; <nl> + _executorForAddShard - > startup ( ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + void ShardingCatalogManagerImpl : : shutDown ( OperationContext * txn ) { <nl> + LOG ( 1 ) < < " ShardingCatalogManagerImpl : : shutDown ( ) called . " ; <nl> + { <nl> + stdx : : lock_guard < stdx : : mutex > lk ( _mutex ) ; <nl> + _inShutdown = true ; <nl> + } <nl> + <nl> + _executorForAddShard - > shutdown ( ) ; <nl> + _executorForAddShard - > join ( ) ; <nl> + } <nl> + <nl> + StatusWith < Shard : : CommandResponse > ShardingCatalogManagerImpl : : _runCommandForAddShard ( <nl> + OperationContext * txn , <nl> + RemoteCommandTargeter * targeter , <nl> + const std : : string & dbName , <nl> + const BSONObj & cmdObj ) { <nl> + auto host = targeter - > findHost ( ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + RemoteCommandTargeter : : selectFindHostMaxWaitTime ( txn ) ) ; <nl> + if ( ! host . isOK ( ) ) { <nl> + return host . getStatus ( ) ; <nl> + } <nl> + <nl> + executor : : RemoteCommandRequest request ( <nl> + host . getValue ( ) , dbName , cmdObj , rpc : : makeEmptyMetadata ( ) , Seconds ( 30 ) ) ; <nl> + StatusWith < executor : : RemoteCommandResponse > swResponse = <nl> + Status ( ErrorCodes : : InternalError , " Internal error running command " ) ; <nl> + <nl> + auto callStatus = _executorForAddShard - > scheduleRemoteCommand ( <nl> + request , [ & swResponse ] ( const executor : : TaskExecutor : : RemoteCommandCallbackArgs & args ) { <nl> + swResponse = args . response ; <nl> + } ) ; <nl> + if ( ! callStatus . isOK ( ) ) { <nl> + return callStatus . getStatus ( ) ; <nl> + } <nl> + <nl> + / / Block until the command is carried out <nl> + _executorForAddShard - > wait ( callStatus . getValue ( ) ) ; <nl> + <nl> + if ( ! swResponse . isOK ( ) ) { <nl> + if ( swResponse . getStatus ( ) . compareCode ( ErrorCodes : : ExceededTimeLimit ) ) { <nl> + LOG ( 0 ) < < " Operation for addShard timed out with status " < < swResponse . getStatus ( ) ; <nl> + } <nl> + return swResponse . getStatus ( ) ; <nl> + } <nl> + <nl> + BSONObj responseObj = swResponse . getValue ( ) . data . getOwned ( ) ; <nl> + BSONObj responseMetadata = swResponse . getValue ( ) . metadata . getOwned ( ) ; <nl> + Status commandStatus = getStatusFromCommandResult ( responseObj ) ; <nl> + Status writeConcernStatus = getWriteConcernStatusFromCommandResult ( responseObj ) ; <nl> + <nl> + return Shard : : CommandResponse ( std : : move ( responseObj ) , <nl> + std : : move ( responseMetadata ) , <nl> + std : : move ( commandStatus ) , <nl> + std : : move ( writeConcernStatus ) ) ; <nl> + } <nl> + <nl> + StatusWith < ShardType > ShardingCatalogManagerImpl : : _validateHostAsShard ( <nl> + OperationContext * txn , <nl> + ShardRegistry * shardRegistry , <nl> + const ConnectionString & connectionString , <nl> + const std : : string * shardProposedName ) { <nl> + if ( connectionString . type ( ) = = ConnectionString : : INVALID ) { <nl> + return { ErrorCodes : : BadValue , " Invalid connection string " } ; <nl> + } <nl> + <nl> + if ( shardProposedName & & shardProposedName - > empty ( ) ) { <nl> + return { ErrorCodes : : BadValue , " shard name cannot be empty " } ; <nl> + } <nl> + <nl> + / / TODO : Don ' t create a detached Shard object , create a detached RemoteCommandTargeter instead . <nl> + const std : : shared_ptr < Shard > shardConn { shardRegistry - > createConnection ( connectionString ) } ; <nl> + invariant ( shardConn ) ; <nl> + auto targeter = shardConn - > getTargeter ( ) ; <nl> + <nl> + / / Check whether any host in the connection is already part of the cluster . <nl> + shardRegistry - > reload ( txn ) ; <nl> + for ( const auto & hostAndPort : connectionString . getServers ( ) ) { <nl> + std : : shared_ptr < Shard > shard ; <nl> + shard = shardRegistry - > getShardNoReload ( hostAndPort . toString ( ) ) ; <nl> + if ( shard ) { <nl> + return { ErrorCodes : : OperationFailed , <nl> + str : : stream ( ) < < " ' " < < hostAndPort . toString ( ) < < " ' " <nl> + < < " is already a member of the existing shard ' " <nl> + < < shard - > getConnString ( ) . toString ( ) <nl> + < < " ' ( " <nl> + < < shard - > getId ( ) <nl> + < < " ) . " } ; <nl> + } <nl> + } <nl> + <nl> + / / Check for mongos and older version mongod connections , and whether the hosts <nl> + / / can be found for the user specified replset . <nl> + auto swCommandResponse = <nl> + _runCommandForAddShard ( txn , targeter . get ( ) , " admin " , BSON ( " isMaster " < < 1 ) ) ; <nl> + if ( ! swCommandResponse . isOK ( ) ) { <nl> + if ( swCommandResponse . getStatus ( ) = = ErrorCodes : : RPCProtocolNegotiationFailed ) { <nl> + / / Mongos to mongos commands are no longer supported in the wire protocol <nl> + / / ( because mongos does not support OP_COMMAND ) , similarly for a new mongos <nl> + / / and an old mongod . So the call will fail in such cases . <nl> + / / TODO : If / When mongos ever supports opCommands , this logic will break because <nl> + / / cmdStatus will be OK . <nl> + return { ErrorCodes : : RPCProtocolNegotiationFailed , <nl> + str : : stream ( ) < < shardConn - > toString ( ) <nl> + < < " does not recognize the RPC protocol being used . This is " <nl> + < < " likely because it contains a node that is a mongos or an old " <nl> + < < " version of mongod . " } ; <nl> + } else { <nl> + return swCommandResponse . getStatus ( ) ; <nl> + } <nl> + } <nl> + <nl> + / / Check for a command response error <nl> + auto resIsMasterStatus = std : : move ( swCommandResponse . getValue ( ) . commandStatus ) ; <nl> + if ( ! resIsMasterStatus . isOK ( ) ) { <nl> + return { resIsMasterStatus . code ( ) , <nl> + str : : stream ( ) < < " Error running isMaster against " < < shardConn - > toString ( ) < < " : " <nl> + < < causedBy ( resIsMasterStatus ) } ; <nl> + } <nl> + <nl> + auto resIsMaster = std : : move ( swCommandResponse . getValue ( ) . response ) ; <nl> + <nl> + / / Check whether there is a master . If there isn ' t , the replica set may not have been <nl> + / / initiated . If the connection is a standalone , it will return true for isMaster . <nl> + bool isMaster ; <nl> + Status status = bsonExtractBooleanField ( resIsMaster , " ismaster " , & isMaster ) ; <nl> + if ( ! status . isOK ( ) ) { <nl> + return Status ( status . code ( ) , <nl> + str : : stream ( ) < < " isMaster returned invalid ' ismaster ' " <nl> + < < " field when attempting to add " <nl> + < < connectionString . toString ( ) <nl> + < < " as a shard : " <nl> + < < status . reason ( ) ) ; <nl> + } <nl> + if ( ! isMaster ) { <nl> + return { ErrorCodes : : NotMaster , <nl> + str : : stream ( ) <nl> + < < connectionString . toString ( ) <nl> + < < " does not have a master . If this is a replica set , ensure that it has a " <nl> + < < " healthy primary and that the set has been properly initiated . " } ; <nl> + } <nl> + <nl> + const string providedSetName = connectionString . getSetName ( ) ; <nl> + const string foundSetName = resIsMaster [ " setName " ] . str ( ) ; <nl> + <nl> + / / Make sure the specified replica set name ( if any ) matches the actual shard ' s replica set <nl> + if ( providedSetName . empty ( ) & & ! foundSetName . empty ( ) ) { <nl> + return { ErrorCodes : : OperationFailed , <nl> + str : : stream ( ) < < " host is part of set " < < foundSetName < < " ; " <nl> + < < " use replica set url format " <nl> + < < " < setname > / < server1 > , < server2 > , . . . " } ; <nl> + } <nl> + <nl> + if ( ! providedSetName . empty ( ) & & foundSetName . empty ( ) ) { <nl> + return { ErrorCodes : : OperationFailed , <nl> + str : : stream ( ) < < " host did not return a set name ; " <nl> + < < " is the replica set still initializing ? " <nl> + < < resIsMaster } ; <nl> + } <nl> + <nl> + / / Make sure the set name specified in the connection string matches the one where its hosts <nl> + / / belong into <nl> + if ( ! providedSetName . empty ( ) & & ( providedSetName ! = foundSetName ) ) { <nl> + return { ErrorCodes : : OperationFailed , <nl> + str : : stream ( ) < < " the provided connection string ( " < < connectionString . toString ( ) <nl> + < < " ) does not match the actual set name " <nl> + < < foundSetName } ; <nl> + } <nl> + <nl> + / / Is it a config server ? <nl> + if ( resIsMaster . hasField ( " configsvr " ) ) { <nl> + return { ErrorCodes : : OperationFailed , <nl> + str : : stream ( ) < < " Cannot add " < < connectionString . toString ( ) <nl> + < < " as a shard since it is a config server " } ; <nl> + } <nl> + <nl> + / / If the shard is part of a replica set , make sure all the hosts mentioned in the connection <nl> + / / string are part of the set . It is fine if not all members of the set are mentioned in the <nl> + / / connection string , though . <nl> + if ( ! providedSetName . empty ( ) ) { <nl> + std : : set < string > hostSet ; <nl> + <nl> + BSONObjIterator iter ( resIsMaster [ " hosts " ] . Obj ( ) ) ; <nl> + while ( iter . more ( ) ) { <nl> + hostSet . insert ( iter . next ( ) . String ( ) ) ; / / host : port <nl> + } <nl> + <nl> + if ( resIsMaster [ " passives " ] . isABSONObj ( ) ) { <nl> + BSONObjIterator piter ( resIsMaster [ " passives " ] . Obj ( ) ) ; <nl> + while ( piter . more ( ) ) { <nl> + hostSet . insert ( piter . next ( ) . String ( ) ) ; / / host : port <nl> + } <nl> + } <nl> + <nl> + if ( resIsMaster [ " arbiters " ] . isABSONObj ( ) ) { <nl> + BSONObjIterator piter ( resIsMaster [ " arbiters " ] . Obj ( ) ) ; <nl> + while ( piter . more ( ) ) { <nl> + hostSet . insert ( piter . next ( ) . String ( ) ) ; / / host : port <nl> + } <nl> + } <nl> + <nl> + vector < HostAndPort > hosts = connectionString . getServers ( ) ; <nl> + for ( size_t i = 0 ; i < hosts . size ( ) ; i + + ) { <nl> + const string host = hosts [ i ] . toString ( ) ; / / host : port <nl> + if ( hostSet . find ( host ) = = hostSet . end ( ) ) { <nl> + return { ErrorCodes : : OperationFailed , <nl> + str : : stream ( ) < < " in seed list " < < connectionString . toString ( ) < < " , host " <nl> + < < host <nl> + < < " does not belong to replica set " <nl> + < < foundSetName <nl> + < < " ; found " <nl> + < < resIsMaster . toString ( ) } ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + string actualShardName ; <nl> + <nl> + if ( shardProposedName ) { <nl> + actualShardName = * shardProposedName ; <nl> + } else if ( ! foundSetName . empty ( ) ) { <nl> + / / Default it to the name of the replica set <nl> + actualShardName = foundSetName ; <nl> + } <nl> + <nl> + / / Disallow adding shard replica set with name ' config ' <nl> + if ( actualShardName = = " config " ) { <nl> + return { ErrorCodes : : BadValue , " use of shard replica set with name ' config ' is not allowed " } ; <nl> + } <nl> + <nl> + / / Retrieve the most up to date connection string that we know from the replica set monitor ( if <nl> + / / this is a replica set shard , otherwise it will be the same value as connectionString ) . <nl> + ConnectionString actualShardConnStr = shardConn - > getTargeter ( ) - > connectionString ( ) ; <nl> + <nl> + ShardType shard ; <nl> + shard . setName ( actualShardName ) ; <nl> + shard . setHost ( actualShardConnStr . toString ( ) ) ; <nl> + <nl> + return shard ; <nl> + } <nl> + <nl> + StatusWith < std : : vector < std : : string > > ShardingCatalogManagerImpl : : _getDBNamesListFromShard ( <nl> + OperationContext * txn , ShardRegistry * shardRegistry , const ConnectionString & connectionString ) { <nl> + / / TODO : Don ' t create a detached Shard object , create a detached RemoteCommandTargeter instead . <nl> + const std : : shared_ptr < Shard > shardConn { <nl> + shardRegistry - > createConnection ( connectionString ) . release ( ) } ; <nl> + invariant ( shardConn ) ; <nl> + <nl> + auto swCommandResponse = _runCommandForAddShard ( <nl> + txn , shardConn - > getTargeter ( ) . get ( ) , " admin " , BSON ( " listDatabases " < < 1 ) ) ; <nl> + if ( ! swCommandResponse . isOK ( ) ) { <nl> + return swCommandResponse . getStatus ( ) ; <nl> + } <nl> + <nl> + auto cmdStatus = std : : move ( swCommandResponse . getValue ( ) . commandStatus ) ; <nl> + if ( ! cmdStatus . isOK ( ) ) { <nl> + return cmdStatus ; <nl> + } <nl> + <nl> + auto cmdResult = std : : move ( swCommandResponse . getValue ( ) . response ) ; <nl> + <nl> + vector < string > dbNames ; <nl> + <nl> + for ( const auto & dbEntry : cmdResult [ " databases " ] . Obj ( ) ) { <nl> + const string & dbName = dbEntry [ " name " ] . String ( ) ; <nl> + <nl> + if ( ! ( dbName = = " local " | | dbName = = " admin " ) ) { <nl> + dbNames . push_back ( dbName ) ; <nl> + } <nl> + } <nl> + <nl> + return dbNames ; <nl> + } <nl> + <nl> + StatusWith < std : : string > ShardingCatalogManagerImpl : : _generateNewShardName ( OperationContext * txn ) { <nl> + BSONObjBuilder shardNameRegex ; <nl> + shardNameRegex . appendRegex ( ShardType : : name ( ) , " ^ shard " ) ; <nl> + <nl> + auto findStatus = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + txn , <nl> + kConfigReadSelector , <nl> + NamespaceString ( ShardType : : ConfigNS ) , <nl> + shardNameRegex . obj ( ) , <nl> + BSON ( ShardType : : name ( ) < < - 1 ) , <nl> + 1 ) ; <nl> + if ( ! findStatus . isOK ( ) ) { <nl> + return findStatus . getStatus ( ) ; <nl> + } <nl> + <nl> + const auto & docs = findStatus . getValue ( ) . docs ; <nl> + <nl> + int count = 0 ; <nl> + if ( ! docs . empty ( ) ) { <nl> + const auto shardStatus = ShardType : : fromBSON ( docs . front ( ) ) ; <nl> + if ( ! shardStatus . isOK ( ) ) { <nl> + return shardStatus . getStatus ( ) ; <nl> + } <nl> + <nl> + std : : istringstream is ( shardStatus . getValue ( ) . getName ( ) . substr ( 5 ) ) ; <nl> + is > > count ; <nl> + count + + ; <nl> + } <nl> + <nl> + / / TODO fix so that we can have more than 10000 automatically generated shard names <nl> + if ( count < 9999 ) { <nl> + std : : stringstream ss ; <nl> + ss < < " shard " < < std : : setfill ( ' 0 ' ) < < std : : setw ( 4 ) < < count ; <nl> + return ss . str ( ) ; <nl> + } <nl> + <nl> + return Status ( ErrorCodes : : OperationFailed , " unable to generate new shard name " ) ; <nl> + } <nl> + <nl> + StatusWith < string > ShardingCatalogManagerImpl : : addShard ( <nl> + OperationContext * txn , <nl> + const std : : string * shardProposedName , <nl> + const ConnectionString & shardConnectionString , <nl> + const long long maxSize ) { <nl> + / / Validate the specified connection string may serve as shard at all <nl> + auto shardStatus = <nl> + _validateHostAsShard ( txn , grid . shardRegistry ( ) , shardConnectionString , shardProposedName ) ; <nl> + if ( ! shardStatus . isOK ( ) ) { <nl> + / / TODO : This is a workaround for the case were we could have some bad shard being <nl> + / / requested to be added and we put that bad connection string on the global replica set <nl> + / / monitor registry . It needs to be cleaned up so that when a correct replica set is added , <nl> + / / it will be recreated . <nl> + ReplicaSetMonitor : : remove ( shardConnectionString . getSetName ( ) ) ; <nl> + return shardStatus . getStatus ( ) ; <nl> + } <nl> + <nl> + ShardType & shardType = shardStatus . getValue ( ) ; <nl> + <nl> + auto dbNamesStatus = _getDBNamesListFromShard ( txn , grid . shardRegistry ( ) , shardConnectionString ) ; <nl> + if ( ! dbNamesStatus . isOK ( ) ) { <nl> + return dbNamesStatus . getStatus ( ) ; <nl> + } <nl> + <nl> + / / Check that none of the existing shard candidate ' s dbs exist already <nl> + for ( const string & dbName : dbNamesStatus . getValue ( ) ) { <nl> + auto dbt = _catalogClient - > getDatabase ( txn , dbName ) ; <nl> + if ( dbt . isOK ( ) ) { <nl> + const auto & dbDoc = dbt . getValue ( ) . value ; <nl> + return Status ( ErrorCodes : : OperationFailed , <nl> + str : : stream ( ) < < " can ' t add shard " <nl> + < < " ' " <nl> + < < shardConnectionString . toString ( ) <nl> + < < " ' " <nl> + < < " because a local database ' " <nl> + < < dbName <nl> + < < " ' exists in another " <nl> + < < dbDoc . getPrimary ( ) ) ; <nl> + } else if ( dbt ! = ErrorCodes : : NamespaceNotFound ) { <nl> + return dbt . getStatus ( ) ; <nl> + } <nl> + } <nl> + <nl> + / / If a name for a shard wasn ' t provided , generate one <nl> + if ( shardType . getName ( ) . empty ( ) ) { <nl> + StatusWith < string > result = _generateNewShardName ( txn ) ; <nl> + if ( ! result . isOK ( ) ) { <nl> + return result . getStatus ( ) ; <nl> + } <nl> + shardType . setName ( result . getValue ( ) ) ; <nl> + } <nl> + <nl> + if ( maxSize > 0 ) { <nl> + shardType . setMaxSizeMB ( maxSize ) ; <nl> + } <nl> + <nl> + ShardIdentityType shardIdentity ; <nl> + shardIdentity . setConfigsvrConnString ( <nl> + Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigServerConnectionString ( ) ) ; <nl> + shardIdentity . setShardName ( shardType . getName ( ) ) ; <nl> + shardIdentity . setClusterId ( Grid : : get ( txn ) - > shardRegistry ( ) - > getClusterId ( ) ) ; <nl> + auto validateStatus = shardIdentity . validate ( ) ; <nl> + if ( ! validateStatus . isOK ( ) ) { <nl> + return validateStatus ; <nl> + } <nl> + <nl> + log ( ) < < " going to insert shardIdentity document into shard : " < < shardIdentity . toString ( ) ; <nl> + <nl> + auto updateRequest = shardIdentity . createUpsertForAddShard ( ) ; <nl> + BatchedCommandRequest commandRequest ( updateRequest . release ( ) ) ; <nl> + commandRequest . setNS ( NamespaceString : : kConfigCollectionNamespace ) ; <nl> + commandRequest . setWriteConcern ( kMajorityWriteConcern . toBSON ( ) ) ; <nl> + <nl> + const std : : shared_ptr < Shard > shardConn { <nl> + Grid : : get ( txn ) - > shardRegistry ( ) - > createConnection ( shardConnectionString ) } ; <nl> + invariant ( shardConn ) ; <nl> + auto targeter = shardConn - > getTargeter ( ) ; <nl> + <nl> + auto swCommandResponse = <nl> + _runCommandForAddShard ( txn , targeter . get ( ) , " admin " , commandRequest . toBSON ( ) ) ; <nl> + <nl> + if ( ! swCommandResponse . isOK ( ) ) { <nl> + return swCommandResponse . getStatus ( ) ; <nl> + } <nl> + <nl> + auto commandResponse = std : : move ( swCommandResponse . getValue ( ) ) ; <nl> + <nl> + BatchedCommandResponse batchResponse ; <nl> + auto batchResponseStatus = _processBatchWriteResponse ( commandResponse , & batchResponse ) ; <nl> + if ( ! batchResponseStatus . isOK ( ) ) { <nl> + return batchResponseStatus ; <nl> + } <nl> + <nl> + log ( ) < < " going to insert new entry for shard into config . shards : " < < shardType . toString ( ) ; <nl> + <nl> + Status result = <nl> + _catalogClient - > insertConfigDocument ( txn , ShardType : : ConfigNS , shardType . toBSON ( ) ) ; <nl> + if ( ! result . isOK ( ) ) { <nl> + log ( ) < < " error adding shard : " < < shardType . toBSON ( ) < < " err : " < < result . reason ( ) ; <nl> + if ( result = = ErrorCodes : : DuplicateKey ) { <nl> + / / TODO ( SERVER - 24213 ) : adding a shard that already exists should be considered success , <nl> + / / however this approach does no validation that we are adding the shard with the same <nl> + / / options . It also does not protect against adding the same shard with a different <nl> + / / shard name and slightly different connection string . This is a temporary hack to <nl> + / / get the continuous stepdown suite passing . <nl> + warning ( ) < < " Received duplicate key error when inserting new shard with name " <nl> + < < shardType . getName ( ) < < " and connection string " <nl> + < < shardConnectionString . toString ( ) <nl> + < < " to config . shards collection . This most likely means that there was an " <nl> + " attempt to add a shard that already exists in the cluster " ; <nl> + return shardType . getName ( ) ; <nl> + } <nl> + return result ; <nl> + } <nl> + <nl> + / / Add all databases which were discovered on the new shard <nl> + for ( const string & dbName : dbNamesStatus . getValue ( ) ) { <nl> + DatabaseType dbt ; <nl> + dbt . setName ( dbName ) ; <nl> + dbt . setPrimary ( shardType . getName ( ) ) ; <nl> + dbt . setSharded ( false ) ; <nl> + <nl> + Status status = _catalogClient - > updateDatabase ( txn , dbName , dbt ) ; <nl> + if ( ! status . isOK ( ) ) { <nl> + log ( ) < < " adding shard " < < shardConnectionString . toString ( ) <nl> + < < " even though could not add database " < < dbName ; <nl> + } <nl> + } <nl> + <nl> + / / Record in changelog <nl> + BSONObjBuilder shardDetails ; <nl> + shardDetails . append ( " name " , shardType . getName ( ) ) ; <nl> + shardDetails . append ( " host " , shardConnectionString . toString ( ) ) ; <nl> + <nl> + _catalogClient - > logChange ( txn , " addShard " , " " , shardDetails . obj ( ) ) ; <nl> + <nl> + / / Ensure the added shard is visible to this process . <nl> + auto shardRegistry = Grid : : get ( txn ) - > shardRegistry ( ) ; <nl> + if ( ! shardRegistry - > getShard ( txn , shardType . getName ( ) ) ) { <nl> + return { ErrorCodes : : OperationFailed , <nl> + " Could not find shard metadata for shard after adding it . This most likely " <nl> + " indicates that the shard was removed immediately after it was added . " } ; <nl> + } <nl> + <nl> + return shardType . getName ( ) ; <nl> + } <nl> + <nl> + void ShardingCatalogManagerImpl : : appendConnectionStats ( executor : : ConnectionPoolStats * stats ) { <nl> + _executorForAddShard - > appendConnectionStats ( stats ) ; <nl> + } <nl> + <nl> + } / / namespace mongo <nl> new file mode 100644 <nl> index 000000000000 . . 7c2bbd05479f <nl> mmm / dev / null <nl> ppp b / src / mongo / s / catalog / replset / sharding_catalog_manager_impl . h <nl> <nl> + / * * <nl> + * Copyright ( C ) 2015 MongoDB Inc . <nl> + * <nl> + * This program is free software : you can redistribute it and / or modify <nl> + * it under the terms of the GNU Affero General Public License , version 3 , <nl> + * as published by the Free Software Foundation . <nl> + * <nl> + * This program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * GNU Affero General Public License for more details . <nl> + * <nl> + * You should have received a copy of the GNU Affero General Public License <nl> + * along with this program . If not , see < http : / / www . gnu . org / licenses / > . <nl> + * <nl> + * As a special exception , the copyright holders give permission to link the <nl> + * code of portions of this program with the OpenSSL library under certain <nl> + * conditions as described in each individual source file and distribute <nl> + * linked combinations including the program with the OpenSSL library . You <nl> + * must comply with the GNU Affero General Public License in all respects for <nl> + * all of the code used other than as permitted herein . If you modify file ( s ) <nl> + * with this exception , you may extend this exception to your version of the <nl> + * file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> + * delete this exception statement from your version . If you delete this <nl> + * exception statement from all source files in the program , then also delete <nl> + * it in the license file . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # include < vector > <nl> + <nl> + # include " mongo / s / catalog / sharding_catalog_manager . h " <nl> + # include " mongo / s / client / shard_registry . h " <nl> + # include " mongo / stdx / mutex . h " <nl> + <nl> + namespace mongo { <nl> + <nl> + class DatabaseType ; <nl> + class ShardingCatalogClient ; <nl> + <nl> + namespace executor { <nl> + class TaskExecutor ; <nl> + } / / namespace executor <nl> + <nl> + / * * <nl> + * Implements the catalog manager for writing to replica set config servers . <nl> + * / <nl> + class ShardingCatalogManagerImpl final : public ShardingCatalogManager { <nl> + public : <nl> + ShardingCatalogManagerImpl ( ShardingCatalogClient * catalogClient , <nl> + std : : unique_ptr < executor : : TaskExecutor > addShardExecutor ) ; <nl> + virtual ~ ShardingCatalogManagerImpl ( ) ; <nl> + <nl> + / * * <nl> + * Safe to call multiple times as long as the calls are externally synchronized to be <nl> + * non - overlapping . <nl> + * / <nl> + Status startup ( ) override ; <nl> + <nl> + void shutDown ( OperationContext * txn ) override ; <nl> + <nl> + StatusWith < std : : string > addShard ( OperationContext * txn , <nl> + const std : : string * shardProposedName , <nl> + const ConnectionString & shardConnectionString , <nl> + const long long maxSize ) override ; <nl> + <nl> + void appendConnectionStats ( executor : : ConnectionPoolStats * stats ) override ; <nl> + <nl> + private : <nl> + / * * <nl> + * Generates a unique name to be given to a newly added shard . <nl> + * / <nl> + StatusWith < std : : string > _generateNewShardName ( OperationContext * txn ) ; <nl> + <nl> + / * * <nl> + * Validates that the specified connection string can serve as a shard server . In particular , <nl> + * this function checks that the shard can be contacted , that it is not already member of <nl> + * another sharded cluster and etc . <nl> + * <nl> + * @ param shardRegistry Shard registry to use for getting a targeter to the shard - to - be . <nl> + * @ param connectionString Connection string to be attempted as a shard host . <nl> + * @ param shardProposedName Optional proposed name for the shard . Can be omitted in which case <nl> + * a unique name for the shard will be generated from the shard ' s connection string . If it <nl> + * is not omitted , the value cannot be the empty string . <nl> + * <nl> + * On success returns a partially initialized ShardType object corresponding to the requested <nl> + * shard . It will have the hostName field set and optionally the name , if the name could be <nl> + * generated from either the proposed name or the connection string set name . The returned <nl> + * shard ' s name should be checked and if empty , one should be generated using some uniform <nl> + * algorithm . <nl> + * / <nl> + StatusWith < ShardType > _validateHostAsShard ( OperationContext * txn , <nl> + ShardRegistry * shardRegistry , <nl> + const ConnectionString & connectionString , <nl> + const std : : string * shardProposedName ) ; <nl> + <nl> + / * * <nl> + * Runs the listDatabases command on the specified host and returns the names of all databases <nl> + * it returns excluding those named local and admin , since they serve administrative purpose . <nl> + * / <nl> + StatusWith < std : : vector < std : : string > > _getDBNamesListFromShard ( <nl> + OperationContext * txn , <nl> + ShardRegistry * shardRegistry , <nl> + const ConnectionString & connectionString ) ; <nl> + <nl> + / * * <nl> + * Runs a command against a " shard " that is not yet in the cluster and thus not present in the <nl> + * ShardRegistry . <nl> + * / <nl> + StatusWith < Shard : : CommandResponse > _runCommandForAddShard ( OperationContext * txn , <nl> + RemoteCommandTargeter * targeter , <nl> + const std : : string & dbName , <nl> + const BSONObj & cmdObj ) ; <nl> + <nl> + <nl> + / / <nl> + / / All member variables are labeled with one of the following codes indicating the <nl> + / / synchronization rules for accessing them . <nl> + / / <nl> + / / ( M ) Must hold _mutex for access . <nl> + / / ( R ) Read only , can only be written during initialization . <nl> + / / ( S ) Self - synchronizing ; access in any way from any context . <nl> + / / <nl> + <nl> + stdx : : mutex _mutex ; <nl> + <nl> + / / Pointer to the ShardingCatalogClient that can be used to read config server data . <nl> + / / This pointer is not owned , so it is important that the object it points to continues to be <nl> + / / valid for the lifetime of this ShardingCatalogManager . <nl> + ShardingCatalogClient * _catalogClient ; / / ( R ) <nl> + <nl> + / / Executor specifically used for sending commands to servers that are in the process of being <nl> + / / added as shards . Does not have any connection hook set on it , thus it can be used to talk <nl> + / / to servers that are not yet in the ShardRegistry . <nl> + std : : unique_ptr < executor : : TaskExecutor > _executorForAddShard ; / / ( R ) <nl> + <nl> + / / True if shutDown ( ) has been called . False , otherwise . <nl> + bool _inShutdown = false ; / / ( M ) <nl> + <nl> + / / True if startup ( ) has been called . <nl> + bool _started = false ; / / ( M ) <nl> + } ; <nl> + <nl> + } / / namespace mongo <nl> mmm a / src / mongo / s / catalog / sharding_catalog_client . h <nl> ppp b / src / mongo / s / catalog / sharding_catalog_client . h <nl> class ShardingCatalogClient { <nl> <nl> / * * <nl> * Performs implementation - specific startup tasks . Must be run after the catalog client <nl> - * has been installed into the global ' grid ' object . Implementation do not need to guarantee <nl> + * has been installed into the global ' grid ' object . Implementations do not need to guarantee <nl> * thread safety so callers should employ proper synchronization when calling this method . <nl> * / <nl> virtual Status startup ( ) = 0 ; <nl> class ShardingCatalogClient { <nl> const std : : vector < BSONObj > & initPoints , <nl> const std : : set < ShardId > & initShardIds ) = 0 ; <nl> <nl> - / * * <nl> - * <nl> - * Adds a new shard . It expects a standalone mongod process or replica set to be running <nl> - * on the provided address . <nl> - * <nl> - * @ param shardProposedName is an optional string with the proposed name of the shard . <nl> - * If it is nullptr , a name will be automatically generated ; if not nullptr , it cannot <nl> - * contain the empty string . <nl> - * @ param shardConnectionString is the connection string of the shard being added . <nl> - * @ param maxSize is the optional space quota in bytes . Zeros means there ' s <nl> - * no limitation to space usage . <nl> - * @ return either an ! OK status or the name of the newly added shard . <nl> - * / <nl> - virtual StatusWith < std : : string > addShard ( OperationContext * txn , <nl> - const std : : string * shardProposedName , <nl> - const ConnectionString & shardConnectionString , <nl> - const long long maxSize ) = 0 ; <nl> - <nl> / * * <nl> * Tries to remove a shard . To completely remove a shard from a sharded cluster , <nl> * the data residing in that shard must be moved to the remaining shards in the <nl> class ShardingCatalogClient { <nl> virtual Status appendInfoForConfigServerDatabases ( OperationContext * txn , <nl> BSONArrayBuilder * builder ) = 0 ; <nl> <nl> - / * * <nl> - * Append information about the connection pools owned by the CatalogClient . <nl> - * / <nl> - virtual void appendConnectionStats ( executor : : ConnectionPoolStats * stats ) = 0 ; <nl> - <nl> <nl> virtual StatusWith < DistLockManager : : ScopedDistLock > distLock ( <nl> OperationContext * txn , <nl> mmm a / src / mongo / s / catalog / sharding_catalog_client_mock . cpp <nl> ppp b / src / mongo / s / catalog / sharding_catalog_client_mock . cpp <nl> Status ShardingCatalogClientMock : : shardCollection ( OperationContext * txn , <nl> return { ErrorCodes : : InternalError , " Method not implemented " } ; <nl> } <nl> <nl> - StatusWith < string > ShardingCatalogClientMock : : addShard ( <nl> - OperationContext * txn , <nl> - const std : : string * shardProposedName , <nl> - const ConnectionString & shardConnectionString , <nl> - const long long maxSize ) { <nl> - return { ErrorCodes : : InternalError , " Method not implemented " } ; <nl> - } <nl> - <nl> StatusWith < ShardDrainingStatus > ShardingCatalogClientMock : : removeShard ( OperationContext * txn , <nl> const string & name ) { <nl> return ShardDrainingStatus : : COMPLETED ; <nl> Status ShardingCatalogClientMock : : appendInfoForConfigServerDatabases ( OperationCo <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> - void ShardingCatalogClientMock : : appendConnectionStats ( executor : : ConnectionPoolStats * stats ) { } <nl> - <nl> } / / namespace mongo <nl> mmm a / src / mongo / s / catalog / sharding_catalog_client_mock . h <nl> ppp b / src / mongo / s / catalog / sharding_catalog_client_mock . h <nl> class ShardingCatalogClientMock : public ShardingCatalogClient { <nl> const std : : vector < BSONObj > & initPoints , <nl> const std : : set < ShardId > & initShardIds ) override ; <nl> <nl> - StatusWith < std : : string > addShard ( OperationContext * txn , <nl> - const std : : string * shardProposedName , <nl> - const ConnectionString & shardConnectionString , <nl> - const long long maxSize ) override ; <nl> - <nl> StatusWith < ShardDrainingStatus > removeShard ( OperationContext * txn , <nl> const std : : string & name ) override ; <nl> <nl> class ShardingCatalogClientMock : public ShardingCatalogClient { <nl> Status appendInfoForConfigServerDatabases ( OperationContext * txn , <nl> BSONArrayBuilder * builder ) override ; <nl> <nl> - void appendConnectionStats ( executor : : ConnectionPoolStats * stats ) override ; <nl> - <nl> private : <nl> std : : unique_ptr < DistLockManagerMock > _mockDistLockMgr ; <nl> } ; <nl> new file mode 100644 <nl> index 000000000000 . . 2ac9413128fb <nl> mmm / dev / null <nl> ppp b / src / mongo / s / catalog / sharding_catalog_manager . h <nl> <nl> + / * * <nl> + * Copyright ( C ) 2015 MongoDB Inc . <nl> + * <nl> + * This program is free software : you can redistribute it and / or modify <nl> + * it under the terms of the GNU Affero General Public License , version 3 , <nl> + * as published by the Free Software Foundation . <nl> + * <nl> + * This program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * GNU Affero General Public License for more details . <nl> + * <nl> + * You should have received a copy of the GNU Affero General Public License <nl> + * along with this program . If not , see < http : / / www . gnu . org / licenses / > . <nl> + * <nl> + * As a special exception , the copyright holders give permission to link the <nl> + * code of portions of this program with the OpenSSL library under certain <nl> + * conditions as described in each individual source file and distribute <nl> + * linked combinations including the program with the OpenSSL library . You <nl> + * must comply with the GNU Affero General Public License in all respects for <nl> + * all of the code used other than as permitted herein . If you modify file ( s ) <nl> + * with this exception , you may extend this exception to your version of the <nl> + * file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> + * delete this exception statement from your version . If you delete this <nl> + * exception statement from all source files in the program , then also delete <nl> + * it in the license file . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # include < string > <nl> + <nl> + # include " mongo / base / disallow_copying . h " <nl> + <nl> + namespace mongo { <nl> + <nl> + class ConnectionString ; <nl> + class OperationContext ; <nl> + class Status ; <nl> + template < typename T > <nl> + class StatusWith ; <nl> + <nl> + namespace executor { <nl> + struct ConnectionPoolStats ; <nl> + } <nl> + <nl> + / * * <nl> + * Abstracts writes of the sharding catalog metadata . <nl> + * <nl> + * All implementations of this interface should go directly to the persistent backing store <nl> + * and should avoid doing any caching of their own . The caching is delegated to a parallel <nl> + * read - only view of the catalog , which is maintained by a higher level code . <nl> + * <nl> + * TODO : Currently the code responsible for writing the sharding catalog metadata is split between <nl> + * this class and ShardingCatalogClient . Eventually all methods that write catalog data should be <nl> + * moved out of ShardingCatalogClient and into ShardingCatalogManager , here . <nl> + * / <nl> + class ShardingCatalogManager { <nl> + MONGO_DISALLOW_COPYING ( ShardingCatalogManager ) ; <nl> + <nl> + public : <nl> + virtual ~ ShardingCatalogManager ( ) = default ; <nl> + <nl> + / * * <nl> + * Performs implementation - specific startup tasks . Must be run after the catalog manager <nl> + * has been installed into the global ' grid ' object . Implementations do not need to guarantee <nl> + * thread safety so callers should employ proper synchronization when calling this method . <nl> + * / <nl> + virtual Status startup ( ) = 0 ; <nl> + <nl> + / * * <nl> + * Performs necessary cleanup when shutting down cleanly . <nl> + * / <nl> + virtual void shutDown ( OperationContext * txn ) = 0 ; <nl> + <nl> + / * * <nl> + * <nl> + * Adds a new shard . It expects a standalone mongod process or replica set to be running <nl> + * on the provided address . <nl> + * <nl> + * @ param shardProposedName is an optional string with the proposed name of the shard . <nl> + * If it is nullptr , a name will be automatically generated ; if not nullptr , it cannot <nl> + * contain the empty string . <nl> + * @ param shardConnectionString is the connection string of the shard being added . <nl> + * @ param maxSize is the optional space quota in bytes . Zeros means there ' s <nl> + * no limitation to space usage . <nl> + * @ return either an ! OK status or the name of the newly added shard . <nl> + * / <nl> + virtual StatusWith < std : : string > addShard ( OperationContext * txn , <nl> + const std : : string * shardProposedName , <nl> + const ConnectionString & shardConnectionString , <nl> + const long long maxSize ) = 0 ; <nl> + <nl> + / * * <nl> + * Append information about the connection pools owned by the CatalogManager . <nl> + * / <nl> + virtual void appendConnectionStats ( executor : : ConnectionPoolStats * stats ) = 0 ; <nl> + <nl> + protected : <nl> + ShardingCatalogManager ( ) = default ; <nl> + } ; <nl> + <nl> + } / / namespace mongo <nl> new file mode 100644 <nl> index 000000000000 . . 1768a1a99258 <nl> mmm / dev / null <nl> ppp b / src / mongo / s / catalog / sharding_catalog_manager_mock . cpp <nl> <nl> + / * * <nl> + * Copyright ( C ) 2015 MongoDB Inc . <nl> + * <nl> + * This program is free software : you can redistribute it and / or modify <nl> + * it under the terms of the GNU Affero General Public License , version 3 , <nl> + * as published by the Free Software Foundation . <nl> + * <nl> + * This program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * GNU Affero General Public License for more details . <nl> + * <nl> + * You should have received a copy of the GNU Affero General Public License <nl> + * along with this program . If not , see < http : / / www . gnu . org / licenses / > . <nl> + * <nl> + * As a special exception , the copyright holders give permission to link the <nl> + * code of portions of this program with the OpenSSL library under certain <nl> + * conditions as described in each individual source file and distribute <nl> + * linked combinations including the program with the OpenSSL library . You <nl> + * must comply with the GNU Affero General Public License in all respects for <nl> + * all of the code used other than as permitted herein . If you modify file ( s ) <nl> + * with this exception , you may extend this exception to your version of the <nl> + * file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> + * delete this exception statement from your version . If you delete this <nl> + * exception statement from all source files in the program , then also delete <nl> + * it in the license file . <nl> + * / <nl> + <nl> + # include " mongo / platform / basic . h " <nl> + <nl> + # include " mongo / s / catalog / sharding_catalog_manager_mock . h " <nl> + <nl> + # include " mongo / base / status . h " <nl> + # include " mongo / base / status_with . h " <nl> + <nl> + namespace mongo { <nl> + <nl> + using std : : string ; <nl> + <nl> + ShardingCatalogManagerMock : : ShardingCatalogManagerMock ( ) = default ; <nl> + <nl> + ShardingCatalogManagerMock : : ~ ShardingCatalogManagerMock ( ) = default ; <nl> + <nl> + Status ShardingCatalogManagerMock : : startup ( ) { <nl> + return { ErrorCodes : : InternalError , " Method not implemented " } ; <nl> + } <nl> + <nl> + void ShardingCatalogManagerMock : : shutDown ( OperationContext * txn ) { } <nl> + <nl> + StatusWith < string > ShardingCatalogManagerMock : : addShard ( <nl> + OperationContext * txn , <nl> + const std : : string * shardProposedName , <nl> + const ConnectionString & shardConnectionString , <nl> + const long long maxSize ) { <nl> + return { ErrorCodes : : InternalError , " Method not implemented " } ; <nl> + } <nl> + <nl> + void ShardingCatalogManagerMock : : appendConnectionStats ( executor : : ConnectionPoolStats * stats ) { } <nl> + <nl> + } / / namespace mongo <nl> new file mode 100644 <nl> index 000000000000 . . a56681e37fa8 <nl> mmm / dev / null <nl> ppp b / src / mongo / s / catalog / sharding_catalog_manager_mock . h <nl> <nl> + / * * <nl> + * Copyright ( C ) 2015 MongoDB Inc . <nl> + * <nl> + * This program is free software : you can redistribute it and / or modify <nl> + * it under the terms of the GNU Affero General Public License , version 3 , <nl> + * as published by the Free Software Foundation . <nl> + * <nl> + * This program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * GNU Affero General Public License for more details . <nl> + * <nl> + * You should have received a copy of the GNU Affero General Public License <nl> + * along with this program . If not , see < http : / / www . gnu . org / licenses / > . <nl> + * <nl> + * As a special exception , the copyright holders give permission to link the <nl> + * code of portions of this program with the OpenSSL library under certain <nl> + * conditions as described in each individual source file and distribute <nl> + * linked combinations including the program with the OpenSSL library . You <nl> + * must comply with the GNU Affero General Public License in all respects for <nl> + * all of the code used other than as permitted herein . If you modify file ( s ) <nl> + * with this exception , you may extend this exception to your version of the <nl> + * file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> + * delete this exception statement from your version . If you delete this <nl> + * exception statement from all source files in the program , then also delete <nl> + * it in the license file . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # include " mongo / s / catalog / sharding_catalog_manager . h " <nl> + <nl> + namespace mongo { <nl> + <nl> + / * * <nl> + * A dummy implementation of ShardingCatalogManager for testing purposes . <nl> + * / <nl> + class ShardingCatalogManagerMock : public ShardingCatalogManager { <nl> + public : <nl> + ShardingCatalogManagerMock ( ) ; <nl> + ~ ShardingCatalogManagerMock ( ) ; <nl> + <nl> + Status startup ( ) override ; <nl> + <nl> + void shutDown ( OperationContext * txn ) override ; <nl> + <nl> + StatusWith < std : : string > addShard ( OperationContext * txn , <nl> + const std : : string * shardProposedName , <nl> + const ConnectionString & shardConnectionString , <nl> + const long long maxSize ) override ; <nl> + <nl> + void appendConnectionStats ( executor : : ConnectionPoolStats * stats ) override ; <nl> + } ; <nl> + <nl> + } / / namespace mongo <nl> mmm a / src / mongo / s / grid . cpp <nl> ppp b / src / mongo / s / grid . cpp <nl> <nl> # include " mongo / s / balancer / balancer_configuration . h " <nl> # include " mongo / s / catalog / catalog_cache . h " <nl> # include " mongo / s / catalog / sharding_catalog_client . h " <nl> + # include " mongo / s / catalog / sharding_catalog_manager . h " <nl> # include " mongo / s / client / shard_factory . h " <nl> # include " mongo / s / client / shard_registry . h " <nl> # include " mongo / s / query / cluster_cursor_manager . h " <nl> Grid * Grid : : get ( OperationContext * operationContext ) { <nl> } <nl> <nl> void Grid : : init ( std : : unique_ptr < ShardingCatalogClient > catalogClient , <nl> + std : : unique_ptr < ShardingCatalogManager > catalogManager , <nl> std : : unique_ptr < CatalogCache > catalogCache , <nl> std : : unique_ptr < ShardRegistry > shardRegistry , <nl> std : : unique_ptr < ClusterCursorManager > cursorManager , <nl> void Grid : : init ( std : : unique_ptr < ShardingCatalogClient > catalogClient , <nl> std : : unique_ptr < executor : : TaskExecutorPool > executorPool , <nl> executor : : NetworkInterface * network ) { <nl> invariant ( ! _catalogClient ) ; <nl> + invariant ( ! _catalogManager ) ; <nl> invariant ( ! _catalogCache ) ; <nl> invariant ( ! _shardRegistry ) ; <nl> invariant ( ! _cursorManager ) ; <nl> void Grid : : init ( std : : unique_ptr < ShardingCatalogClient > catalogClient , <nl> invariant ( ! _network ) ; <nl> <nl> _catalogClient = std : : move ( catalogClient ) ; <nl> + _catalogManager = std : : move ( catalogManager ) ; <nl> _catalogCache = std : : move ( catalogCache ) ; <nl> _shardRegistry = std : : move ( shardRegistry ) ; <nl> _cursorManager = std : : move ( cursorManager ) ; <nl> void Grid : : advanceConfigOpTime ( repl : : OpTime opTime ) { <nl> } <nl> <nl> void Grid : : clearForUnitTests ( ) { <nl> + _catalogManager . reset ( ) ; <nl> _catalogClient . reset ( ) ; <nl> _catalogCache . reset ( ) ; <nl> _shardRegistry . reset ( ) ; <nl> mmm a / src / mongo / s / grid . h <nl> ppp b / src / mongo / s / grid . h <nl> namespace mongo { <nl> class BalancerConfiguration ; <nl> class CatalogCache ; <nl> class ShardingCatalogClient ; <nl> + class ShardingCatalogManager ; <nl> class ClusterCursorManager ; <nl> class OperationContext ; <nl> class ShardRegistry ; <nl> class Grid { <nl> * state using clearForUnitTests . <nl> * / <nl> void init ( std : : unique_ptr < ShardingCatalogClient > catalogClient , <nl> + std : : unique_ptr < ShardingCatalogManager > catalogManager , <nl> std : : unique_ptr < CatalogCache > catalogCache , <nl> std : : unique_ptr < ShardRegistry > shardRegistry , <nl> std : : unique_ptr < ClusterCursorManager > cursorManager , <nl> class Grid { <nl> return _catalogClient . get ( ) ; <nl> } <nl> <nl> + / * * <nl> + * Returns a pointer to a ShardingCatalogManager to use for manipulating catalog data stored on <nl> + * the config servers . <nl> + * / <nl> + ShardingCatalogManager * catalogManager ( ) { <nl> + return _catalogManager . get ( ) ; <nl> + } <nl> + <nl> CatalogCache * catalogCache ( ) const { <nl> return _catalogCache . get ( ) ; <nl> } <nl> class Grid { <nl> <nl> private : <nl> std : : unique_ptr < ShardingCatalogClient > _catalogClient ; <nl> + std : : unique_ptr < ShardingCatalogManager > _catalogManager ; <nl> std : : unique_ptr < CatalogCache > _catalogCache ; <nl> std : : unique_ptr < ShardRegistry > _shardRegistry ; <nl> std : : unique_ptr < ClusterCursorManager > _cursorManager ; <nl> mmm a / src / mongo / s / server . cpp <nl> ppp b / src / mongo / s / server . cpp <nl> <nl> # include " mongo / s / balancer / balancer . h " <nl> # include " mongo / s / balancer / balancer_configuration . h " <nl> # include " mongo / s / catalog / sharding_catalog_client . h " <nl> + # include " mongo / s / catalog / sharding_catalog_manager . h " <nl> # include " mongo / s / catalog / type_chunk . h " <nl> # include " mongo / s / catalog / type_lockpings . h " <nl> # include " mongo / s / catalog / type_locks . h " <nl> static Status initializeSharding ( OperationContext * txn ) { <nl> auto shardFactory = <nl> stdx : : make_unique < ShardFactory > ( std : : move ( buildersMap ) , std : : move ( targeterFactory ) ) ; <nl> <nl> - Status status = <nl> - initializeGlobalShardingState ( mongosGlobalParams . configdbs , std : : move ( shardFactory ) , [ ] ( ) { <nl> - return stdx : : make_unique < rpc : : ShardingEgressMetadataHookForMongos > ( ) ; <nl> + Status status = initializeGlobalShardingState ( <nl> + mongosGlobalParams . configdbs , <nl> + std : : move ( shardFactory ) , <nl> + [ ] ( ) { return stdx : : make_unique < rpc : : ShardingEgressMetadataHookForMongos > ( ) ; } , <nl> + [ ] ( ShardingCatalogClient * catalogClient , std : : unique_ptr < executor : : TaskExecutor > executor ) { <nl> + return nullptr ; / / Only config servers get a real ShardingCatalogManager . <nl> } ) ; <nl> <nl> if ( ! status . isOK ( ) ) { <nl> mmm a / src / mongo / s / sharding_initialization . cpp <nl> ppp b / src / mongo / s / sharding_initialization . cpp <nl> <nl> # include " mongo / s / catalog / replset / dist_lock_catalog_impl . h " <nl> # include " mongo / s / catalog / replset / replset_dist_lock_manager . h " <nl> # include " mongo / s / catalog / replset / sharding_catalog_client_impl . h " <nl> + # include " mongo / s / catalog / replset / sharding_catalog_manager_impl . h " <nl> # include " mongo / s / client / shard_factory . h " <nl> # include " mongo / s / client / shard_registry . h " <nl> # include " mongo / s / client / sharding_network_connection_hook . h " <nl> std : : unique_ptr < ShardingCatalogClient > makeCatalogClient ( ServiceContext * service <nl> ReplSetDistLockManager : : kDistLockPingInterval , <nl> ReplSetDistLockManager : : kDistLockExpirationTime ) ; <nl> <nl> - return stdx : : make_unique < ShardingCatalogClientImpl > ( <nl> - std : : move ( distLockManager ) , <nl> - makeTaskExecutor ( <nl> - executor : : makeNetworkInterface ( " NetworkInterfaceASIO - AddShard - TaskExecutor " ) ) ) ; <nl> + return stdx : : make_unique < ShardingCatalogClientImpl > ( std : : move ( distLockManager ) ) ; <nl> } <nl> <nl> std : : unique_ptr < TaskExecutorPool > makeTaskExecutorPool ( <nl> std : : unique_ptr < TaskExecutorPool > makeTaskExecutorPool ( <nl> <nl> Status initializeGlobalShardingState ( const ConnectionString & configCS , <nl> std : : unique_ptr < ShardFactory > shardFactory , <nl> - rpc : : ShardingEgressMetadataHookBuilder hookBuilder ) { <nl> + rpc : : ShardingEgressMetadataHookBuilder hookBuilder , <nl> + ShardingCatalogManagerBuilder catalogManagerBuilder ) { <nl> if ( configCS . type ( ) = = ConnectionString : : INVALID ) { <nl> return { ErrorCodes : : BadValue , " Unrecognized connection string . " } ; <nl> } <nl> Status initializeGlobalShardingState ( const ConnectionString & configCS , <nl> HostAndPort ( getHostName ( ) , serverGlobalParams . port ) ) ; <nl> <nl> auto rawCatalogClient = catalogClient . get ( ) ; <nl> + <nl> + std : : unique_ptr < ShardingCatalogManager > catalogManager = catalogManagerBuilder ( <nl> + rawCatalogClient , <nl> + makeTaskExecutor ( executor : : makeNetworkInterface ( " AddShard - TaskExecutor " ) ) ) ; <nl> + auto rawCatalogManager = catalogManager . get ( ) ; <nl> + <nl> grid . init ( <nl> std : : move ( catalogClient ) , <nl> + std : : move ( catalogManager ) , <nl> stdx : : make_unique < CatalogCache > ( ) , <nl> std : : move ( shardRegistry ) , <nl> stdx : : make_unique < ClusterCursorManager > ( getGlobalServiceContext ( ) - > getPreciseClockSource ( ) ) , <nl> Status initializeGlobalShardingState ( const ConnectionString & configCS , <nl> return status ; <nl> } <nl> <nl> + if ( serverGlobalParams . clusterRole = = ClusterRole : : ConfigServer ) { <nl> + / / Only config servers get a ShardingCatalogManager . <nl> + status = rawCatalogManager - > startup ( ) ; <nl> + if ( ! status . isOK ( ) ) { <nl> + return status ; <nl> + } <nl> + } <nl> + <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> mmm a / src / mongo / s / sharding_initialization . h <nl> ppp b / src / mongo / s / sharding_initialization . h <nl> <nl> <nl> namespace mongo { <nl> <nl> + namespace executor { <nl> + class TaskExecutor ; <nl> + } / / namespace executor <nl> + <nl> class ConnectionString ; <nl> class OperationContext ; <nl> class ShardFactory ; <nl> class Status ; <nl> + class ShardingCatalogClient ; <nl> + class ShardingCatalogManager ; <nl> + using ShardingCatalogManagerBuilder = stdx : : function < std : : unique_ptr < ShardingCatalogManager > ( <nl> + ShardingCatalogClient * , std : : unique_ptr < executor : : TaskExecutor > ) > ; <nl> <nl> namespace rpc { <nl> class ShardingEgressMetadataHook ; <nl> using ShardingEgressMetadataHookBuilder = <nl> * / <nl> Status initializeGlobalShardingState ( const ConnectionString & configCS , <nl> std : : unique_ptr < ShardFactory > shardFactory , <nl> - rpc : : ShardingEgressMetadataHookBuilder hookBuilder ) ; <nl> + rpc : : ShardingEgressMetadataHookBuilder hookBuilder , <nl> + ShardingCatalogManagerBuilder catalogManagerBuilder ) ; <nl> <nl> / * * <nl> * Tries to contact the config server and reload the shard registry until it succeeds or <nl> mmm a / src / mongo / s / sharding_test_fixture . cpp <nl> ppp b / src / mongo / s / sharding_test_fixture . cpp <nl> <nl> # include " mongo / s / catalog / catalog_cache . h " <nl> # include " mongo / s / catalog / dist_lock_manager_mock . h " <nl> # include " mongo / s / catalog / replset / sharding_catalog_client_impl . h " <nl> + # include " mongo / s / catalog / replset / sharding_catalog_manager_impl . h " <nl> # include " mongo / s / catalog / type_changelog . h " <nl> # include " mongo / s / catalog / type_collection . h " <nl> # include " mongo / s / catalog / type_shard . h " <nl> void ShardingTestFixture : : setUp ( ) { <nl> auto uniqueDistLockManager = stdx : : make_unique < DistLockManagerMock > ( ) ; <nl> _distLockManager = uniqueDistLockManager . get ( ) ; <nl> std : : unique_ptr < ShardingCatalogClientImpl > catalogClient ( <nl> - stdx : : make_unique < ShardingCatalogClientImpl > ( std : : move ( uniqueDistLockManager ) , <nl> - std : : move ( specialExec ) ) ) ; <nl> + stdx : : make_unique < ShardingCatalogClientImpl > ( std : : move ( uniqueDistLockManager ) ) ) ; <nl> _catalogClient = catalogClient . get ( ) ; <nl> catalogClient - > startup ( ) ; <nl> <nl> + std : : unique_ptr < ShardingCatalogManagerImpl > catalogManager ( <nl> + stdx : : make_unique < ShardingCatalogManagerImpl > ( _catalogClient , std : : move ( specialExec ) ) ) ; <nl> + _catalogManager = catalogManager . get ( ) ; <nl> + catalogManager - > startup ( ) ; <nl> + <nl> ConnectionString configCS = ConnectionString : : forReplicaSet ( <nl> " configRS " , { HostAndPort { " TestHost1 " } , HostAndPort { " TestHost2 " } } ) ; <nl> <nl> void ShardingTestFixture : : setUp ( ) { <nl> / / For now initialize the global grid object . All sharding objects will be accessible from there <nl> / / until we get rid of it . <nl> grid . init ( std : : move ( catalogClient ) , <nl> + std : : move ( catalogManager ) , <nl> stdx : : make_unique < CatalogCache > ( ) , <nl> std : : move ( shardRegistry ) , <nl> stdx : : make_unique < ClusterCursorManager > ( _service - > getPreciseClockSource ( ) ) , <nl> void ShardingTestFixture : : setUp ( ) { <nl> <nl> void ShardingTestFixture : : tearDown ( ) { <nl> grid . getExecutorPool ( ) - > shutdownAndJoin ( ) ; <nl> + grid . catalogManager ( ) - > shutDown ( _opCtx . get ( ) ) ; <nl> grid . catalogClient ( _opCtx . get ( ) ) - > shutDown ( _opCtx . get ( ) ) ; <nl> grid . clearForUnitTests ( ) ; <nl> <nl> ShardingCatalogClient * ShardingTestFixture : : catalogClient ( ) const { <nl> return grid . catalogClient ( _opCtx . get ( ) ) ; <nl> } <nl> <nl> + ShardingCatalogManager * ShardingTestFixture : : catalogManager ( ) const { <nl> + return grid . catalogManager ( ) ; <nl> + } <nl> + <nl> ShardingCatalogClientImpl * ShardingTestFixture : : getCatalogClient ( ) const { <nl> return _catalogClient ; <nl> } <nl> mmm a / src / mongo / s / sharding_test_fixture . h <nl> ppp b / src / mongo / s / sharding_test_fixture . h <nl> class BSONObj ; <nl> class CatalogCache ; <nl> class ShardingCatalogClient ; <nl> class ShardingCatalogClientImpl ; <nl> + class ShardingCatalogManager ; <nl> + class ShardingCatalogManagerImpl ; <nl> struct ChunkVersion ; <nl> class CollectionType ; <nl> class DistLockManagerMock ; <nl> class ShardingTestFixture : public mongo : : unittest : : Test { <nl> <nl> ShardingCatalogClient * catalogClient ( ) const ; <nl> <nl> + ShardingCatalogManager * catalogManager ( ) const ; <nl> + <nl> / * * <nl> * Prefer catalogClient ( ) method over this as much as possible . <nl> * / <nl> class ShardingTestFixture : public mongo : : unittest : : Test { <nl> std : : unique_ptr < executor : : NetworkTestEnv > _addShardNetworkTestEnv ; <nl> DistLockManagerMock * _distLockManager = nullptr ; <nl> ShardingCatalogClientImpl * _catalogClient = nullptr ; <nl> + ShardingCatalogManagerImpl * _catalogManager = nullptr ; <nl> } ; <nl> <nl> } / / namespace mongo <nl>
|
SERVER - 24323 Add ShardingCatalogManager and move addShard implementation into it
|
mongodb/mongo
|
e324289ed29a41f0f6f610dc63ab5d2ce1f9c351
|
2016-06-13T23:02:47Z
|
mmm a / src / test / data / script_invalid . json <nl> ppp b / src / test / data / script_invalid . json <nl> <nl> " DERSIG " , <nl> " P2PK NOT with too much R padding " <nl> ] , <nl> + [ <nl> + " 0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG " , <nl> + " DERSIG " , <nl> + " BIP66 example 1 , with DERSIG " <nl> + ] , <nl> + [ <nl> + " 0x47 0x304402208e43c0b91f7c1e5bc58e41c8185f8a6086e111b0090187968a86f2822462d3c902200a58f4076b1133b18ff1dc83ee51676e44c60cc608d9534e0df5ace0424fc0be01 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT " , <nl> + " " , <nl> + " BIP66 example 2 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 0x47 0x304402208e43c0b91f7c1e5bc58e41c8185f8a6086e111b0090187968a86f2822462d3c902200a58f4076b1133b18ff1dc83ee51676e44c60cc608d9534e0df5ace0424fc0be01 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT " , <nl> + " DERSIG " , <nl> + " BIP66 example 2 , with DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG " , <nl> + " " , <nl> + " BIP66 example 3 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG " , <nl> + " DERSIG " , <nl> + " BIP66 example 3 , with DERSIG " <nl> + ] , <nl> + [ <nl> + " 1 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG " , <nl> + " " , <nl> + " BIP66 example 5 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 1 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG " , <nl> + " DERSIG " , <nl> + " BIP66 example 5 , with DERSIG " <nl> + ] , <nl> + [ <nl> + " 1 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT " , <nl> + " DERSIG " , <nl> + " BIP66 example 6 , with DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x304402200b3d0b0375bb15c14620afa4aa10ae90a0d6a046ce217bc20fe0bc1ced68c1b802204b550acab90ae6d3478057c9ad24f9df743815b799b6449dd7e7f6d3bc6e274c01 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG " , <nl> + " DERSIG " , <nl> + " BIP66 example 7 , with DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0x47 0x30440220f00a77260d34ec2f0c59621dc710f58169d0ca06df1a88cd4b1f1b97bd46991b02201ee220c7e04f26aed03f94aa97fb09ca5627163bf4ba07e6979972ec737db22601 0x47 0x3044022079ea80afd538d9ada421b5101febeb6bc874e01dde5bca108c1d0479aec339a4022004576db8f66130d1df686ccf00935703689d69cf539438da1edab208b0d63c4801 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT " , <nl> + " " , <nl> + " BIP66 example 8 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0x47 0x30440220f00a77260d34ec2f0c59621dc710f58169d0ca06df1a88cd4b1f1b97bd46991b02201ee220c7e04f26aed03f94aa97fb09ca5627163bf4ba07e6979972ec737db22601 0x47 0x3044022079ea80afd538d9ada421b5101febeb6bc874e01dde5bca108c1d0479aec339a4022004576db8f66130d1df686ccf00935703689d69cf539438da1edab208b0d63c4801 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT " , <nl> + " DERSIG " , <nl> + " BIP66 example 8 , with DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0 0x47 0x3044022081aa9d436f2154e8b6d600516db03d78de71df685b585a9807ead4210bd883490220534bb6bdf318a419ac0749660b60e78d17d515558ef369bf872eff405b676b2e01 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG " , <nl> + " " , <nl> + " BIP66 example 9 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0 0x47 0x3044022081aa9d436f2154e8b6d600516db03d78de71df685b585a9807ead4210bd883490220534bb6bdf318a419ac0749660b60e78d17d515558ef369bf872eff405b676b2e01 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG " , <nl> + " DERSIG " , <nl> + " BIP66 example 9 , with DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0 0x47 0x30440220afa76a8f60622f813b05711f051c6c3407e32d1b1b70b0576c1f01b54e4c05c702200d58e9df044fd1845cabfbeef6e624ba0401daf7d7e084736f9ff601c3783bf501 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT " , <nl> + " DERSIG " , <nl> + " BIP66 example 10 , with DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG " , <nl> + " " , <nl> + " BIP66 example 11 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG " , <nl> + " DERSIG " , <nl> + " BIP66 example 11 , with DERSIG " <nl> + ] , <nl> [ <nl> " 0x49 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef05101 " , <nl> " 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG " , <nl> mmm a / src / test / data / script_valid . json <nl> ppp b / src / test / data / script_valid . json <nl> <nl> " " , <nl> " P2PK NOT with bad sig with too much R padding but no DERSIG " <nl> ] , <nl> + [ <nl> + " 0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG " , <nl> + " " , <nl> + " BIP66 example 1 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT " , <nl> + " " , <nl> + " BIP66 example 4 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT " , <nl> + " DERSIG " , <nl> + " BIP66 example 4 , with DERSIG " <nl> + ] , <nl> + [ <nl> + " 1 " , <nl> + " 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT " , <nl> + " " , <nl> + " BIP66 example 6 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x304402200b3d0b0375bb15c14620afa4aa10ae90a0d6a046ce217bc20fe0bc1ced68c1b802204b550acab90ae6d3478057c9ad24f9df743815b799b6449dd7e7f6d3bc6e274c01 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG " , <nl> + " " , <nl> + " BIP66 example 7 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0 0x47 0x30440220afa76a8f60622f813b05711f051c6c3407e32d1b1b70b0576c1f01b54e4c05c702200d58e9df044fd1845cabfbeef6e624ba0401daf7d7e084736f9ff601c3783bf501 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT " , <nl> + " " , <nl> + " BIP66 example 10 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0x47 0x30440220f00a77260d34ec2f0c59621dc710f58169d0ca06df1a88cd4b1f1b97bd46991b02201ee220c7e04f26aed03f94aa97fb09ca5627163bf4ba07e6979972ec737db22601 0 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT " , <nl> + " " , <nl> + " BIP66 example 12 , without DERSIG " <nl> + ] , <nl> + [ <nl> + " 0 0x47 0x30440220f00a77260d34ec2f0c59621dc710f58169d0ca06df1a88cd4b1f1b97bd46991b02201ee220c7e04f26aed03f94aa97fb09ca5627163bf4ba07e6979972ec737db22601 0 " , <nl> + " 2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT " , <nl> + " DERSIG " , <nl> + " BIP66 example 12 , with DERSIG " <nl> + ] , <nl> [ <nl> " 0x49 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef05101 " , <nl> " 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG " , <nl> mmm a / src / test / script_tests . cpp <nl> ppp b / src / test / script_tests . cpp <nl> BOOST_AUTO_TEST_CASE ( script_build ) <nl> " P2PK NOT with too much R padding " , SCRIPT_VERIFY_DERSIG <nl> ) . PushSig ( keys . key2 , SIGHASH_ALL , 31 , 32 ) . EditPush ( 1 , " 43021F " , " 44022000 " ) ) ; <nl> <nl> + good . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG , <nl> + " BIP66 example 1 , without DERSIG " , 0 <nl> + ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG , <nl> + " BIP66 example 1 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG < < OP_NOT , <nl> + " BIP66 example 2 , without DERSIG " , 0 <nl> + ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG < < OP_NOT , <nl> + " BIP66 example 2 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG , <nl> + " BIP66 example 3 , without DERSIG " , 0 <nl> + ) . Num ( 0 ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG , <nl> + " BIP66 example 3 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . Num ( 0 ) ) ; <nl> + good . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG < < OP_NOT , <nl> + " BIP66 example 4 , without DERSIG " , 0 <nl> + ) . Num ( 0 ) ) ; <nl> + good . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG < < OP_NOT , <nl> + " BIP66 example 4 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . Num ( 0 ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG , <nl> + " BIP66 example 5 , without DERSIG " , 0 <nl> + ) . Num ( 1 ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG , <nl> + " BIP66 example 5 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . Num ( 1 ) ) ; <nl> + good . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG < < OP_NOT , <nl> + " BIP66 example 6 , without DERSIG " , 0 <nl> + ) . Num ( 1 ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey1C ) < < OP_CHECKSIG < < OP_NOT , <nl> + " BIP66 example 6 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . Num ( 1 ) ) ; <nl> + good . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG , <nl> + " BIP66 example 7 , without DERSIG " , 0 <nl> + ) . Num ( 0 ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) . PushSig ( keys . key2 ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG , <nl> + " BIP66 example 7 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . Num ( 0 ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) . PushSig ( keys . key2 ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG < < OP_NOT , <nl> + " BIP66 example 8 , without DERSIG " , 0 <nl> + ) . Num ( 0 ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) . PushSig ( keys . key2 ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG < < OP_NOT , <nl> + " BIP66 example 8 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . Num ( 0 ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) . PushSig ( keys . key2 ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG , <nl> + " BIP66 example 9 , without DERSIG " , 0 <nl> + ) . Num ( 0 ) . Num ( 0 ) . PushSig ( keys . key2 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG , <nl> + " BIP66 example 9 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . Num ( 0 ) . Num ( 0 ) . PushSig ( keys . key2 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) ) ; <nl> + good . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG < < OP_NOT , <nl> + " BIP66 example 10 , without DERSIG " , 0 <nl> + ) . Num ( 0 ) . Num ( 0 ) . PushSig ( keys . key2 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG < < OP_NOT , <nl> + " BIP66 example 10 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . Num ( 0 ) . Num ( 0 ) . PushSig ( keys . key2 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG , <nl> + " BIP66 example 11 , without DERSIG " , 0 <nl> + ) . Num ( 0 ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) . Num ( 0 ) ) ; <nl> + bad . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG , <nl> + " BIP66 example 11 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . Num ( 0 ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) . Num ( 0 ) ) ; <nl> + good . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG < < OP_NOT , <nl> + " BIP66 example 12 , without DERSIG " , 0 <nl> + ) . Num ( 0 ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) . Num ( 0 ) ) ; <nl> + good . push_back ( TestBuilder ( CScript ( ) < < OP_2 < < ToByteVector ( keys . pubkey1C ) < < ToByteVector ( keys . pubkey2C ) < < OP_2 < < OP_CHECKMULTISIG < < OP_NOT , <nl> + " BIP66 example 12 , with DERSIG " , SCRIPT_VERIFY_DERSIG <nl> + ) . Num ( 0 ) . PushSig ( keys . key1 , SIGHASH_ALL , 33 , 32 ) . EditPush ( 1 , " 45022100 " , " 440220 " ) . Num ( 0 ) ) ; <nl> + <nl> good . push_back ( TestBuilder ( CScript ( ) < < ToByteVector ( keys . pubkey2C ) < < OP_CHECKSIG , <nl> " P2PK with high S but no LOW_S " , 0 <nl> ) . PushSig ( keys . key2 , SIGHASH_ALL , 32 , 33 ) ) ; <nl>
|
Example unit tests from BIP66
|
bitcoin/bitcoin
|
092e9fe5fb61ff7ce38dc2820938106fc0f0081d
|
2015-02-01T21:47:21Z
|
mmm a / dlib / image_transforms / interpolation . h <nl> ppp b / dlib / image_transforms / interpolation . h <nl> namespace dlib <nl> swap ( chips [ 0 ] , chip ) ; <nl> } <nl> <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + inline chip_details get_face_chip_details ( <nl> + const full_object_detection & det , <nl> + const unsigned long size = 100 , <nl> + const double padding = 0 . 2 <nl> + ) <nl> + { <nl> + DLIB_CASSERT ( det . num_parts ( ) = = 68 , <nl> + " \ t chip_details get_face_chip_details ( ) " <nl> + < < " \ n \ t You must give a detection with exactly 68 parts in it . " <nl> + < < " \ n \ t det . num_parts ( ) : " < < det . num_parts ( ) <nl> + ) ; <nl> + DLIB_CASSERT ( padding > = 0 & & size > 0 , <nl> + " \ t chip_details get_face_chip_details ( ) " <nl> + < < " \ n \ t Invalid inputs were given to this function . " <nl> + < < " \ n \ t padding : " < < padding <nl> + < < " \ n \ t size : " < < size <nl> + ) ; <nl> + <nl> + / / Average positions of face points 17 - 67 <nl> + const double mean_face_shape_x [ ] = { <nl> + 0 . 000213256 , 0 . 0752622 , 0 . 18113 , 0 . 29077 , 0 . 393397 , 0 . 586856 , 0 . 689483 , 0 . 799124 , <nl> + 0 . 904991 , 0 . 98004 , 0 . 490127 , 0 . 490127 , 0 . 490127 , 0 . 490127 , 0 . 36688 , 0 . 426036 , <nl> + 0 . 490127 , 0 . 554217 , 0 . 613373 , 0 . 121737 , 0 . 187122 , 0 . 265825 , 0 . 334606 , 0 . 260918 , <nl> + 0 . 182743 , 0 . 645647 , 0 . 714428 , 0 . 793132 , 0 . 858516 , 0 . 79751 , 0 . 719335 , 0 . 254149 , <nl> + 0 . 340985 , 0 . 428858 , 0 . 490127 , 0 . 551395 , 0 . 639268 , 0 . 726104 , 0 . 642159 , 0 . 556721 , <nl> + 0 . 490127 , 0 . 423532 , 0 . 338094 , 0 . 290379 , 0 . 428096 , 0 . 490127 , 0 . 552157 , 0 . 689874 , <nl> + 0 . 553364 , 0 . 490127 , 0 . 42689 <nl> + } ; <nl> + const double mean_face_shape_y [ ] = { <nl> + 0 . 106454 , 0 . 038915 , 0 . 0187482 , 0 . 0344891 , 0 . 0773906 , 0 . 0773906 , 0 . 0344891 , <nl> + 0 . 0187482 , 0 . 038915 , 0 . 106454 , 0 . 203352 , 0 . 307009 , 0 . 409805 , 0 . 515625 , 0 . 587326 , <nl> + 0 . 609345 , 0 . 628106 , 0 . 609345 , 0 . 587326 , 0 . 216423 , 0 . 178758 , 0 . 179852 , 0 . 231733 , <nl> + 0 . 245099 , 0 . 244077 , 0 . 231733 , 0 . 179852 , 0 . 178758 , 0 . 216423 , 0 . 244077 , 0 . 245099 , <nl> + 0 . 780233 , 0 . 745405 , 0 . 727388 , 0 . 742578 , 0 . 727388 , 0 . 745405 , 0 . 780233 , 0 . 864805 , <nl> + 0 . 902192 , 0 . 909281 , 0 . 902192 , 0 . 864805 , 0 . 784792 , 0 . 778746 , 0 . 785343 , 0 . 778746 , <nl> + 0 . 784792 , 0 . 824182 , 0 . 831803 , 0 . 824182 <nl> + } ; <nl> + <nl> + COMPILE_TIME_ASSERT ( sizeof ( mean_face_shape_x ) / sizeof ( double ) = = 68 - 17 ) ; <nl> + <nl> + std : : vector < dlib : : vector < double , 2 > > from_points , to_points ; <nl> + for ( unsigned long i = 17 ; i < det . num_parts ( ) ; + + i ) <nl> + { <nl> + dlib : : vector < double , 2 > p ; <nl> + p . x ( ) = ( padding + mean_face_shape_x [ i - 17 ] ) / ( 2 * padding + 1 ) ; <nl> + p . y ( ) = ( padding + mean_face_shape_y [ i - 17 ] ) / ( 2 * padding + 1 ) ; <nl> + from_points . push_back ( p * size ) ; <nl> + to_points . push_back ( det . part ( i ) ) ; <nl> + } <nl> + <nl> + return chip_details ( from_points , to_points , chip_dims ( size , size ) ) ; <nl> + } <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> } <nl> mmm a / dlib / image_transforms / interpolation_abstract . h <nl> ppp b / dlib / image_transforms / interpolation_abstract . h <nl> namespace dlib <nl> and stores the single output chip into # chip . <nl> ! * / <nl> <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + chip_details get_face_chip_details ( <nl> + const full_object_detection & det , <nl> + const unsigned long size = 100 , <nl> + const double padding = 0 . 2 <nl> + ) ; <nl> + / * ! <nl> + requires <nl> + - det . num_parts ( ) = = 68 <nl> + - size > 0 <nl> + - padding > = 0 <nl> + ensures <nl> + - This function assumes det contains a human face detection with face parts <nl> + annotated using the annotation scheme from the iBUG 300 - W face landmark <nl> + dataset . Given these assumptions , it creates a chip_details object that will <nl> + extract a copy of the face that has been rotated upright , centered , and <nl> + scaled to a standard size when given to extract_image_chip ( ) . <nl> + - The extracted chips will have size rows and columns in them . <nl> + - if padding = = 0 then the chip will be closely cropped around the face . <nl> + Setting larger padding values will result a looser cropping . In particular , <nl> + a padding of 0 . 5 would double the width of the cropped area , a value of 1 <nl> + would tripple it , and so forth . <nl> + ! * / <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl>
|
added get_face_chip_details ( )
|
davisking/dlib
|
cc12815104fef919ecf810b6f053af854acd5169
|
2014-09-06T19:31:13Z
|
mmm a / . gitignore <nl> ppp b / . gitignore <nl> test / . coverage <nl> * / * . so * <nl> * / * * / * . so * <nl> * / * * / * . dylib * <nl> + test / data / legacy_serialized . pt <nl> \ No newline at end of file <nl>
|
add legacy_serialized . pt to gitignore
|
pytorch/pytorch
|
ed8773f7bdf2228e4e9ddbe13debacfd956f157c
|
2017-03-13T20:37:35Z
|
mmm a / src / app / application . cpp <nl> ppp b / src / app / application . cpp <nl> void Application : : torrentFinished ( BitTorrent : : TorrentHandle * const torrent ) <nl> <nl> / / AutoRun program <nl> if ( pref - > isAutoRunEnabled ( ) ) { <nl> - QString program = pref - > getAutoRunProgram ( ) . trimmed ( ) ; <nl> - / / Replace % f by torrent path <nl> - program . replace ( " % f " , torrent - > savePathParsed ( ) ) ; <nl> - / / Replace % n by torrent name <nl> - program . replace ( " % n " , torrent - > name ( ) ) ; <nl> + QString program = pref - > getAutoRunProgram ( ) ; <nl> + int file_count = torrent - > filesCount ( ) ; <nl> + <nl> + program . replace ( " % N " , torrent - > name ( ) ) ; <nl> + program . replace ( " % F " , ( file_count > 1 ) ? " " : torrent - > fileName ( 0 ) ) ; <nl> + program . replace ( " % L " , torrent - > label ( ) ) ; <nl> + program . replace ( " % D " , torrent - > rootPath ( ) ) ; <nl> + program . replace ( " % K " , ( file_count > 1 ) ? " multi " : " single " ) ; <nl> + program . replace ( " % C " , QString : : number ( torrent - > filesCount ( ) ) ) ; <nl> + program . replace ( " % Z " , QString : : number ( torrent - > totalSize ( ) ) ) ; <nl> + program . replace ( " % T " , torrent - > currentTracker ( ) ) ; <nl> + program . replace ( " % I " , torrent - > hash ( ) ) ; <nl> + <nl> QProcess : : startDetached ( program ) ; <nl> } <nl> <nl> mmm a / src / gui / options . ui <nl> ppp b / src / gui / options . ui <nl> <nl> < string > Behavior < / string > <nl> < / property > <nl> < property name = " textAlignment " > <nl> - < set > AlignHCenter | AlignVCenter | AlignCenter < / set > <nl> + < set > AlignCenter < / set > <nl> < / property > <nl> < property name = " flags " > <nl> < set > ItemIsSelectable | ItemIsEnabled < / set > <nl> <nl> < string > Downloads < / string > <nl> < / property > <nl> < property name = " textAlignment " > <nl> - < set > AlignHCenter | AlignVCenter | AlignCenter < / set > <nl> + < set > AlignCenter < / set > <nl> < / property > <nl> < property name = " flags " > <nl> < set > ItemIsSelectable | ItemIsEnabled < / set > <nl> <nl> < string > Connection < / string > <nl> < / property > <nl> < property name = " textAlignment " > <nl> - < set > AlignHCenter | AlignVCenter | AlignCenter < / set > <nl> + < set > AlignCenter < / set > <nl> < / property > <nl> < property name = " flags " > <nl> < set > ItemIsSelectable | ItemIsEnabled < / set > <nl> <nl> < string > Speed < / string > <nl> < / property > <nl> < property name = " textAlignment " > <nl> - < set > AlignHCenter | AlignVCenter | AlignCenter < / set > <nl> + < set > AlignCenter < / set > <nl> < / property > <nl> < property name = " flags " > <nl> < set > ItemIsSelectable | ItemIsEnabled < / set > <nl> <nl> < string > BitTorrent < / string > <nl> < / property > <nl> < property name = " textAlignment " > <nl> - < set > AlignHCenter | AlignVCenter | AlignCenter < / set > <nl> + < set > AlignCenter < / set > <nl> < / property > <nl> < property name = " flags " > <nl> < set > ItemIsSelectable | ItemIsEnabled < / set > <nl> <nl> < string > Web UI < / string > <nl> < / property > <nl> < property name = " textAlignment " > <nl> - < set > AlignHCenter | AlignVCenter | AlignCenter < / set > <nl> + < set > AlignCenter < / set > <nl> < / property > <nl> < property name = " flags " > <nl> < set > ItemIsSelectable | ItemIsEnabled < / set > <nl> <nl> < string > Advanced < / string > <nl> < / property > <nl> < property name = " textAlignment " > <nl> - < set > AlignHCenter | AlignVCenter | AlignCenter < / set > <nl> + < set > AlignCenter < / set > <nl> < / property > <nl> < property name = " flags " > <nl> < set > ItemIsSelectable | ItemIsEnabled < / set > <nl> <nl> < x > 0 < / x > <nl> < y > 0 < / y > <nl> < width > 487 < / width > <nl> - < height > 1005 < / height > <nl> + < height > 965 < / height > <nl> < / rect > <nl> < / property > <nl> < layout class = " QVBoxLayout " name = " verticalLayout " > <nl> <nl> < item > <nl> < widget class = " QGroupBox " name = " autoRunBox " > <nl> < property name = " title " > <nl> - < string > Run an external program on torrent completion < / string > <nl> + < string > Run external program on torrent completion < / string > <nl> < / property > <nl> < property name = " checkable " > <nl> < bool > true < / bool > <nl> <nl> < widget class = " QLineEdit " name = " autoRun_txt " / > <nl> < / item > <nl> < item > <nl> - < widget class = " QLabel " name = " label_4 " > <nl> - < property name = " text " > <nl> - < string > The following parameters are supported : <nl> - & lt ; ul & gt ; <nl> - & lt ; li & gt ; % f : Torrent path & lt ; / li & gt ; <nl> - & lt ; li & gt ; % n : Torrent name & lt ; / li & gt ; <nl> - & lt ; / ul & gt ; < / string > <nl> - < / property > <nl> - < property name = " textFormat " > <nl> - < enum > Qt : : RichText < / enum > <nl> - < / property > <nl> - < / widget > <nl> + < widget class = " QLabel " name = " autoRun_param " / > <nl> < / item > <nl> < / layout > <nl> < / widget > <nl> <nl> < rect > <nl> < x > 0 < / x > <nl> < y > 0 < / y > <nl> - < width > 474 < / width > <nl> - < height > 640 < / height > <nl> + < width > 450 < / width > <nl> + < height > 632 < / height > <nl> < / rect > <nl> < / property > <nl> < layout class = " QVBoxLayout " name = " verticalLayout_20 " > <nl> <nl> < rect > <nl> < x > 0 < / x > <nl> < y > 0 < / y > <nl> - < width > 474 < / width > <nl> - < height > 438 < / height > <nl> + < width > 376 < / width > <nl> + < height > 431 < / height > <nl> < / rect > <nl> < / property > <nl> < layout class = " QVBoxLayout " name = " verticalLayout_33 " > <nl> <nl> < property name = " wrapping " > <nl> < bool > true < / bool > <nl> < / property > <nl> + < property name = " displayFormat " > <nl> + < string notr = " true " > hh : mm < / string > <nl> + < / property > <nl> + < property name = " calendarPopup " > <nl> + < bool > false < / bool > <nl> + < / property > <nl> < property name = " time " > <nl> < time > <nl> < hour > 8 < / hour > <nl> <nl> < second > 0 < / second > <nl> < / time > <nl> < / property > <nl> - < property name = " displayFormat " > <nl> - < string notr = " true " > hh : mm < / string > <nl> - < / property > <nl> - < property name = " calendarPopup " > <nl> - < bool > false < / bool > <nl> - < / property > <nl> < / widget > <nl> < / item > <nl> < item > <nl> <nl> < property name = " wrapping " > <nl> < bool > true < / bool > <nl> < / property > <nl> + < property name = " displayFormat " > <nl> + < string notr = " true " > hh : mm < / string > <nl> + < / property > <nl> < property name = " time " > <nl> < time > <nl> < hour > 20 < / hour > <nl> <nl> < second > 0 < / second > <nl> < / time > <nl> < / property > <nl> - < property name = " displayFormat " > <nl> - < string notr = " true " > hh : mm < / string > <nl> - < / property > <nl> < / widget > <nl> < / item > <nl> < item > <nl> <nl> < rect > <nl> < x > 0 < / x > <nl> < y > 0 < / y > <nl> - < width > 556 < / width > <nl> - < height > 418 < / height > <nl> + < width > 555 < / width > <nl> + < height > 410 < / height > <nl> < / rect > <nl> < / property > <nl> < layout class = " QVBoxLayout " name = " verticalLayout_7 " > <nl> <nl> < rect > <nl> < x > 0 < / x > <nl> < y > 0 < / y > <nl> - < width > 474 < / width > <nl> + < width > 419 < / width > <nl> < height > 537 < / height > <nl> < / rect > <nl> < / property > <nl> <nl> < rect > <nl> < x > 0 < / x > <nl> < y > 0 < / y > <nl> - < width > 487 < / width > <nl> - < height > 342 < / height > <nl> + < width > 98 < / width > <nl> + < height > 28 < / height > <nl> < / rect > <nl> < / property > <nl> < layout class = " QVBoxLayout " name = " verticalLayout_36 " / > <nl> mmm a / src / gui / options_imp . cpp <nl> ppp b / src / gui / options_imp . cpp <nl> options_imp : : options_imp ( QWidget * parent ) : <nl> connect ( mailNotifPassword , SIGNAL ( textChanged ( QString ) ) , this , SLOT ( enableApplyButton ( ) ) ) ; <nl> connect ( autoRunBox , SIGNAL ( toggled ( bool ) ) , this , SLOT ( enableApplyButton ( ) ) ) ; <nl> connect ( autoRun_txt , SIGNAL ( textChanged ( QString ) ) , this , SLOT ( enableApplyButton ( ) ) ) ; <nl> + <nl> + autoRun_param - > setText ( QString : : fromUtf8 ( " % 1 \ n % 2 \ n % 3 \ n % 4 \ n % 5 \ n % 6 \ n % 7 \ n % 8 \ n % 9 \ n % 10 " ) <nl> + . arg ( tr ( " Supported parameters ( case sensitive ) : " ) ) <nl> + . arg ( tr ( " % N : Torrent name " ) ) <nl> + . arg ( tr ( " % F : Downloaded file name ( single - file torrent only ) " ) ) <nl> + . arg ( tr ( " % L : Label " ) ) <nl> + . arg ( tr ( " % D : Save path " ) ) <nl> + . arg ( tr ( " % K : \ " single \ " | \ " multi \ " file ( s ) " ) ) <nl> + . arg ( tr ( " % C : Number of files " ) ) <nl> + . arg ( tr ( " % Z : Torrent size ( bytes ) " ) ) <nl> + . arg ( tr ( " % T : Current tracker " ) ) <nl> + . arg ( tr ( " % I : Info hash " ) ) ) ; <nl> + <nl> / / Connection tab <nl> connect ( spinPort , SIGNAL ( valueChanged ( QString ) ) , this , SLOT ( enableApplyButton ( ) ) ) ; <nl> connect ( checkRandomPort , SIGNAL ( toggled ( bool ) ) , this , SLOT ( enableApplyButton ( ) ) ) ; <nl> void options_imp : : saveOptions ( ) { <nl> pref - > setMailNotificationSMTPUsername ( mailNotifUsername - > text ( ) ) ; <nl> pref - > setMailNotificationSMTPPassword ( mailNotifPassword - > text ( ) ) ; <nl> pref - > setAutoRunEnabled ( autoRunBox - > isChecked ( ) ) ; <nl> - pref - > setAutoRunProgram ( autoRun_txt - > text ( ) ) ; <nl> + pref - > setAutoRunProgram ( autoRun_txt - > text ( ) . trimmed ( ) ) ; <nl> pref - > setActionOnDblClOnTorrentDl ( getActionOnDblClOnTorrentDl ( ) ) ; <nl> pref - > setActionOnDblClOnTorrentFn ( getActionOnDblClOnTorrentFn ( ) ) ; <nl> / / End Downloads preferences <nl>
|
Merge pull request from Chocobo1 / ext_param
|
qbittorrent/qBittorrent
|
fce3a2d5c0221a058ef813b241919d61b0387989
|
2015-07-29T20:17:19Z
|
mmm a / src / clustering / immediate_consistency / branch / multistore . cc <nl> ppp b / src / clustering / immediate_consistency / branch / multistore . cc <nl> <nl> # include " protocol_api . hpp " <nl> # include " rpc / semilattice / joins / vclock . hpp " <nl> <nl> + template < class protocol_t > <nl> + struct multistore_ptr_t < protocol_t > : : switch_read_token_t { <nl> + bool do_read ; <nl> + typename protocol_t : : region_t region ; <nl> + typename protocol_t : : region_t intersection ; <nl> + fifo_enforcer_read_token_t token ; <nl> + } ; <nl> + <nl> template < class protocol_t > <nl> multistore_ptr_t < protocol_t > : : multistore_ptr_t ( store_view_t < protocol_t > * * store_views , <nl> int num_store_views , <nl> void multistore_ptr_t < protocol_t > : : new_write_token ( object_buffer_t < fifo_enforcer <nl> template < class protocol_t > <nl> void multistore_ptr_t < protocol_t > : : do_get_a_metainfo ( int i , <nl> order_token_t order_token , <nl> - const scoped_array_t < fifo_enforcer_read_token_t > & internal_tokens , <nl> + const switch_read_token_t * internal_tokens , <nl> signal_t * interruptor , <nl> region_map_t < protocol_t , version_range_t > * updatee , <nl> mutex_t * updatee_mutex ) THROWS_NOTHING { <nl> void multistore_ptr_t < protocol_t > : : do_get_a_metainfo ( int i , <nl> on_thread_t th ( dest_thread ) ; <nl> <nl> object_buffer_t < fifo_enforcer_sink_t : : exit_read_t > store_token ; <nl> - switch_inner_read_token ( i , internal_tokens [ i ] , & ct_interruptor , & store_token ) ; <nl> + switch_inner_read_token ( i , internal_tokens [ i ] . token , & ct_interruptor , & store_token ) ; <nl> <nl> region_map_t < protocol_t , binary_blob_t > metainfo ; <nl> store_views_ [ i ] - > do_get_metainfo ( order_token , & store_token , & ct_interruptor , & metainfo ) ; <nl> get_all_metainfos ( order_token_t order_token , <nl> object_buffer_t < fifo_enforcer_sink_t : : exit_read_t > * external_token , <nl> signal_t * interruptor ) { <nl> <nl> - scoped_array_t < fifo_enforcer_read_token_t > internal_tokens ; <nl> + / / RSI : this is kind of awkward <nl> + int count = num_stores ( ) ; <nl> + switch_read_token_t internal_tokens [ count ] ; <nl> <nl> - switch_read_tokens ( external_token , interruptor , & order_token , & internal_tokens ) ; <nl> + for ( int i = 0 ; i < count ; + + i ) { <nl> + internal_tokens [ i ] . do_read = true ; <nl> + } <nl> + <nl> + switch_read_tokens ( external_token , interruptor , & order_token , internal_tokens ) ; <nl> <nl> mutex_t ret_mutex ; <nl> typename protocol_t : : region_t region = get_multistore_joined_region ( ) ; <nl> get_all_metainfos ( order_token_t order_token , <nl> / / TODO : For getting , we possibly want to cache things on the home <nl> / / thread , but wait until we want a multithreaded listener . <nl> <nl> - pmap ( store_views_ . size ( ) , boost : : bind ( & multistore_ptr_t < protocol_t > : : do_get_a_metainfo , this , _1 , order_token , boost : : ref ( internal_tokens ) , interruptor , & ret , & ret_mutex ) ) ; <nl> + pmap ( count , boost : : bind ( & multistore_ptr_t < protocol_t > : : do_get_a_metainfo , <nl> + this , <nl> + _1 , <nl> + order_token , <nl> + internal_tokens , <nl> + interruptor , <nl> + & ret , <nl> + & ret_mutex ) ) ; <nl> <nl> if ( interruptor - > is_pulsed ( ) ) { <nl> throw interrupted_exc_t ( ) ; <nl> void multistore_ptr_t < protocol_t > : : single_shard_backfill ( int i , <nl> const region_map_t < protocol_t , state_timestamp_t > & start_point , <nl> chunk_fun_callback_t < protocol_t > * chunk_fun_cb , <nl> traversal_progress_combiner_t * progress , <nl> - const scoped_array_t < fifo_enforcer_read_token_t > & internal_tokens , <nl> + const switch_read_token_t * internal_tokens , <nl> signal_t * interruptor ) THROWS_NOTHING { <nl> store_view_t < protocol_t > * store = store_views_ [ i ] ; <nl> <nl> void multistore_ptr_t < protocol_t > : : single_shard_backfill ( int i , <nl> try { <nl> <nl> object_buffer_t < fifo_enforcer_sink_t : : exit_read_t > store_token ; <nl> - switch_inner_read_token ( i , internal_tokens [ i ] , & ct_interruptor , & store_token ) ; <nl> + switch_inner_read_token ( i , internal_tokens [ i ] . token , & ct_interruptor , & store_token ) ; <nl> <nl> store - > send_backfill ( start_point . mask ( get_region ( i ) ) , <nl> & send_backfill_cb , <nl> bool multistore_ptr_t < protocol_t > : : send_multistore_backfill ( const region_map_t < p <nl> object_buffer_t < fifo_enforcer_sink_t : : exit_read_t > * external_token , <nl> signal_t * interruptor ) THROWS_ONLY ( interrupted_exc_t ) { <nl> guarantee ( region_is_superset ( get_multistore_joined_region ( ) , start_point . get_domain ( ) ) ) ; <nl> - <nl> - scoped_array_t < fifo_enforcer_read_token_t > internal_tokens ; <nl> order_token_t fake_order_token = order_token_t : : ignore ; / / TODO <nl> - switch_read_tokens ( external_token , interruptor , & fake_order_token , & internal_tokens ) ; <nl> + <nl> + / / RSI : this is kind of awkward <nl> + int count = num_stores ( ) ; <nl> + switch_read_token_t internal_tokens [ count ] ; <nl> + <nl> + for ( int i = 0 ; i < count ; + + i ) { <nl> + internal_tokens [ i ] . do_read = true ; <nl> + } <nl> + <nl> + switch_read_tokens ( external_token , interruptor , & fake_order_token , internal_tokens ) ; <nl> <nl> multistore_send_backfill_should_backfill_t < protocol_t > helper ( num_stores ( ) , start_point . get_domain ( ) , send_backfill_cb ) ; <nl> <nl> - pmap ( num_stores ( ) , boost : : bind ( & multistore_ptr_t < protocol_t > : : single_shard_backfill , <nl> - this , <nl> - _1 , <nl> - & helper , <nl> - boost : : ref ( start_point ) , <nl> - send_backfill_cb , <nl> - progress , <nl> - boost : : ref ( internal_tokens ) , <nl> - interruptor ) ) ; <nl> + pmap ( count , boost : : bind ( & multistore_ptr_t < protocol_t > : : single_shard_backfill , <nl> + this , <nl> + _1 , <nl> + & helper , <nl> + boost : : ref ( start_point ) , <nl> + send_backfill_cb , <nl> + progress , <nl> + internal_tokens , <nl> + interruptor ) ) ; <nl> <nl> if ( interruptor - > is_pulsed ( ) ) { <nl> throw interrupted_exc_t ( ) ; <nl> void multistore_ptr_t < protocol_t > : : receive_backfill ( const typename protocol_t : : b <nl> } <nl> } <nl> <nl> - <nl> - <nl> - <nl> template < class protocol_t > <nl> - void multistore_ptr_t < protocol_t > : : single_shard_read ( int i , <nl> - DEBUG_ONLY ( const metainfo_checker_t < protocol_t > & metainfo_checker , ) <nl> - const typename protocol_t : : read_t & read , <nl> - order_token_t order_token , <nl> - const scoped_array_t < fifo_enforcer_read_token_t > & internal_tokens , <nl> - std : : vector < typename protocol_t : : read_response_t > * responses , <nl> - signal_t * interruptor ) THROWS_NOTHING { <nl> - const typename protocol_t : : region_t ith_region = get_region ( i ) ; <nl> - typename protocol_t : : region_t ith_intersection = region_intersection ( ith_region , read . get_region ( ) ) ; <nl> - <nl> - const int dest_thread = store_views_ [ i ] - > home_thread ( ) ; <nl> - <nl> - cross_thread_signal_t ct_interruptor ( interruptor , dest_thread ) ; <nl> - <nl> - try { <nl> - / / TODO : avoid extra copy of read_response_t here <nl> - typename protocol_t : : read_response_t response ; <nl> + class multistore_ptr_t < protocol_t > : : single_shard_reader_t { <nl> + public : <nl> + single_shard_reader_t ( multistore_ptr_t < protocol_t > * _parent , <nl> + DEBUG_ONLY ( const metainfo_checker_t < protocol_t > & _metainfo_checker , ) <nl> + const typename protocol_t : : read_t * _read , <nl> + order_token_t _order_token , <nl> + const typename multistore_ptr_t < protocol_t > : : switch_read_token_t * _internal_tokens , <nl> + typename protocol_t : : read_response_t * _responses , <nl> + size_t _shard , <nl> + size_t _response_index , <nl> + size_t * _reads_left , <nl> + cond_t * _done , <nl> + signal_t * _interruptor ) : <nl> + parent ( _parent ) , <nl> + DEBUG_ONLY ( metainfo_checker ( _metainfo_checker ) , ) <nl> + read ( _read ) , <nl> + order_token ( _order_token ) , <nl> + internal_tokens ( _internal_tokens ) , <nl> + responses ( _responses ) , <nl> + shard ( _shard ) , <nl> + response_index ( _response_index ) , <nl> + reads_left ( _reads_left ) , <nl> + done ( _done ) , <nl> + interruptor ( _interruptor ) { } <nl> + <nl> + void operator ( ) ( ) { <nl> + const int dest_thread = parent - > store_views_ [ shard ] - > home_thread ( ) ; <nl> + cross_thread_signal_t ct_interruptor ( interruptor , dest_thread ) ; <nl> <nl> - { <nl> + try { <nl> on_thread_t th ( dest_thread ) ; <nl> <nl> object_buffer_t < fifo_enforcer_sink_t : : exit_read_t > store_token ; <nl> - switch_inner_read_token ( i , internal_tokens [ i ] , & ct_interruptor , & store_token ) ; <nl> - <nl> - if ( region_is_empty ( ith_intersection ) ) { <nl> - / / TODO : This is ridiculous . We don ' t have to go to <nl> - / / this thread to find out that the region is empty <nl> - / / and kill the store token if we don ' t create the <nl> - / / internal token in the first place . <nl> - return ; <nl> - } <nl> - <nl> - store_views_ [ i ] - > read ( DEBUG_ONLY ( metainfo_checker . mask ( ith_region ) , ) <nl> - read . shard ( ith_intersection ) , <nl> - & response , <nl> - order_token , <nl> - & store_token , <nl> - & ct_interruptor ) ; <nl> + parent - > switch_inner_read_token ( shard , internal_tokens [ shard ] . token , & ct_interruptor , & store_token ) ; <nl> + <nl> + parent - > store_views_ [ shard ] - > read ( DEBUG_ONLY ( metainfo_checker . mask ( internal_tokens [ shard ] . region ) , ) <nl> + read - > shard ( internal_tokens [ shard ] . intersection ) , <nl> + & responses [ response_index ] , <nl> + order_token , <nl> + & store_token , <nl> + & ct_interruptor ) ; <nl> + } catch ( const interrupted_exc_t & exc ) { <nl> + / / do nothing <nl> } <nl> - responses - > push_back ( response ) ; <nl> <nl> - } catch ( const interrupted_exc_t & exc ) { <nl> - / / do nothing <nl> + * reads_left = * reads_left - 1 ; <nl> + if ( * reads_left = = 0 ) { <nl> + done - > pulse ( ) ; <nl> + } <nl> } <nl> - } <nl> + <nl> + private : <nl> + multistore_ptr_t < protocol_t > * parent ; <nl> + DEBUG_ONLY ( const metainfo_checker_t < protocol_t > & metainfo_checker ; ) <nl> + const typename protocol_t : : read_t * read ; <nl> + order_token_t order_token ; <nl> + const typename multistore_ptr_t < protocol_t > : : switch_read_token_t * internal_tokens ; <nl> + typename protocol_t : : read_response_t * responses ; <nl> + size_t shard ; <nl> + size_t response_index ; <nl> + size_t * reads_left ; <nl> + cond_t * done ; <nl> + signal_t * interruptor ; <nl> + } ; <nl> <nl> template < class protocol_t > <nl> void <nl> multistore_ptr_t < protocol_t > : : read ( DEBUG_ONLY ( const metainfo_checker_t < protocol_ <nl> order_token_t order_token , <nl> object_buffer_t < fifo_enforcer_sink_t : : exit_read_t > * external_token , <nl> signal_t * interruptor ) THROWS_ONLY ( interrupted_exc_t ) { <nl> - / / RSI : for each store , check if region is empty before creating internal read tokens <nl> - scoped_array_t < fifo_enforcer_read_token_t > internal_tokens ; <nl> - switch_read_tokens ( external_token , interruptor , & order_token , & internal_tokens ) ; <nl> - <nl> - std : : vector < typename protocol_t : : read_response_t > responses ; <nl> - pmap ( num_stores ( ) , boost : : bind ( & multistore_ptr_t < protocol_t > : : single_shard_read , <nl> - this , _1 , DEBUG_ONLY ( boost : : ref ( metainfo_checker ) , ) <nl> - boost : : ref ( read ) , <nl> - order_token , <nl> - boost : : ref ( internal_tokens ) , <nl> - & responses , <nl> - interruptor ) ) ; <nl> + size_t num_reads = 0 ; <nl> + switch_read_token_t token_info [ num_stores ( ) ] ; <nl> + <nl> + / / RSI : avoid assignment operator here <nl> + for ( int i = 0 ; i < num_stores ( ) ; + + i ) { <nl> + token_info [ i ] . region = get_region ( i ) ; <nl> + token_info [ i ] . intersection = region_intersection ( token_info [ i ] . region , read . get_region ( ) ) ; <nl> + <nl> + if ( region_is_empty ( token_info [ i ] . intersection ) ) { <nl> + token_info [ i ] . do_read = false ; <nl> + } else { <nl> + token_info [ i ] . do_read = true ; <nl> + + + num_reads ; <nl> + } <nl> + } <nl> + <nl> + switch_read_tokens ( external_token , interruptor , & order_token , token_info ) ; <nl> + <nl> + typename protocol_t : : read_response_t responses [ num_reads ] ; <nl> + size_t reads_left = num_reads ; <nl> + size_t response_index = 0 ; <nl> + cond_t done ; <nl> + for ( int i = 0 ; i < num_stores ( ) ; + + i ) { <nl> + if ( token_info [ i ] . do_read ) { <nl> + / / RSI : do this without boost : : bind <nl> + coro_t : : spawn_now_dangerously ( single_shard_reader_t ( this , DEBUG_ONLY ( boost : : ref ( metainfo_checker ) , ) <nl> + & read , <nl> + order_token , <nl> + & token_info [ 0 ] , <nl> + & responses [ 0 ] , <nl> + i , <nl> + response_index , <nl> + & reads_left , <nl> + & done , <nl> + interruptor ) ) ; <nl> + + + response_index ; <nl> + } <nl> + } <nl> + rassert ( response_index = = num_reads ) ; <nl> <nl> + / / RSI : better to use wait_interruptible here ? <nl> + done . wait ( ) ; <nl> if ( interruptor - > is_pulsed ( ) ) { <nl> throw interrupted_exc_t ( ) ; <nl> } <nl> <nl> typename protocol_t : : temporary_cache_t fake_cache ; <nl> - read . multistore_unshard ( responses , response , & fake_cache ) ; <nl> + read . multistore_unshard ( responses , num_reads , response , & fake_cache ) ; <nl> } <nl> <nl> / / Because boost : : bind only takes 10 arguments . <nl> void multistore_ptr_t < protocol_t > : : single_shard_write ( int i , <nl> } <nl> <nl> template < class protocol_t > <nl> - void <nl> - multistore_ptr_t < protocol_t > : : write ( DEBUG_ONLY ( const metainfo_checker_t < protocol_t > & metainfo_checker , ) <nl> - const typename protocol_t : : store_t : : metainfo_t & new_metainfo , <nl> - const typename protocol_t : : write_t & write , <nl> - typename protocol_t : : write_response_t * response , <nl> - transition_timestamp_t timestamp , <nl> - order_token_t order_token , <nl> - object_buffer_t < fifo_enforcer_sink_t : : exit_write_t > * external_token , <nl> - signal_t * interruptor ) THROWS_ONLY ( interrupted_exc_t ) { <nl> + void multistore_ptr_t < protocol_t > : : write ( DEBUG_ONLY ( const metainfo_checker_t < protocol_t > & metainfo_checker , ) <nl> + const typename protocol_t : : store_t : : metainfo_t & new_metainfo , <nl> + const typename protocol_t : : write_t & write , <nl> + typename protocol_t : : write_response_t * response , <nl> + transition_timestamp_t timestamp , <nl> + order_token_t order_token , <nl> + object_buffer_t < fifo_enforcer_sink_t : : exit_write_t > * external_token , <nl> + signal_t * interruptor ) THROWS_ONLY ( interrupted_exc_t ) { <nl> scoped_array_t < fifo_enforcer_write_token_t > internal_tokens ; <nl> switch_write_tokens ( external_token , interruptor , & order_token , & internal_tokens ) ; <nl> <nl> multistore_ptr_t < protocol_t > : : write ( DEBUG_ONLY ( const metainfo_checker_t < protocol <nl> } <nl> <nl> typename protocol_t : : temporary_cache_t fake_cache ; <nl> - write . multistore_unshard ( responses , response , & fake_cache ) ; <nl> + write . multistore_unshard ( responses . data ( ) , responses . size ( ) , response , & fake_cache ) ; <nl> } <nl> <nl> template < class protocol_t > <nl> void multistore_ptr_t < protocol_t > : : reset_all_data ( const typename protocol_t : : reg <nl> } <nl> <nl> template < class protocol_t > <nl> - void multistore_ptr_t < protocol_t > : : switch_read_tokens ( object_buffer_t < fifo_enforcer_sink_t : : exit_read_t > * external_token , signal_t * interruptor , order_token_t * order_token_ref , scoped_array_t < fifo_enforcer_read_token_t > * internal_out ) { <nl> + void multistore_ptr_t < protocol_t > : : switch_read_tokens ( object_buffer_t < fifo_enforcer_sink_t : : exit_read_t > * external_token , signal_t * interruptor , order_token_t * order_token_ref , switch_read_token_t * internal_array_out ) { <nl> object_buffer_t < fifo_enforcer_sink_t : : exit_read_t > : : destruction_sentinel_t destroyer ( external_token ) ; <nl> <nl> wait_interruptible ( external_token - > get ( ) , interruptor ) ; <nl> void multistore_ptr_t < protocol_t > : : switch_read_tokens ( object_buffer_t < fifo_enfor <nl> * order_token_ref = external_checkpoint_ . get ( ) - > check_through ( * order_token_ref ) ; <nl> <nl> const int n = num_stores ( ) ; <nl> - internal_out - > init ( n ) ; <nl> for ( int i = 0 ; i < n ; + + i ) { <nl> - ( * internal_out ) [ i ] = ( * internal_sources_ . get ( ) ) [ i ] . enter_read ( ) ; <nl> + if ( internal_array_out [ i ] . do_read ) { <nl> + internal_array_out [ i ] . token = ( * internal_sources_ . get ( ) ) [ i ] . enter_read ( ) ; <nl> + } <nl> } <nl> } <nl> <nl> void multistore_ptr_t < protocol_t > : : switch_inner_write_token ( int i , fifo_enforcer <nl> store_views_ [ i ] - > new_write_token ( store_token ) ; <nl> } <nl> <nl> - <nl> - <nl> - <nl> - <nl> - <nl> # include " memcached / protocol . hpp " <nl> # include " mock / dummy_protocol . hpp " <nl> # include " rdb_protocol / protocol . hpp " <nl> mmm a / src / clustering / immediate_consistency / branch / multistore . hpp <nl> ppp b / src / clustering / immediate_consistency / branch / multistore . hpp <nl> class multistore_ptr_t { <nl> signal_t * interruptor ) THROWS_ONLY ( interrupted_exc_t ) ; <nl> <nl> private : <nl> + class single_shard_reader_t ; <nl> + struct switch_read_token_t ; <nl> + <nl> / / Used by send_multistore_backfill . <nl> void single_shard_backfill ( int i , <nl> multistore_send_backfill_should_backfill_t < protocol_t > * helper , <nl> const region_map_t < protocol_t , state_timestamp_t > & start_point , <nl> chunk_fun_callback_t < protocol_t > * chunk_fun_cb , <nl> traversal_progress_combiner_t * progress , <nl> - const scoped_array_t < fifo_enforcer_read_token_t > & internal_tokens , <nl> + const switch_read_token_t * internal_tokens , <nl> signal_t * interruptor ) THROWS_NOTHING ; <nl> <nl> void single_shard_receive_backfill ( int i , const typename protocol_t : : backfill_chunk_t & chunk , <nl> class multistore_ptr_t { <nl> <nl> void single_shard_read ( int i , <nl> DEBUG_ONLY ( const metainfo_checker_t < protocol_t > & metainfo_checker , ) <nl> - const typename protocol_t : : read_t & read , <nl> + const typename protocol_t : : read_t * read , <nl> order_token_t order_token , <nl> - const scoped_array_t < fifo_enforcer_read_token_t > & internal_tokens , <nl> - std : : vector < typename protocol_t : : read_response_t > * responses , <nl> + const switch_read_token_t * internal_tokens , <nl> + typename protocol_t : : read_response_t * responses , <nl> + size_t response_index , <nl> + size_t * reads_left , <nl> + cond_t * done , <nl> signal_t * interruptor ) THROWS_NOTHING ; <nl> <nl> - <nl> - <nl> void single_shard_write ( int i , <nl> const new_and_metainfo_checker_t < protocol_t > & metainfo , <nl> const typename protocol_t : : write_t & write , <nl> class multistore_ptr_t { <nl> <nl> void do_get_a_metainfo ( int i , <nl> order_token_t order_token , <nl> - const scoped_array_t < fifo_enforcer_read_token_t > & internal_tokens , <nl> + const switch_read_token_t * internal_tokens , <nl> signal_t * interruptor , <nl> region_map_t < protocol_t , version_range_t > * updatee , <nl> mutex_t * updatee_mutex ) THROWS_NOTHING ; <nl> class multistore_ptr_t { <nl> / / Used by the constructors . <nl> void initialize ( store_view_t < protocol_t > * * _store_views ) THROWS_NOTHING ; <nl> <nl> - void switch_read_tokens ( object_buffer_t < fifo_enforcer_sink_t : : exit_read_t > * external_token , signal_t * interruptor , order_token_t * order_token_ref , scoped_array_t < fifo_enforcer_read_token_t > * internal_out ) ; <nl> + void switch_read_tokens ( object_buffer_t < fifo_enforcer_sink_t : : exit_read_t > * external_token , signal_t * interruptor , order_token_t * order_token_ref , switch_read_token_t * internal_array_out ) ; <nl> <nl> void switch_write_tokens ( object_buffer_t < fifo_enforcer_sink_t : : exit_write_t > * external_token , signal_t * interruptor , order_token_t * order_token_ref , scoped_array_t < fifo_enforcer_write_token_t > * internal_out ) ; <nl> <nl> mmm a / src / clustering / reactor / namespace_interface . cc <nl> ppp b / src / clustering / reactor / namespace_interface . cc <nl> void cluster_namespace_interface_t < protocol_t > : : dispatch_immediate_op ( <nl> } <nl> } <nl> <nl> + / / RSI : don ' t use vector <nl> std : : vector < op_response_type > results ( masters_to_contact . size ( ) ) ; <nl> std : : vector < std : : string > failures ( masters_to_contact . size ( ) ) ; <nl> / / RSI : don ' t use pmap <nl> void cluster_namespace_interface_t < protocol_t > : : dispatch_immediate_op ( <nl> } <nl> } <nl> <nl> - op . unshard ( results , response , & temporary_cache ) ; <nl> + op . unshard ( results . data ( ) , results . size ( ) , response , & temporary_cache ) ; <nl> } <nl> <nl> template < class protocol_t > <nl> cluster_namespace_interface_t < protocol_t > : : dispatch_outdated_read ( const typename <nl> } <nl> } <nl> <nl> - op . unshard ( results , response , & temporary_cache ) ; <nl> + op . unshard ( results . data ( ) , results . size ( ) , response , & temporary_cache ) ; <nl> } <nl> <nl> template < class protocol_t > <nl> mmm a / src / memcached / protocol . cc <nl> ppp b / src / memcached / protocol . cc <nl> class key_with_data_buffer_less_t { <nl> <nl> / / TODO : get rid of this extra response_t copy on the stack <nl> struct read_unshard_visitor_t : public boost : : static_visitor < read_response_t > { <nl> - const std : : vector < read_response_t > & bits ; <nl> + const read_response_t * bits ; <nl> + const size_t count ; <nl> <nl> - explicit read_unshard_visitor_t ( const std : : vector < read_response_t > & b ) : bits ( b ) { } <nl> + explicit read_unshard_visitor_t ( const read_response_t * b , size_t c ) : bits ( b ) , count ( c ) { } <nl> read_response_t operator ( ) ( UNUSED get_query_t get ) { <nl> - rassert ( bits . size ( ) = = 1 ) ; <nl> + rassert ( count = = 1 ) ; <nl> return read_response_t ( boost : : get < get_result_t > ( bits [ 0 ] . result ) ) ; <nl> } <nl> read_response_t operator ( ) ( rget_query_t rget ) { <nl> std : : map < store_key_t , const rget_result_t * > sorted_bits ; <nl> - for ( size_t i = 0 ; i < bits . size ( ) ; + + i ) { <nl> + for ( size_t i = 0 ; i < count ; + + i ) { <nl> const rget_result_t * bit = boost : : get < rget_result_t > ( & bits [ i ] . result ) ; <nl> if ( ! bit - > pairs . empty ( ) ) { <nl> const store_key_t & key = bit - > pairs . front ( ) . key ; <nl> struct read_unshard_visitor_t : public boost : : static_visitor < read_response_t > { <nl> return read_response_t ( result ) ; <nl> } <nl> read_response_t operator ( ) ( UNUSED distribution_get_query_t dget ) { <nl> - rassert ( bits . size ( ) > 0 ) ; <nl> + rassert ( count > 0 ) ; <nl> rassert ( boost : : get < distribution_result_t > ( & bits [ 0 ] . result ) ) ; <nl> - rassert ( bits . size ( ) = = 1 | | boost : : get < distribution_result_t > ( & bits [ 1 ] . result ) ) ; <nl> + rassert ( count = = 1 | | boost : : get < distribution_result_t > ( & bits [ 1 ] . result ) ) ; <nl> <nl> / / Asserts that we don ' t look like a hash - sharded thing . <nl> - rassert ( ! ( bits . size ( ) > 1 <nl> + rassert ( ! ( count > 1 <nl> & & boost : : get < distribution_result_t > ( & bits [ 0 ] . result ) - > key_counts . begin ( ) - > first = = boost : : get < distribution_result_t > ( & bits [ 1 ] . result ) - > key_counts . begin ( ) - > first ) ) ; <nl> <nl> distribution_result_t res ; <nl> <nl> - for ( int i = 0 , e = bits . size ( ) ; i < e ; i + + ) { <nl> + for ( int i = 0 , e = count ; i < e ; i + + ) { <nl> const distribution_result_t * result = boost : : get < distribution_result_t > ( & bits [ i ] . result ) ; <nl> rassert ( result , " Bad boost : : get \ n " ) ; <nl> <nl> struct read_unshard_visitor_t : public boost : : static_visitor < read_response_t > { <nl> } <nl> } ; <nl> <nl> - void read_t : : unshard ( const std : : vector < read_response_t > & responses , read_response_t * response , UNUSED temporary_cache_t * cache ) const THROWS_NOTHING { <nl> - read_unshard_visitor_t v ( responses ) ; <nl> + void read_t : : unshard ( const read_response_t * responses , size_t count , read_response_t * response , UNUSED temporary_cache_t * cache ) const THROWS_NOTHING { <nl> + read_unshard_visitor_t v ( responses , count ) ; <nl> * response = boost : : apply_visitor ( v , query ) ; <nl> } <nl> <nl> / / TODO : get rid of this extra response_t copy on the stack <nl> struct read_multistore_unshard_visitor_t : public boost : : static_visitor < read_response_t > { <nl> - const std : : vector < read_response_t > & bits ; <nl> + const read_response_t * bits ; <nl> + const size_t count ; <nl> <nl> - explicit read_multistore_unshard_visitor_t ( const std : : vector < read_response_t > & b ) : bits ( b ) { } <nl> + explicit read_multistore_unshard_visitor_t ( const read_response_t * b , size_t c ) : bits ( b ) , count ( c ) { } <nl> read_response_t operator ( ) ( UNUSED get_query_t get ) { <nl> - rassert ( bits . size ( ) = = 1 ) ; <nl> + rassert ( count = = 1 ) ; <nl> return read_response_t ( boost : : get < get_result_t > ( bits [ 0 ] . result ) ) ; <nl> } <nl> read_response_t operator ( ) ( rget_query_t rget ) { <nl> std : : vector < key_with_data_buffer_t > pairs ; <nl> - for ( size_t i = 0 ; i < bits . size ( ) ; + + i ) { <nl> + for ( size_t i = 0 ; i < count ; + + i ) { <nl> const rget_result_t * bit = boost : : get < rget_result_t > ( & bits [ i ] . result ) ; <nl> pairs . insert ( pairs . end ( ) , bit - > pairs . begin ( ) , bit - > pairs . end ( ) ) ; <nl> } <nl> struct read_multistore_unshard_visitor_t : public boost : : static_visitor < read_res <nl> return read_response_t ( result ) ; <nl> } <nl> read_response_t operator ( ) ( UNUSED distribution_get_query_t dget ) { <nl> - rassert ( bits . size ( ) > 0 ) ; <nl> + rassert ( count > 0 ) ; <nl> rassert ( boost : : get < distribution_result_t > ( & bits [ 0 ] . result ) ) ; <nl> - rassert ( bits . size ( ) = = 1 | | boost : : get < distribution_result_t > ( & bits [ 1 ] . result ) ) ; <nl> + rassert ( count = = 1 | | boost : : get < distribution_result_t > ( & bits [ 1 ] . result ) ) ; <nl> <nl> / / These test properties of distribution queries sharded by hash rather than key . <nl> - rassert ( bits . size ( ) > 1 ) ; <nl> + rassert ( count > 1 ) ; <nl> rassert ( boost : : get < distribution_result_t > ( & bits [ 0 ] . result ) - > key_counts . begin ( ) - > first = = boost : : get < distribution_result_t > ( & bits [ 1 ] . result ) - > key_counts . begin ( ) - > first ) ; <nl> <nl> distribution_result_t res ; <nl> int64_t total_num_keys = 0 ; <nl> - rassert ( bits . size ( ) > 0 ) ; <nl> + rassert ( count > 0 ) ; <nl> <nl> int64_t total_keys_in_res = 0 ; <nl> - for ( int i = 0 , e = bits . size ( ) ; i < e ; + + i ) { <nl> + for ( int i = 0 , e = count ; i < e ; + + i ) { <nl> const distribution_result_t * result = boost : : get < distribution_result_t > ( & bits [ i ] . result ) ; <nl> rassert ( result , " Bad boost : : get \ n " ) ; <nl> <nl> struct read_multistore_unshard_visitor_t : public boost : : static_visitor < read_res <nl> } <nl> } ; <nl> <nl> - void read_t : : multistore_unshard ( const std : : vector < read_response_t > & responses , read_response_t * response , UNUSED temporary_cache_t * cache ) const THROWS_NOTHING { <nl> - read_multistore_unshard_visitor_t v ( responses ) ; <nl> + void read_t : : multistore_unshard ( const read_response_t * responses , size_t count , read_response_t * response , UNUSED temporary_cache_t * cache ) const THROWS_NOTHING { <nl> + read_multistore_unshard_visitor_t v ( responses , count ) ; <nl> * response = boost : : apply_visitor ( v , query ) ; <nl> } <nl> <nl> write_t write_t : : shard ( DEBUG_ONLY_VAR const region_t & region ) const THROWS_NOTHI <nl> <nl> / * ` write_response_t : : unshard ( ) ` * / <nl> <nl> - void write_t : : unshard ( const std : : vector < write_response_t > & responses , write_response_t * response , UNUSED temporary_cache_t * cache ) const THROWS_NOTHING { <nl> + void write_t : : unshard ( const write_response_t * responses , UNUSED size_t count , write_response_t * response , UNUSED temporary_cache_t * cache ) const THROWS_NOTHING { <nl> / * TODO : Make sure the request type matches the response type * / <nl> - rassert ( responses . size ( ) = = 1 ) ; <nl> + rassert ( count = = 1 ) ; <nl> * response = responses [ 0 ] ; <nl> } <nl> <nl> - void write_t : : multistore_unshard ( const std : : vector < write_response_t > & responses , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING { <nl> - unshard ( responses , response , cache ) ; <nl> + void write_t : : multistore_unshard ( const write_response_t * responses , size_t count , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING { <nl> + unshard ( responses , count , response , cache ) ; <nl> } <nl> <nl> <nl> mmm a / src / memcached / protocol . hpp <nl> ppp b / src / memcached / protocol . hpp <nl> class memcached_protocol_t { <nl> <nl> region_t get_region ( ) const THROWS_NOTHING ; <nl> read_t shard ( const region_t & region ) const THROWS_NOTHING ; <nl> - void unshard ( const std : : vector < read_response_t > & responses , read_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> - void multistore_unshard ( const std : : vector < read_response_t > & responses , read_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> + void unshard ( const read_response_t * responses , size_t count , read_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> + void multistore_unshard ( const read_response_t * responses , size_t count , read_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> <nl> read_t ( ) { } <nl> read_t ( const read_t & r ) : query ( r . query ) , effective_time ( r . effective_time ) { } <nl> class memcached_protocol_t { <nl> typedef boost : : variant < get_cas_mutation_t , sarc_mutation_t , delete_mutation_t , incr_decr_mutation_t , append_prepend_mutation_t > query_t ; <nl> region_t get_region ( ) const THROWS_NOTHING ; <nl> write_t shard ( const region_t & region ) const THROWS_NOTHING ; <nl> - void unshard ( const std : : vector < write_response_t > & responses , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> - void multistore_unshard ( const std : : vector < write_response_t > & responses , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> + void unshard ( const write_response_t * responses , size_t count , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> + void multistore_unshard ( const write_response_t * responses , size_t count , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> <nl> write_t ( ) { } <nl> write_t ( const write_t & w ) : mutation ( w . mutation ) , proposed_cas ( w . proposed_cas ) , effective_time ( w . effective_time ) { } <nl> mmm a / src / mock / dummy_protocol . cc <nl> ppp b / src / mock / dummy_protocol . cc <nl> dummy_protocol_t : : read_t dummy_protocol_t : : read_t : : shard ( region_t region ) const <nl> return r ; <nl> } <nl> <nl> - void dummy_protocol_t : : read_t : : unshard ( std : : vector < read_response_t > resps , dummy_protocol_t : : read_response_t * response , UNUSED temporary_cache_t * cache ) const { <nl> + void dummy_protocol_t : : read_t : : unshard ( const read_response_t * resps , size_t count , dummy_protocol_t : : read_response_t * response , UNUSED temporary_cache_t * cache ) const { <nl> rassert ( cache ! = NULL ) ; <nl> - for ( size_t i = 0 ; i < resps . size ( ) ; + + i ) { <nl> + for ( size_t i = 0 ; i < count ; + + i ) { <nl> for ( std : : map < std : : string , std : : string > : : const_iterator it = resps [ i ] . values . begin ( ) ; <nl> it ! = resps [ i ] . values . end ( ) ; it + + ) { <nl> rassert ( keys . keys . count ( ( * it ) . first ) ! = 0 , <nl> void dummy_protocol_t : : read_t : : unshard ( std : : vector < read_response_t > resps , dummy <nl> } <nl> } <nl> <nl> - void dummy_protocol_t : : read_t : : multistore_unshard ( const std : : vector < read_response_t > & resps , read_response_t * response , UNUSED temporary_cache_t * cache ) const { <nl> - unshard ( resps , response , cache ) ; <nl> + void dummy_protocol_t : : read_t : : multistore_unshard ( const read_response_t * resps , size_t count , read_response_t * response , UNUSED temporary_cache_t * cache ) const { <nl> + unshard ( resps , count , response , cache ) ; <nl> } <nl> <nl> dummy_protocol_t : : region_t dummy_protocol_t : : write_t : : get_region ( ) const { <nl> dummy_protocol_t : : write_t dummy_protocol_t : : write_t : : shard ( region_t region ) cons <nl> return w ; <nl> } <nl> <nl> - void dummy_protocol_t : : write_t : : unshard ( std : : vector < write_response_t > resps , write_response_t * response , UNUSED temporary_cache_t * cache ) const { <nl> + void dummy_protocol_t : : write_t : : unshard ( const write_response_t * resps , size_t count , write_response_t * response , UNUSED temporary_cache_t * cache ) const { <nl> rassert ( cache ! = NULL ) ; <nl> - for ( size_t i = 0 ; i < resps . size ( ) ; + + i ) { <nl> + for ( size_t i = 0 ; i < count ; + + i ) { <nl> for ( std : : map < std : : string , std : : string > : : const_iterator it = resps [ i ] . old_values . begin ( ) ; <nl> it ! = resps [ i ] . old_values . end ( ) ; it + + ) { <nl> rassert ( values . find ( ( * it ) . first ) ! = values . end ( ) , <nl> void dummy_protocol_t : : write_t : : unshard ( std : : vector < write_response_t > resps , wri <nl> } <nl> } <nl> <nl> - void dummy_protocol_t : : write_t : : multistore_unshard ( const std : : vector < write_response_t > & resps , write_response_t * response , UNUSED temporary_cache_t * cache ) const { <nl> - return unshard ( resps , response , cache ) ; <nl> + void dummy_protocol_t : : write_t : : multistore_unshard ( const write_response_t * resps , size_t count , write_response_t * response , UNUSED temporary_cache_t * cache ) const { <nl> + return unshard ( resps , count , response , cache ) ; <nl> } <nl> <nl> bool region_is_superset ( dummy_protocol_t : : region_t a , dummy_protocol_t : : region_t b ) { <nl> mmm a / src / mock / dummy_protocol . hpp <nl> ppp b / src / mock / dummy_protocol . hpp <nl> class dummy_protocol_t { <nl> public : <nl> region_t get_region ( ) const ; <nl> read_t shard ( region_t region ) const ; <nl> - void unshard ( std : : vector < read_response_t > resps , read_response_t * response , temporary_cache_t * cache ) const ; <nl> - void multistore_unshard ( const std : : vector < read_response_t > & resps , read_response_t * response , temporary_cache_t * cache ) const ; <nl> + void unshard ( const read_response_t * resps , size_t count , read_response_t * response , temporary_cache_t * cache ) const ; <nl> + void multistore_unshard ( const read_response_t * resps , size_t count , read_response_t * response , temporary_cache_t * cache ) const ; <nl> <nl> RDB_MAKE_ME_SERIALIZABLE_1 ( keys ) ; <nl> region_t keys ; <nl> class dummy_protocol_t { <nl> public : <nl> region_t get_region ( ) const ; <nl> write_t shard ( region_t region ) const ; <nl> - void unshard ( std : : vector < write_response_t > resps , write_response_t * response , temporary_cache_t * cache ) const ; <nl> - void multistore_unshard ( const std : : vector < write_response_t > & resps , write_response_t * response , temporary_cache_t * cache ) const ; <nl> + void unshard ( const write_response_t * resps , size_t count , write_response_t * response , temporary_cache_t * cache ) const ; <nl> + void multistore_unshard ( const write_response_t * resps , size_t count , write_response_t * response , temporary_cache_t * cache ) const ; <nl> <nl> RDB_MAKE_ME_SERIALIZABLE_1 ( values ) ; <nl> std : : map < std : : string , std : : string > values ; <nl> mmm a / src / rdb_protocol / protocol . cc <nl> ppp b / src / rdb_protocol / protocol . cc <nl> bool read_response_cmp ( const read_response_t & l , const read_response_t & r ) { <nl> return lr - > key_range < rr - > key_range ; <nl> } <nl> <nl> - void read_t : : unshard ( std : : vector < read_response_t > responses , read_response_t * response , temporary_cache_t * ) const THROWS_NOTHING { <nl> + void read_t : : unshard ( read_response_t * responses , size_t count , read_response_t * response , temporary_cache_t * ) const THROWS_NOTHING { <nl> const point_read_t * pr = boost : : get < point_read_t > ( & read ) ; <nl> const rget_read_t * rg = boost : : get < rget_read_t > ( & read ) ; <nl> if ( pr ) { <nl> - rassert ( responses . size ( ) = = 1 ) ; <nl> + rassert ( count = = 1 ) ; <nl> rassert ( boost : : get < point_read_response_t > ( & responses [ 0 ] . response ) ) ; <nl> * response = responses [ 0 ] ; <nl> } else if ( rg ) { <nl> - std : : sort ( responses . begin ( ) , responses . end ( ) , read_response_cmp ) ; <nl> + std : : sort ( responses , responses + count , read_response_cmp ) ; <nl> response - > response = rget_read_response_t ( ) ; <nl> rget_read_response_t & rg_response = boost : : get < rget_read_response_t > ( response - > response ) ; <nl> rg_response . truncated = false ; <nl> rg_response . key_range = get_region ( ) . inner ; <nl> - typedef std : : vector < read_response_t > : : iterator rri_t ; <nl> <nl> if ( ! rg - > terminal ) { <nl> / / A vanilla range get <nl> rg_response . result = stream_t ( ) ; <nl> stream_t * res_stream = boost : : get < stream_t > ( & rg_response . result ) ; <nl> - for ( rri_t i = responses . begin ( ) ; i ! = responses . end ( ) ; + + i ) { <nl> + for ( size_t i = 0 ; i < count ; + + i ) { <nl> / / TODO : we ' re ignoring the limit when recombining . <nl> - const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & i - > response ) ; <nl> + const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & responses [ i ] . response ) ; <nl> rassert ( _rr ) ; <nl> <nl> const stream_t * stream = boost : : get < stream_t > ( & ( _rr - > result ) ) ; <nl> void read_t : : unshard ( std : : vector < read_response_t > responses , read_response_t * re <nl> / / GroupedMapreduce <nl> rg_response . result = groups_t ( ) ; <nl> groups_t * res_groups = boost : : get < groups_t > ( & rg_response . result ) ; <nl> - for ( rri_t i = responses . begin ( ) ; i ! = responses . end ( ) ; + + i ) { <nl> - const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & i - > response ) ; <nl> + for ( size_t i = 0 ; i < count ; + + i ) { <nl> + const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & responses [ i ] . response ) ; <nl> guarantee ( _rr ) ; <nl> <nl> const groups_t * groups = boost : : get < groups_t > ( & ( _rr - > result ) ) ; <nl> void read_t : : unshard ( std : : vector < read_response_t > responses , read_response_t * re <nl> Term base = r - > base ( ) ; <nl> * res_atom = eval ( & base , env , backtrace ) ; <nl> <nl> - for ( rri_t i = responses . begin ( ) ; i ! = responses . end ( ) ; + + i ) { <nl> - const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & i - > response ) ; <nl> + for ( size_t i = 0 ; i < count ; + + i ) { <nl> + const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & responses [ i ] . response ) ; <nl> guarantee ( _rr ) ; <nl> <nl> const atom_t * atom = boost : : get < atom_t > ( & ( _rr - > result ) ) ; <nl> void read_t : : unshard ( std : : vector < read_response_t > responses , read_response_t * re <nl> length_t * res_length = boost : : get < length_t > ( & rg_response . result ) ; <nl> res_length - > length = 0 ; <nl> <nl> - for ( rri_t i = responses . begin ( ) ; i ! = responses . end ( ) ; + + i ) { <nl> - const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & i - > response ) ; <nl> + for ( size_t i = 0 ; i < count ; + + i ) { <nl> + const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & responses [ i ] . response ) ; <nl> guarantee ( _rr ) ; <nl> <nl> const length_t * length = boost : : get < length_t > ( & ( _rr - > result ) ) ; <nl> void read_t : : unshard ( std : : vector < read_response_t > responses , read_response_t * re <nl> inserted_t * res_inserted = boost : : get < inserted_t > ( & rg_response . result ) ; <nl> res_inserted - > inserted = 0 ; <nl> <nl> - for ( rri_t i = responses . begin ( ) ; i ! = responses . end ( ) ; + + i ) { <nl> - const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & i - > response ) ; <nl> + for ( size_t i = 0 ; i < count ; + + i ) { <nl> + const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & responses [ i ] . response ) ; <nl> guarantee ( _rr ) ; <nl> <nl> const inserted_t * inserted = boost : : get < inserted_t > ( & ( _rr - > result ) ) ; <nl> bool rget_data_cmp ( const std : : pair < store_key_t , boost : : shared_ptr < scoped_cJSON_t <nl> return a . first < b . first ; <nl> } <nl> <nl> - void merge_slices_onto_result ( std : : vector < read_response_t > : : iterator begin , <nl> - std : : vector < read_response_t > : : iterator end , <nl> + void merge_slices_onto_result ( const read_response_t * array , <nl> + size_t count , <nl> rget_read_response_t * response ) { <nl> std : : vector < std : : pair < store_key_t , boost : : shared_ptr < scoped_cJSON_t > > > merged ; <nl> <nl> - for ( std : : vector < read_response_t > : : iterator i = begin ; i ! = end ; + + i ) { <nl> - const rget_read_response_t * delta = boost : : get < rget_read_response_t > ( & i - > response ) ; <nl> + for ( size_t i = 0 ; i < count ; + + i ) { <nl> + const rget_read_response_t * delta = boost : : get < rget_read_response_t > ( & array [ i ] . response ) ; <nl> rassert ( delta ) ; <nl> const stream_t * stream = boost : : get < stream_t > ( & delta - > result ) ; <nl> guarantee ( stream ) ; <nl> void merge_slices_onto_result ( std : : vector < read_response_t > : : iterator begin , <nl> stream - > insert ( stream - > end ( ) , merged . begin ( ) , merged . end ( ) ) ; <nl> } <nl> <nl> - void read_t : : multistore_unshard ( std : : vector < read_response_t > responses , read_response_t * response , UNUSED temporary_cache_t * cache ) const THROWS_NOTHING { <nl> + void read_t : : multistore_unshard ( read_response_t * responses , size_t count , read_response_t * response , UNUSED temporary_cache_t * cache ) const THROWS_NOTHING { <nl> const point_read_t * pr = boost : : get < point_read_t > ( & read ) ; <nl> const rget_read_t * rg = boost : : get < rget_read_t > ( & read ) ; <nl> if ( pr ) { <nl> - rassert ( responses . size ( ) = = 1 ) ; <nl> + rassert ( count = = 1 ) ; <nl> rassert ( boost : : get < point_read_response_t > ( & responses [ 0 ] . response ) ) ; <nl> * response = responses [ 0 ] ; <nl> } else if ( rg ) { <nl> - std : : sort ( responses . begin ( ) , responses . end ( ) , read_response_cmp ) ; <nl> + std : : sort ( responses , responses + count , read_response_cmp ) ; <nl> response - > response = rget_read_response_t ( ) ; <nl> rget_read_response_t & rg_response = boost : : get < rget_read_response_t > ( response - > response ) ; <nl> rg_response . truncated = false ; <nl> rg_response . key_range = get_region ( ) . inner ; <nl> - typedef std : : vector < read_response_t > : : iterator rri_t ; <nl> - for ( rri_t i = responses . begin ( ) ; i ! = responses . end ( ) ; ) { <nl> + for ( size_t i = 0 ; i < count ; ) { <nl> / / TODO : we ' re ignoring the limit when recombining . <nl> - const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & i - > response ) ; <nl> + const rget_read_response_t * _rr = boost : : get < rget_read_response_t > ( & responses [ i ] . response ) ; <nl> rassert ( _rr ) ; <nl> rg_response . truncated = rg_response . truncated | | _rr - > truncated ; <nl> <nl> / / Collect all the responses from the same shard and merge their responses into the final response <nl> - rri_t shard_end = i ; <nl> + size_t shard_end = i ; <nl> + + shard_end ; <nl> - while ( shard_end ! = responses . end ( ) ) { <nl> - const rget_read_response_t * _rrr = boost : : get < rget_read_response_t > ( & shard_end - > response ) ; <nl> + while ( shard_end ! = count ) { <nl> + const rget_read_response_t * _rrr = boost : : get < rget_read_response_t > ( & responses [ shard_end ] . response ) ; <nl> rassert ( _rrr ) ; <nl> <nl> if ( _rrr - > key_range ! = _rr - > key_range ) { <nl> void read_t : : multistore_unshard ( std : : vector < read_response_t > responses , read_res <nl> + + shard_end ; <nl> } <nl> <nl> - merge_slices_onto_result ( i , shard_end , & rg_response ) ; <nl> + merge_slices_onto_result ( & responses [ i ] , shard_end - i , & rg_response ) ; <nl> i = shard_end ; <nl> } <nl> <nl> write_t write_t : : shard ( const region_t & region ) const THROWS_NOTHING { <nl> return boost : : apply_visitor ( w_shard_visitor ( region ) , write ) ; <nl> } <nl> <nl> - void write_t : : unshard ( std : : vector < write_response_t > responses , write_response_t * response , temporary_cache_t * ) const THROWS_NOTHING { <nl> - rassert ( responses . size ( ) = = 1 ) ; <nl> + void write_t : : unshard ( const write_response_t * responses , UNUSED size_t count , write_response_t * response , temporary_cache_t * ) const THROWS_NOTHING { <nl> + rassert ( count = = 1 ) ; <nl> * response = responses [ 0 ] ; <nl> } <nl> <nl> - void write_t : : multistore_unshard ( const std : : vector < write_response_t > & responses , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING { <nl> - return unshard ( responses , response , cache ) ; <nl> + void write_t : : multistore_unshard ( const write_response_t * responses , size_t count , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING { <nl> + return unshard ( responses , count , response , cache ) ; <nl> } <nl> <nl> store_t : : store_t ( io_backender_t * io_backend , <nl> mmm a / src / rdb_protocol / protocol . hpp <nl> ppp b / src / rdb_protocol / protocol . hpp <nl> struct rdb_protocol_t { <nl> <nl> region_t get_region ( ) const THROWS_NOTHING ; <nl> read_t shard ( const region_t & region ) const THROWS_NOTHING ; <nl> - void unshard ( std : : vector < read_response_t > responses , read_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> - void multistore_unshard ( std : : vector < read_response_t > responses , read_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> + void unshard ( read_response_t * responses , size_t count , read_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> + void multistore_unshard ( read_response_t * responses , size_t count , read_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> <nl> read_t ( ) { } <nl> read_t ( const read_t & r ) : read ( r . read ) { } <nl> struct rdb_protocol_t { <nl> <nl> region_t get_region ( ) const THROWS_NOTHING ; <nl> write_t shard ( const region_t & region ) const THROWS_NOTHING ; <nl> - void unshard ( std : : vector < write_response_t > responses , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> - void multistore_unshard ( const std : : vector < write_response_t > & responses , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> + void unshard ( const write_response_t * responses , size_t count , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> + void multistore_unshard ( const write_response_t * responses , size_t count , write_response_t * response , temporary_cache_t * cache ) const THROWS_NOTHING ; <nl> <nl> write_t ( ) { } <nl> write_t ( const write_t & w ) : write ( w . write ) { } <nl> mmm a / src / unittest / dummy_namespace_interface . hpp <nl> ppp b / src / unittest / dummy_namespace_interface . hpp <nl> class dummy_sharder_t { <nl> } <nl> } <nl> typename protocol_t : : temporary_cache_t cache ; <nl> - read . unshard ( responses , response , & cache ) ; <nl> + read . unshard ( responses . data ( ) , responses . size ( ) , response , & cache ) ; <nl> } <nl> <nl> void read_outdated ( const typename protocol_t : : read_t & read , typename protocol_t : : read_response_t * response , signal_t * interruptor ) { <nl> class dummy_sharder_t { <nl> } <nl> } <nl> typename protocol_t : : temporary_cache_t cache ; <nl> - read . unshard ( responses , response , & cache ) ; <nl> + read . unshard ( responses . data ( ) , responses . size ( ) , response , & cache ) ; <nl> } <nl> <nl> void write ( const typename protocol_t : : write_t & write , typename protocol_t : : write_response_t * response , order_token_t tok , signal_t * interruptor ) { <nl> class dummy_sharder_t { <nl> } <nl> } <nl> typename protocol_t : : temporary_cache_t cache ; <nl> - write . unshard ( responses , response , & cache ) ; <nl> + write . unshard ( responses . data ( ) , responses . size ( ) , response , & cache ) ; <nl> } <nl> <nl> private : <nl>
|
modified multistore_ptr_t to be more efficient on reads , could still use some cleanup
|
rethinkdb/rethinkdb
|
1065e67b81fec7a536aafa0afa8895e894d21b90
|
2012-08-27T19:31:30Z
|
mmm a / lib / Parse / Lexer . cpp <nl> ppp b / lib / Parse / Lexer . cpp <nl> static SourceLoc getLocForStartOfTokenInBuf ( SourceManager & SM , <nl> unsigned BufferID , <nl> unsigned Offset , <nl> unsigned BufferStart , <nl> - unsigned BufferEnd , <nl> - bool InInterpolatedString ) { <nl> + unsigned BufferEnd ) { <nl> / / Use fake language options ; language options only affect validity <nl> / / and the exact token produced . <nl> LangOptions FakeLangOptions ; <nl> static SourceLoc getLocForStartOfTokenInBuf ( SourceManager & SM , <nl> / / Current token encompasses our source location . <nl> <nl> if ( Tok . is ( tok : : string_literal ) ) { <nl> - assert ( ! InInterpolatedString ) ; <nl> SmallVector < Lexer : : StringSegment , 4 > Segments ; <nl> Lexer : : getStringLiteralSegments ( Tok , Segments , / * Diags = * / nullptr ) ; <nl> for ( auto & Seg : Segments ) { <nl> static SourceLoc getLocForStartOfTokenInBuf ( SourceManager & SM , <nl> if ( Seg . Kind = = Lexer : : StringSegment : : Expr & & Offset < SegEnd ) <nl> return getLocForStartOfTokenInBuf ( SM , BufferID , Offset , <nl> / * BufferStart = * / SegOffs , <nl> - / * BufferEnd = * / SegEnd , <nl> - / * InInterpolatedString = * / true ) ; <nl> + / * BufferEnd = * / SegEnd ) ; <nl> } <nl> } <nl> <nl> SourceLoc Lexer : : getLocForStartOfToken ( SourceManager & SM , unsigned BufferID , <nl> <nl> return getLocForStartOfTokenInBuf ( SM , BufferID , Offset , <nl> / * BufferStart = * / LexStart - BufStart , <nl> - / * BufferEnd = * / Buffer . size ( ) , <nl> - / * InInterpolatedString = * / false ) ; <nl> + / * BufferEnd = * / Buffer . size ( ) ) ; <nl> } <nl> <nl> SourceLoc Lexer : : getLocForStartOfLine ( SourceManager & SM , SourceLoc Loc ) { <nl> new file mode 100644 <nl> index 000000000000 . . 56904f37aebe <nl> mmm / dev / null <nl> ppp b / test / SourceKit / CursorInfo / rdar_31539499 . swift <nl> <nl> + / / Checks that we don ' t crash <nl> + / / RUN : % sourcekitd - test - req = cursor - pos = 6 : 30 % s - - % s | % FileCheck % s <nl> + / / CHECK : source . lang . swift . ref . var . global <nl> + <nl> + let y = 1 <nl> + print ( " text : \ ( " he \ ( / * here * / y ) lo " ) " ) <nl>
|
Merge pull request from nathawes / rdar31539499 - cursorinfo - nested - interpolated - strings
|
apple/swift
|
ea36b9892b94d54032008e00979fa9e22572cd7f
|
2017-04-10T21:19:10Z
|
mmm a / torch / csrc / utils / hash . h <nl> ppp b / torch / csrc / utils / hash . h <nl> <nl> # pragma once <nl> <nl> # include < functional > <nl> + # include < vector > <nl> # include < ATen / ATen . h > <nl> <nl> namespace torch { <nl> auto dispatch_hash ( const T & o ) - > decltype ( std : : hash < T > ( ) ( o ) , std : : size_t ( ) ) { <nl> } <nl> <nl> template < typename T > <nl> - auto dispatch_hash ( const T & o ) - > decltype ( ( typename std : : enable_if < std : : is_enum < T > : : value , std : : size_t > : : type ) { } ) { <nl> + typename std : : enable_if < std : : is_enum < T > : : value , std : : size_t > : : type dispatch_hash ( const T & o ) { <nl> return std : : hash < int > ( ) ( static_cast < int > ( o ) ) ; <nl> } <nl> <nl>
|
Fix GCC 4 . 8 build
|
pytorch/pytorch
|
23ca19ae3d1d62600185214dfbf5c0d98d754b6c
|
2017-11-17T16:54:28Z
|
mmm a / js / apps / system / _admin / aardvark / APP / frontend / js / views / documentView . js <nl> ppp b / js / apps / system / _admin / aardvark / APP / frontend / js / views / documentView . js <nl> <nl> } <nl> <nl> model = JSON . stringify ( model ) ; <nl> + console . log ( model ) ; <nl> + console . log ( this . type ) ; <nl> <nl> - if ( this . type . _from & & this . type . _to ) { <nl> + if ( this . type = = = ' edge ' | | this . type . _from ) { <nl> var callbackE = function ( error , data ) { <nl> if ( error ) { <nl> arangoHelper . arangoError ( ' Error ' , data . responseJSON . errorMessage ) ; <nl> <nl> } <nl> } . bind ( this ) ; <nl> <nl> - this . collection . saveEdge ( this . colid , this . docid , this . type . _from , this . type . _to , model , callbackE ) ; <nl> + this . collection . saveEdge ( this . colid , this . docid , $ ( ' # document - from ' ) . html ( ) , $ ( ' # document - to ' ) . html ( ) , model , callbackE ) ; <nl> } else { <nl> var callback = function ( error , data ) { <nl> if ( error ) { <nl> mmm a / js / apps / system / _admin / aardvark / APP / frontend / js / views / graphViewer . js <nl> ppp b / js / apps / system / _admin / aardvark / APP / frontend / js / views / graphViewer . js <nl> <nl> var callback = function ( error , data , id ) { <nl> if ( ! error ) { <nl> var attributes = ' ' ; <nl> - attributes + = ' < span class = " title " > ID < / span > < span class = " nodeId " > ' + data . _id + ' < / span > ' ; <nl> - if ( Object . keys ( data ) . length > 3 ) { <nl> + attributes + = ' < span class = " title " > ID < / span > < span class = " nodeId " > ' + data . documents [ 0 ] . _id + ' < / span > ' ; <nl> + if ( Object . keys ( data . documents [ 0 ] ) . length > 3 ) { <nl> attributes + = ' < span class = " title " > ATTRIBUTES < / span > ' ; <nl> } <nl> - _ . each ( data , function ( value , key ) { <nl> + _ . each ( data . documents [ 0 ] , function ( value , key ) { <nl> if ( key ! = = ' _key ' & & key ! = = ' _id ' & & key ! = = ' _rev ' & & key ! = = ' _from ' & & key ! = = ' _to ' ) { <nl> attributes + = ' < span class = " nodeAttribute " > ' + key + ' < / span > ' ; <nl> } <nl>
|
Merge remote - tracking branch ' origin / devel ' into feature / ldap - auth
|
arangodb/arangodb
|
f8e73763ef6c3932754cf636a9d26674a9512ea6
|
2017-03-26T08:23:06Z
|
mmm a / modules / perception / data / obstacle_common_test / QB9178_3_1461381834_1461382134_30651 . pcd <nl> ppp b / modules / perception / data / obstacle_common_test / QB9178_3_1461381834_1461382134_30651 . pcd <nl> <nl> - 3 14 . 1913 - 63 . 8893 1 . 10654 195 14 . 1589 - 64 . 0393 0 . 374468 255 14 . 215 - 64 . 0288 0 . 747298 235 <nl> - 76 16 . 9306 - 61 . 465 1 . 0824 213 16 . 8195 - 61 . 4375 1 . 08166 230 16 . 6193 - 61 . 4629 1 . 0813 209 16 . 2218 - 61 . 5197 1 . 08084 214 16 . 0306 - 61 . 5781 1 . 08097 222 15 . 8243 - 61 . 5776 1 . 08028 255 15 . 6305 - 61 . 625 1 . 08028 229 15 . 4268 - 61 . 633 1 . 07972 253 15 . 2285 - 61 . 658 1 . 07957 255 15 . 0367 - 61 . 7132 1 . 07971 228 17 . 4557 - 61 . 4336 1 . 41825 255 14 . 8141 - 61 . 6394 1 . 07802 255 17 . 252 - 61 . 4495 1 . 41751 255 14 . 6329 - 61 . 7381 1 . 07879 224 14 . 5319 - 61 . 7434 1 . 07856 253 14 . 3331 - 61 . 7672 1 . 07828 253 16 . 7467 - 61 . 4999 1 . 41595 255 14 . 1343 - 61 . 7867 1 . 07811 251 13 . 9433 - 61 . 8443 1 . 07832 229 16 . 3453 - 61 . 5441 1 . 41497 255 16 . 145 - 61 . 5679 1 . 41446 255 15 . 9466 - 61 . 5988 1 . 41411 255 15 . 7497 - 61 . 6349 1 . 41386 255 15 . 5469 - 61 . 6471 1 . 41316 255 15 . 3479 - 61 . 6706 1 . 41285 255 15 . 1509 - 61 . 7048 1 . 41261 255 17 . 4532 - 61 . 4412 1 . 80751 213 14 . 9525 - 61 . 7325 1 . 41225 255 17 . 2452 - 61 . 4416 1 . 80612 201 14 . 7298 - 61 . 6584 1 . 40992 255 17 . 0394 - 61 . 4491 1 . 80494 202 14 . 6566 - 61 . 7807 1 . 41188 255 16 . 9362 - 61 . 4507 1 . 80432 201 14 . 4512 - 61 . 7776 1 . 41095 255 16 . 7411 - 61 . 4958 1 . 80414 203 14 . 2537 - 61 . 8033 1 . 41075 255 14 . 0539 - 61 . 8223 1 . 41028 255 16 . 3475 - 61 . 5688 1 . 80354 185 16 . 1475 - 61 . 5945 1 . 80291 185 15 . 9446 - 61 . 608 1 . 80198 185 15 . 7453 - 61 . 6344 1 . 8014 185 15 . 5478 - 61 . 6679 1 . 80102 185 15 . 3498 - 61 . 6952 1 . 80065 185 15 . 1494 - 61 . 7158 1 . 79997 185 17 . 6189 - 61 . 3696 2 . 22456 215 14 . 9495 - 61 . 7376 1 . 79933 185 17 . 4256 - 61 . 4226 2 . 22452 230 14 . 6915 - 61 . 5137 1 . 79238 184 17 . 2187 - 61 . 4268 2 . 2229 255 17 . 1202 - 61 . 446 2 . 22267 231 14 . 4474 - 61 . 7788 1 . 79749 200 16 . 9124 - 61 . 4454 2 . 22092 255 14 . 2535 - 61 . 82 1 . 79757 185 16 . 7193 - 61 . 4945 2 . 22098 230 14 . 0558 - 61 . 8487 1 . 79719 185 16 . 315 - 61 . 5303 2 . 2188 255 16 . 1233 - 61 . 5869 2 . 21902 231 15 . 9129 - 61 . 5713 2 . 21689 255 15 . 7201 - 61 . 6227 2 . 21697 231 15 . 5163 - 61 . 6273 2 . 2157 255 15 . 3247 - 61 . 6833 2 . 21597 231 15 . 12 - 61 . 6863 2 . 21454 255 14 . 9291 - 61 . 745 2 . 21494 233 14 . 72 - 61 . 7272 2 . 21287 255 14 . 6236 - 61 . 7521 2 . 21296 228 14 . 4211 - 61 . 7569 2 . 21181 255 14 . 2299 - 61 . 8134 2 . 21221 230 14 . 0256 - 61 . 8128 2 . 21077 255 17 . 332 - 61 . 4452 0 . 731885 235 14 . 7769 - 61 . 7469 0 . 368853 255 17 . 1314 - 61 . 4687 0 . 731805 235 16 . 932 - 61 . 4988 0 . 731629 235 16 . 731 - 61 . 5226 0 . 731403 235 16 . 5321 - 61 . 5534 0 . 731243 235 13 . 9016 - 61 . 9409 0 . 368936 255 13 . 9427 - 61 . 8782 0 . 729348 235 <nl> - 4 29 . 7949 - 55 . 0599 2 . 18182 207 29 . 3628 - 54 . 6707 2 . 16454 182 29 . 2374 - 54 . 6428 2 . 16191 201 29 . 1098 - 54 . 8174 2 . 16491 206 <nl> - 7 13 . 2007 - 53 . 6192 0 . 347656 255 13 . 0187 - 53 . 6039 0 . 347528 255 13 . 5003 - 53 . 2234 0 . 658881 235 13 . 3293 - 53 . 2498 0 . 658768 235 13 . 1559 - 53 . 266 0 . 658572 235 12 . 9868 - 53 . 299 0 . 658524 235 12 . 8205 - 53 . 3396 0 . 658683 235 <nl> - 11 15 . 1235 - 53 . 3189 - 0 . 318568 255 14 . 7625 - 53 . 3181 - 0 . 317596 255 15 . 0667 - 53 . 3429 - 0 . 0216523 255 14 . 8923 - 53 . 3648 - 0 . 0215248 255 14 . 3726 - 53 . 4369 - 0 . 0210415 255 14 . 1057 - 53 . 4458 - 0 . 0207527 255 15 . 0182 - 53 . 372 0 . 347728 255 14 . 8459 - 53 . 3978 0 . 347835 255 14 . 6635 - 53 . 3899 0 . 347712 255 14 . 499 - 53 . 4471 0 . 347762 255 13 . 9987 - 53 . 0904 0 . 658651 235 <nl> + 3 14 . 1913 - 63 . 8893 1 . 10654 195 14 . 1589 - 64 . 0393 0 . 374468 255 14 . 215 - 64 . 0288 0 . 747298 235 <nl> + 76 16 . 9306 - 61 . 465 1 . 0824 213 16 . 8195 - 61 . 4375 1 . 08166 230 16 . 6193 - 61 . 4629 1 . 0813 209 16 . 2218 - 61 . 5197 1 . 08084 214 16 . 0306 - 61 . 5781 1 . 08097 222 15 . 8243 - 61 . 5776 1 . 08028 255 15 . 6305 - 61 . 625 1 . 08028 229 15 . 4268 - 61 . 633 1 . 07972 253 15 . 2285 - 61 . 658 1 . 07957 255 15 . 0367 - 61 . 7132 1 . 07971 228 17 . 4557 - 61 . 4336 1 . 41825 255 14 . 8141 - 61 . 6394 1 . 07802 255 17 . 252 - 61 . 4495 1 . 41751 255 14 . 6329 - 61 . 7381 1 . 07879 224 14 . 5319 - 61 . 7434 1 . 07856 253 14 . 3331 - 61 . 7672 1 . 07828 253 16 . 7467 - 61 . 4999 1 . 41595 255 14 . 1343 - 61 . 7867 1 . 07811 251 13 . 9433 - 61 . 8443 1 . 07832 229 16 . 3453 - 61 . 5441 1 . 41497 255 16 . 145 - 61 . 5679 1 . 41446 255 15 . 9466 - 61 . 5988 1 . 41411 255 15 . 7497 - 61 . 6349 1 . 41386 255 15 . 5469 - 61 . 6471 1 . 41316 255 15 . 3479 - 61 . 6706 1 . 41285 255 15 . 1509 - 61 . 7048 1 . 41261 255 17 . 4532 - 61 . 4412 1 . 80751 213 14 . 9525 - 61 . 7325 1 . 41225 255 17 . 2452 - 61 . 4416 1 . 80612 201 14 . 7298 - 61 . 6584 1 . 40992 255 17 . 0394 - 61 . 4491 1 . 80494 202 14 . 6566 - 61 . 7807 1 . 41188 255 16 . 9362 - 61 . 4507 1 . 80432 201 14 . 4512 - 61 . 7776 1 . 41095 255 16 . 7411 - 61 . 4958 1 . 80414 203 14 . 2537 - 61 . 8033 1 . 41075 255 14 . 0539 - 61 . 8223 1 . 41028 255 16 . 3475 - 61 . 5688 1 . 80354 185 16 . 1475 - 61 . 5945 1 . 80291 185 15 . 9446 - 61 . 608 1 . 80198 185 15 . 7453 - 61 . 6344 1 . 8014 185 15 . 5478 - 61 . 6679 1 . 80102 185 15 . 3498 - 61 . 6952 1 . 80065 185 15 . 1494 - 61 . 7158 1 . 79997 185 17 . 6189 - 61 . 3696 2 . 22456 215 14 . 9495 - 61 . 7376 1 . 79933 185 17 . 4256 - 61 . 4226 2 . 22452 230 14 . 6915 - 61 . 5137 1 . 79238 184 17 . 2187 - 61 . 4268 2 . 2229 255 17 . 1202 - 61 . 446 2 . 22267 231 14 . 4474 - 61 . 7788 1 . 79749 200 16 . 9124 - 61 . 4454 2 . 22092 255 14 . 2535 - 61 . 82 1 . 79757 185 16 . 7193 - 61 . 4945 2 . 22098 230 14 . 0558 - 61 . 8487 1 . 79719 185 16 . 315 - 61 . 5303 2 . 2188 255 16 . 1233 - 61 . 5869 2 . 21902 231 15 . 9129 - 61 . 5713 2 . 21689 255 15 . 7201 - 61 . 6227 2 . 21697 231 15 . 5163 - 61 . 6273 2 . 2157 255 15 . 3247 - 61 . 6833 2 . 21597 231 15 . 12 - 61 . 6863 2 . 21454 255 14 . 9291 - 61 . 745 2 . 21494 233 14 . 72 - 61 . 7272 2 . 21287 255 14 . 6236 - 61 . 7521 2 . 21296 228 14 . 4211 - 61 . 7569 2 . 21181 255 14 . 2299 - 61 . 8134 2 . 21221 230 14 . 0256 - 61 . 8128 2 . 21077 255 17 . 332 - 61 . 4452 0 . 731885 235 14 . 7769 - 61 . 7469 0 . 368853 255 17 . 1314 - 61 . 4687 0 . 731805 235 16 . 932 - 61 . 4988 0 . 731629 235 16 . 731 - 61 . 5226 0 . 731403 235 16 . 5321 - 61 . 5534 0 . 731243 235 13 . 9016 - 61 . 9409 0 . 368936 255 13 . 9427 - 61 . 8782 0 . 729348 235 <nl> + 4 29 . 7949 - 55 . 0599 2 . 18182 207 29 . 3628 - 54 . 6707 2 . 16454 182 29 . 2374 - 54 . 6428 2 . 16191 201 29 . 1098 - 54 . 8174 2 . 16491 206 <nl> + 7 13 . 2007 - 53 . 6192 0 . 347656 255 13 . 0187 - 53 . 6039 0 . 347528 255 13 . 5003 - 53 . 2234 0 . 658881 235 13 . 3293 - 53 . 2498 0 . 658768 235 13 . 1559 - 53 . 266 0 . 658572 235 12 . 9868 - 53 . 299 0 . 658524 235 12 . 8205 - 53 . 3396 0 . 658683 235 <nl> + 11 15 . 1235 - 53 . 3189 - 0 . 318568 255 14 . 7625 - 53 . 3181 - 0 . 317596 255 15 . 0667 - 53 . 3429 - 0 . 0216523 255 14 . 8923 - 53 . 3648 - 0 . 0215248 255 14 . 3726 - 53 . 4369 - 0 . 0210415 255 14 . 1057 - 53 . 4458 - 0 . 0207527 255 15 . 0182 - 53 . 372 0 . 347728 255 14 . 8459 - 53 . 3978 0 . 347835 255 14 . 6635 - 53 . 3899 0 . 347712 255 14 . 499 - 53 . 4471 0 . 347762 255 13 . 9987 - 53 . 0904 0 . 658651 235 <nl> mmm a / modules / perception / obstacle / common / convex_hullxy_test . cc <nl> ppp b / modules / perception / obstacle / common / convex_hullxy_test . cc <nl> <nl> <nl> # include " modules / perception / obstacle / common / convex_hullxy . h " <nl> <nl> + # include < boost / algorithm / string . hpp > <nl> # include < fstream > <nl> <nl> # include " gtest / gtest . h " <nl> static bool ConstructPointCloud ( std : : vector < pcl_util : : PointCloudPtr > * clouds ) { <nl> std : : string point_buf ; <nl> while ( cluster_ifs . good ( ) ) { <nl> getline ( cluster_ifs , point_buf ) ; <nl> + std : : vector < std : : string > point_strs ; <nl> + boost : : algorithm : : split ( point_strs , point_buf , <nl> + boost : : algorithm : : is_any_of ( " " ) ) ; <nl> + if ( point_strs . size ( ) < = 1 | | ( point_strs . size ( ) - 1 ) % 4 ! = 0 ) { <nl> + continue ; <nl> + } <nl> std : : stringstream ss ; <nl> ss < < point_buf ; <nl> int point_num = 0 ; <nl> ss > > point_num ; <nl> - if ( point_num < = 0 ) { <nl> + int exact_point_num = ( point_strs . size ( ) - 1 ) / 4 ; <nl> + if ( point_num ! = exact_point_num ) { <nl> continue ; <nl> } <nl> uint64_t intensity ; <nl> pcl_util : : PointCloudPtr cluster_cloud ( new pcl_util : : PointCloud ) ; <nl> - for ( int i = 0 ; i < point_num ; + + i ) { <nl> + for ( int i = 0 ; i < exact_point_num ; + + i ) { <nl> pcl_util : : Point p ; <nl> ss > > p . x > > p . y > > p . z > > intensity ; <nl> p . intensity = static_cast < uint8_t > ( intensity ) ; <nl> static bool ConstructPointCloud ( std : : vector < pcl_util : : PointCloudPtr > * clouds ) { <nl> TEST ( ConvexHull2DXYTest , Reconstruct2dxy ) { <nl> std : : vector < pcl_util : : PointCloudPtr > clouds ; <nl> ConstructPointCloud ( & clouds ) ; <nl> - EXPECT_EQ ( 5 , clouds . size ( ) ) ; <nl> + ASSERT_EQ ( 5 , clouds . size ( ) ) ; <nl> ConvexHull2DXY < pcl_util : : Point > convex_hull ; <nl> EXPECT_EQ ( convex_hull . getClassName ( ) , " ConvexHull2DXY " ) ; <nl> std : : vector < pcl : : Vertices > poly_vt ; <nl> mmm a / modules / perception / obstacle / common / geometry_util_test . cc <nl> ppp b / modules / perception / obstacle / common / geometry_util_test . cc <nl> <nl> <nl> # include " modules / perception / obstacle / common / geometry_util . h " <nl> <nl> + # include < boost / algorithm / string . hpp > <nl> # include < cfloat > <nl> # include < fstream > <nl> # include < string > <nl> static bool ConstructPointCloud ( std : : vector < pcl_util : : PointCloudPtr > * clouds ) { <nl> std : : string point_buf ; <nl> while ( cluster_ifs . good ( ) ) { <nl> getline ( cluster_ifs , point_buf ) ; <nl> + std : : vector < std : : string > point_strs ; <nl> + boost : : algorithm : : split ( point_strs , point_buf , <nl> + boost : : algorithm : : is_any_of ( " " ) ) ; <nl> + if ( point_strs . size ( ) < = 1 | | ( point_strs . size ( ) - 1 ) % 4 ! = 0 ) { <nl> + continue ; <nl> + } <nl> std : : stringstream ss ; <nl> ss < < point_buf ; <nl> int point_num = 0 ; <nl> ss > > point_num ; <nl> - if ( point_num < = 0 ) { <nl> + int exact_point_num = ( point_strs . size ( ) - 1 ) / 4 ; <nl> + if ( point_num ! = exact_point_num ) { <nl> continue ; <nl> } <nl> uint64_t intensity ; <nl> pcl_util : : PointCloudPtr cluster_cloud ( new pcl_util : : PointCloud ) ; <nl> - for ( int i = 0 ; i < point_num ; + + i ) { <nl> + for ( int i = 0 ; i < exact_point_num ; + + i ) { <nl> pcl_util : : Point p ; <nl> ss > > p . x > > p . y > > p . z > > intensity ; <nl> p . intensity = static_cast < uint8_t > ( intensity ) ; <nl> class GeometryUtilTest : public testing : : Test { <nl> virtual ~ GeometryUtilTest ( ) { } <nl> void SetUp ( ) { <nl> ConstructPointCloud ( & _clouds ) ; <nl> + ASSERT_EQ ( 5 , _clouds . size ( ) ) ; <nl> Eigen : : Vector3d translation ( - 0 . 0189 , 1 . 0061 , 1 ) ; <nl> Eigen : : Vector4d rotation ( 0 . 0099 , - 0 . 0029 , 0 . 6989 , 0 . 7151 ) ; <nl> TransAffineToMatrix4 ( translation , rotation , & _trans_matrix ) ; <nl> mmm a / modules / perception / obstacle / lidar / tracker / hm_tracker / feature_descriptor . cc <nl> ppp b / modules / perception / obstacle / lidar / tracker / hm_tracker / feature_descriptor . cc <nl> void FeatureDescriptor : : ComputeHistogram ( const int bin_size , <nl> int pt_num = cloud_ - > points . size ( ) ; <nl> for ( int i = 0 ; i < pt_num ; + + i ) { <nl> pcl_util : : Point & pt = cloud_ - > points [ i ] ; <nl> - stat_feat [ static_cast < int > ( ( pt . x - min_pt_ . x ) / xsize ) ] + + ; <nl> - stat_feat [ static_cast < int > ( xstep + ( pt . y - min_pt_ . y ) / ysize ) ] + + ; <nl> - stat_feat [ static_cast < int > ( xstep + ystep + ( pt . z - min_pt_ . z ) / zsize ) ] + + ; <nl> + stat_feat [ floor ( ( pt . x - min_pt_ . x ) / xsize ) ] + + ; <nl> + stat_feat [ xstep + floor ( ( pt . y - min_pt_ . y ) / ysize ) ] + + ; <nl> + stat_feat [ xstep + ystep + floor ( ( pt . z - min_pt_ . z ) / zsize ) ] + + ; <nl> } <nl> / / update feature <nl> ( * feature ) . resize ( stat_len ) ; <nl> mmm a / modules / perception / traffic_light / onboard / tl_preprocessor_subnode . cc <nl> ppp b / modules / perception / traffic_light / onboard / tl_preprocessor_subnode . cc <nl> void TLPreprocessorSubnode : : SubLongFocusCamera ( const sensor_msgs : : Image & msg ) { <nl> AdapterManager : : Observe ( ) ; <nl> SubCameraImage ( AdapterManager : : GetImageLong ( ) - > GetLatestObservedPtr ( ) , <nl> LONG_FOCUS ) ; <nl> + PERF_FUNCTION ( " SubLongFocusCamera " ) ; <nl> } <nl> <nl> void TLPreprocessorSubnode : : SubShortFocusCamera ( const sensor_msgs : : Image & msg ) { <nl> AdapterManager : : Observe ( ) ; <nl> SubCameraImage ( AdapterManager : : GetImageShort ( ) - > GetLatestObservedPtr ( ) , <nl> SHORT_FOCUS ) ; <nl> + PERF_FUNCTION ( " SubShortFocusCamera " ) ; <nl> } <nl> <nl> void TLPreprocessorSubnode : : SubCameraImage ( <nl> boost : : shared_ptr < const sensor_msgs : : Image > msg , CameraId camera_id ) { <nl> const double sub_camera_image_start_ts = TimeUtil : : GetCurrentTime ( ) ; <nl> - PERF_FUNCTION ( ) ; <nl> std : : shared_ptr < Image > image ( new Image ) ; <nl> cv : : Mat cv_mat ; <nl> double timestamp = msg - > header . stamp . toSec ( ) ; <nl> mmm a / modules / perception / traffic_light / onboard / tl_proc_subnode . cc <nl> ppp b / modules / perception / traffic_light / onboard / tl_proc_subnode . cc <nl> bool TLProcSubnode : : InitInternal ( ) { <nl> <nl> bool TLProcSubnode : : ProcEvent ( const Event & event ) { <nl> const double proc_subnode_handle_event_start_ts = TimeUtil : : GetCurrentTime ( ) ; <nl> - PERF_FUNCTION ( ) ; <nl> + PERF_FUNCTION ( " TLProcSubnode " ) ; <nl> / / get up - stream data <nl> const double timestamp = event . timestamp ; <nl> const std : : string device_id = event . reserve ; <nl>
|
perception : fix icafe bug 1030 and 945
|
ApolloAuto/apollo
|
e1cf18ab922a790a1876335631a9f577d9fd805f
|
2018-02-10T18:30:45Z
|
mmm a / src / builtins . h <nl> ppp b / src / builtins . h <nl> enum BuiltinExtraArguments { <nl> V ( SAR_STRONG , 1 ) \ <nl> V ( SHR , 1 ) \ <nl> V ( SHR_STRONG , 1 ) \ <nl> + V ( IN , 1 ) \ <nl> V ( INSTANCE_OF , 1 ) \ <nl> V ( CALL_NON_FUNCTION , 0 ) \ <nl> V ( CALL_NON_FUNCTION_AS_CONSTRUCTOR , 0 ) \ <nl> mmm a / src / compiler / js - generic - lowering . cc <nl> ppp b / src / compiler / js - generic - lowering . cc <nl> void JSGenericLowering : : LowerJSDeleteProperty ( Node * node ) { <nl> <nl> <nl> void JSGenericLowering : : LowerJSHasProperty ( Node * node ) { <nl> - ReplaceWithRuntimeCall ( node , Runtime : : kHasProperty ) ; <nl> + ReplaceWithBuiltinCall ( node , Builtins : : IN , 2 ) ; <nl> } <nl> <nl> <nl> mmm a / src / compiler / js - intrinsic - lowering . cc <nl> ppp b / src / compiler / js - intrinsic - lowering . cc <nl> Reduction JSIntrinsicLowering : : Reduce ( Node * node ) { <nl> return ReduceIsInstanceType ( node , JS_TYPED_ARRAY_TYPE ) ; <nl> case Runtime : : kInlineIsFunction : <nl> return ReduceIsInstanceType ( node , JS_FUNCTION_TYPE ) ; <nl> + case Runtime : : kInlineIsNonNegativeSmi : <nl> + return ReduceIsNonNegativeSmi ( node ) ; <nl> case Runtime : : kInlineIsRegExp : <nl> return ReduceIsInstanceType ( node , JS_REGEXP_TYPE ) ; <nl> case Runtime : : kInlineIsSmi : <nl> Reduction JSIntrinsicLowering : : ReduceIsInstanceType ( <nl> } <nl> <nl> <nl> + Reduction JSIntrinsicLowering : : ReduceIsNonNegativeSmi ( Node * node ) { <nl> + return Change ( node , simplified ( ) - > ObjectIsNonNegativeSmi ( ) ) ; <nl> + } <nl> + <nl> + <nl> Reduction JSIntrinsicLowering : : ReduceIsSmi ( Node * node ) { <nl> return Change ( node , simplified ( ) - > ObjectIsSmi ( ) ) ; <nl> } <nl> mmm a / src / compiler / js - intrinsic - lowering . h <nl> ppp b / src / compiler / js - intrinsic - lowering . h <nl> class JSIntrinsicLowering final : public AdvancedReducer { <nl> Reduction ReduceIncrementStatsCounter ( Node * node ) ; <nl> Reduction ReduceIsMinusZero ( Node * node ) ; <nl> Reduction ReduceIsInstanceType ( Node * node , InstanceType instance_type ) ; <nl> + Reduction ReduceIsNonNegativeSmi ( Node * node ) ; <nl> Reduction ReduceIsSmi ( Node * node ) ; <nl> Reduction ReduceJSValueGetValue ( Node * node ) ; <nl> Reduction ReduceMapGetInstanceType ( Node * node ) ; <nl> mmm a / src / compiler / typer . cc <nl> ppp b / src / compiler / typer . cc <nl> Bounds Typer : : Visitor : : TypeJSCallFunction ( Node * node ) { <nl> Bounds Typer : : Visitor : : TypeJSCallRuntime ( Node * node ) { <nl> switch ( CallRuntimeParametersOf ( node - > op ( ) ) . id ( ) ) { <nl> case Runtime : : kInlineIsSmi : <nl> + case Runtime : : kInlineIsNonNegativeSmi : <nl> case Runtime : : kInlineIsArray : <nl> case Runtime : : kInlineIsDate : <nl> case Runtime : : kInlineIsTypedArray : <nl> mmm a / src / full - codegen / arm / full - codegen - arm . cc <nl> ppp b / src / full - codegen / arm / full - codegen - arm . cc <nl> void FullCodeGenerator : : EmitIsSmi ( CallRuntime * expr ) { <nl> } <nl> <nl> <nl> + void FullCodeGenerator : : EmitIsNonNegativeSmi ( CallRuntime * expr ) { <nl> + ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> + DCHECK ( args - > length ( ) = = 1 ) ; <nl> + <nl> + VisitForAccumulatorValue ( args - > at ( 0 ) ) ; <nl> + <nl> + Label materialize_true , materialize_false ; <nl> + Label * if_true = NULL ; <nl> + Label * if_false = NULL ; <nl> + Label * fall_through = NULL ; <nl> + context ( ) - > PrepareTest ( & materialize_true , & materialize_false , <nl> + & if_true , & if_false , & fall_through ) ; <nl> + <nl> + PrepareForBailoutBeforeSplit ( expr , true , if_true , if_false ) ; <nl> + __ NonNegativeSmiTst ( r0 ) ; <nl> + Split ( eq , if_true , if_false , fall_through ) ; <nl> + <nl> + context ( ) - > Plug ( if_true , if_false ) ; <nl> + } <nl> + <nl> + <nl> void FullCodeGenerator : : EmitIsObject ( CallRuntime * expr ) { <nl> ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> DCHECK ( args - > length ( ) = = 1 ) ; <nl> void FullCodeGenerator : : VisitCompareOperation ( CompareOperation * expr ) { <nl> switch ( op ) { <nl> case Token : : IN : <nl> VisitForStackValue ( expr - > right ( ) ) ; <nl> - __ CallRuntime ( Runtime : : kHasProperty , 2 ) ; <nl> + __ InvokeBuiltin ( Builtins : : IN , CALL_FUNCTION ) ; <nl> PrepareForBailoutBeforeSplit ( expr , false , NULL , NULL ) ; <nl> __ LoadRoot ( ip , Heap : : kTrueValueRootIndex ) ; <nl> __ cmp ( r0 , ip ) ; <nl> mmm a / src / full - codegen / arm64 / full - codegen - arm64 . cc <nl> ppp b / src / full - codegen / arm64 / full - codegen - arm64 . cc <nl> void FullCodeGenerator : : EmitIsSmi ( CallRuntime * expr ) { <nl> } <nl> <nl> <nl> + void FullCodeGenerator : : EmitIsNonNegativeSmi ( CallRuntime * expr ) { <nl> + ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> + DCHECK ( args - > length ( ) = = 1 ) ; <nl> + <nl> + VisitForAccumulatorValue ( args - > at ( 0 ) ) ; <nl> + <nl> + Label materialize_true , materialize_false ; <nl> + Label * if_true = NULL ; <nl> + Label * if_false = NULL ; <nl> + Label * fall_through = NULL ; <nl> + context ( ) - > PrepareTest ( & materialize_true , & materialize_false , <nl> + & if_true , & if_false , & fall_through ) ; <nl> + <nl> + uint64_t sign_mask = V8_UINT64_C ( 1 ) < < ( kSmiShift + kSmiValueSize - 1 ) ; <nl> + <nl> + PrepareForBailoutBeforeSplit ( expr , true , if_true , if_false ) ; <nl> + __ TestAndSplit ( x0 , kSmiTagMask | sign_mask , if_true , if_false , fall_through ) ; <nl> + <nl> + context ( ) - > Plug ( if_true , if_false ) ; <nl> + } <nl> + <nl> + <nl> void FullCodeGenerator : : EmitIsObject ( CallRuntime * expr ) { <nl> ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> DCHECK ( args - > length ( ) = = 1 ) ; <nl> void FullCodeGenerator : : VisitCompareOperation ( CompareOperation * expr ) { <nl> switch ( op ) { <nl> case Token : : IN : <nl> VisitForStackValue ( expr - > right ( ) ) ; <nl> - __ CallRuntime ( Runtime : : kHasProperty , 2 ) ; <nl> + __ InvokeBuiltin ( Builtins : : IN , CALL_FUNCTION ) ; <nl> PrepareForBailoutBeforeSplit ( expr , false , NULL , NULL ) ; <nl> __ CompareRoot ( x0 , Heap : : kTrueValueRootIndex ) ; <nl> Split ( eq , if_true , if_false , fall_through ) ; <nl> mmm a / src / full - codegen / full - codegen . h <nl> ppp b / src / full - codegen / full - codegen . h <nl> class FullCodeGenerator : public AstVisitor { <nl> <nl> # define FOR_EACH_FULL_CODE_INTRINSIC ( F ) \ <nl> F ( IsSmi ) \ <nl> + F ( IsNonNegativeSmi ) \ <nl> F ( IsArray ) \ <nl> F ( IsTypedArray ) \ <nl> F ( IsRegExp ) \ <nl> mmm a / src / full - codegen / ia32 / full - codegen - ia32 . cc <nl> ppp b / src / full - codegen / ia32 / full - codegen - ia32 . cc <nl> void FullCodeGenerator : : EmitIsSmi ( CallRuntime * expr ) { <nl> } <nl> <nl> <nl> + void FullCodeGenerator : : EmitIsNonNegativeSmi ( CallRuntime * expr ) { <nl> + ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> + DCHECK ( args - > length ( ) = = 1 ) ; <nl> + <nl> + VisitForAccumulatorValue ( args - > at ( 0 ) ) ; <nl> + <nl> + Label materialize_true , materialize_false ; <nl> + Label * if_true = NULL ; <nl> + Label * if_false = NULL ; <nl> + Label * fall_through = NULL ; <nl> + context ( ) - > PrepareTest ( & materialize_true , & materialize_false , <nl> + & if_true , & if_false , & fall_through ) ; <nl> + <nl> + PrepareForBailoutBeforeSplit ( expr , true , if_true , if_false ) ; <nl> + __ test ( eax , Immediate ( kSmiTagMask | 0x80000000 ) ) ; <nl> + Split ( zero , if_true , if_false , fall_through ) ; <nl> + <nl> + context ( ) - > Plug ( if_true , if_false ) ; <nl> + } <nl> + <nl> + <nl> void FullCodeGenerator : : EmitIsObject ( CallRuntime * expr ) { <nl> ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> DCHECK ( args - > length ( ) = = 1 ) ; <nl> void FullCodeGenerator : : VisitCompareOperation ( CompareOperation * expr ) { <nl> switch ( op ) { <nl> case Token : : IN : <nl> VisitForStackValue ( expr - > right ( ) ) ; <nl> - __ CallRuntime ( Runtime : : kHasProperty , 2 ) ; <nl> + __ InvokeBuiltin ( Builtins : : IN , CALL_FUNCTION ) ; <nl> PrepareForBailoutBeforeSplit ( expr , false , NULL , NULL ) ; <nl> __ cmp ( eax , isolate ( ) - > factory ( ) - > true_value ( ) ) ; <nl> Split ( equal , if_true , if_false , fall_through ) ; <nl> mmm a / src / full - codegen / mips / full - codegen - mips . cc <nl> ppp b / src / full - codegen / mips / full - codegen - mips . cc <nl> void FullCodeGenerator : : EmitIsSmi ( CallRuntime * expr ) { <nl> } <nl> <nl> <nl> + void FullCodeGenerator : : EmitIsNonNegativeSmi ( CallRuntime * expr ) { <nl> + ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> + DCHECK ( args - > length ( ) = = 1 ) ; <nl> + <nl> + VisitForAccumulatorValue ( args - > at ( 0 ) ) ; <nl> + <nl> + Label materialize_true , materialize_false ; <nl> + Label * if_true = NULL ; <nl> + Label * if_false = NULL ; <nl> + Label * fall_through = NULL ; <nl> + context ( ) - > PrepareTest ( & materialize_true , & materialize_false , <nl> + & if_true , & if_false , & fall_through ) ; <nl> + <nl> + PrepareForBailoutBeforeSplit ( expr , true , if_true , if_false ) ; <nl> + __ NonNegativeSmiTst ( v0 , at ) ; <nl> + Split ( eq , at , Operand ( zero_reg ) , if_true , if_false , fall_through ) ; <nl> + <nl> + context ( ) - > Plug ( if_true , if_false ) ; <nl> + } <nl> + <nl> + <nl> void FullCodeGenerator : : EmitIsObject ( CallRuntime * expr ) { <nl> ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> DCHECK ( args - > length ( ) = = 1 ) ; <nl> void FullCodeGenerator : : VisitCompareOperation ( CompareOperation * expr ) { <nl> switch ( op ) { <nl> case Token : : IN : <nl> VisitForStackValue ( expr - > right ( ) ) ; <nl> - __ CallRuntime ( Runtime : : kHasProperty , 2 ) ; <nl> + __ InvokeBuiltin ( Builtins : : IN , CALL_FUNCTION ) ; <nl> PrepareForBailoutBeforeSplit ( expr , false , NULL , NULL ) ; <nl> __ LoadRoot ( t0 , Heap : : kTrueValueRootIndex ) ; <nl> Split ( eq , v0 , Operand ( t0 ) , if_true , if_false , fall_through ) ; <nl> mmm a / src / full - codegen / mips64 / full - codegen - mips64 . cc <nl> ppp b / src / full - codegen / mips64 / full - codegen - mips64 . cc <nl> void FullCodeGenerator : : EmitIsSmi ( CallRuntime * expr ) { <nl> } <nl> <nl> <nl> + void FullCodeGenerator : : EmitIsNonNegativeSmi ( CallRuntime * expr ) { <nl> + ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> + DCHECK ( args - > length ( ) = = 1 ) ; <nl> + <nl> + VisitForAccumulatorValue ( args - > at ( 0 ) ) ; <nl> + <nl> + Label materialize_true , materialize_false ; <nl> + Label * if_true = NULL ; <nl> + Label * if_false = NULL ; <nl> + Label * fall_through = NULL ; <nl> + context ( ) - > PrepareTest ( & materialize_true , & materialize_false , <nl> + & if_true , & if_false , & fall_through ) ; <nl> + <nl> + PrepareForBailoutBeforeSplit ( expr , true , if_true , if_false ) ; <nl> + __ NonNegativeSmiTst ( v0 , at ) ; <nl> + Split ( eq , at , Operand ( zero_reg ) , if_true , if_false , fall_through ) ; <nl> + <nl> + context ( ) - > Plug ( if_true , if_false ) ; <nl> + } <nl> + <nl> + <nl> void FullCodeGenerator : : EmitIsObject ( CallRuntime * expr ) { <nl> ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> DCHECK ( args - > length ( ) = = 1 ) ; <nl> void FullCodeGenerator : : VisitCompareOperation ( CompareOperation * expr ) { <nl> switch ( op ) { <nl> case Token : : IN : <nl> VisitForStackValue ( expr - > right ( ) ) ; <nl> - __ CallRuntime ( Runtime : : kHasProperty , 2 ) ; <nl> + __ InvokeBuiltin ( Builtins : : IN , CALL_FUNCTION ) ; <nl> PrepareForBailoutBeforeSplit ( expr , false , NULL , NULL ) ; <nl> __ LoadRoot ( a4 , Heap : : kTrueValueRootIndex ) ; <nl> Split ( eq , v0 , Operand ( a4 ) , if_true , if_false , fall_through ) ; <nl> mmm a / src / full - codegen / ppc / full - codegen - ppc . cc <nl> ppp b / src / full - codegen / ppc / full - codegen - ppc . cc <nl> void FullCodeGenerator : : EmitIsSmi ( CallRuntime * expr ) { <nl> } <nl> <nl> <nl> + void FullCodeGenerator : : EmitIsNonNegativeSmi ( CallRuntime * expr ) { <nl> + ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> + DCHECK ( args - > length ( ) = = 1 ) ; <nl> + <nl> + VisitForAccumulatorValue ( args - > at ( 0 ) ) ; <nl> + <nl> + Label materialize_true , materialize_false ; <nl> + Label * if_true = NULL ; <nl> + Label * if_false = NULL ; <nl> + Label * fall_through = NULL ; <nl> + context ( ) - > PrepareTest ( & materialize_true , & materialize_false , & if_true , <nl> + & if_false , & fall_through ) ; <nl> + <nl> + PrepareForBailoutBeforeSplit ( expr , true , if_true , if_false ) ; <nl> + __ TestIfPositiveSmi ( r3 , r0 ) ; <nl> + Split ( eq , if_true , if_false , fall_through , cr0 ) ; <nl> + <nl> + context ( ) - > Plug ( if_true , if_false ) ; <nl> + } <nl> + <nl> + <nl> void FullCodeGenerator : : EmitIsObject ( CallRuntime * expr ) { <nl> ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> DCHECK ( args - > length ( ) = = 1 ) ; <nl> void FullCodeGenerator : : VisitCompareOperation ( CompareOperation * expr ) { <nl> switch ( op ) { <nl> case Token : : IN : <nl> VisitForStackValue ( expr - > right ( ) ) ; <nl> - __ CallRuntime ( Runtime : : kHasProperty , 2 ) ; <nl> + __ InvokeBuiltin ( Builtins : : IN , CALL_FUNCTION ) ; <nl> PrepareForBailoutBeforeSplit ( expr , false , NULL , NULL ) ; <nl> __ LoadRoot ( ip , Heap : : kTrueValueRootIndex ) ; <nl> __ cmp ( r3 , ip ) ; <nl> mmm a / src / full - codegen / x64 / full - codegen - x64 . cc <nl> ppp b / src / full - codegen / x64 / full - codegen - x64 . cc <nl> void FullCodeGenerator : : EmitIsSmi ( CallRuntime * expr ) { <nl> } <nl> <nl> <nl> + void FullCodeGenerator : : EmitIsNonNegativeSmi ( CallRuntime * expr ) { <nl> + ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> + DCHECK ( args - > length ( ) = = 1 ) ; <nl> + <nl> + VisitForAccumulatorValue ( args - > at ( 0 ) ) ; <nl> + <nl> + Label materialize_true , materialize_false ; <nl> + Label * if_true = NULL ; <nl> + Label * if_false = NULL ; <nl> + Label * fall_through = NULL ; <nl> + context ( ) - > PrepareTest ( & materialize_true , & materialize_false , <nl> + & if_true , & if_false , & fall_through ) ; <nl> + <nl> + PrepareForBailoutBeforeSplit ( expr , true , if_true , if_false ) ; <nl> + Condition non_negative_smi = masm ( ) - > CheckNonNegativeSmi ( rax ) ; <nl> + Split ( non_negative_smi , if_true , if_false , fall_through ) ; <nl> + <nl> + context ( ) - > Plug ( if_true , if_false ) ; <nl> + } <nl> + <nl> + <nl> void FullCodeGenerator : : EmitIsObject ( CallRuntime * expr ) { <nl> ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> DCHECK ( args - > length ( ) = = 1 ) ; <nl> void FullCodeGenerator : : VisitCompareOperation ( CompareOperation * expr ) { <nl> switch ( op ) { <nl> case Token : : IN : <nl> VisitForStackValue ( expr - > right ( ) ) ; <nl> - __ CallRuntime ( Runtime : : kHasProperty , 2 ) ; <nl> + __ InvokeBuiltin ( Builtins : : IN , CALL_FUNCTION ) ; <nl> PrepareForBailoutBeforeSplit ( expr , false , NULL , NULL ) ; <nl> __ CompareRoot ( rax , Heap : : kTrueValueRootIndex ) ; <nl> Split ( equal , if_true , if_false , fall_through ) ; <nl> mmm a / src / full - codegen / x87 / full - codegen - x87 . cc <nl> ppp b / src / full - codegen / x87 / full - codegen - x87 . cc <nl> void FullCodeGenerator : : EmitIsSmi ( CallRuntime * expr ) { <nl> } <nl> <nl> <nl> + void FullCodeGenerator : : EmitIsNonNegativeSmi ( CallRuntime * expr ) { <nl> + ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> + DCHECK ( args - > length ( ) = = 1 ) ; <nl> + <nl> + VisitForAccumulatorValue ( args - > at ( 0 ) ) ; <nl> + <nl> + Label materialize_true , materialize_false ; <nl> + Label * if_true = NULL ; <nl> + Label * if_false = NULL ; <nl> + Label * fall_through = NULL ; <nl> + context ( ) - > PrepareTest ( & materialize_true , & materialize_false , <nl> + & if_true , & if_false , & fall_through ) ; <nl> + <nl> + PrepareForBailoutBeforeSplit ( expr , true , if_true , if_false ) ; <nl> + __ test ( eax , Immediate ( kSmiTagMask | 0x80000000 ) ) ; <nl> + Split ( zero , if_true , if_false , fall_through ) ; <nl> + <nl> + context ( ) - > Plug ( if_true , if_false ) ; <nl> + } <nl> + <nl> + <nl> void FullCodeGenerator : : EmitIsObject ( CallRuntime * expr ) { <nl> ZoneList < Expression * > * args = expr - > arguments ( ) ; <nl> DCHECK ( args - > length ( ) = = 1 ) ; <nl> void FullCodeGenerator : : VisitCompareOperation ( CompareOperation * expr ) { <nl> switch ( op ) { <nl> case Token : : IN : <nl> VisitForStackValue ( expr - > right ( ) ) ; <nl> - __ CallRuntime ( Runtime : : kHasProperty , 2 ) ; <nl> + __ InvokeBuiltin ( Builtins : : IN , CALL_FUNCTION ) ; <nl> PrepareForBailoutBeforeSplit ( expr , false , NULL , NULL ) ; <nl> __ cmp ( eax , isolate ( ) - > factory ( ) - > true_value ( ) ) ; <nl> Split ( equal , if_true , if_false , fall_through ) ; <nl> mmm a / src / hydrogen . cc <nl> ppp b / src / hydrogen . cc <nl> void HOptimizedGraphBuilder : : VisitCompareOperation ( CompareOperation * expr ) { <nl> return ast_context ( ) - > ReturnInstruction ( result , expr - > id ( ) ) ; <nl> <nl> } else if ( op = = Token : : IN ) { <nl> + HValue * function = AddLoadJSBuiltin ( Builtins : : IN ) ; <nl> Add < HPushArguments > ( left , right ) ; <nl> - HInstruction * result = <nl> - New < HCallRuntime > ( isolate ( ) - > factory ( ) - > empty_string ( ) , <nl> - Runtime : : FunctionForId ( Runtime : : kHasProperty ) , 2 ) ; <nl> + / / TODO ( olivf ) InvokeFunction produces a check for the parameter count , <nl> + / / even though we are certain to pass the correct number of arguments here . <nl> + HInstruction * result = New < HInvokeFunction > ( function , 2 ) ; <nl> return ast_context ( ) - > ReturnInstruction ( result , expr - > id ( ) ) ; <nl> } <nl> <nl> mmm a / src / runtime . js <nl> ppp b / src / runtime . js <nl> var SAR ; <nl> var SAR_STRONG ; <nl> var SHR ; <nl> var SHR_STRONG ; <nl> + var IN ; <nl> var INSTANCE_OF ; <nl> var CALL_NON_FUNCTION ; <nl> var CALL_NON_FUNCTION_AS_CONSTRUCTOR ; <nl> SHR_STRONG = function SHR_STRONG ( y ) { <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> * / <nl> <nl> + / / ECMA - 262 , section 11 . 8 . 7 , page 54 . <nl> + IN = function IN ( x ) { <nl> + if ( ! IS_SPEC_OBJECT ( x ) ) { <nl> + throw % MakeTypeError ( kInvalidInOperatorUse , this , x ) ; <nl> + } <nl> + if ( % _IsNonNegativeSmi ( this ) ) { <nl> + if ( IS_ARRAY ( x ) & & % _HasFastPackedElements ( x ) ) { <nl> + return this < x . length ; <nl> + } <nl> + return % HasElement ( x , this ) ; <nl> + } <nl> + return % HasProperty ( x , % $ toName ( this ) ) ; <nl> + } <nl> + <nl> + <nl> / / ECMA - 262 , section 11 . 8 . 6 , page 54 . To make the implementation more <nl> / / efficient , the return value should be zero if the ' this ' is an <nl> / / instance of F , and non - zero if not . This makes it possible to avoid <nl> mmm a / src / runtime / runtime - numbers . cc <nl> ppp b / src / runtime / runtime - numbers . cc <nl> RUNTIME_FUNCTION ( Runtime_IsSmi ) { <nl> } <nl> <nl> <nl> + RUNTIME_FUNCTION ( Runtime_IsNonNegativeSmi ) { <nl> + SealHandleScope shs ( isolate ) ; <nl> + DCHECK ( args . length ( ) = = 1 ) ; <nl> + CONVERT_ARG_CHECKED ( Object , obj , 0 ) ; <nl> + return isolate - > heap ( ) - > ToBoolean ( obj - > IsSmi ( ) & & <nl> + Smi : : cast ( obj ) - > value ( ) > = 0 ) ; <nl> + } <nl> + <nl> + <nl> RUNTIME_FUNCTION ( Runtime_GetRootNaN ) { <nl> SealHandleScope shs ( isolate ) ; <nl> DCHECK ( args . length ( ) = = 0 ) ; <nl> mmm a / src / runtime / runtime - object . cc <nl> ppp b / src / runtime / runtime - object . cc <nl> RUNTIME_FUNCTION ( Runtime_HasOwnProperty ) { <nl> } <nl> <nl> <nl> - / / ES6 section 12 . 9 . 3 , operator in . <nl> RUNTIME_FUNCTION ( Runtime_HasProperty ) { <nl> HandleScope scope ( isolate ) ; <nl> - DCHECK_EQ ( 2 , args . length ( ) ) ; <nl> - CONVERT_ARG_HANDLE_CHECKED ( Object , key , 0 ) ; <nl> - CONVERT_ARG_HANDLE_CHECKED ( Object , object , 1 ) ; <nl> + DCHECK ( args . length ( ) = = 2 ) ; <nl> + CONVERT_ARG_HANDLE_CHECKED ( JSReceiver , receiver , 0 ) ; <nl> + CONVERT_ARG_HANDLE_CHECKED ( Name , key , 1 ) ; <nl> <nl> - / / Check that { object } is actually a receiver . <nl> - if ( ! object - > IsJSReceiver ( ) ) { <nl> - THROW_NEW_ERROR_RETURN_FAILURE ( <nl> - isolate , <nl> - NewTypeError ( MessageTemplate : : kInvalidInOperatorUse , key , object ) ) ; <nl> - } <nl> - Handle < JSReceiver > receiver = Handle < JSReceiver > : : cast ( object ) ; <nl> + Maybe < bool > maybe = JSReceiver : : HasProperty ( receiver , key ) ; <nl> + if ( ! maybe . IsJust ( ) ) return isolate - > heap ( ) - > exception ( ) ; <nl> + return isolate - > heap ( ) - > ToBoolean ( maybe . FromJust ( ) ) ; <nl> + } <nl> <nl> - / / Check for fast element case . <nl> - uint32_t index = 0 ; <nl> - if ( key - > ToArrayIndex ( & index ) ) { <nl> - Maybe < bool > maybe = JSReceiver : : HasElement ( receiver , index ) ; <nl> - if ( ! maybe . IsJust ( ) ) return isolate - > heap ( ) - > exception ( ) ; <nl> - return isolate - > heap ( ) - > ToBoolean ( maybe . FromJust ( ) ) ; <nl> - } <nl> <nl> - / / Convert { key } to a Name first . <nl> - Handle < Name > name ; <nl> - ASSIGN_RETURN_FAILURE_ON_EXCEPTION ( isolate , name , <nl> - Runtime : : ToName ( isolate , key ) ) ; <nl> + RUNTIME_FUNCTION ( Runtime_HasElement ) { <nl> + HandleScope scope ( isolate ) ; <nl> + DCHECK ( args . length ( ) = = 2 ) ; <nl> + CONVERT_ARG_HANDLE_CHECKED ( JSReceiver , receiver , 0 ) ; <nl> + CONVERT_SMI_ARG_CHECKED ( index , 1 ) ; <nl> <nl> - / / Lookup property by { name } on { receiver } . <nl> - Maybe < bool > maybe = JSReceiver : : HasProperty ( receiver , name ) ; <nl> + Maybe < bool > maybe = JSReceiver : : HasElement ( receiver , index ) ; <nl> if ( ! maybe . IsJust ( ) ) return isolate - > heap ( ) - > exception ( ) ; <nl> return isolate - > heap ( ) - > ToBoolean ( maybe . FromJust ( ) ) ; <nl> } <nl> mmm a / src / runtime / runtime . h <nl> ppp b / src / runtime / runtime . h <nl> namespace internal { <nl> F ( SmiLexicographicCompare , 2 , 1 ) \ <nl> F ( MaxSmi , 0 , 1 ) \ <nl> F ( IsSmi , 1 , 1 ) \ <nl> + F ( IsNonNegativeSmi , 1 , 1 ) \ <nl> F ( GetRootNaN , 0 , 1 ) <nl> <nl> <nl> namespace internal { <nl> F ( DeleteProperty_Strict , 2 , 1 ) \ <nl> F ( HasOwnProperty , 2 , 1 ) \ <nl> F ( HasProperty , 2 , 1 ) \ <nl> + F ( HasElement , 2 , 1 ) \ <nl> F ( IsPropertyEnumerable , 2 , 1 ) \ <nl> F ( GetPropertyNamesFast , 1 , 1 ) \ <nl> F ( GetOwnPropertyNames , 2 , 1 ) \ <nl> mmm a / test / cctest / compiler / test - run - inlining . cc <nl> ppp b / test / cctest / compiler / test - run - inlining . cc <nl> TEST ( InlineIntrinsicIsSmi ) { <nl> } <nl> <nl> <nl> + TEST ( InlineIntrinsicIsNonNegativeSmi ) { <nl> + FunctionTester T ( <nl> + " ( function ( ) { " <nl> + " var x = 42 ; " <nl> + " function bar ( s , t ) { return % _IsNonNegativeSmi ( x ) ; } ; " <nl> + " return bar ; " <nl> + " } ) ( ) ; " , <nl> + kInlineFlags ) ; <nl> + <nl> + InstallAssertInlineCountHelper ( CcTest : : isolate ( ) ) ; <nl> + T . CheckCall ( T . true_value ( ) , T . Val ( 12 ) , T . Val ( 4 ) ) ; <nl> + } <nl> + <nl> + <nl> TEST ( InlineIntrinsicIsArray ) { <nl> FunctionTester T ( <nl> " ( function ( ) { " <nl> mmm a / test / cctest / compiler / test - run - intrinsics . cc <nl> ppp b / test / cctest / compiler / test - run - intrinsics . cc <nl> TEST ( IsMinusZero ) { <nl> } <nl> <nl> <nl> + TEST ( IsNonNegativeSmi ) { <nl> + FunctionTester T ( " ( function ( a ) { return % _IsNonNegativeSmi ( a ) ; } ) " , flags ) ; <nl> + <nl> + T . CheckTrue ( T . Val ( 1 ) ) ; <nl> + T . CheckFalse ( T . Val ( 1 . 1 ) ) ; <nl> + T . CheckFalse ( T . Val ( - 0 . 0 ) ) ; <nl> + T . CheckFalse ( T . Val ( - 2 ) ) ; <nl> + T . CheckFalse ( T . Val ( - 2 . 3 ) ) ; <nl> + T . CheckFalse ( T . undefined ( ) ) ; <nl> + } <nl> + <nl> + <nl> TEST ( IsObject ) { <nl> FunctionTester T ( " ( function ( a ) { return % _IsObject ( a ) ; } ) " , flags ) ; <nl> <nl> mmm a / test / cctest / test - api . cc <nl> ppp b / test / cctest / test - api . cc <nl> TEST ( AccessCheckThrows ) { <nl> CheckCorrectThrow ( " % DeleteProperty_Sloppy ( other , ' 1 ' ) " ) ; <nl> CheckCorrectThrow ( " % DeleteProperty_Strict ( other , ' 1 ' ) " ) ; <nl> CheckCorrectThrow ( " % HasOwnProperty ( other , ' x ' ) " ) ; <nl> - CheckCorrectThrow ( " % HasProperty ( ' x ' , other ) " ) ; <nl> + CheckCorrectThrow ( " % HasProperty ( other , ' x ' ) " ) ; <nl> + CheckCorrectThrow ( " % HasElement ( other , 1 ) " ) ; <nl> CheckCorrectThrow ( " % IsPropertyEnumerable ( other , ' x ' ) " ) ; <nl> / / PROPERTY_ATTRIBUTES_NONE = 0 <nl> CheckCorrectThrow ( " % DefineAccessorPropertyUnchecked ( " <nl> mmm a / test / unittests / compiler / js - intrinsic - lowering - unittest . cc <nl> ppp b / test / unittests / compiler / js - intrinsic - lowering - unittest . cc <nl> TEST_F ( JSIntrinsicLoweringTest , InlineIsSmi ) { <nl> } <nl> <nl> <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / % _IsNonNegativeSmi <nl> + <nl> + <nl> + TEST_F ( JSIntrinsicLoweringTest , InlineIsNonNegativeSmi ) { <nl> + Node * const input = Parameter ( 0 ) ; <nl> + Node * const context = Parameter ( 1 ) ; <nl> + Node * const effect = graph ( ) - > start ( ) ; <nl> + Node * const control = graph ( ) - > start ( ) ; <nl> + Reduction const r = Reduce ( graph ( ) - > NewNode ( <nl> + javascript ( ) - > CallRuntime ( Runtime : : kInlineIsNonNegativeSmi , 1 ) , input , <nl> + context , effect , control ) ) ; <nl> + ASSERT_TRUE ( r . Changed ( ) ) ; <nl> + EXPECT_THAT ( r . replacement ( ) , IsObjectIsNonNegativeSmi ( input ) ) ; <nl> + } <nl> + <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / % _IsArray <nl> <nl>
|
Revert of [ runtime ] Remove useless IN builtin . ( patchset id : 20001 of https : / / codereview . chromium . org / 1295433002 / )
|
v8/v8
|
96e331e2f2c43d53eb475766163b14b093efa4c0
|
2015-08-13T13:06:58Z
|
mmm a / tensorflow / python / ops / logging_ops . py <nl> ppp b / tensorflow / python / ops / logging_ops . py <nl> <nl> # call relies on certain conditionals for its dependencies . Use <nl> # control_flow_ops . Assert . <nl> <nl> - # Assert and Print are special symbols in python , so we must <nl> - # have an upper - case version of them . <nl> - # <nl> - # For users with Python 3 or Python 2 . 7 <nl> - # with ` from __future__ import print_function ` , we could also allow lowercase . <nl> + # Assert and Print are special symbols in Python 2 , so we must <nl> + # have an upper - case version of them . When support for it is dropped , <nl> + # we can allow lowercase . <nl> # See https : / / github . com / tensorflow / tensorflow / issues / 18053 <nl> <nl> <nl> def Print ( input_ , data , message = None , first_n = None , summarize = None , name = None ) : <nl> with jupyter notebook ( printing to the notebook * server ' s * output , not into <nl> the notebook ) . <nl> <nl> - Additionally , to use tf . print in python 2 . 7 , users must make sure to import <nl> - the following : <nl> - <nl> - ` from __future__ import print_function ` <nl> - <nl> Args : <nl> input_ : A tensor passed through this op . <nl> data : A list of tensors to print out when op is evaluated . <nl> def print_v2 ( * inputs , * * kwargs ) : <nl> Python objects . Printed tensors will recursively show the first and last <nl> elements of each dimension to summarize . <nl> <nl> - @ compatibility ( python2 ) <nl> - In python 2 . 7 , make sure to import the following : <nl> - ` from __future__ import print_function ` <nl> - @ end_compatibility <nl> - <nl> Example : <nl> Single - input usage : <nl> <nl>
|
Enable type annotations for python / ops .
|
tensorflow/tensorflow
|
d8b90acf95bdff09e29b1065739e28e8bd7500d9
|
2020-06-23T01:50:57Z
|
mmm a / tools / clang_format . py <nl> ppp b / tools / clang_format . py <nl> def download_clang_format ( path ) : <nl> print ( " Downloading clang - format to { } " . format ( path ) ) <nl> try : <nl> urllib . request . urlretrieve ( <nl> - cf_url , filename , reporthook = report_download_progress <nl> + cf_url , filename , reporthook = report_download_progress if sys . stdout . isatty ( ) else None <nl> ) <nl> except urllib . error . URLError as e : <nl> print ( " Error downloading { } : { } " . format ( filename , str ( e ) ) ) <nl>
|
[ clang - format ] Disable progress bar if stdout is piped ( )
|
pytorch/pytorch
|
a05406ea56abe021e4bfe93374f777428623dacf
|
2020-04-21T18:28:33Z
|
mmm a / folly / io / async / ssl / SSLErrors . cpp <nl> ppp b / folly / io / async / ssl / SSLErrors . cpp <nl> std : : string decodeOpenSSLError ( <nl> int sslOperationReturnValue ) { <nl> if ( sslError = = SSL_ERROR_SYSCALL & & errError = = 0 ) { <nl> if ( sslOperationReturnValue = = 0 ) { <nl> - return " SSL_ERROR_SYSCALL : EOF " ; <nl> + return " Connection EOF " ; <nl> } else { <nl> / / In this case errno is set , AsyncSocketException will add it . <nl> - return " SSL_ERROR_SYSCALL " ; <nl> + return " Network error " ; <nl> } <nl> } else if ( sslError = = SSL_ERROR_ZERO_RETURN ) { <nl> / / This signifies a TLS closure alert . <nl> - return " SSL_ERROR_ZERO_RETURN " ; <nl> + return " SSL connection closed normally " ; <nl> } else { <nl> std : : array < char , 256 > buf ; <nl> std : : string msg ( ERR_error_string ( errError , buf . data ( ) ) ) ; <nl> const StringPiece getSSLErrorString ( SSLError error ) { <nl> case SSLError : : EARLY_WRITE : <nl> ret = " Attempt to write before SSL connection established " ; <nl> break ; <nl> - case SSLError : : OPENSSL_ERR : <nl> - / / decodeOpenSSLError should be used for this type . <nl> - ret = " OPENSSL error " ; <nl> + case SSLError : : SSL_ERROR : <nl> + ret = " SSL error " ; <nl> + break ; <nl> + case SSLError : : NETWORK_ERROR : <nl> + ret = " Network error " ; <nl> + break ; <nl> + case SSLError : : EOF_ERROR : <nl> + ret = " SSL connection closed normally " ; <nl> break ; <nl> } <nl> return ret ; <nl> const StringPiece getSSLErrorString ( SSLError error ) { <nl> namespace folly { <nl> <nl> SSLException : : SSLException ( <nl> - int sslError , <nl> + int sslErr , <nl> unsigned long errError , <nl> int sslOperationReturnValue , <nl> int errno_copy ) <nl> : AsyncSocketException ( <nl> AsyncSocketException : : SSL_ERROR , <nl> - decodeOpenSSLError ( sslError , errError , sslOperationReturnValue ) , <nl> - sslError = = SSL_ERROR_SYSCALL ? errno_copy : 0 ) , <nl> - sslError ( SSLError : : OPENSSL_ERR ) , <nl> - opensslSSLError ( sslError ) , <nl> - opensslErr ( errError ) { } <nl> + decodeOpenSSLError ( sslErr , errError , sslOperationReturnValue ) , <nl> + sslErr = = SSL_ERROR_SYSCALL ? errno_copy : 0 ) { <nl> + if ( sslErr = = SSL_ERROR_ZERO_RETURN ) { <nl> + sslError = SSLError : : EOF_ERROR ; <nl> + } else if ( sslErr = = SSL_ERROR_SYSCALL ) { <nl> + sslError = SSLError : : NETWORK_ERROR ; <nl> + } else { <nl> + / / Conservatively assume that this is an SSL error <nl> + sslError = SSLError : : SSL_ERROR ; <nl> + } <nl> + } <nl> <nl> SSLException : : SSLException ( SSLError error ) <nl> : AsyncSocketException ( <nl> mmm a / folly / io / async / ssl / SSLErrors . h <nl> ppp b / folly / io / async / ssl / SSLErrors . h <nl> enum class SSLError { <nl> CLIENT_RENEGOTIATION , / / A client tried to renegotiate with this server <nl> INVALID_RENEGOTIATION , / / We attempted to start a renegotiation . <nl> EARLY_WRITE , / / Wrote before SSL connection established . <nl> - / / An openssl error type . The openssl specific methods should be used <nl> - / / to find the real error type . <nl> - / / This exists for compatibility until all error types can be move to proper <nl> - / / errors . <nl> - OPENSSL_ERR , <nl> + SSL_ERROR , / / An error related to SSL <nl> + NETWORK_ERROR , / / An error related to the network . <nl> + EOF_ERROR , / / The peer terminated the connection correctly . <nl> } ; <nl> <nl> class SSLException : public folly : : AsyncSocketException { <nl> class SSLException : public folly : : AsyncSocketException { <nl> return sslError ; <nl> } <nl> <nl> - / / These methods exist for compatibility until there are proper exceptions <nl> - / / for all ssl error types . <nl> - int getOpensslSSLError ( ) const { <nl> - return opensslSSLError ; <nl> - } <nl> - <nl> - unsigned long getOpensslErr ( ) const { <nl> - return opensslErr ; <nl> - } <nl> - <nl> private : <nl> SSLError sslError ; <nl> - int opensslSSLError ; <nl> - unsigned long opensslErr ; <nl> } ; <nl> } <nl> mmm a / folly / io / async / test / AsyncSSLSocketTest . cpp <nl> ppp b / folly / io / async / test / AsyncSSLSocketTest . cpp <nl> TEST ( AsyncSSLSocketTest , ConnResetErrorString ) { <nl> socket - > closeWithReset ( ) ; <nl> <nl> handshakeCallback . waitForHandshake ( ) ; <nl> - EXPECT_NE ( handshakeCallback . errorString_ . find ( " SSL_ERROR_SYSCALL " ) , <nl> - std : : string : : npos ) ; <nl> + EXPECT_NE ( <nl> + handshakeCallback . errorString_ . find ( " Network error " ) , std : : string : : npos ) ; <nl> EXPECT_NE ( handshakeCallback . errorString_ . find ( " 104 " ) , std : : string : : npos ) ; <nl> } <nl> <nl> TEST ( AsyncSSLSocketTest , ConnEOFErrorString ) { <nl> socket - > close ( ) ; <nl> <nl> handshakeCallback . waitForHandshake ( ) ; <nl> - EXPECT_NE ( handshakeCallback . errorString_ . find ( " SSL_ERROR_SYSCALL " ) , <nl> - std : : string : : npos ) ; <nl> + EXPECT_NE ( <nl> + handshakeCallback . errorString_ . find ( " Connection EOF " ) , std : : string : : npos ) ; <nl> EXPECT_NE ( handshakeCallback . errorString_ . find ( " EOF " ) , std : : string : : npos ) ; <nl> } <nl> <nl>
|
Better exception types to SSLexception
|
facebook/folly
|
0d9217b4915bbede50ebb7c43f98fda17aaf9a83
|
2016-04-28T19:20:29Z
|
mmm a / . compute <nl> ppp b / . compute <nl> <nl> <nl> set - xe <nl> <nl> - apt - get install - y python3 - venv <nl> + apt - get install - y python3 - venv libopus0 <nl> + <nl> python3 - m venv / tmp / venv <nl> source / tmp / venv / bin / activate <nl> <nl> + pip install - U setuptools wheel pip <nl> pip install - r < ( grep - v tensorflow requirements . txt ) <nl> - pip install tensorflow - gpu = = 1 . 15 . 0 <nl> + pip install tensorflow - gpu = = 1 . 14 <nl> <nl> # Install ds_ctcdecoder package from TaskCluster <nl> pip install $ ( python3 util / taskcluster . py - - decoder ) <nl> data = " $ { SHARED_DIR } / data " <nl> fis = " $ { data } / LDC / fisher " <nl> swb = " $ { data } / LDC / LDC97S62 / swb " <nl> lbs = " $ { data } / OpenSLR / LibriSpeech / librivox " <nl> + cv = " $ { data } / mozilla / CommonVoice / en_1087h_2019 - 06 - 12 / clips " <nl> + npr = " $ { data } / NPR / WAMU / sets / v0 . 3 " <nl> <nl> python - u DeepSpeech . py \ <nl> - - - train_files " $ { fis } - train . csv " , " $ { swb } - train . csv " , " $ { lbs } - train - clean - 100 . csv " , " $ { lbs } - train - clean - 360 . csv " , " $ { lbs } - train - other - 500 . csv " \ <nl> - - - dev_files " $ { lbs } - dev - clean . csv " \ <nl> - - - test_files " $ { lbs } - test - clean . csv " \ <nl> + - - train_files " $ { npr } / best - train . sdb " , " $ { npr } / good - train . sdb " , " $ { cv } / train . sdb " , " $ { fis } - train . sdb " , " $ { swb } - train . sdb " , " $ { lbs } - train - clean - 100 . sdb " , " $ { lbs } - train - clean - 360 . sdb " , " $ { lbs } - train - other - 500 . sdb " \ <nl> + - - dev_files " $ { lbs } - dev - clean . sdb " \ <nl> + - - test_files " $ { lbs } - test - clean . sdb " \ <nl> - - train_batch_size 24 \ <nl> - - dev_batch_size 48 \ <nl> - - test_batch_size 48 \ <nl> + - - train_cudnn \ <nl> - - n_hidden 2048 \ <nl> - - learning_rate 0 . 0001 \ <nl> - - - dropout_rate 0 . 2 \ <nl> - - - epoch 13 \ <nl> + - - dropout_rate 0 . 40 \ <nl> + - - epochs 150 \ <nl> + - - noearly_stop \ <nl> + - - feature_cache " . . / tmp / feature . cache " \ <nl> - - checkpoint_dir " . . / keep " \ <nl> - - summary_dir " . . / keep / summaries " <nl>
|
Merge pull request from tilmankamp / dot - compute
|
mozilla/DeepSpeech
|
5acc5282c7b71b35f9a3c68dff1392e8bca9d256
|
2020-04-01T09:42:00Z
|
mmm a / xbmc / android / jni / Context . cpp <nl> ppp b / xbmc / android / jni / Context . cpp <nl> <nl> # include " ApplicationInfo . h " <nl> # include " File . h " <nl> # include " ContentResolver . h " <nl> + # include " BaseColumns . h " <nl> + # include " MediaStore . h " <nl> # include < android / native_activity . h > <nl> <nl> using namespace jni ; <nl> CJNIContext : : CJNIContext ( const ANativeActivity * nativeActivity ) : CJNIBroadcastR <nl> { <nl> m_context . reset ( nativeActivity - > clazz ) ; <nl> xbmc_jni_on_load ( nativeActivity - > vm , nativeActivity - > env ) ; <nl> + PopulateStaticFields ( ) ; <nl> InitializeBroadcastReceiver ( ) ; <nl> } <nl> <nl> CJNIContext : : ~ CJNIContext ( ) <nl> xbmc_jni_on_unload ( ) ; <nl> } <nl> <nl> + void CJNIContext : : PopulateStaticFields ( ) <nl> + { <nl> + CJNIBaseColumns : : PopulateStaticFields ( ) ; <nl> + CJNIMediaStoreMediaColumns : : PopulateStaticFields ( ) ; <nl> + } <nl> + <nl> CJNIPackageManager CJNIContext : : GetPackageManager ( ) <nl> { <nl> return ( CJNIPackageManager ) call_method < jhobject > ( m_context , " getPackageManager " , " ( ) Landroid / content / pm / PackageManager ; " ) ; <nl> mmm a / xbmc / android / jni / Context . h <nl> ppp b / xbmc / android / jni / Context . h <nl> class CJNIContext : public CJNIBroadcastReceiver <nl> <nl> private : <nl> CJNIContext ( ) ; <nl> + void PopulateStaticFields ( ) ; <nl> void operator = ( CJNIContext const & ) { } ; <nl> static jni : : jhobject m_context ; <nl> } ; <nl>
|
jni : Add a top - level static member cache
|
xbmc/xbmc
|
1573f740e5d78508249e14de315ea976ff07334f
|
2013-06-07T21:47:52Z
|
mmm a / cocos / 2d / CCActionInterval . cpp <nl> ppp b / cocos / 2d / CCActionInterval . cpp <nl> Spawn * Spawn : : reverse ( ) const <nl> / / RotateTo <nl> / / <nl> <nl> - RotateTo * RotateTo : : create ( float duration , float deltaAngle ) <nl> + RotateTo * RotateTo : : create ( float duration , float dstAngle ) <nl> { <nl> RotateTo * rotateTo = new RotateTo ( ) ; <nl> - rotateTo - > initWithDuration ( duration , deltaAngle ) ; <nl> + rotateTo - > initWithDuration ( duration , dstAngle , dstAngle ) ; <nl> rotateTo - > autorelease ( ) ; <nl> <nl> return rotateTo ; <nl> } <nl> <nl> - RotateTo * RotateTo : : create ( float duration , float deltaAngleX , float deltaAngleY ) <nl> + RotateTo * RotateTo : : create ( float duration , float dstAngleX , float dstAngleY ) <nl> { <nl> RotateTo * rotateTo = new RotateTo ( ) ; <nl> - rotateTo - > initWithDuration ( duration , deltaAngleX , deltaAngleY ) ; <nl> + rotateTo - > initWithDuration ( duration , dstAngleX , dstAngleY ) ; <nl> rotateTo - > autorelease ( ) ; <nl> <nl> return rotateTo ; <nl> } <nl> <nl> - RotateTo * RotateTo : : create ( float duration , const Vec3 & deltaAngle3D ) <nl> + RotateTo * RotateTo : : create ( float duration , const Vec3 & dstAngle3D ) <nl> { <nl> RotateTo * rotateTo = new RotateTo ( ) ; <nl> - rotateTo - > initWithDuration ( duration , deltaAngle3D ) ; <nl> + rotateTo - > initWithDuration ( duration , dstAngle3D ) ; <nl> rotateTo - > autorelease ( ) ; <nl> <nl> return rotateTo ; <nl> RotateTo : : RotateTo ( ) <nl> { <nl> } <nl> <nl> - bool RotateTo : : initWithDuration ( float duration , float deltaAngle ) <nl> + bool RotateTo : : initWithDuration ( float duration , float dstAngleX , float dstAngleY ) <nl> { <nl> if ( ActionInterval : : initWithDuration ( duration ) ) <nl> { <nl> - _dstAngleX = _dstAngleY = deltaAngle ; <nl> - return true ; <nl> - } <nl> - <nl> - return false ; <nl> - } <nl> - <nl> - bool RotateTo : : initWithDuration ( float duration , float deltaAngleX , float deltaAngleY ) <nl> - { <nl> - if ( ActionInterval : : initWithDuration ( duration ) ) <nl> - { <nl> - _dstAngleX = deltaAngleX ; <nl> - _dstAngleY = deltaAngleY ; <nl> + _dstAngle . x = dstAngleX ; <nl> + _dstAngle . y = dstAngleY ; <nl> <nl> return true ; <nl> } <nl> bool RotateTo : : initWithDuration ( float duration , float deltaAngleX , float deltaAn <nl> return false ; <nl> } <nl> <nl> - bool RotateTo : : initWithDuration ( float duration , const Vec3 & deltaAngle3D ) <nl> + bool RotateTo : : initWithDuration ( float duration , const Vec3 & dstAngle3D ) <nl> { <nl> if ( ActionInterval : : initWithDuration ( duration ) ) <nl> { <nl> - _dstAngle3D = deltaAngle3D ; <nl> + _dstAngle = dstAngle3D ; <nl> _is3D = true ; <nl> <nl> return true ; <nl> RotateTo * RotateTo : : clone ( void ) const <nl> / / no copy constructor <nl> auto a = new RotateTo ( ) ; <nl> if ( _is3D ) <nl> - a - > initWithDuration ( _duration , _dstAngle3D ) ; <nl> + a - > initWithDuration ( _duration , _dstAngle ) ; <nl> else <nl> - a - > initWithDuration ( _duration , _dstAngleX , _dstAngleY ) ; <nl> + a - > initWithDuration ( _duration , _dstAngle . x , _dstAngle . y ) ; <nl> a - > autorelease ( ) ; <nl> return a ; <nl> } <nl> void RotateTo : : startWithTarget ( Node * target ) <nl> <nl> if ( _is3D ) <nl> { <nl> - _startAngle3D = _target - > getRotation3D ( ) ; <nl> - <nl> - calculateAngles ( _startAngle3D . x , _diffAngle3D . x , _dstAngle3D . x ) ; <nl> - calculateAngles ( _startAngle3D . y , _diffAngle3D . y , _dstAngle3D . y ) ; <nl> - calculateAngles ( _startAngle3D . z , _diffAngle3D . z , _dstAngle3D . z ) ; <nl> + _startAngle = _target - > getRotation3D ( ) ; <nl> } <nl> else <nl> { <nl> - _startAngleX = _target - > getRotationSkewX ( ) ; <nl> - _startAngleY = _target - > getRotationSkewY ( ) ; <nl> - <nl> - calculateAngles ( _startAngleX , _diffAngleX , _dstAngleX ) ; <nl> - calculateAngles ( _startAngleY , _diffAngleY , _dstAngleY ) ; <nl> + _startAngle . x = _target - > getRotationSkewX ( ) ; <nl> + _startAngle . y = _target - > getRotationSkewY ( ) ; <nl> } <nl> + <nl> + calculateAngles ( _startAngle . x , _diffAngle . x , _dstAngle . x ) ; <nl> + calculateAngles ( _startAngle . y , _diffAngle . y , _dstAngle . y ) ; <nl> + calculateAngles ( _startAngle . z , _diffAngle . z , _dstAngle . z ) ; <nl> } <nl> <nl> void RotateTo : : update ( float time ) <nl> void RotateTo : : update ( float time ) <nl> if ( _is3D ) <nl> { <nl> _target - > setRotation3D ( Vec3 ( <nl> - _startAngle3D . x + _diffAngle3D . x * time , <nl> - _startAngle3D . y + _diffAngle3D . y * time , <nl> - _startAngle3D . z + _diffAngle3D . z * time <nl> + _startAngle . x + _diffAngle . x * time , <nl> + _startAngle . y + _diffAngle . y * time , <nl> + _startAngle . z + _diffAngle . z * time <nl> ) ) ; <nl> } <nl> else <nl> { <nl> # if CC_USE_PHYSICS <nl> - if ( _startAngleX = = _startAngleY & & _diffAngleX = = _diffAngleY ) <nl> + if ( _startAngle . x = = _startAngle . y & & _diffAngle . x = = _diffAngle . y ) <nl> { <nl> - _target - > setRotation ( _startAngleX + _diffAngleX * time ) ; <nl> + _target - > setRotation ( _startAngle . x + _diffAngle . x * time ) ; <nl> } <nl> else <nl> { <nl> - / / _startAngleX ! = _startAngleY | | _diffAngleX ! = _diffAngleY <nl> + / / _startAngle . x ! = _startAngle . y | | _diffAngle . x ! = _diffAngle . y <nl> if ( _target - > getPhysicsBody ( ) ! = nullptr ) <nl> { <nl> CCLOG ( " RotateTo WARNING : PhysicsBody doesn ' t support skew rotation " ) ; <nl> } <nl> <nl> - _target - > setRotationSkewX ( _startAngleX + _diffAngleX * time ) ; <nl> - _target - > setRotationSkewY ( _startAngleY + _diffAngleY * time ) ; <nl> + _target - > setRotationSkewX ( _startAngle . x + _diffAngle . x * time ) ; <nl> + _target - > setRotationSkewY ( _startAngle . y + _diffAngle . y * time ) ; <nl> } <nl> # else <nl> - _target - > setRotationSkewX ( _startAngleX + _diffAngleX * time ) ; <nl> - _target - > setRotationSkewY ( _startAngleY + _diffAngleY * time ) ; <nl> + _target - > setRotationSkewX ( _startAngle . x + _diffAngle . x * time ) ; <nl> + _target - > setRotationSkewY ( _startAngle . y + _diffAngle . y * time ) ; <nl> # endif / / CC_USE_PHYSICS <nl> } <nl> } <nl> mmm a / cocos / 2d / CCActionInterval . h <nl> ppp b / cocos / 2d / CCActionInterval . h <nl> class CC_DLL RotateTo : public ActionInterval <nl> { <nl> public : <nl> / * * creates the action with separate rotation angles * / <nl> - static RotateTo * create ( float duration , float deltaAngleX , float deltaAngleY ) ; <nl> + static RotateTo * create ( float duration , float dstAngleX , float dstAngleY ) ; <nl> <nl> / * * creates the action * / <nl> - static RotateTo * create ( float duration , float deltaAngle ) ; <nl> + static RotateTo * create ( float duration , float dstAngle ) ; <nl> <nl> / * * creates the action with 3D rotation angles * / <nl> - static RotateTo * create ( float duration , const Vec3 & deltaAngle3D ) ; <nl> + static RotateTo * create ( float duration , const Vec3 & dstAngle3D ) ; <nl> <nl> / / <nl> / / Overrides <nl> class CC_DLL RotateTo : public ActionInterval <nl> virtual ~ RotateTo ( ) { } <nl> <nl> / * * initializes the action * / <nl> - bool initWithDuration ( float duration , float deltaAngle ) ; <nl> - bool initWithDuration ( float duration , float deltaAngleX , float deltaAngleY ) ; <nl> - bool initWithDuration ( float duration , const Vec3 & deltaAngle3D ) ; <nl> + bool initWithDuration ( float duration , float dstAngleX , float dstAngleY ) ; <nl> + bool initWithDuration ( float duration , const Vec3 & dstAngle3D ) ; <nl> <nl> / * * calculates the start and diff angles * / <nl> void calculateAngles ( float & startAngle , float & diffAngle , float dstAngle ) ; <nl> <nl> protected : <nl> - float _dstAngleX ; <nl> - float _startAngleX ; <nl> - float _diffAngleX ; <nl> - <nl> - float _dstAngleY ; <nl> - float _startAngleY ; <nl> - float _diffAngleY ; <nl> - <nl> bool _is3D ; <nl> - Vec3 _dstAngle3D ; <nl> - Vec3 _startAngle3D ; <nl> - Vec3 _diffAngle3D ; <nl> + Vec3 _dstAngle ; <nl> + Vec3 _startAngle ; <nl> + Vec3 _diffAngle ; <nl> <nl> private : <nl> CC_DISALLOW_COPY_AND_ASSIGN ( RotateTo ) ; <nl>
|
RotateTo action now uses Vec3 ( ) to keep track of the state
|
cocos2d/cocos2d-x
|
98354e9f8e5bf375452a71ae789752943b8656e7
|
2014-07-31T21:05:58Z
|
mmm a / benchmark / scripts / compare_perf_tests . py <nl> ppp b / benchmark / scripts / compare_perf_tests . py <nl> def main ( ) : <nl> <nl> if args . format : <nl> if args . format . lower ( ) ! = " markdown " : <nl> - pain_data = PAIN_DETAIL . format ( " Regression " , markdown_regression ) <nl> - pain_data + = PAIN_DETAIL . format ( " Improvement " , markdown_improvement ) <nl> + pain_data = PAIN_DETAIL . format ( " Regression " , markdown_regression ) <nl> + pain_data + = PAIN_DETAIL . format ( " Improvement " , <nl> + markdown_improvement ) <nl> if not args . changes_only : <nl> - pain_data + = PAIN_DETAIL . format ( " No Changes " , markdown_normal ) <nl> + pain_data + = PAIN_DETAIL . format ( " No Changes " , markdown_normal ) <nl> <nl> print ( pain_data . replace ( " | " , " " ) . replace ( " - " , " " ) ) <nl> else : <nl> mmm a / lib / LLVMPasses / ARCEntryPointBuilder . h <nl> ppp b / lib / LLVMPasses / ARCEntryPointBuilder . h <nl> class ARCEntryPointBuilder { <nl> / / for the deployment target provided for this compilation . <nl> if ( SWIFT_RT_USE_RegisterPreservingCC ) { <nl> bool ShouldUseRegisterPreservingCC = false ; <nl> - auto & TargeTriple = F . getParent ( ) - > getTargetTriple ( ) ; <nl> - llvm : : Triple Triple ( TargeTriple ) ; <nl> + auto & TargetTriple = F . getParent ( ) - > getTargetTriple ( ) ; <nl> + llvm : : Triple Triple ( TargetTriple ) ; <nl> auto Arch = Triple . getArch ( ) ; <nl> if ( Arch = = llvm : : Triple : : ArchType : : aarch64 ) { <nl> ShouldUseRegisterPreservingCC = true ; <nl>
|
Merge pull request from practicalswift / gardening - 20160402
|
apple/swift
|
b91f3d9751c13a57fa0bccab25d5bb59eed777b1
|
2016-04-02T15:02:00Z
|
mmm a / src / app / commands / commands_list . h <nl> ppp b / src / app / commands / commands_list . h <nl> FOR_EACH_COMMAND ( LoadPalette ) <nl> FOR_EACH_COMMAND ( NewFrame ) <nl> FOR_EACH_COMMAND ( NewLayer ) <nl> FOR_EACH_COMMAND ( OpenFile ) <nl> + FOR_EACH_COMMAND ( PaletteSize ) <nl> FOR_EACH_COMMAND ( Redo ) <nl> FOR_EACH_COMMAND ( RemoveLayer ) <nl> FOR_EACH_COMMAND ( SaveFile ) <nl> FOR_EACH_COMMAND ( OpenInFolder ) <nl> FOR_EACH_COMMAND ( OpenWithApp ) <nl> FOR_EACH_COMMAND ( Options ) <nl> FOR_EACH_COMMAND ( PaletteEditor ) <nl> - FOR_EACH_COMMAND ( PaletteSize ) <nl> FOR_EACH_COMMAND ( Paste ) <nl> FOR_EACH_COMMAND ( PasteText ) <nl> FOR_EACH_COMMAND ( PixelPerfectMode ) <nl>
|
Move PaletteSize to the non - UI list of commands
|
aseprite/aseprite
|
569b923e2fd992ddd23123681ce0e646e1927538
|
2019-01-06T21:46:00Z
|
mmm a / Telegram / SourceFiles / window / window_peer_menu . cpp <nl> ppp b / Telegram / SourceFiles / window / window_peer_menu . cpp <nl> void Filler : : addBlockUser ( not_null < UserData * > user ) { <nl> void Filler : : addUserActions ( not_null < UserData * > user ) { <nl> if ( _source ! = PeerMenuSource : : ChatsList ) { <nl> if ( user - > isContact ( ) ) { <nl> - _addAction ( <nl> - lang ( lng_info_share_contact ) , <nl> - [ user ] { PeerMenuShareContactBox ( user ) ; } ) ; <nl> if ( ! user - > isSelf ( ) ) { <nl> + _addAction ( <nl> + lang ( lng_info_share_contact ) , <nl> + [ user ] { PeerMenuShareContactBox ( user ) ; } ) ; <nl> _addAction ( <nl> lang ( lng_info_edit_contact ) , <nl> [ user ] { Ui : : show ( Box < AddContactBox > ( user ) ) ; } ) ; <nl>
|
Hide Share contact button in saved messages .
|
telegramdesktop/tdesktop
|
d77afef8b05c633be1b23bdeab61b701165e5447
|
2017-12-06T14:41:37Z
|
mmm a / third_party / mlir / lib / Transforms / SimplifyAffineStructures . cpp <nl> ppp b / third_party / mlir / lib / Transforms / SimplifyAffineStructures . cpp <nl> void SimplifyAffineStructures : : runOnFunction ( ) { <nl> } <nl> } ) ; <nl> <nl> - / / Turn memrefs ' non - identity layouts maps into ones with identity . <nl> - func . walk ( [ ] ( AllocOp op ) { normalizeMemRef ( op ) ; } ) ; <nl> + / / Turn memrefs ' non - identity layouts maps into ones with identity . Collect <nl> + / / alloc ops first and then process since normalizeMemRef replaces / erases ops <nl> + / / during memref rewriting . <nl> + SmallVector < AllocOp , 4 > allocOps ; <nl> + func . walk ( [ & ] ( AllocOp op ) { allocOps . push_back ( op ) ; } ) ; <nl> + for ( auto allocOp : allocOps ) { <nl> + normalizeMemRef ( allocOp ) ; <nl> + } <nl> } <nl> <nl> static PassRegistration < SimplifyAffineStructures > <nl> - pass ( " simplify - affine - structures " , " Simplify affine expressions " ) ; <nl> + pass ( " simplify - affine - structures " , <nl> + " Simplify affine expressions in maps / sets and normalize memrefs " ) ; <nl>
|
fix simplify - affine - structures bug
|
tensorflow/tensorflow
|
f23e6832c0d6c75290c93adc13ebc0bd34d9d527
|
2019-10-07T18:29:48Z
|
mmm a / src / core / transport / transport . c <nl> ppp b / src / core / transport / transport . c <nl> void grpc_transport_op_finish_with_failure ( grpc_transport_op * op ) { <nl> if ( op - > recv_ops ) { <nl> op - > on_done_recv ( op - > recv_user_data , 0 ) ; <nl> } <nl> - } <nl> \ No newline at end of file <nl> + } <nl>
|
Add newline
|
grpc/grpc
|
7e320ba5187a1c57b8e8144a941f2fe82e4f600b
|
2015-04-23T23:28:07Z
|
mmm a / hphp / runtime / ext / fb / FBSerialize - inl . h <nl> ppp b / hphp / runtime / ext / fb / FBSerialize - inl . h <nl> FBUnserializer < V > : : FBUnserializer ( folly : : StringPiece serialized ) : <nl> <nl> template < class V > <nl> inline void FBUnserializer < V > : : need ( size_t n ) const { <nl> - if ( UNLIKELY ( n > end_ - p_ ) ) { <nl> + if ( UNLIKELY ( p_ + n > end_ ) ) { <nl> throw UnserializeError ( " Unexpected end " ) ; <nl> } <nl> } <nl>
|
Fix signed / unsigned comparison
|
facebook/hhvm
|
7141dd954314d07e40ce17bdfc56fac4adaaf0cd
|
2015-11-21T05:05:46Z
|
mmm a / xbmc / peripherals / devices / PeripheralCecAdapter . cpp <nl> ppp b / xbmc / peripherals / devices / PeripheralCecAdapter . cpp <nl> void CPeripheralCecAdapter : : ResetMembers ( void ) <nl> m_bDeviceRemoved = false ; <nl> m_bActiveSourcePending = false ; <nl> m_bStandbyPending = false ; <nl> + m_bActiveSourceBeforeStandby = false ; <nl> <nl> m_currentButton . iButton = 0 ; <nl> m_currentButton . iDuration = 0 ; <nl> void CPeripheralCecAdapter : : Announce ( AnnouncementFlag flag , const char * sender , <nl> / / this will also power off devices when we ' re the active source <nl> { <nl> CSingleLock lock ( m_critSection ) ; <nl> - m_bGoingToStandby = false ; <nl> + m_bGoingToStandby = true ; <nl> } <nl> StopThread ( ) ; <nl> } <nl> else if ( flag = = System & & ! strcmp ( sender , " xbmc " ) & & ! strcmp ( message , " OnWake " ) ) <nl> { <nl> CLog : : Log ( LOGDEBUG , " % s - reconnecting to the CEC adapter after standby mode " , __FUNCTION__ ) ; <nl> - ReopenConnection ( ) ; <nl> + if ( ReopenConnection ( ) ) <nl> + { <nl> + bool bActivate ( false ) ; <nl> + { <nl> + CSingleLock lock ( m_critSection ) ; <nl> + bActivate = m_bActiveSourceBeforeStandby ; <nl> + m_bActiveSourceBeforeStandby = false ; <nl> + } <nl> + if ( bActivate ) <nl> + ActivateSource ( ) ; <nl> + } <nl> } <nl> else if ( flag = = Player & & ! strcmp ( sender , " xbmc " ) & & ! strcmp ( message , " OnStop " ) ) <nl> { <nl> void CPeripheralCecAdapter : : Process ( void ) <nl> m_iExitCode = EXITCODE_QUIT ; <nl> m_bGoingToStandby = false ; <nl> m_bIsRunning = true ; <nl> + m_bActiveSourceBeforeStandby = false ; <nl> } <nl> <nl> CAnnouncementManager : : AddAnnouncer ( this ) ; <nl> void CPeripheralCecAdapter : : Process ( void ) <nl> ! m_bDeviceRemoved & & <nl> ( ! m_bGoingToStandby | | GetSettingBool ( " standby_tv_on_pc_standby " ) ) & & <nl> GetSettingBool ( " enabled " ) ; <nl> + <nl> + if ( m_bGoingToStandby ) <nl> + m_bActiveSourceBeforeStandby = m_cecAdapter - > IsLibCECActiveSource ( ) ; <nl> } <nl> <nl> if ( bSendStandbyCommands ) <nl> void CPeripheralCecAdapter : : OnDeviceRemoved ( void ) <nl> m_bDeviceRemoved = true ; <nl> } <nl> <nl> - void CPeripheralCecAdapter : : ReopenConnection ( void ) <nl> + bool CPeripheralCecAdapter : : ReopenConnection ( void ) <nl> { <nl> / / stop running thread <nl> { <nl> void CPeripheralCecAdapter : : ReopenConnection ( void ) <nl> ResetMembers ( ) ; <nl> <nl> / / reopen the connection <nl> - InitialiseFeature ( FEATURE_CEC ) ; <nl> + return InitialiseFeature ( FEATURE_CEC ) ; <nl> } <nl> <nl> void CPeripheralCecAdapter : : ActivateSource ( void ) <nl> mmm a / xbmc / peripherals / devices / PeripheralCecAdapter . h <nl> ppp b / xbmc / peripherals / devices / PeripheralCecAdapter . h <nl> namespace PERIPHERALS <nl> static int CecAlert ( void * cbParam , const CEC : : libcec_alert alert , const CEC : : libcec_parameter data ) ; <nl> static void CecSourceActivated ( void * param , const CEC : : cec_logical_address address , const uint8_t activated ) ; <nl> bool IsRunning ( void ) const ; <nl> - void ReopenConnection ( void ) ; <nl> + bool ReopenConnection ( void ) ; <nl> void ProcessActivateSource ( void ) ; <nl> void ProcessStandbyDevices ( void ) ; <nl> <nl> namespace PERIPHERALS <nl> bool m_bActiveSourcePending ; <nl> bool m_bStandbyPending ; <nl> CDateTime m_preventActivateSourceOnPlay ; <nl> + bool m_bActiveSourceBeforeStandby ; <nl> } ; <nl> <nl> class CPeripheralCecAdapterUpdateThread : public CThread <nl>
|
[ cec ] fixed - make xbmc the active source again when resuming from standby and xbmc was the active source before it went to standby
|
xbmc/xbmc
|
abcb3f86843ed098822c30d1dab17e378aa0b946
|
2012-12-06T01:28:49Z
|
mmm a / TMessagesProj / build . gradle <nl> ppp b / TMessagesProj / build . gradle <nl> android { <nl> defaultConfig { <nl> minSdkVersion 8 <nl> targetSdkVersion 19 <nl> - versionCode 234 <nl> + versionCode 236 <nl> versionName " 1 . 4 . 15 " <nl> } <nl> } <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / ChatActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / ChatActivity . java <nl> public void hideEmojiPopup ( ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> + <nl> showActionBar ( ) ; <nl> <nl> checkActionBarMenu ( ) ; <nl> private void setTypingAnimation ( boolean start ) { <nl> <nl> @ Override <nl> public void onPause ( ) { <nl> + super . onPause ( ) ; <nl> actionBarLayer . hideActionMode ( ) ; <nl> hideEmojiPopup ( ) ; <nl> paused = true ; <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / ChatProfileActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / ChatProfileActivity . java <nl> public void didReceivedNotification ( int id , Object . . . args ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> if ( listViewAdapter ! = null ) { <nl> listViewAdapter . notifyDataSetChanged ( ) ; <nl> } <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / ChatProfileChangeNameActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / ChatProfileChangeNameActivity . java <nl> public boolean onEditorAction ( TextView textView , int i , KeyEvent keyEvent ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> SharedPreferences preferences = ApplicationLoader . applicationContext . getSharedPreferences ( " mainconfig " , Activity . MODE_PRIVATE ) ; <nl> boolean animations = preferences . getBoolean ( " view_animations " , true ) ; <nl> if ( ! animations ) { <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / ContactAddActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / ContactAddActivity . java <nl> public void didReceivedNotification ( int id , Object . . . args ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> SharedPreferences preferences = ApplicationLoader . applicationContext . getSharedPreferences ( " mainconfig " , Activity . MODE_PRIVATE ) ; <nl> boolean animations = preferences . getBoolean ( " view_animations " , true ) ; <nl> if ( ! animations ) { <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / ContactsActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / ContactsActivity . java <nl> public void onClick ( DialogInterface dialogInterface , int i ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> if ( listViewAdapter ! = null ) { <nl> listViewAdapter . notifyDataSetChanged ( ) ; <nl> } <nl> } <nl> <nl> - @ Override <nl> - public void onPause ( ) { <nl> - actionBarLayer . closeSearchField ( ) ; <nl> - } <nl> - <nl> @ Override <nl> public void didReceivedNotification ( int id , Object . . . args ) { <nl> if ( id = = MessagesController . contactsDidLoaded ) { <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / CountrySelectActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / CountrySelectActivity . java <nl> public void onScroll ( AbsListView absListView , int firstVisibleItem , int visibleI <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> if ( listViewAdapter ! = null ) { <nl> listViewAdapter . notifyDataSetChanged ( ) ; <nl> } <nl> } <nl> <nl> - @ Override <nl> - public void onPause ( ) { <nl> - actionBarLayer . closeSearchField ( ) ; <nl> - } <nl> - <nl> public void search ( final String query ) { <nl> if ( query = = null ) { <nl> searchResult = null ; <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / DocumentSelectActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / DocumentSelectActivity . java <nl> public void onItemClick ( AdapterView < ? > adapterView , View view , int i , long l ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> if ( listAdapter ! = null ) { <nl> listAdapter . notifyDataSetChanged ( ) ; <nl> } <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / IdenticonActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / IdenticonActivity . java <nl> public void onConfigurationChanged ( android . content . res . Configuration newConfig ) <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> fixLayout ( ) ; <nl> } <nl> <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / LanguageSelectActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / LanguageSelectActivity . java <nl> public void onScroll ( AbsListView absListView , int firstVisibleItem , int visibleI <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> if ( listAdapter ! = null ) { <nl> listAdapter . notifyDataSetChanged ( ) ; <nl> } <nl> } <nl> <nl> - @ Override <nl> - public void onPause ( ) { <nl> - actionBarLayer . closeSearchField ( ) ; <nl> - } <nl> - <nl> public void search ( final String query ) { <nl> if ( query = = null ) { <nl> searchResult = null ; <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / LaunchActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / LaunchActivity . java <nl> public void onClick ( View view ) { <nl> <nl> if ( fragmentsStack . isEmpty ( ) ) { <nl> if ( ! UserConfig . clientActivated ) { <nl> - LoginActivity fragment = new LoginActivity ( ) ; <nl> - fragment . onFragmentCreate ( ) ; <nl> - fragmentsStack . add ( fragment ) ; <nl> + addFragmentToStack ( new LoginActivity ( ) ) ; <nl> } else { <nl> - MessagesActivity fragment = new MessagesActivity ( null ) ; <nl> - fragment . onFragmentCreate ( ) ; <nl> - fragmentsStack . add ( fragment ) ; <nl> + addFragmentToStack ( new MessagesActivity ( null ) ) ; <nl> } <nl> <nl> try { <nl> public void onClick ( View view ) { <nl> if ( fragmentName . equals ( " chat " ) ) { <nl> if ( args ! = null ) { <nl> ChatActivity chat = new ChatActivity ( args ) ; <nl> - if ( chat . onFragmentCreate ( ) ) { <nl> - fragmentsStack . add ( chat ) ; <nl> + if ( addFragmentToStack ( chat ) ) { <nl> chat . restoreSelfArgs ( savedInstanceState ) ; <nl> } <nl> } <nl> } else if ( fragmentName . equals ( " settings " ) ) { <nl> SettingsActivity settings = new SettingsActivity ( ) ; <nl> - settings . onFragmentCreate ( ) ; <nl> + addFragmentToStack ( settings ) ; <nl> settings . restoreSelfArgs ( savedInstanceState ) ; <nl> - fragmentsStack . add ( settings ) ; <nl> } else if ( fragmentName . equals ( " group " ) ) { <nl> if ( args ! = null ) { <nl> GroupCreateFinalActivity group = new GroupCreateFinalActivity ( args ) ; <nl> - if ( group . onFragmentCreate ( ) ) { <nl> + if ( addFragmentToStack ( group ) ) { <nl> group . restoreSelfArgs ( savedInstanceState ) ; <nl> - fragmentsStack . add ( group ) ; <nl> } <nl> } <nl> } else if ( fragmentName . equals ( " chat_profile " ) ) { <nl> if ( args ! = null ) { <nl> ChatProfileActivity profile = new ChatProfileActivity ( args ) ; <nl> - if ( profile . onFragmentCreate ( ) ) { <nl> + if ( addFragmentToStack ( profile ) ) { <nl> profile . restoreSelfArgs ( savedInstanceState ) ; <nl> - fragmentsStack . add ( profile ) ; <nl> } <nl> } <nl> } else if ( fragmentName . equals ( " wallpapers " ) ) { <nl> SettingsWallpapersActivity settings = new SettingsWallpapersActivity ( ) ; <nl> - settings . onFragmentCreate ( ) ; <nl> + addFragmentToStack ( settings ) ; <nl> settings . restoreSelfArgs ( savedInstanceState ) ; <nl> - fragmentsStack . add ( settings ) ; <nl> } <nl> } <nl> } <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / MediaActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / MediaActivity . java <nl> public void didReceivedNotification ( int id , Object . . . args ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> if ( listAdapter ! = null ) { <nl> listAdapter . notifyDataSetChanged ( ) ; <nl> } <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / MessagesActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / MessagesActivity . java <nl> public void onScroll ( AbsListView absListView , int firstVisibleItem , int visibleI <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> showActionBar ( ) ; <nl> if ( messagesListViewAdapter ! = null ) { <nl> messagesListViewAdapter . notifyDataSetChanged ( ) ; <nl> } <nl> } <nl> <nl> - @ Override <nl> - public void onPause ( ) { <nl> - actionBarLayer . closeSearchField ( ) ; <nl> - } <nl> - <nl> @ Override <nl> @ SuppressWarnings ( " unchecked " ) <nl> public void didReceivedNotification ( int id , Object . . . args ) { <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / SettingsActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / SettingsActivity . java <nl> private void sendLogs ( ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> showActionBar ( ) ; <nl> if ( listAdapter ! = null ) { <nl> listAdapter . notifyDataSetChanged ( ) ; <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / SettingsBlockedUsers . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / SettingsBlockedUsers . java <nl> private void updateVisibleRows ( int mask ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> if ( listViewAdapter ! = null ) { <nl> listViewAdapter . notifyDataSetChanged ( ) ; <nl> } <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / SettingsChangeNameActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / SettingsChangeNameActivity . java <nl> public boolean onEditorAction ( TextView textView , int i , KeyEvent keyEvent ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> SharedPreferences preferences = ApplicationLoader . applicationContext . getSharedPreferences ( " mainconfig " , Activity . MODE_PRIVATE ) ; <nl> boolean animations = preferences . getBoolean ( " view_animations " , true ) ; <nl> if ( ! animations ) { <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / SettingsWallpapersActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / SettingsWallpapersActivity . java <nl> public void run ( ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> if ( listAdapter ! = null ) { <nl> listAdapter . notifyDataSetChanged ( ) ; <nl> } <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / UserProfileActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / UserProfileActivity . java <nl> public void didReceivedNotification ( int id , Object . . . args ) { <nl> <nl> @ Override <nl> public void onResume ( ) { <nl> + super . onResume ( ) ; <nl> if ( listAdapter ! = null ) { <nl> listAdapter . notifyDataSetChanged ( ) ; <nl> } <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / Views / ActionBar / ActionBarActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / Views / ActionBar / ActionBarActivity . java <nl> <nl> import org . telegram . messenger . FileLog ; <nl> import org . telegram . messenger . R ; <nl> import org . telegram . messenger . Utilities ; <nl> - import org . telegram . ui . ChatActivity ; <nl> - import org . telegram . ui . GroupCreateFinalActivity ; <nl> - import org . telegram . ui . SettingsActivity ; <nl> - import org . telegram . ui . SettingsWallpapersActivity ; <nl> <nl> import java . util . ArrayList ; <nl> <nl> public void onAnimationRepeat ( Animator animator ) { <nl> <nl> @ Override <nl> public void onBackPressed ( ) { <nl> - if ( startedTracking | | checkTransitionAnimation ( ) ) { <nl> + if ( startedTracking | | checkTransitionAnimation ( ) | | fragmentsStack . isEmpty ( ) ) { <nl> return ; <nl> } <nl> if ( actionBar . currentLayer ! = null & & actionBar . currentLayer . isSearchFieldVisible ) { <nl> public void onAnimationRepeat ( Animation animation ) { <nl> return true ; <nl> } <nl> <nl> + public boolean addFragmentToStack ( BaseFragment fragment ) { <nl> + if ( ! fragment . onFragmentCreate ( ) ) { <nl> + return false ; <nl> + } <nl> + fragment . setParentActivity ( this ) ; <nl> + fragmentsStack . add ( fragment ) ; <nl> + return true ; <nl> + } <nl> + <nl> private void closeLastFragmentInternalRemoveOld ( BaseFragment fragment ) { <nl> fragment . onPause ( ) ; <nl> fragment . onFragmentDestroy ( ) ; <nl> public void showLastFragment ( ) { <nl> } <nl> <nl> public void removeFragmentFromStack ( BaseFragment fragment ) { <nl> - / / if ( ! fragmentsStack . isEmpty ( ) & & fragmentsStack . get ( fragmentsStack . size ( ) - 1 ) = = fragment ) { <nl> - / / return ; <nl> - / / } <nl> fragment . onFragmentDestroy ( ) ; <nl> fragment . setParentActivity ( null ) ; <nl> fragmentsStack . remove ( fragment ) ; <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / Views / ActionBar / ActionBarLayer . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / Views / ActionBar / ActionBarLayer . java <nl> public void onMenuButtonPressed ( ) { <nl> menu . onMenuButtonPressed ( ) ; <nl> } <nl> } <nl> + <nl> + protected void onPause ( ) { <nl> + if ( menu ! = null ) { <nl> + menu . hideAllPopupMenus ( ) ; <nl> + } <nl> + } <nl> } <nl> \ No newline at end of file <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / Views / ActionBar / ActionBarMenu . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / Views / ActionBar / ActionBarMenu . java <nl> public void onClick ( View view ) { <nl> return menuItem ; <nl> } <nl> <nl> - public void onDestroy ( ) { <nl> + public void hideAllPopupMenus ( ) { <nl> for ( int a = 0 ; a < getChildCount ( ) ; a + + ) { <nl> View view = getChildAt ( a ) ; <nl> if ( view instanceof ActionBarMenuItem ) { <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / Views / ActionBar / ActionBarMenuItem . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / Views / ActionBar / ActionBarMenuItem . java <nl> <nl> import android . widget . FrameLayout ; <nl> import android . widget . ImageView ; <nl> import android . widget . LinearLayout ; <nl> - import android . widget . PopupWindow ; <nl> import android . widget . TextView ; <nl> <nl> import org . telegram . messenger . R ; <nl> <nl> <nl> private LinearLayout popupLayout ; <nl> private ActionBarMenu parentMenu ; <nl> - private PopupWindow popupWindow ; <nl> + private ActionBarPopupWindow popupWindow ; <nl> private ActionBar parentActionBar ; <nl> private EditText searchField ; <nl> private boolean isSearchField = false ; <nl> public void toggleSubMenu ( ) { <nl> return ; <nl> } <nl> if ( popupWindow = = null ) { <nl> - popupWindow = new PopupWindow ( popupLayout , FrameLayout . LayoutParams . WRAP_CONTENT , FrameLayout . LayoutParams . WRAP_CONTENT ) ; <nl> + popupWindow = new ActionBarPopupWindow ( popupLayout , FrameLayout . LayoutParams . WRAP_CONTENT , FrameLayout . LayoutParams . WRAP_CONTENT ) ; <nl> popupWindow . setFocusable ( true ) ; <nl> popupWindow . setBackgroundDrawable ( new BitmapDrawable ( ) ) ; <nl> popupWindow . setOutsideTouchable ( true ) ; <nl> popupWindow . setClippingEnabled ( true ) ; <nl> - popupWindow . setInputMethodMode ( PopupWindow . INPUT_METHOD_NOT_NEEDED ) ; <nl> + popupWindow . setInputMethodMode ( ActionBarPopupWindow . INPUT_METHOD_NOT_NEEDED ) ; <nl> popupWindow . setSoftInputMode ( WindowManager . LayoutParams . SOFT_INPUT_STATE_UNSPECIFIED ) ; <nl> } <nl> if ( popupLayout . getMeasuredWidth ( ) = = 0 ) { <nl> public ActionBarMenuItem setIsSearchField ( boolean value ) { <nl> searchField . setTextSize ( 18 ) ; <nl> searchField . setTextColor ( 0xffffffff ) ; <nl> searchField . setSingleLine ( true ) ; <nl> - searchField . setTextIsSelectable ( false ) ; <nl> searchField . setBackgroundResource ( R . drawable . search_light_states ) ; <nl> searchField . setPadding ( Utilities . dp ( 6 ) , 0 , Utilities . dp ( 6 ) , 0 ) ; <nl> searchField . setInputType ( EditorInfo . TYPE_TEXT_FLAG_NO_SUGGESTIONS ) ; <nl> public void afterTextChanged ( Editable s ) { <nl> mCursorDrawableRes . setAccessible ( true ) ; <nl> mCursorDrawableRes . set ( searchField , R . drawable . search_carret ) ; <nl> } catch ( Exception e ) { <nl> - e . printStackTrace ( ) ; <nl> + / / nothing to do <nl> } <nl> if ( Build . VERSION . SDK_INT > = 11 ) { <nl> searchField . setImeOptions ( EditorInfo . IME_FLAG_NO_FULLSCREEN | EditorInfo . IME_ACTION_SEARCH ) ; <nl> + searchField . setTextIsSelectable ( false ) ; <nl> } else { <nl> searchField . setImeOptions ( EditorInfo . IME_ACTION_SEARCH ) ; <nl> } <nl> new file mode 100644 <nl> index 0000000000 . . a011316d1f <nl> mmm / dev / null <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / Views / ActionBar / ActionBarPopupWindow . java <nl> <nl> + / * <nl> + * This is the source code of Telegram for Android v . 1 . 4 . x . <nl> + * It is licensed under GNU GPL v . 2 or later . <nl> + * You should have received a copy of the license in this archive ( see LICENSE ) . <nl> + * <nl> + * Copyright Nikolai Kudashov , 2013 - 2014 . <nl> + * / <nl> + <nl> + / / Thanks to https : / / github . com / JakeWharton / ActionBarSherlock / <nl> + <nl> + package org . telegram . ui . Views . ActionBar ; <nl> + <nl> + import android . content . Context ; <nl> + import android . util . AttributeSet ; <nl> + import android . view . View ; <nl> + import android . view . ViewTreeObserver ; <nl> + import android . widget . PopupWindow ; <nl> + <nl> + import java . lang . reflect . Field ; <nl> + <nl> + public class ActionBarPopupWindow extends PopupWindow { <nl> + private static final Field superListenerField ; <nl> + static { <nl> + Field f = null ; <nl> + try { <nl> + f = PopupWindow . class . getDeclaredField ( " mOnScrollChangedListener " ) ; <nl> + f . setAccessible ( true ) ; <nl> + } catch ( NoSuchFieldException e ) { <nl> + / * ignored * / <nl> + } <nl> + superListenerField = f ; <nl> + } <nl> + <nl> + private static final ViewTreeObserver . OnScrollChangedListener NOP = new ViewTreeObserver . OnScrollChangedListener ( ) { <nl> + @ Override <nl> + public void onScrollChanged ( ) { <nl> + / * do nothing * / <nl> + } <nl> + } ; <nl> + <nl> + private ViewTreeObserver . OnScrollChangedListener mSuperScrollListener ; <nl> + private ViewTreeObserver mViewTreeObserver ; <nl> + <nl> + public ActionBarPopupWindow ( ) { <nl> + super ( ) ; <nl> + init ( ) ; <nl> + } <nl> + <nl> + public ActionBarPopupWindow ( Context context ) { <nl> + super ( context ) ; <nl> + init ( ) ; <nl> + } <nl> + <nl> + public ActionBarPopupWindow ( Context context , AttributeSet attrs ) { <nl> + super ( context , attrs ) ; <nl> + init ( ) ; <nl> + } <nl> + <nl> + public ActionBarPopupWindow ( Context context , AttributeSet attrs , int defStyle ) { <nl> + super ( context , attrs , defStyle ) ; <nl> + init ( ) ; <nl> + } <nl> + <nl> + public ActionBarPopupWindow ( Context context , AttributeSet attrs , int defStyleAttr , int defStyleRes ) { <nl> + super ( context , attrs , defStyleAttr , defStyleRes ) ; <nl> + init ( ) ; <nl> + } <nl> + <nl> + public ActionBarPopupWindow ( int width , int height ) { <nl> + super ( width , height ) ; <nl> + init ( ) ; <nl> + } <nl> + <nl> + public ActionBarPopupWindow ( View contentView ) { <nl> + super ( contentView ) ; <nl> + init ( ) ; <nl> + } <nl> + <nl> + public ActionBarPopupWindow ( View contentView , int width , int height , boolean focusable ) { <nl> + super ( contentView , width , height , focusable ) ; <nl> + init ( ) ; <nl> + } <nl> + <nl> + public ActionBarPopupWindow ( View contentView , int width , int height ) { <nl> + super ( contentView , width , height ) ; <nl> + init ( ) ; <nl> + } <nl> + <nl> + private void init ( ) { <nl> + if ( superListenerField ! = null ) { <nl> + try { <nl> + mSuperScrollListener = ( ViewTreeObserver . OnScrollChangedListener ) superListenerField . get ( this ) ; <nl> + superListenerField . set ( this , NOP ) ; <nl> + } catch ( Exception e ) { <nl> + mSuperScrollListener = null ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + private void unregisterListener ( ) { <nl> + / / Don ' t do anything if we haven ' t managed to patch the super listener <nl> + if ( mSuperScrollListener ! = null & & mViewTreeObserver ! = null ) { <nl> + if ( mViewTreeObserver . isAlive ( ) ) { <nl> + mViewTreeObserver . removeOnScrollChangedListener ( mSuperScrollListener ) ; <nl> + } <nl> + mViewTreeObserver = null ; <nl> + } <nl> + } <nl> + <nl> + private void registerListener ( View anchor ) { <nl> + / / Don ' t do anything if we haven ' t managed to patch the super listener . <nl> + / / And don ' t bother attaching the listener if the anchor view isn ' t <nl> + / / attached . This means we ' ll only have to deal with the real VTO owned <nl> + / / by the ViewRoot . <nl> + if ( mSuperScrollListener ! = null ) { <nl> + ViewTreeObserver vto = ( anchor . getWindowToken ( ) ! = null ) ? anchor . getViewTreeObserver ( ) <nl> + : null ; <nl> + if ( vto ! = mViewTreeObserver ) { <nl> + if ( mViewTreeObserver ! = null & & mViewTreeObserver . isAlive ( ) ) { <nl> + mViewTreeObserver . removeOnScrollChangedListener ( mSuperScrollListener ) ; <nl> + } <nl> + if ( ( mViewTreeObserver = vto ) ! = null ) { <nl> + vto . addOnScrollChangedListener ( mSuperScrollListener ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> + @ Override <nl> + public void showAsDropDown ( View anchor , int xoff , int yoff ) { <nl> + super . showAsDropDown ( anchor , xoff , yoff ) ; <nl> + registerListener ( anchor ) ; <nl> + } <nl> + <nl> + @ Override <nl> + public void update ( View anchor , int xoff , int yoff , int width , int height ) { <nl> + super . update ( anchor , xoff , yoff , width , height ) ; <nl> + registerListener ( anchor ) ; <nl> + } <nl> + <nl> + @ Override <nl> + public void update ( View anchor , int width , int height ) { <nl> + super . update ( anchor , width , height ) ; <nl> + registerListener ( anchor ) ; <nl> + } <nl> + <nl> + @ Override <nl> + public void showAtLocation ( View parent , int gravity , int x , int y ) { <nl> + super . showAtLocation ( parent , gravity , x , y ) ; <nl> + unregisterListener ( ) ; <nl> + } <nl> + <nl> + @ Override <nl> + public void dismiss ( ) { <nl> + super . dismiss ( ) ; <nl> + unregisterListener ( ) ; <nl> + } <nl> + } <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / Views / ActionBar / BaseFragment . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / Views / ActionBar / BaseFragment . java <nl> public void setParentActivity ( ActionBarActivity activity ) { <nl> } <nl> fragmentView = null ; <nl> } <nl> + if ( actionBarLayer ! = null ) { <nl> + actionBarLayer . onDestroy ( ) ; <nl> + actionBarLayer = null ; <nl> + } <nl> if ( parentActivity ! = null ) { <nl> - if ( actionBarLayer ! = null ) { <nl> - actionBarLayer . onDestroy ( ) ; <nl> - actionBarLayer = null ; <nl> - } <nl> actionBarLayer = parentActivity . getInternalActionBar ( ) . createLayer ( ) ; <nl> } <nl> } <nl> public void onResume ( ) { <nl> } <nl> <nl> public void onPause ( ) { <nl> - <nl> + if ( actionBarLayer ! = null ) { <nl> + actionBarLayer . onPause ( ) ; <nl> + actionBarLayer . closeSearchField ( ) ; <nl> + } <nl> } <nl> <nl> public void onConfigurationChanged ( android . content . res . Configuration newConfig ) { <nl> mmm a / TMessagesProj / src / main / res / values / styles . xml <nl> ppp b / TMessagesProj / src / main / res / values / styles . xml <nl> <nl> < item name = " android : colorBackground " > @ android : color / white < / item > <nl> < item name = " android : windowBackground " > @ android : color / white < / item > <nl> < item name = " android : windowContentOverlay " > @ drawable / shadow < / item > <nl> + < item name = " android : windowNoTitle " > true < / item > <nl> < / style > <nl> <nl> < style name = " Theme . TMessages " parent = " @ android : style / Theme . Holo . Light " > <nl>
|
Fixed app startup on Android 2 . x , crash fixes
|
DrKLO/Telegram
|
2c61da0001b57fe7a39229021123a1fe82e3e4b4
|
2014-06-04T16:00:42Z
|
mmm a / flow / Net2 . actor . cpp <nl> ppp b / flow / Net2 . actor . cpp <nl> <nl> # endif <nl> # include " flow / actorcompiler . h " / / This must be the last # include . <nl> <nl> + # include < memory > <nl> + <nl> / / Defined to track the stack limit <nl> extern " C " intptr_t g_stackYieldLimit ; <nl> intptr_t g_stackYieldLimit = 0 ; <nl> class Net2 ; <nl> class Peer ; <nl> class Connection ; <nl> <nl> - Net2 * g_net2 = 0 ; <nl> + std : : unique_ptr < Net2 > g_net2 = 0 ; <nl> <nl> class Task { <nl> public : <nl> void ASIOReactor : : wake ( ) { <nl> <nl> INetwork * newNet2 ( const TLSConfig & tlsConfig , bool useThreadPool , bool useMetrics ) { <nl> try { <nl> - N2 : : g_net2 = new N2 : : Net2 ( tlsConfig , useThreadPool , useMetrics ) ; <nl> + N2 : : g_net2 = std : : make_unique < N2 : : Net2 > ( tlsConfig , useThreadPool , useMetrics ) ; <nl> } <nl> catch ( boost : : system : : system_error e ) { <nl> TraceEvent ( " Net2InitError " ) . detail ( " Message " , e . what ( ) ) ; <nl> INetwork * newNet2 ( const TLSConfig & tlsConfig , bool useThreadPool , bool useMetric <nl> throw unknown_error ( ) ; <nl> } <nl> <nl> - return N2 : : g_net2 ; <nl> + return N2 : : g_net2 . get ( ) ; <nl> } <nl> <nl> struct TestGVR { <nl>
|
Make g_net2 a unique_ptr
|
apple/foundationdb
|
fad43687d1b06a5a7dc936eaab6f90b83ce2ad39
|
2020-12-08T17:09:31Z
|
mmm a / CHANGELOG <nl> ppp b / CHANGELOG <nl> <nl> v1 . 3 ( XXXX - XX - XX ) <nl> mmmmmmmmmmmmmmm - - <nl> <nl> + * fixed issue # 436 : GET / _api / document on edge <nl> + <nl> * make AQL REVERSE ( ) function work on strings , too <nl> <nl> * disabled DOT generation in ` make doxygen ` . this speeds up docs generation <nl> mmm a / UnitTests / HttpInterface / rest - edge - spec . rb <nl> ppp b / UnitTests / HttpInterface / rest - edge - spec . rb <nl> <nl> ArangoDB . drop_collection ( cn ) <nl> cmd = " / _api / edge ? collection = # { cn } & from = test & to = test " <nl> body = " { } " <nl> - doc = ArangoDB . log_post ( " # { prefix } - no - collection " , cmd , : body = > body ) <nl> + doc = ArangoDB . log_post ( " # { prefix } - no - collection " , cmd , : body = > body ) <nl> <nl> doc . code . should eq ( 404 ) <nl> doc . parsed_response [ ' error ' ] . should eq ( true ) <nl> <nl> cn = " UnitTestsCollectionEdge " <nl> ArangoDB . drop_collection ( cn ) <nl> cmd = " / _api / edges / # { cn } ? vertex = test " <nl> - doc = ArangoDB . log_get ( " # { prefix } - no - collection - query " , cmd ) <nl> + doc = ArangoDB . log_get ( " # { prefix } - no - collection - query " , cmd ) <nl> <nl> doc . code . should eq ( 404 ) <nl> doc . parsed_response [ ' error ' ] . should eq ( true ) <nl> <nl> doc . parsed_response [ ' code ' ] . should eq ( 404 ) <nl> doc . headers [ ' content - type ' ] . should eq ( " application / json ; charset = utf - 8 " ) <nl> end <nl> + <nl> + it " returns an error if document handler is used to create an edge " do <nl> + cn = " UnitTestsCollectionEdge " <nl> + ArangoDB . drop_collection ( cn ) <nl> + ArangoDB . create_collection ( cn , true , 3 ) # type 3 = edge collection <nl> + cmd = " / _api / document ? collection = # { cn } & from = test & to = test " <nl> + body = " { } " <nl> + doc = ArangoDB . log_post ( " # { prefix } - wrong - type " , cmd , : body = > body ) <nl> + <nl> + doc . code . should eq ( 400 ) <nl> + doc . parsed_response [ ' error ' ] . should eq ( true ) <nl> + doc . parsed_response [ ' errorNum ' ] . should eq ( 405 ) <nl> + doc . parsed_response [ ' code ' ] . should eq ( 400 ) <nl> + doc . headers [ ' content - type ' ] . should eq ( " application / json ; charset = utf - 8 " ) <nl> + end <nl> end <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> mmm a / arangod / RestHandler / RestDocumentHandler . cpp <nl> ppp b / arangod / RestHandler / RestDocumentHandler . cpp <nl> bool RestDocumentHandler : : createDocument ( ) { <nl> return false ; <nl> } <nl> <nl> + if ( trx . primaryCollection ( ) - > base . _info . _type = = TRI_COL_TYPE_EDGE ) { <nl> + / / check if we are inserting with the DOCUMENT handler into an EDGE collection <nl> + generateError ( HttpResponse : : BAD , <nl> + TRI_ERROR_HTTP_METHOD_NOT_ALLOWED , <nl> + " must not use the document handler to create an edge " ) ; <nl> + return false ; <nl> + } <nl> + <nl> const TRI_voc_cid_t cid = trx . cid ( ) ; <nl> <nl> TRI_doc_mptr_t * document = 0 ; <nl>
|
issue
|
arangodb/arangodb
|
47bce0a0b43b93298bcd0bd2a3d50de738b6c2d8
|
2013-02-27T13:47:05Z
|
mmm a / dlib / dnn / trainer . h <nl> ppp b / dlib / dnn / trainer . h <nl> namespace dlib <nl> const std : : vector < label_type > & labels <nl> ) <nl> { <nl> - DLIB_CASSERT ( data . size ( ) = = labels . size ( ) & & data . size ( ) > 0 ) ; <nl> + DLIB_CASSERT ( data . size ( ) = = labels . size ( ) ) ; <nl> + <nl> + train_one_step ( data . begin ( ) , data . end ( ) , labels . begin ( ) ) ; <nl> + } <nl> + <nl> + template < <nl> + typename data_iterator , <nl> + typename label_iterator <nl> + > <nl> + void train_one_step ( <nl> + data_iterator dbegin , <nl> + data_iterator dend , <nl> + label_iterator lbegin <nl> + ) <nl> + { <nl> + DLIB_CASSERT ( std : : distance ( dbegin , dend ) > 0 ) ; <nl> <nl> if ( verbose ) <nl> { <nl> namespace dlib <nl> } <nl> } <nl> sync_to_disk ( ) ; <nl> - send_job ( data . begin ( ) , data . end ( ) , labels . begin ( ) ) ; <nl> + send_job ( dbegin , dend , lbegin ) ; <nl> <nl> + + train_one_step_calls ; <nl> } <nl> namespace dlib <nl> const std : : vector < input_type > & data <nl> ) <nl> { <nl> - DLIB_CASSERT ( data . size ( ) > 0 ) ; <nl> + train_one_step ( data . begin ( ) , data . end ( ) ) ; <nl> + } <nl> + <nl> + template < <nl> + typename data_iterator <nl> + > <nl> + void train_one_step ( <nl> + data_iterator dbegin , <nl> + data_iterator dend <nl> + ) <nl> + { <nl> + DLIB_CASSERT ( std : : distance ( dbegin , dend ) > 0 ) ; <nl> if ( verbose ) <nl> { <nl> using namespace std : : chrono ; <nl> namespace dlib <nl> } <nl> } <nl> sync_to_disk ( ) ; <nl> - send_job ( data . begin ( ) , data . end ( ) ) ; <nl> + send_job ( dbegin , dend ) ; <nl> + + train_one_step_calls ; <nl> } <nl> <nl> mmm a / dlib / dnn / trainer_abstract . h <nl> ppp b / dlib / dnn / trainer_abstract . h <nl> namespace dlib <nl> - # get_train_one_step_calls ( ) = = get_train_one_step_calls ( ) + 1 . <nl> ! * / <nl> <nl> + template < <nl> + typename data_iterator , <nl> + typename label_iterator <nl> + > <nl> + void train_one_step ( <nl> + data_iterator dbegin , <nl> + data_iterator dend , <nl> + label_iterator lbegin <nl> + ) ; <nl> + / * ! <nl> + requires <nl> + - std : : advance ( lbegin , std : : distance ( dbegin , dend ) - 1 ) is dereferencable <nl> + - std : : distance ( dbegin , dend ) > 0 <nl> + - net_type uses a supervised loss . <nl> + i . e . net_type : : label_type ! = no_label_type . <nl> + ensures <nl> + - Performs one stochastic gradient update step based on the mini - batch of <nl> + data and labels supplied to this function . In particular , calling <nl> + train_one_step ( ) in a loop is equivalent to calling the train ( ) method <nl> + defined above . However , train_one_step ( ) allows you to stream data from <nl> + disk into the training process while train ( ) requires you to first load <nl> + all the training data into RAM . Otherwise , these training methods are <nl> + equivalent . <nl> + - You can observe the current average loss value by calling get_average_loss ( ) . <nl> + - The network training will happen in another thread . Therefore , after <nl> + calling this function you should call get_net ( ) before you touch the net <nl> + object from the calling thread to ensure no other threads are still <nl> + accessing the network . <nl> + - # get_train_one_step_calls ( ) = = get_train_one_step_calls ( ) + 1 . <nl> + ! * / <nl> + <nl> void train_one_step ( <nl> const std : : vector < input_type > & data <nl> ) ; <nl> namespace dlib <nl> - # get_train_one_step_calls ( ) = = get_train_one_step_calls ( ) + 1 . <nl> ! * / <nl> <nl> + template < <nl> + typename data_iterator <nl> + > <nl> + void train_one_step ( <nl> + data_iterator dbegin , <nl> + data_iterator dend <nl> + ) ; <nl> + / * ! <nl> + requires <nl> + - std : : distance ( dbegin , dend ) > 0 <nl> + - net_type uses an unsupervised loss . <nl> + i . e . net_type : : label_type = = no_label_type . <nl> + ensures <nl> + - Performs one stochastic gradient update step based on the mini - batch of <nl> + data supplied to this function . In particular , calling train_one_step ( ) <nl> + in a loop is equivalent to calling the train ( ) method defined above . <nl> + However , train_one_step ( ) allows you to stream data from disk into the <nl> + training process while train ( ) requires you to first load all the <nl> + training data into RAM . Otherwise , these training methods are <nl> + equivalent . <nl> + - You can observe the current average loss value by calling get_average_loss ( ) . <nl> + - The network training will happen in another thread . Therefore , after <nl> + calling this function you should call get_net ( ) before you touch the net <nl> + object from the calling thread to ensure no other threads are still <nl> + accessing the network . <nl> + - # get_train_one_step_calls ( ) = = get_train_one_step_calls ( ) + 1 . <nl> + ! * / <nl> + <nl> double get_average_loss ( <nl> ) const ; <nl> / * ! <nl>
|
Add dnn_trainer : : train_one_step iterator signature ( )
|
davisking/dlib
|
9726ce1cac4c5c47a47834cde460f9a90a954292
|
2016-09-01T02:13:39Z
|
mmm a / utils / build - script <nl> ppp b / utils / build - script <nl> from build_swift . build_swift import presets <nl> import six <nl> <nl> from swift_build_support . swift_build_support import ( <nl> - debug , <nl> diagnostics , <nl> products , <nl> shell , <nl> class JSONDumper ( json . JSONEncoder ) : <nl> return six . text_type ( o ) <nl> <nl> <nl> + def print_xcodebuild_versions ( file = sys . stdout ) : <nl> + " " " <nl> + Print the host machine ' s ` xcodebuild ` version , as well as version <nl> + information for all available SDKs . <nl> + " " " <nl> + version = shell . capture ( <nl> + [ ' xcodebuild ' , ' - version ' ] , dry_run = False , echo = False ) . rstrip ( ) <nl> + # Allow non - zero exit codes . Under certain obscure circumstances <nl> + # xcodebuild can exit with a non - zero exit code even when the SDK is <nl> + # usable . <nl> + sdks = shell . capture ( <nl> + [ ' xcodebuild ' , ' - version ' , ' - sdk ' ] , dry_run = False , echo = False , <nl> + allow_non_zero_exit = True ) . rstrip ( ) <nl> + fmt = ' { version } \ n \ nmmm SDK versions mmm \ n { sdks } \ n ' <nl> + <nl> + print ( fmt . format ( version = version , sdks = sdks ) , file = file ) <nl> + file . flush ( ) <nl> + <nl> + <nl> class BuildScriptInvocation ( object ) : <nl> <nl> " " " Represent a single build script invocation . " " " <nl> def main_normal ( ) : <nl> <nl> # Show SDKs , if requested . <nl> if args . show_sdks : <nl> - debug . print_xcodebuild_versions ( ) <nl> + print_xcodebuild_versions ( ) <nl> <nl> if args . dump_config : <nl> print ( JSONDumper ( ) . encode ( invocation ) ) <nl> deleted file mode 100644 <nl> index e4369b97d190 . . 000000000000 <nl> mmm a / utils / swift_build_support / swift_build_support / debug . py <nl> ppp / dev / null <nl> <nl> - # swift_build_support / debug . py - Print information on the build - * - python - * - <nl> - # <nl> - # This source file is part of the Swift . org open source project <nl> - # <nl> - # Copyright ( c ) 2014 - 2017 Apple Inc . and the Swift project authors <nl> - # Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> - # <nl> - # See https : / / swift . org / LICENSE . txt for license information <nl> - # See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> - # <nl> - # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - # <nl> - # Convenient functions for printing out information on the build process . <nl> - # <nl> - # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - from __future__ import absolute_import <nl> - from __future__ import print_function <nl> - <nl> - import sys <nl> - <nl> - from . import shell <nl> - <nl> - <nl> - def print_xcodebuild_versions ( file = sys . stdout ) : <nl> - " " " <nl> - Print the host machine ' s ` xcodebuild ` version , as well as version <nl> - information for all available SDKs . <nl> - " " " <nl> - version = shell . capture ( <nl> - [ ' xcodebuild ' , ' - version ' ] , dry_run = False , echo = False ) . rstrip ( ) <nl> - # Allow non - zero exit codes . Under certain obscure circumstances <nl> - # xcodebuild can exit with a non - zero exit code even when the SDK is <nl> - # usable . <nl> - sdks = shell . capture ( <nl> - [ ' xcodebuild ' , ' - version ' , ' - sdk ' ] , dry_run = False , echo = False , <nl> - allow_non_zero_exit = True ) . rstrip ( ) <nl> - fmt = " " " \ <nl> - { version } <nl> - <nl> mmm - SDK versions mmm <nl> - { sdks } <nl> - <nl> - " " " <nl> - print ( fmt . format ( version = version , sdks = sdks ) , file = file ) <nl> - file . flush ( ) <nl> deleted file mode 100644 <nl> index 954db1714673 . . 000000000000 <nl> mmm a / utils / swift_build_support / tests / test_debug . py <nl> ppp / dev / null <nl> <nl> - # test_debug . py - Unit tests for swift_build_support . debug - * - python - * - <nl> - # <nl> - # This source file is part of the Swift . org open source project <nl> - # <nl> - # Copyright ( c ) 2014 - 2017 Apple Inc . and the Swift project authors <nl> - # Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> - # <nl> - # See https : / / swift . org / LICENSE . txt for license information <nl> - # See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> - <nl> - import platform <nl> - import unittest <nl> - try : <nl> - # py2 <nl> - from StringIO import StringIO <nl> - except ImportError : <nl> - # py3 <nl> - from io import StringIO <nl> - <nl> - from swift_build_support import debug <nl> - <nl> - <nl> - class PrintXcodebuildVersionsTestCase ( unittest . TestCase ) : <nl> - def setUp ( self ) : <nl> - if platform . system ( ) ! = ' Darwin ' : <nl> - self . skipTest ( ' print_xcodebuild_version ( ) tests should only be ' <nl> - ' run on OS X ' ) <nl> - self . _out = StringIO ( ) <nl> - <nl> - def test_outputs_xcode_version ( self ) : <nl> - debug . print_xcodebuild_versions ( file = self . _out ) <nl> - actual = self . _out . getvalue ( ) . splitlines ( ) <nl> - self . assertTrue ( actual [ 0 ] . startswith ( ' Xcode ' ) ) <nl> - self . assertTrue ( actual [ 1 ] . startswith ( ' Build version ' ) ) <nl> - self . assertEqual ( actual [ 3 ] , ' mmm SDK versions mmm ' ) <nl> - # You can ' t test beyond this because each developer ' s machines may have <nl> - # a different set of SDKs installed . <nl> - <nl> - <nl> - if __name__ = = ' __main__ ' : <nl> - unittest . main ( ) <nl>
|
Merge remote - tracking branch ' origin / master ' into master - rebranch
|
apple/swift
|
4d06e5d1f49bec09293d2347c302634caf9e648e
|
2020-01-27T05:43:25Z
|
mmm a / src / memcached / memcached . cc <nl> ppp b / src / memcached / memcached . cc <nl> class txt_memcached_delete_request_t : <nl> if ( _noreply ) _rh - > read_next_command ( ) ; <nl> } <nl> <nl> - ~ txt_memcached_delete_request_t ( ) { <nl> - rh - > end_write_command ( ) ; <nl> - } <nl> + ~ txt_memcached_delete_request_t ( ) { } <nl> <nl> void deleted ( ) { <nl> if ( ! noreply ) { <nl> rh - > writef ( " DELETED \ r \ n " ) ; <nl> rh - > read_next_command ( ) ; <nl> } <nl> + rh - > end_write_command ( ) ; <nl> delete this ; <nl> } <nl> void not_found ( ) { <nl> class txt_memcached_delete_request_t : <nl> rh - > writef ( " NOT_FOUND \ r \ n " ) ; <nl> rh - > read_next_command ( ) ; <nl> } <nl> + rh - > end_write_command ( ) ; <nl> delete this ; <nl> } <nl> } ; <nl> new file mode 100755 <nl> index 00000000000 . . 288cc75619b <nl> mmm / dev / null <nl> ppp b / test / regression / issue_153 . py <nl> <nl> + # ! / usr / bin / python <nl> + import os , sys , socket , random <nl> + import time <nl> + <nl> + sys . path . append ( os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , os . path . pardir , ' common ' ) ) ) <nl> + from test_common import * <nl> + <nl> + n_ops = 10000 <nl> + <nl> + def test_function ( opts , port ) : <nl> + s = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) <nl> + s . connect ( ( " localhost " , port ) ) <nl> + <nl> + def assert_on_socket ( string ) : <nl> + res = s . recv ( len ( string ) ) <nl> + if string ! = res : <nl> + print " Got : % s , expect % s " % ( res , string ) <nl> + assert string = = res <nl> + <nl> + s . send ( " set fizz 0 0 4 \ r \ nbuzz \ r \ n " ) <nl> + assert_on_socket ( ' STORED \ r \ n ' ) <nl> + <nl> + s . send ( ' delete fizz fizz fizz fizz \ r \ n ' ) <nl> + assert_on_socket ( ' ERROR \ r \ n ' ) <nl> + <nl> + s . send ( ' get fizz \ r \ n ' ) <nl> + assert_on_socket ( ' VALUE fizz 0 4 \ r \ nbuzz \ r \ nEND \ r \ n ' ) <nl> + <nl> + s . close ( ) <nl> + <nl> + if __name__ = = " __main__ " : <nl> + op = make_option_parser ( ) <nl> + auto_server_test_main ( test_function , op . parse ( sys . argv ) ) <nl>
|
Fix locking problem in memcached . cc .
|
rethinkdb/rethinkdb
|
6a11595c1a93dd15284bb005232cb0fe7c94b9fe
|
2011-01-03T21:11:56Z
|
mmm a / torch / csrc / jit / mobile / module . cpp <nl> ppp b / torch / csrc / jit / mobile / module . cpp <nl> Method Module : : get_method ( const std : : string & name ) const { <nl> AT_ERROR ( " Method ' " , name , " ' is not defined . " ) ; <nl> } <nl> <nl> - c10 : : IValue Module : : run_method ( const std : : string & method_name , Stack stack ) { <nl> - auto observer = torch : : observerConfig ( ) . getModuleObserver ( ) ; <nl> - / * if the metadata dict doesn ' t contain " model_name " , copy the metadata and <nl> - set the value of " model_name " as name ( ) * / <nl> - std : : unordered_map < std : : string , std : : string > copied_metadata = metadata ( ) ; <nl> - if ( metadata ( ) . find ( " model_name " ) = = metadata ( ) . end ( ) ) { <nl> - copied_metadata [ " model_name " ] = name ( ) ; <nl> - } <nl> - if ( observer ) { <nl> - observer - > onEnterRunMethod ( copied_metadata , method_name ) ; <nl> - } <nl> - <nl> - auto debug_info = std : : make_shared < MobileDebugInfo > ( ) ; <nl> - std : : string name = copied_metadata [ " model_name " ] ; <nl> - debug_info - > setModelName ( name ) ; <nl> - debug_info - > setMethodName ( method_name ) ; <nl> - at : : DebugInfoGuard guard ( at : : DebugInfoKind : : MOBILE_RUNTIME_INFO , debug_info ) ; <nl> - <nl> - auto m = find_method ( method_name ) ; <nl> - if ( m = = c10 : : nullopt ) { <nl> - if ( observer ) { <nl> - std : : string cancellation_reason = <nl> - " Method ' " + method_name + " ' is not defined " ; <nl> - observer - > onCancelRunMethod ( cancellation_reason ) ; <nl> - } <nl> - AT_ERROR ( " Method ' " , method_name , " ' is not defined . " ) ; <nl> - } <nl> - try { <nl> - m - > run ( stack ) ; <nl> - c10 : : IValue result = stack . front ( ) ; <nl> - if ( observer ) { <nl> - observer - > onExitRunMethod ( ) ; <nl> - } <nl> - return result ; <nl> - } catch ( c10 : : Error & error ) { <nl> - if ( observer ) { <nl> - observer - > onFailRunMethod ( error . what ( ) ) ; <nl> - } <nl> - TORCH_RETHROW ( error ) ; <nl> - } catch ( . . . ) { <nl> - auto currentException = std : : current_exception ( ) ; <nl> - try { <nl> - if ( ! currentException ) { <nl> - TORCH_CHECK ( false , " Unknown exception " ) ; <nl> - } else { <nl> - try { <nl> - std : : rethrow_exception ( currentException ) ; <nl> - } catch ( const std : : exception & e ) { <nl> - TORCH_CHECK ( false , e . what ( ) ) ; <nl> - } <nl> - } <nl> - } catch ( c10 : : Error & error ) { <nl> - if ( observer ) { <nl> - observer - > onFailRunMethod ( error . what ( ) ) ; <nl> - } <nl> - TORCH_RETHROW ( error ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> c10 : : optional < Method > Module : : find_method ( const std : : string & basename ) const { <nl> for ( auto & fn : cu_ - > methods ( ) ) { <nl> if ( fn - > name ( ) = = basename ) { <nl> mmm a / torch / csrc / jit / mobile / module . h <nl> ppp b / torch / csrc / jit / mobile / module . h <nl> class TORCH_API Module { <nl> : object_ ( object ) , metadata_ ( std : : move ( metadata ) ) , cu_ ( std : : move ( cu ) ) { } <nl> Module ( ) = default ; <nl> Method get_method ( const std : : string & method_name ) const ; <nl> - c10 : : IValue run_method ( const std : : string & method_name , Stack stack ) ; <nl> c10 : : IValue forward ( std : : vector < c10 : : IValue > inputs ) { <nl> return get_method ( " forward " ) ( std : : move ( inputs ) ) ; <nl> } <nl>
|
[ pytorch ] Remove mobile nonvariadic run_method ( )
|
pytorch/pytorch
|
442957d8b645b387d2eee75f507a574855d76436
|
2020-09-11T17:23:08Z
|
mmm a / src / builtins / builtins - symbol . cc <nl> ppp b / src / builtins / builtins - symbol . cc <nl> BUILTIN ( SymbolKeyFor ) { <nl> Handle < Symbol > symbol = Handle < Symbol > : : cast ( obj ) ; <nl> DisallowHeapAllocation no_gc ; <nl> Object result ; <nl> - if ( symbol - > is_public ( ) ) { <nl> + if ( symbol - > is_in_public_symbol_table ( ) ) { <nl> result = symbol - > name ( ) ; <nl> DCHECK ( result . IsString ( ) ) ; <nl> } else { <nl> mmm a / src / execution / isolate . cc <nl> ppp b / src / execution / isolate . cc <nl> Handle < Symbol > Isolate : : SymbolFor ( RootIndex dictionary_index , <nl> PropertyDetails : : Empty ( ) , & entry ) ; <nl> switch ( dictionary_index ) { <nl> case RootIndex : : kPublicSymbolTable : <nl> - symbol - > set_is_public ( true ) ; <nl> + symbol - > set_is_in_public_symbol_table ( true ) ; <nl> heap ( ) - > set_public_symbol_table ( * dictionary ) ; <nl> break ; <nl> case RootIndex : : kApiSymbolTable : <nl> mmm a / src / objects / name - inl . h <nl> ppp b / src / objects / name - inl . h <nl> TQ_OBJECT_CONSTRUCTORS_IMPL ( Symbol ) <nl> BIT_FIELD_ACCESSORS ( Symbol , flags , is_private , Symbol : : IsPrivateBit ) <nl> BIT_FIELD_ACCESSORS ( Symbol , flags , is_well_known_symbol , <nl> Symbol : : IsWellKnownSymbolBit ) <nl> - BIT_FIELD_ACCESSORS ( Symbol , flags , is_public , Symbol : : IsPublicBit ) <nl> + BIT_FIELD_ACCESSORS ( Symbol , flags , is_in_public_symbol_table , <nl> + Symbol : : IsInPublicSymbolTableBit ) <nl> BIT_FIELD_ACCESSORS ( Symbol , flags , is_interesting_symbol , <nl> Symbol : : IsInterestingSymbolBit ) <nl> <nl> mmm a / src / objects / name . h <nl> ppp b / src / objects / name . h <nl> class Symbol : public TorqueGeneratedSymbol < Symbol , Name > { <nl> / / for a detailed description . <nl> DECL_BOOLEAN_ACCESSORS ( is_interesting_symbol ) <nl> <nl> - / / [ is_public ] : Whether this is a symbol created by Symbol . for . Calling <nl> - / / Symbol . keyFor on such a symbol simply needs to return the attached name . <nl> - DECL_BOOLEAN_ACCESSORS ( is_public ) <nl> + / / [ is_in_public_symbol_table ] : Whether this is a symbol created by <nl> + / / Symbol . for . Calling Symbol . keyFor on such a symbol simply needs <nl> + / / to return the attached name . <nl> + DECL_BOOLEAN_ACCESSORS ( is_in_public_symbol_table ) <nl> <nl> / / [ is_private_name ] : Whether this is a private name . Private names <nl> / / are the same as private symbols except they throw on missing <nl> class Symbol : public TorqueGeneratedSymbol < Symbol , Name > { <nl> DECL_VERIFIER ( Symbol ) <nl> <nl> / / Flags layout . <nl> - # define FLAGS_BIT_FIELDS ( V , _ ) \ <nl> - V ( IsPrivateBit , bool , 1 , _ ) \ <nl> - V ( IsWellKnownSymbolBit , bool , 1 , _ ) \ <nl> - V ( IsPublicBit , bool , 1 , _ ) \ <nl> - V ( IsInterestingSymbolBit , bool , 1 , _ ) \ <nl> + # define FLAGS_BIT_FIELDS ( V , _ ) \ <nl> + V ( IsPrivateBit , bool , 1 , _ ) \ <nl> + V ( IsWellKnownSymbolBit , bool , 1 , _ ) \ <nl> + V ( IsInPublicSymbolTableBit , bool , 1 , _ ) \ <nl> + V ( IsInterestingSymbolBit , bool , 1 , _ ) \ <nl> V ( IsPrivateNameBit , bool , 1 , _ ) <nl> <nl> DEFINE_BIT_FIELDS ( FLAGS_BIT_FIELDS ) <nl>
|
[ objects ] Rename is_public bit on Symbol
|
v8/v8
|
b319a99b16e2355bfd52e3dc9aacc37504a91a7b
|
2019-08-06T11:55:44Z
|
mmm a / guilib / GUIFontTTF . cpp <nl> ppp b / guilib / GUIFontTTF . cpp <nl> void CGUIFontTTFBase : : RenderCharacter ( float posX , float posY , const Character * c <nl> if ( m_vertex_count > = m_vertex_size ) <nl> { <nl> m_vertex_size * = 2 ; <nl> + void * old = m_vertex ; <nl> m_vertex = ( SVertex * ) realloc ( m_vertex , m_vertex_size * sizeof ( SVertex ) ) ; <nl> + if ( ! m_vertex ) <nl> + { <nl> + free ( old ) ; <nl> + printf ( " realloc failed in CGUIFontTTF : : RenderCharacter . aborting \ n " ) ; <nl> + abort ( ) ; <nl> + } <nl> } <nl> <nl> m_color = color ; <nl>
|
fixed : realloc may not free stuff properly . check and abort . part of ticket
|
xbmc/xbmc
|
f95e9808803edb60d8d8847a608340c719d5a5f0
|
2011-01-04T19:37:47Z
|
similarity index 100 % <nl> rename from code / dynamic_programming / src / longest_common_subsequence / longestcommonsubsequence . go <nl> rename to code / dynamic_programming / src / longest_common_subsequence / longest_common_subsequence . go <nl> similarity index 100 % <nl> rename from code / dynamic_programming / src / longest_common_subsequence / longestcommonsubsequence . java <nl> rename to code / dynamic_programming / src / longest_common_subsequence / longest_common_subsequence . java <nl> similarity index 100 % <nl> rename from code / dynamic_programming / src / longest_common_subsequence / longestcommonsubsequencerec . java <nl> rename to code / dynamic_programming / src / longest_common_subsequence / longest_common_subsequence_rec . java <nl>
|
renaming files
|
OpenGenus/cosmos
|
ec88fa63ed82b51ff7294480e32e771fe208aeb4
|
2020-03-26T21:20:47Z
|
mmm a / scene / resources / style_box . cpp <nl> ppp b / scene / resources / style_box . cpp <nl> int StyleBoxFlat : : get_shadow_size ( ) const { <nl> return shadow_size ; <nl> } <nl> <nl> + void StyleBoxFlat : : set_shadow_offset ( const Point2 & p_offset ) { <nl> + <nl> + shadow_offset = p_offset ; <nl> + emit_changed ( ) ; <nl> + } <nl> + Point2 StyleBoxFlat : : get_shadow_offset ( ) const { <nl> + <nl> + return shadow_offset ; <nl> + } <nl> + <nl> void StyleBoxFlat : : set_anti_aliased ( const bool & p_anti_aliased ) { <nl> anti_aliased = p_anti_aliased ; <nl> emit_changed ( ) ; <nl> inline void set_inner_corner_radius ( const Rect2 style_rect , const Rect2 inner_re <nl> } <nl> <nl> inline void draw_ring ( Vector < Vector2 > & verts , Vector < int > & indices , Vector < Color > & colors , const Rect2 style_rect , const int corner_radius [ 4 ] , <nl> - const Rect2 ring_rect , const int border_width [ 4 ] , const Color inner_color [ 4 ] , const Color outer_color [ 4 ] , const int corner_detail ) { <nl> + const Rect2 ring_rect , const int border_width [ 4 ] , const Color inner_color [ 4 ] , const Color outer_color [ 4 ] , const int corner_detail , const bool fill_center = false ) { <nl> <nl> int vert_offset = verts . size ( ) ; <nl> if ( ! vert_offset ) { <nl> vert_offset = 0 ; <nl> } <nl> + <nl> int adapted_corner_detail = ( corner_radius [ 0 ] = = 0 & & corner_radius [ 1 ] = = 0 & & corner_radius [ 2 ] = = 0 & & corner_radius [ 3 ] = = 0 ) ? 1 : corner_detail ; <nl> <nl> int ring_corner_radius [ 4 ] ; <nl> inline void draw_ring ( Vector < Vector2 > & verts , Vector < int > & indices , Vector < Color <nl> <nl> Rect2 inner_rect ; <nl> inner_rect = ring_rect . grow_individual ( - border_width [ MARGIN_LEFT ] , - border_width [ MARGIN_TOP ] , - border_width [ MARGIN_RIGHT ] , - border_width [ MARGIN_BOTTOM ] ) ; <nl> + <nl> int inner_corner_radius [ 4 ] ; <nl> + set_inner_corner_radius ( style_rect , inner_rect , corner_radius , inner_corner_radius ) ; <nl> <nl> Vector < Point2 > inner_points ; <nl> - set_inner_corner_radius ( style_rect , inner_rect , corner_radius , inner_corner_radius ) ; <nl> inner_points . push_back ( inner_rect . position + Vector2 ( inner_corner_radius [ 0 ] , inner_corner_radius [ 0 ] ) ) ; / / tl <nl> inner_points . push_back ( Point2 ( inner_rect . position . x + inner_rect . size . x - inner_corner_radius [ 1 ] , inner_rect . position . y + inner_corner_radius [ 1 ] ) ) ; / / tr <nl> inner_points . push_back ( inner_rect . position + inner_rect . size - Vector2 ( inner_corner_radius [ 2 ] , inner_corner_radius [ 2 ] ) ) ; / / br <nl> inline void draw_ring ( Vector < Vector2 > & verts , Vector < int > & indices , Vector < Color <nl> } <nl> } <nl> <nl> - int vert_count = ( adapted_corner_detail + 1 ) * 4 * 2 ; <nl> + int vert_count = verts . size ( ) - vert_offset ; <nl> + <nl> / / fill the indices and the colors for the border <nl> for ( int i = 0 ; i < vert_count ; i + + ) { <nl> - / / poly 1 <nl> indices . push_back ( vert_offset + ( ( i + 0 ) % vert_count ) ) ; <nl> indices . push_back ( vert_offset + ( ( i + 2 ) % vert_count ) ) ; <nl> indices . push_back ( vert_offset + ( ( i + 1 ) % vert_count ) ) ; <nl> - / / poly 2 <nl> - indices . push_back ( vert_offset + ( ( i + 1 ) % vert_count ) ) ; <nl> - indices . push_back ( vert_offset + ( ( i + 2 ) % vert_count ) ) ; <nl> - indices . push_back ( vert_offset + ( ( i + 3 ) % vert_count ) ) ; <nl> + } <nl> + <nl> + if ( fill_center ) { <nl> + / / fill the indices and the colors for the center <nl> + for ( int index = 0 ; index < vert_count / 2 ; index + = 2 ) { <nl> + int i = index ; <nl> + / / poly 1 <nl> + indices . push_back ( vert_offset + i ) ; <nl> + indices . push_back ( vert_offset + vert_count - 4 - i ) ; <nl> + indices . push_back ( vert_offset + i + 2 ) ; <nl> + / / poly 2 <nl> + indices . push_back ( vert_offset + i ) ; <nl> + indices . push_back ( vert_offset + vert_count - 2 - i ) ; <nl> + indices . push_back ( vert_offset + vert_count - 4 - i ) ; <nl> + } <nl> } <nl> } <nl> <nl> void StyleBoxFlat : : draw ( RID p_canvas_item , const Rect2 & p_rect ) const { <nl> / / DRAW SHADOW <nl> if ( shadow_size > 0 ) { <nl> int shadow_width [ 4 ] = { shadow_size , shadow_size , shadow_size , shadow_size } ; <nl> + <nl> + Rect2 shadow_inner_rect = style_rect ; <nl> + shadow_inner_rect . position + = shadow_offset ; <nl> + <nl> + Rect2 shadow_rect = style_rect . grow ( shadow_size ) ; <nl> + shadow_rect . position + = shadow_offset ; <nl> + <nl> Color shadow_colors [ 4 ] = { shadow_color , shadow_color , shadow_color , shadow_color } ; <nl> Color shadow_colors_transparent [ 4 ] ; <nl> for ( int i = 0 ; i < 4 ; i + + ) { <nl> shadow_colors_transparent [ i ] = Color ( shadow_color . r , shadow_color . g , shadow_color . b , 0 ) ; <nl> } <nl> - draw_ring ( verts , indices , colors , style_rect , adapted_corner , <nl> - style_rect . grow ( shadow_size ) , shadow_width , shadow_colors , shadow_colors_transparent , corner_detail ) ; <nl> + <nl> + draw_ring ( verts , indices , colors , shadow_inner_rect , adapted_corner , <nl> + shadow_rect , shadow_width , shadow_colors , shadow_colors_transparent , corner_detail ) ; <nl> + <nl> + if ( draw_center ) { <nl> + int no_border [ 4 ] = { 0 , 0 , 0 , 0 } ; <nl> + draw_ring ( verts , indices , colors , shadow_inner_rect , adapted_corner , <nl> + shadow_inner_rect , no_border , shadow_colors , shadow_colors , corner_detail , true ) ; <nl> + } <nl> } <nl> <nl> / / DRAW border <nl> void StyleBoxFlat : : draw ( RID p_canvas_item , const Rect2 & p_rect ) const { <nl> <nl> / / DRAW INFILL <nl> if ( draw_center ) { <nl> - int temp_vert_offset = verts . size ( ) ; <nl> int no_border [ 4 ] = { 0 , 0 , 0 , 0 } ; <nl> draw_ring ( verts , indices , colors , style_rect , adapted_corner , <nl> - infill_rect , no_border , & bg_color , & bg_color , corner_detail ) ; <nl> - int added_vert_count = verts . size ( ) - temp_vert_offset ; <nl> - / / fill the indices and the colors for the center <nl> - for ( int index = 0 ; index < = added_vert_count / 2 ; index + = 2 ) { <nl> - int i = index ; <nl> - / / poly 1 <nl> - indices . push_back ( temp_vert_offset + i ) ; <nl> - indices . push_back ( temp_vert_offset + added_vert_count - 4 - i ) ; <nl> - indices . push_back ( temp_vert_offset + i + 2 ) ; <nl> - / / poly 1 <nl> - indices . push_back ( temp_vert_offset + i ) ; <nl> - indices . push_back ( temp_vert_offset + added_vert_count - 2 - i ) ; <nl> - indices . push_back ( temp_vert_offset + added_vert_count - 4 - i ) ; <nl> - } <nl> + infill_rect , no_border , & bg_color , & bg_color , corner_detail , true ) ; <nl> } <nl> <nl> if ( aa_on ) { <nl> void StyleBoxFlat : : _bind_methods ( ) { <nl> ClassDB : : bind_method ( D_METHOD ( " set_shadow_size " , " size " ) , & StyleBoxFlat : : set_shadow_size ) ; <nl> ClassDB : : bind_method ( D_METHOD ( " get_shadow_size " ) , & StyleBoxFlat : : get_shadow_size ) ; <nl> <nl> + ClassDB : : bind_method ( D_METHOD ( " set_shadow_offset " , " offset " ) , & StyleBoxFlat : : set_shadow_offset ) ; <nl> + ClassDB : : bind_method ( D_METHOD ( " get_shadow_offset " ) , & StyleBoxFlat : : get_shadow_offset ) ; <nl> + <nl> ClassDB : : bind_method ( D_METHOD ( " set_anti_aliased " , " anti_aliased " ) , & StyleBoxFlat : : set_anti_aliased ) ; <nl> ClassDB : : bind_method ( D_METHOD ( " is_anti_aliased " ) , & StyleBoxFlat : : is_anti_aliased ) ; <nl> <nl> void StyleBoxFlat : : _bind_methods ( ) { <nl> ADD_GROUP ( " Shadow " , " shadow_ " ) ; <nl> ADD_PROPERTY ( PropertyInfo ( Variant : : COLOR , " shadow_color " ) , " set_shadow_color " , " get_shadow_color " ) ; <nl> ADD_PROPERTY ( PropertyInfo ( Variant : : INT , " shadow_size " ) , " set_shadow_size " , " get_shadow_size " ) ; <nl> + ADD_PROPERTY ( PropertyInfo ( Variant : : VECTOR2 , " shadow_offset " ) , " set_shadow_offset " , " get_shadow_offset " ) ; <nl> <nl> ADD_GROUP ( " Anti Aliasing " , " anti_aliasing_ " ) ; <nl> ADD_PROPERTY ( PropertyInfo ( Variant : : BOOL , " anti_aliasing " ) , " set_anti_aliased " , " is_anti_aliased " ) ; <nl> StyleBoxFlat : : StyleBoxFlat ( ) { <nl> anti_aliased = true ; <nl> <nl> shadow_size = 0 ; <nl> + shadow_offset = Point2 ( 0 , 0 ) ; <nl> corner_detail = 8 ; <nl> aa_size = 1 ; <nl> <nl> mmm a / scene / resources / style_box . h <nl> ppp b / scene / resources / style_box . h <nl> class StyleBoxFlat : public StyleBox { <nl> <nl> int corner_detail ; <nl> int shadow_size ; <nl> + Point2 shadow_offset ; <nl> int aa_size ; <nl> <nl> protected : <nl> class StyleBoxFlat : public StyleBox { <nl> void set_shadow_size ( const int & p_size ) ; <nl> int get_shadow_size ( ) const ; <nl> <nl> + void set_shadow_offset ( const Point2 & p_offset ) ; <nl> + Point2 get_shadow_offset ( ) const ; <nl> + <nl> / / ANTI_ALIASING <nl> void set_anti_aliased ( const bool & p_anti_aliased ) ; <nl> bool is_anti_aliased ( ) const ; <nl>
|
Support for shadow offset in box style
|
godotengine/godot
|
cb097283dbaba257c55e46bc2f9993630f4c3913
|
2019-03-19T09:35:06Z
|
mmm a / src / video_core / debug_utils / debug_utils . cpp <nl> ppp b / src / video_core / debug_utils / debug_utils . cpp <nl> void GeometryDumper : : AddTriangle ( Vertex & v0 , Vertex & v1 , Vertex & v2 ) { <nl> vertices . push_back ( v1 ) ; <nl> vertices . push_back ( v2 ) ; <nl> <nl> + int num_vertices = static_cast < int > ( vertices . size ( ) ) ; <nl> faces . push_back ( { num_vertices - 3 , num_vertices - 2 , num_vertices - 1 } ) ; <nl> } <nl> <nl> void DumpShader ( const u32 * binary_data , u32 binary_size , const u32 * swizzle_data <nl> <nl> dvle . main_offset_words = main_offset ; <nl> dvle . output_register_table_offset = write_offset - dvlb . dvle_offset ; <nl> + dvle . output_register_table_size = static_cast < uint32_t > ( output_info_table . size ( ) ) ; <nl> + QueueForWriting ( ( u8 * ) output_info_table . data ( ) , static_cast < u32 > ( output_info_table . size ( ) * sizeof ( OutputRegisterInfo ) ) ) ; <nl> <nl> / / TODO : Create a label table for " main " <nl> <nl> const Math : : Vec4 < u8 > LookupTexture ( const u8 * source , int x , int y , const Texture <nl> Math : : Vec3 < int > ret ; <nl> if ( differential_mode ) { <nl> ret . r ( ) = static_cast < int > ( differential . r ) ; <nl> + ret . g ( ) = static_cast < int > ( differential . g ) ; <nl> + ret . b ( ) = static_cast < int > ( differential . b ) ; <nl> if ( x > = 2 ) { <nl> + ret . r ( ) + = static_cast < int > ( differential . dr ) ; <nl> + ret . g ( ) + = static_cast < int > ( differential . dg ) ; <nl> + ret . b ( ) + = static_cast < int > ( differential . db ) ; <nl> } <nl> ret . r ( ) = Color : : Convert5To8 ( ret . r ( ) ) ; <nl> ret . g ( ) = Color : : Convert5To8 ( ret . g ( ) ) ; <nl> ret . b ( ) = Color : : Convert5To8 ( ret . b ( ) ) ; <nl> } else { <nl> if ( x < 2 ) { <nl> + ret . r ( ) = Color : : Convert4To8 ( static_cast < u8 > ( separate . r1 ) ) ; <nl> + ret . g ( ) = Color : : Convert4To8 ( static_cast < u8 > ( separate . g1 ) ) ; <nl> + ret . b ( ) = Color : : Convert4To8 ( static_cast < u8 > ( separate . b1 ) ) ; <nl> } else { <nl> + ret . r ( ) = Color : : Convert4To8 ( static_cast < u8 > ( separate . r2 ) ) ; <nl> + ret . g ( ) = Color : : Convert4To8 ( static_cast < u8 > ( separate . g2 ) ) ; <nl> + ret . b ( ) = Color : : Convert4To8 ( static_cast < u8 > ( separate . b2 ) ) ; <nl> } <nl> } <nl> <nl> / / Add modifier <nl> + unsigned table_index = static_cast < int > ( ( x < 2 ) ? table_index_1 . Value ( ) : table_index_2 . Value ( ) ) ; <nl> <nl> static const std : : array < std : : array < u8 , 2 > , 8 > etc1_modifier_table = { { <nl> { 2 , 8 } , { 5 , 17 } , { 9 , 29 } , { 13 , 42 } , <nl>
|
Video_Core : Change Tabs to Spaces
|
yuzu-emu/yuzu
|
017437e8d77048d40a1e764cc4c2b2c211233e47
|
2015-07-19T10:59:50Z
|
mmm a / tools / dockerfile / interoptest / grpc_interop_node / build_interop . sh <nl> ppp b / tools / dockerfile / interoptest / grpc_interop_node / build_interop . sh <nl> <nl> set - e <nl> <nl> mkdir - p / var / local / git <nl> - git clone / var / local / jenkins / grpc / var / local / git / grpc <nl> + git clone / var / local / jenkins / grpc - node / var / local / git / grpc - node <nl> # clone gRPC submodules , use data from locally cloned submodules where possible <nl> - ( cd / var / local / jenkins / grpc / & & git submodule foreach ' cd / var / local / git / grpc \ <nl> - & & git submodule update - - init - - reference / var / local / jenkins / grpc / $ { name } \ <nl> + ( cd / var / local / jenkins / grpc - node / & & git submodule foreach ' cd / var / local / git / grpc - node \ <nl> + & & git submodule update - - init - - recursive - - reference / var / local / jenkins / grpc - node / $ { name } \ <nl> $ { name } ' ) <nl> <nl> # copy service account keys if available <nl> cp - r / var / local / jenkins / service_account $ HOME | | true <nl> <nl> - cd / var / local / git / grpc <nl> + cd / var / local / git / grpc - node <nl> <nl> # build Node interop client & server <nl> - npm install - g node - gyp <nl> - npm install - - unsafe - perm - - build - from - source <nl> + npm install - g node - gyp gulp <nl> + npm install <nl> + gulp setup <nl> mmm a / tools / internal_ci / helper_scripts / prepare_build_interop_rc <nl> ppp b / tools / internal_ci / helper_scripts / prepare_build_interop_rc <nl> git submodule update - - init <nl> # Set up gRPC - Go and gRPC - Java to test <nl> git clone - - recursive https : / / github . com / grpc / grpc - go . / . . / grpc - go <nl> git clone - - recursive https : / / github . com / grpc / grpc - java . / . . / grpc - java <nl> + git clone - - recursive https : / / github . com / grpc / grpc - node . / . . / grpc - node <nl> <nl> # Download json file . <nl> mkdir ~ / service_account <nl> mmm a / tools / internal_ci / helper_scripts / prepare_build_macos_interop_rc <nl> ppp b / tools / internal_ci / helper_scripts / prepare_build_macos_interop_rc <nl> brew install md5sha1sum <nl> # Set up gRPC - Go and gRPC - Java to test <nl> git clone - - recursive https : / / github . com / grpc / grpc - go . / . . / grpc - go <nl> git clone - - recursive https : / / github . com / grpc / grpc - java . / . . / grpc - java <nl> + git clone - - recursive https : / / github . com / grpc / grpc - node . / . . / grpc - node <nl> <nl> # Set up Docker for Mac <nl> docker - machine create - d virtualbox - - virtualbox - share - folder " / Users / kbuilder / workspace : " default <nl> mmm a / tools / interop_matrix / create_matrix_images . py <nl> ppp b / tools / interop_matrix / create_matrix_images . py <nl> def build_all_images_for_release ( lang , release ) : <nl> # If we not using current tree or the sibling for grpc stack , do checkout . <nl> if args . git_checkout : <nl> stack_base = checkout_grpc_stack ( lang , release ) <nl> - var = { ' go ' : ' GRPC_GO_ROOT ' , ' java ' : ' GRPC_JAVA_ROOT ' } . get ( lang , ' GRPC_ROOT ' ) <nl> + var = { ' go ' : ' GRPC_GO_ROOT ' , ' java ' : ' GRPC_JAVA_ROOT ' , ' node ' : ' GRPC_NODE_ROOT ' } . get ( lang , ' GRPC_ROOT ' ) <nl> env [ var ] = stack_base <nl> <nl> for runtime in client_matrix . LANG_RUNTIME_MATRIX [ lang ] : <nl> mmm a / tools / run_tests / dockerize / build_interop_image . sh <nl> ppp b / tools / run_tests / dockerize / build_interop_image . sh <nl> else <nl> echo " WARNING : grpc - go not found , it won ' t be mounted to the docker container . " <nl> fi <nl> <nl> + echo " GRPC_NODE_ROOT : $ { GRPC_NODE_ROOT : = $ ( cd . . / grpc - node & & pwd ) } " <nl> + if [ - n " $ GRPC_NODE_ROOT " ] <nl> + then <nl> + MOUNT_ARGS + = " - v $ GRPC_NODE_ROOT : / var / local / jenkins / grpc - node : ro " <nl> + else <nl> + echo " WARNING : grpc - node not found , it won ' t be mounted to the docker container . " <nl> + fi <nl> + <nl> mkdir - p / tmp / ccache <nl> <nl> # Mount service account dir if available . <nl> mmm a / tools / run_tests / run_interop_tests . py <nl> ppp b / tools / run_tests / run_interop_tests . py <nl> def __str__ ( self ) : <nl> class NodeLanguage : <nl> <nl> def __init__ ( self ) : <nl> - self . client_cwd = None <nl> - self . server_cwd = None <nl> + self . client_cwd = ' . . / grpc - node ' <nl> + self . server_cwd = ' . . / grpc - node ' <nl> self . safename = str ( self ) <nl> <nl> def client_cmd ( self , args ) : <nl> - return [ ' tools / run_tests / interop / with_nvm . sh ' , <nl> - ' node ' , ' src / node / interop / interop_client . js ' ] + args <nl> + return [ ' packages / grpc - native - core / deps / grpc / tools / run_tests / interop / with_nvm . sh ' , <nl> + ' node ' , ' test / interop / interop_client . js ' ] + args <nl> <nl> def cloud_to_prod_env ( self ) : <nl> return { } <nl> <nl> def server_cmd ( self , args ) : <nl> - return [ ' tools / run_tests / interop / with_nvm . sh ' , <nl> - ' node ' , ' src / node / interop / interop_server . js ' ] + args <nl> + return [ ' packages / grpc - native - core / deps / grpc / tools / run_tests / interop / with_nvm . sh ' , <nl> + ' node ' , ' test / interop / interop_server . js ' ] + args <nl> <nl> def global_env ( self ) : <nl> return { } <nl>
|
Merge pull request from murgatroid99 / grpc - node_interop
|
grpc/grpc
|
523fefe821407d9364f8e5062f45b3994aaf0ab4
|
2017-10-17T23:28:01Z
|
mmm a / dbms / src / Storages / Kafka / ReadBufferFromKafkaConsumer . cpp <nl> ppp b / dbms / src / Storages / Kafka / ReadBufferFromKafkaConsumer . cpp <nl> void ReadBufferFromKafkaConsumer : : commit ( ) <nl> <nl> PrintOffsets ( " Polled offset " , consumer - > get_offsets_position ( consumer - > get_assignment ( ) ) ) ; <nl> <nl> - / / / Since we can poll more messages than we already processed - commit only processed messages . <nl> - if ( ! messages . empty ( ) ) <nl> - consumer - > async_commit ( * std : : prev ( current ) ) ; <nl> + consumer - > async_commit ( ) ; <nl> <nl> PrintOffsets ( " Committed offset " , consumer - > get_offsets_committed ( consumer - > get_assignment ( ) ) ) ; <nl> <nl> bool ReadBufferFromKafkaConsumer : : nextImpl ( ) <nl> auto new_position = reinterpret_cast < char * > ( const_cast < unsigned char * > ( current - > get_payload ( ) . get_data ( ) ) ) ; <nl> BufferBase : : set ( new_position , current - > get_payload ( ) . get_size ( ) , 0 ) ; <nl> <nl> + / / / Since we can poll more messages than we already processed - commit only processed messages . <nl> + consumer - > store_offset ( * current ) ; <nl> + <nl> + + current ; <nl> <nl> return true ; <nl> mmm a / dbms / src / Storages / Kafka / StorageKafka . cpp <nl> ppp b / dbms / src / Storages / Kafka / StorageKafka . cpp <nl> ConsumerBufferPtr StorageKafka : : createReadBuffer ( ) <nl> conf . set ( " metadata . broker . list " , brokers ) ; <nl> conf . set ( " group . id " , group ) ; <nl> conf . set ( " client . id " , VERSION_FULL ) ; <nl> - conf . set ( " auto . offset . reset " , " smallest " ) ; / / If no offset stored for this group , read all messages from the start <nl> - conf . set ( " enable . auto . commit " , " false " ) ; / / We manually commit offsets after a stream successfully finished <nl> - conf . set ( " enable . partition . eof " , " false " ) ; / / Ignore EOF messages <nl> + conf . set ( " auto . offset . reset " , " smallest " ) ; / / If no offset stored for this group , read all messages from the start <nl> + conf . set ( " enable . auto . commit " , " false " ) ; / / We manually commit offsets after a stream successfully finished <nl> + conf . set ( " enable . auto . offset . store " , " false " ) ; / / Update offset automatically - to commit them all at once . <nl> + conf . set ( " enable . partition . eof " , " false " ) ; / / Ignore EOF messages <nl> updateConfiguration ( conf ) ; <nl> <nl> / / Create a consumer and subscribe to topics <nl>
|
Store offsets manually for each message ( )
|
ClickHouse/ClickHouse
|
9ed197c24f176a2ed820768d8e4cb8162d2fb234
|
2019-09-09T18:26:58Z
|
mmm a / fdbserver / ClusterController . actor . cpp <nl> ppp b / fdbserver / ClusterController . actor . cpp <nl> class ClusterControllerData { <nl> Counter getClientWorkersRequests ; <nl> Counter registerMasterRequests ; <nl> Counter statusRequests ; <nl> - Counter failureMonitoringRequests ; <nl> - <nl> - Counter serversFailed ; <nl> - Counter serversUnfailed ; <nl> <nl> ClusterControllerData ( ClusterControllerFullInterface const & ccInterface , LocalityData const & locality ) <nl> : clusterControllerProcessId ( locality . processId ( ) ) , clusterControllerDcId ( locality . dcId ( ) ) , <nl> class ClusterControllerData { <nl> getWorkersRequests ( " GetWorkersRequests " , clusterControllerMetrics ) , <nl> getClientWorkersRequests ( " GetClientWorkersRequests " , clusterControllerMetrics ) , <nl> registerMasterRequests ( " RegisterMasterRequests " , clusterControllerMetrics ) , <nl> - statusRequests ( " StatusRequests " , clusterControllerMetrics ) , <nl> - failureMonitoringRequests ( " FailureMonitoringRequests " , clusterControllerMetrics ) , <nl> - serversFailed ( " ServersFailed " , clusterControllerMetrics ) , <nl> - serversUnfailed ( " ServersUnfailed " , clusterControllerMetrics ) <nl> + statusRequests ( " StatusRequests " , clusterControllerMetrics ) <nl> { <nl> auto serverInfo = ServerDBInfo ( ) ; <nl> serverInfo . id = deterministicRandom ( ) - > randomUniqueID ( ) ; <nl> struct FailureStatusInfo { <nl> } <nl> } ; <nl> <nl> - / / The failure monitor client relies on the fact that the failure detection server will not declare itself failed <nl> - ACTOR Future < Void > failureDetectionServer ( UID uniqueID , ClusterControllerData * self , FutureStream < FailureMonitoringRequest > requests ) { <nl> - state Version currentVersion = 0 ; <nl> - state std : : map < NetworkAddressList , FailureStatusInfo > currentStatus ; / / The status at currentVersion <nl> - state std : : deque < SystemFailureStatus > statusHistory ; / / The last change in statusHistory is from currentVersion - 1 to currentVersion <nl> - state Future < Void > periodically = Void ( ) ; <nl> - state double lastT = 0 ; <nl> - <nl> - loop choose { <nl> - when ( FailureMonitoringRequest req = waitNext ( requests ) ) { <nl> - / / TODO : Handling this request should no longer be necessary . <nl> - + + self - > failureMonitoringRequests ; <nl> - if ( req . senderStatus . present ( ) ) { <nl> - / / Update the status of requester , if necessary <nl> - auto & stat = currentStatus [ req . addresses ] ; <nl> - auto & newStat = req . senderStatus . get ( ) ; <nl> - <nl> - ASSERT ( ! newStat . failed | | req . addresses ! = g_network - > getLocalAddresses ( ) ) ; <nl> - <nl> - stat . insertRequest ( now ( ) ) ; <nl> - if ( req . senderStatus ! = stat . status ) { <nl> - if ( newStat . failed ) { <nl> - + + self - > serversFailed ; <nl> - } <nl> - else { <nl> - + + self - > serversUnfailed ; <nl> - } <nl> - TraceEvent ( " FailureDetectionStatus " , uniqueID ) . detail ( " System " , req . addresses . toString ( ) ) . detail ( " Status " , newStat . failed ? " Failed " : " OK " ) . detail ( " Why " , " Request " ) ; <nl> - statusHistory . push_back ( SystemFailureStatus ( req . addresses , newStat ) ) ; <nl> - + + currentVersion ; <nl> - <nl> - if ( req . senderStatus = = FailureStatus ( ) ) { <nl> - / / failureMonitorClient reports explicitly that it is failed <nl> - ASSERT ( false ) ; / / This can ' t happen at the moment ; if that changes , make this a TEST instead <nl> - currentStatus . erase ( req . addresses ) ; <nl> - } else { <nl> - TEST ( true ) ; <nl> - stat . status = newStat ; <nl> - } <nl> - <nl> - while ( statusHistory . size ( ) > currentStatus . size ( ) ) <nl> - statusHistory . pop_front ( ) ; <nl> - } <nl> - } <nl> - <nl> - / / Return delta - compressed status changes to requester <nl> - Version reqVersion = req . failureInformationVersion ; <nl> - if ( reqVersion > currentVersion ) { <nl> - req . reply . sendError ( future_version ( ) ) ; <nl> - ASSERT ( false ) ; <nl> - } else { <nl> - TEST ( true ) ; / / failureDetectionServer sending failure data to requester <nl> - FailureMonitoringReply reply ; <nl> - reply . failureInformationVersion = currentVersion ; <nl> - if ( req . senderStatus . present ( ) ) { <nl> - reply . clientRequestIntervalMS = FLOW_KNOBS - > SERVER_REQUEST_INTERVAL * 1000 ; <nl> - reply . considerServerFailedTimeoutMS = CLIENT_KNOBS - > FAILURE_TIMEOUT_DELAY * 1000 ; <nl> - } else { <nl> - reply . clientRequestIntervalMS = FLOW_KNOBS - > CLIENT_REQUEST_INTERVAL * 1000 ; <nl> - reply . considerServerFailedTimeoutMS = CLIENT_KNOBS - > CLIENT_FAILURE_TIMEOUT_DELAY * 1000 ; <nl> - } <nl> - <nl> - ASSERT ( currentVersion > = ( int64_t ) statusHistory . size ( ) ) ; <nl> - <nl> - if ( reqVersion < currentVersion - ( int64_t ) statusHistory . size ( ) | | reqVersion = = 0 ) { <nl> - / / Send everything <nl> - TEST ( true ) ; / / failureDetectionServer sending all current data to requester <nl> - reply . allOthersFailed = true ; <nl> - for ( auto it = currentStatus . begin ( ) ; it ! = currentStatus . end ( ) ; + + it ) <nl> - reply . changes . push_back ( reply . arena , SystemFailureStatus ( it - > first , it - > second . status ) ) ; <nl> - } else { <nl> - TEST ( true ) ; / / failureDetectionServer sending delta - compressed data to requester <nl> - / / SOMEDAY : Send only the last change for a given address ? <nl> - reply . allOthersFailed = false ; <nl> - for ( int v = reqVersion - currentVersion + statusHistory . size ( ) ; v < statusHistory . size ( ) ; v + + ) { <nl> - reply . changes . push_back ( reply . arena , statusHistory [ v ] ) ; <nl> - } <nl> - } <nl> - req . reply . send ( reply ) ; <nl> - } <nl> - } <nl> - when ( wait ( periodically ) ) { <nl> - periodically = delay ( FLOW_KNOBS - > SERVER_REQUEST_INTERVAL ) ; <nl> - double t = now ( ) ; <nl> - if ( lastT ! = 0 & & t - lastT > 1 ) <nl> - TraceEvent ( " LongDelayOnClusterController " ) . detail ( " Duration " , t - lastT ) ; <nl> - lastT = t ; <nl> - <nl> - / / Adapt to global unresponsiveness <nl> - vector < double > delays ; <nl> - for ( auto it = currentStatus . begin ( ) ; it ! = currentStatus . end ( ) ; it + + ) <nl> - if ( it - > second . penultimateRequestTime ) { <nl> - delays . push_back ( it - > second . latency ( t ) ) ; <nl> - / / TraceEvent ( " FDData " , uniqueID ) . detail ( " S " , it - > first . toString ( ) ) . detail ( " L " , it - > second . latency ( t ) ) ; <nl> - } <nl> - int pivot = std : : max ( 0 , ( int ) delays . size ( ) - 2 ) ; <nl> - double pivotDelay = 0 ; <nl> - if ( delays . size ( ) ) { <nl> - std : : nth_element ( delays . begin ( ) , delays . begin ( ) + pivot , delays . end ( ) ) ; <nl> - pivotDelay = * ( delays . begin ( ) + pivot ) ; <nl> - } <nl> - pivotDelay = std : : max ( 0 . 0 , pivotDelay - FLOW_KNOBS - > SERVER_REQUEST_INTERVAL ) ; <nl> - <nl> - / / TraceEvent ( " FailureDetectionPoll " , uniqueID ) . detail ( " PivotDelay " , pivotDelay ) . detail ( " Clients " , currentStatus . size ( ) ) ; <nl> - / / TraceEvent ( " FailureDetectionAcceptableDelay " ) . detail ( " Delay " , acceptableDelay1000 ) ; <nl> - <nl> - bool useEmergencyDelay = ( std : : max ( self - > db . unfinishedRecoveries , self - > db . logGenerations ) > CLIENT_KNOBS - > FAILURE_MAX_GENERATIONS ) | | <nl> - ( now ( ) - self - > startTime < CLIENT_KNOBS - > FAILURE_EMERGENCY_DELAY ) ; <nl> - <nl> - for ( auto it = currentStatus . begin ( ) ; it ! = currentStatus . end ( ) ; ) { <nl> - double delay = t - it - > second . lastRequestTime ; <nl> - if ( it - > first ! = g_network - > getLocalAddresses ( ) & & ( useEmergencyDelay ? <nl> - ( delay > CLIENT_KNOBS - > FAILURE_EMERGENCY_DELAY ) : <nl> - ( delay > pivotDelay * 2 + FLOW_KNOBS - > SERVER_REQUEST_INTERVAL + CLIENT_KNOBS - > FAILURE_MIN_DELAY | | delay > CLIENT_KNOBS - > FAILURE_MAX_DELAY ) ) ) { <nl> - / / printf ( " Failure Detection Server : Status of ' % s ' is now ' % s ' after % f sec \ n " , it - > first . toString ( ) . c_str ( ) , " Failed " , now ( ) - it - > second . lastRequestTime ) ; <nl> - TraceEvent ( " FailureDetectionStatus " , uniqueID ) . detail ( " System " , describe ( it - > first ) ) . detail ( " Status " , " Failed " ) . detail ( " Why " , " Timeout " ) . detail ( " LastRequestAge " , delay ) <nl> - . detail ( " PivotDelay " , pivotDelay ) . detail ( " UnfinishedRecoveries " , self - > db . unfinishedRecoveries ) . detail ( " LogGenerations " , self - > db . logGenerations ) ; <nl> - + + self - > serversFailed ; <nl> - statusHistory . push_back ( SystemFailureStatus ( it - > first , FailureStatus ( true ) ) ) ; <nl> - + + currentVersion ; <nl> - it = currentStatus . erase ( it ) ; <nl> - while ( statusHistory . size ( ) > currentStatus . size ( ) ) <nl> - statusHistory . pop_front ( ) ; <nl> - } else { <nl> - + + it ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - } <nl> - <nl> ACTOR Future < vector < TLogInterface > > requireAll ( vector < Future < Optional < vector < TLogInterface > > > > in ) { <nl> state vector < TLogInterface > out ; <nl> state int i ; <nl> ACTOR Future < Void > clusterControllerCore ( ClusterControllerFullInterface interf , <nl> state uint64_t step = 0 ; <nl> state Future < ErrorOr < Void > > error = errorOr ( actorCollection ( self . addActor . getFuture ( ) ) ) ; <nl> <nl> - self . addActor . send ( failureDetectionServer ( self . id , & self , interf . clientInterface . failureMonitoring . getFuture ( ) ) ) ; <nl> self . addActor . send ( clusterWatchDatabase ( & self , & self . db ) ) ; / / Start the master database <nl> self . addActor . send ( self . updateWorkerList . init ( self . db . db ) ) ; <nl> self . addActor . send ( statusServer ( interf . clientInterface . databaseStatus . getFuture ( ) , & self , coordinators ) ) ; <nl>
|
Merge pull request from apple / release - 6 . 3
|
apple/foundationdb
|
9668f32df5abf985095faef33ddeefd07463983c
|
2020-06-18T15:50:25Z
|
mmm a / src / mongo / db / pdfile . h <nl> ppp b / src / mongo / db / pdfile . h <nl> namespace mongo { <nl> <nl> / * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm * / <nl> <nl> - # pragma pack ( 1 ) <nl> - <nl> - class DeletedRecord { <nl> - public : <nl> - <nl> - int lengthWithHeaders ( ) const { _accessing ( ) ; return _lengthWithHeaders ; } <nl> - int & lengthWithHeaders ( ) { _accessing ( ) ; return _lengthWithHeaders ; } <nl> - <nl> - int extentOfs ( ) const { _accessing ( ) ; return _extentOfs ; } <nl> - int & extentOfs ( ) { _accessing ( ) ; return _extentOfs ; } <nl> - <nl> - / / TODO : we need to not const_cast here but problem is DiskLoc : : writing <nl> - DiskLoc & nextDeleted ( ) const { _accessing ( ) ; return const_cast < DiskLoc & > ( _nextDeleted ) ; } <nl> - <nl> - DiskLoc myExtentLoc ( const DiskLoc & myLoc ) const { <nl> - _accessing ( ) ; <nl> - return DiskLoc ( myLoc . a ( ) , _extentOfs ) ; <nl> - } <nl> - Extent * myExtent ( const DiskLoc & myLoc ) { <nl> - _accessing ( ) ; <nl> - return DiskLoc ( myLoc . a ( ) , _extentOfs ) . ext ( ) ; <nl> - } <nl> - private : <nl> - <nl> - void _accessing ( ) const ; <nl> - <nl> - int _lengthWithHeaders ; <nl> - int _extentOfs ; <nl> - DiskLoc _nextDeleted ; <nl> - } ; <nl> - <nl> - / * Record is a record in a datafile . DeletedRecord is similar but for deleted space . <nl> - <nl> - * 11 : 03 : 20 AM ) dm10gen : regarding extentOfs . . . <nl> - ( 11 : 03 : 42 AM ) dm10gen : an extent is a continugous disk area , which contains many Records and DeleteRecords <nl> - ( 11 : 03 : 56 AM ) dm10gen : a DiskLoc has two pieces , the fileno and ofs . ( 64 bit total ) <nl> - ( 11 : 04 : 16 AM ) dm10gen : to keep the headesr small , instead of storing a 64 bit ptr to the full extent address , we keep just the offset <nl> - ( 11 : 04 : 29 AM ) dm10gen : we can do this as we know the record ' s address , and it has the same fileNo <nl> - ( 11 : 04 : 33 AM ) dm10gen : see class DiskLoc for more info <nl> - ( 11 : 04 : 43 AM ) dm10gen : so that is how Record : : myExtent ( ) works <nl> - ( 11 : 04 : 53 AM ) dm10gen : on an alloc ( ) , when we build a new Record , we must populate its extentOfs then <nl> - * / <nl> - class Record { <nl> - public : <nl> - enum HeaderSizeValue { HeaderSize = 16 } ; <nl> - <nl> - int lengthWithHeaders ( ) const { _accessing ( ) ; return _lengthWithHeaders ; } <nl> - int & lengthWithHeaders ( ) { _accessing ( ) ; return _lengthWithHeaders ; } <nl> - <nl> - int extentOfs ( ) const { _accessing ( ) ; return _extentOfs ; } <nl> - int & extentOfs ( ) { _accessing ( ) ; return _extentOfs ; } <nl> - <nl> - int nextOfs ( ) const { _accessing ( ) ; return _nextOfs ; } <nl> - int & nextOfs ( ) { _accessing ( ) ; return _nextOfs ; } <nl> - <nl> - int prevOfs ( ) const { _accessing ( ) ; return _prevOfs ; } <nl> - int & prevOfs ( ) { _accessing ( ) ; return _prevOfs ; } <nl> - <nl> - const char * data ( ) const { _accessing ( ) ; return _data ; } <nl> - char * data ( ) { _accessing ( ) ; return _data ; } <nl> - <nl> - const char * dataNoThrowing ( ) const { return _data ; } <nl> - char * dataNoThrowing ( ) { return _data ; } <nl> - <nl> - int netLength ( ) const { _accessing ( ) ; return _netLength ( ) ; } <nl> - <nl> - / * use this when a record is deleted . basically a union with next / prev fields * / <nl> - DeletedRecord & asDeleted ( ) { return * ( ( DeletedRecord * ) this ) ; } <nl> - <nl> - Extent * myExtent ( const DiskLoc & myLoc ) { return DiskLoc ( myLoc . a ( ) , extentOfs ( ) ) . ext ( ) ; } <nl> - <nl> - / * get the next record in the namespace , traversing extents as necessary * / <nl> - DiskLoc getNext ( const DiskLoc & myLoc ) ; <nl> - DiskLoc getPrev ( const DiskLoc & myLoc ) ; <nl> - <nl> - struct NP { <nl> - int nextOfs ; <nl> - int prevOfs ; <nl> - } ; <nl> - NP * np ( ) { return ( NP * ) & _nextOfs ; } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmm <nl> - / / memory cache <nl> - / / mmmmmmmmmmmmmmmmmmmmm <nl> - <nl> - / * * <nl> - * touches the data so that is in physical memory <nl> - * @ param entireRecrd if false , only the header and first byte is touched <nl> - * if true , the entire record is touched <nl> - * * / <nl> - void touch ( bool entireRecrd = false ) const ; <nl> - <nl> - / * * <nl> - * @ return if this record is likely in physical memory <nl> - * its not guaranteed because its possible it gets swapped out in a very unlucky windows <nl> - * / <nl> - bool likelyInPhysicalMemory ( ) const ; <nl> - <nl> - / * * <nl> - * tell the cache this Record was accessed <nl> - * @ return this , for simple chaining <nl> - * / <nl> - Record * accessed ( ) ; <nl> - <nl> - static bool likelyInPhysicalMemory ( const char * data ) ; <nl> - <nl> - / * * <nl> - * this adds stats about page fault exceptions currently <nl> - * specically how many times we call _accessing where the record is not in memory <nl> - * and how many times we throw a PageFaultException <nl> - * / <nl> - static void appendStats ( BSONObjBuilder & b ) ; <nl> - <nl> - static void appendWorkingSetInfo ( BSONObjBuilder & b ) ; <nl> - private : <nl> - <nl> - int _netLength ( ) const { return _lengthWithHeaders - HeaderSize ; } <nl> - <nl> - / * * <nl> - * call this when accessing a field which could hit disk <nl> - * / <nl> - void _accessing ( ) const ; <nl> - <nl> - int _lengthWithHeaders ; <nl> - int _extentOfs ; <nl> - int _nextOfs ; <nl> - int _prevOfs ; <nl> - <nl> - / * * be careful when referencing this that your write intent was correct * / <nl> - char _data [ 4 ] ; <nl> - <nl> - public : <nl> - <nl> - static bool MemoryTrackingEnabled ; <nl> - } ; <nl> - # pragma pack ( ) <nl> - <nl> - / / XXX - ERH <nl> - <nl> - inline DiskLoc Record : : getNext ( const DiskLoc & myLoc ) { <nl> - _accessing ( ) ; <nl> - if ( _nextOfs ! = DiskLoc : : NullOfs ) { <nl> - / * defensive * / <nl> - if ( _nextOfs > = 0 & & _nextOfs < 10 ) { <nl> - logContext ( " Assertion failure - Record : : getNext ( ) referencing a deleted record ? " ) ; <nl> - return DiskLoc ( ) ; <nl> - } <nl> - <nl> - return DiskLoc ( myLoc . a ( ) , _nextOfs ) ; <nl> - } <nl> - Extent * e = myExtent ( myLoc ) ; <nl> - while ( 1 ) { <nl> - if ( e - > xnext . isNull ( ) ) <nl> - return DiskLoc ( ) ; / / end of table . <nl> - e = e - > xnext . ext ( ) ; <nl> - if ( ! e - > firstRecord . isNull ( ) ) <nl> - break ; <nl> - / / entire extent could be empty , keep looking <nl> - } <nl> - return e - > firstRecord ; <nl> - } <nl> - <nl> - inline DiskLoc Record : : getPrev ( const DiskLoc & myLoc ) { <nl> - _accessing ( ) ; <nl> - <nl> - / / Check if we still have records on our current extent <nl> - if ( _prevOfs ! = DiskLoc : : NullOfs ) { <nl> - return DiskLoc ( myLoc . a ( ) , _prevOfs ) ; <nl> - } <nl> - <nl> - / / Get the current extent <nl> - Extent * e = myExtent ( myLoc ) ; <nl> - while ( 1 ) { <nl> - if ( e - > xprev . isNull ( ) ) { <nl> - / / There are no more extents before this one <nl> - return DiskLoc ( ) ; <nl> - } <nl> - <nl> - / / Move to the extent before this one <nl> - e = e - > xprev . ext ( ) ; <nl> - <nl> - if ( ! e - > lastRecord . isNull ( ) ) { <nl> - / / We have found a non empty extent <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - / / Return the last record in our new extent <nl> - return e - > lastRecord ; <nl> - } <nl> - <nl> - inline BSONObj DiskLoc : : obj ( ) const { <nl> - return BSONObj : : make ( rec ( ) - > accessed ( ) ) ; <nl> - } <nl> - <nl> template < class V > <nl> - inline <nl> + inline <nl> const BtreeBucket < V > * DiskLoc : : btree ( ) const { <nl> verify ( _a ! = - 1 ) ; <nl> Record * r = rec ( ) ; <nl> namespace mongo { <nl> return ( const BtreeBucket < V > * ) r - > data ( ) ; <nl> } <nl> <nl> + <nl> + <nl> boost : : intmax_t dbSize ( const char * database ) ; <nl> <nl> inline NamespaceIndex * nsindex ( const StringData & ns ) { <nl> mmm a / src / mongo / db / storage / record . cpp <nl> ppp b / src / mongo / db / storage / record . cpp <nl> namespace mongo { <nl> return cc ( ) . database ( ) - > getExtentManager ( ) . getExtent ( * this ) ; <nl> } <nl> <nl> + BSONObj DiskLoc : : obj ( ) const { <nl> + return BSONObj : : make ( rec ( ) - > accessed ( ) ) ; <nl> + } <nl> + <nl> void Record : : _accessing ( ) const { <nl> if ( likelyInPhysicalMemory ( ) ) <nl> return ; <nl> mmm a / src / mongo / db / storage / record . h <nl> ppp b / src / mongo / db / storage / record . h <nl> <nl> <nl> # include " mongo / bson / bsonobjbuilder . h " <nl> # include " mongo / platform / atomic_word . h " <nl> + # include " mongo / db / storage / extent . h " <nl> <nl> namespace mongo { <nl> <nl> + / * Record is a record in a datafile . DeletedRecord is similar but for deleted space . <nl> + <nl> + * 11 : 03 : 20 AM ) dm10gen : regarding extentOfs . . . <nl> + ( 11 : 03 : 42 AM ) dm10gen : an extent is a continugous disk area , which contains many Records and DeleteRecords <nl> + ( 11 : 03 : 56 AM ) dm10gen : a DiskLoc has two pieces , the fileno and ofs . ( 64 bit total ) <nl> + ( 11 : 04 : 16 AM ) dm10gen : to keep the headesr small , instead of storing a 64 bit ptr to the full extent address , we keep just the offset <nl> + ( 11 : 04 : 29 AM ) dm10gen : we can do this as we know the record ' s address , and it has the same fileNo <nl> + ( 11 : 04 : 33 AM ) dm10gen : see class DiskLoc for more info <nl> + ( 11 : 04 : 43 AM ) dm10gen : so that is how Record : : myExtent ( ) works <nl> + ( 11 : 04 : 53 AM ) dm10gen : on an alloc ( ) , when we build a new Record , we must populate its extentOfs then <nl> + * / <nl> + # pragma pack ( 1 ) <nl> + class Record { <nl> + public : <nl> + enum HeaderSizeValue { HeaderSize = 16 } ; <nl> + <nl> + int lengthWithHeaders ( ) const { _accessing ( ) ; return _lengthWithHeaders ; } <nl> + int & lengthWithHeaders ( ) { _accessing ( ) ; return _lengthWithHeaders ; } <nl> + <nl> + int extentOfs ( ) const { _accessing ( ) ; return _extentOfs ; } <nl> + int & extentOfs ( ) { _accessing ( ) ; return _extentOfs ; } <nl> + <nl> + int nextOfs ( ) const { _accessing ( ) ; return _nextOfs ; } <nl> + int & nextOfs ( ) { _accessing ( ) ; return _nextOfs ; } <nl> + <nl> + int prevOfs ( ) const { _accessing ( ) ; return _prevOfs ; } <nl> + int & prevOfs ( ) { _accessing ( ) ; return _prevOfs ; } <nl> + <nl> + const char * data ( ) const { _accessing ( ) ; return _data ; } <nl> + char * data ( ) { _accessing ( ) ; return _data ; } <nl> + <nl> + const char * dataNoThrowing ( ) const { return _data ; } <nl> + char * dataNoThrowing ( ) { return _data ; } <nl> + <nl> + int netLength ( ) const { _accessing ( ) ; return _netLength ( ) ; } <nl> + <nl> + / * use this when a record is deleted . basically a union with next / prev fields * / <nl> + DeletedRecord & asDeleted ( ) { return * ( ( DeletedRecord * ) this ) ; } <nl> + <nl> + / / TODO ( ERH ) : remove <nl> + Extent * myExtent ( const DiskLoc & myLoc ) { return DiskLoc ( myLoc . a ( ) , extentOfs ( ) ) . ext ( ) ; } <nl> + <nl> + / * get the next record in the namespace , traversing extents as necessary * / <nl> + DiskLoc getNext ( const DiskLoc & myLoc ) ; / / TODO ( ERH ) : remove <nl> + DiskLoc getPrev ( const DiskLoc & myLoc ) ; / / TODO ( ERH ) : remove <nl> + <nl> + struct NP { <nl> + int nextOfs ; <nl> + int prevOfs ; <nl> + } ; <nl> + NP * np ( ) { return ( NP * ) & _nextOfs ; } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmm <nl> + / / memory cache <nl> + / / mmmmmmmmmmmmmmmmmmmmm <nl> + <nl> + / * * <nl> + * touches the data so that is in physical memory <nl> + * @ param entireRecrd if false , only the header and first byte is touched <nl> + * if true , the entire record is touched <nl> + * * / <nl> + void touch ( bool entireRecrd = false ) const ; <nl> + <nl> + / * * <nl> + * @ return if this record is likely in physical memory <nl> + * its not guaranteed because its possible it gets swapped out in a very unlucky windows <nl> + * / <nl> + bool likelyInPhysicalMemory ( ) const ; <nl> + <nl> + / * * <nl> + * tell the cache this Record was accessed <nl> + * @ return this , for simple chaining <nl> + * / <nl> + Record * accessed ( ) ; <nl> + <nl> + static bool likelyInPhysicalMemory ( const char * data ) ; <nl> + <nl> + / * * <nl> + * this adds stats about page fault exceptions currently <nl> + * specically how many times we call _accessing where the record is not in memory <nl> + * and how many times we throw a PageFaultException <nl> + * / <nl> + static void appendStats ( BSONObjBuilder & b ) ; <nl> + <nl> + static void appendWorkingSetInfo ( BSONObjBuilder & b ) ; <nl> + private : <nl> + <nl> + int _netLength ( ) const { return _lengthWithHeaders - HeaderSize ; } <nl> + <nl> + / * * <nl> + * call this when accessing a field which could hit disk <nl> + * / <nl> + void _accessing ( ) const ; <nl> + <nl> + int _lengthWithHeaders ; <nl> + int _extentOfs ; <nl> + int _nextOfs ; <nl> + int _prevOfs ; <nl> + <nl> + / * * be careful when referencing this that your write intent was correct * / <nl> + char _data [ 4 ] ; <nl> + <nl> + public : <nl> + static bool MemoryTrackingEnabled ; <nl> + <nl> + } ; <nl> + # pragma pack ( ) <nl> + <nl> + class DeletedRecord { <nl> + public : <nl> + <nl> + int lengthWithHeaders ( ) const { _accessing ( ) ; return _lengthWithHeaders ; } <nl> + int & lengthWithHeaders ( ) { _accessing ( ) ; return _lengthWithHeaders ; } <nl> + <nl> + int extentOfs ( ) const { _accessing ( ) ; return _extentOfs ; } <nl> + int & extentOfs ( ) { _accessing ( ) ; return _extentOfs ; } <nl> + <nl> + / / TODO : we need to not const_cast here but problem is DiskLoc : : writing <nl> + DiskLoc & nextDeleted ( ) const { _accessing ( ) ; return const_cast < DiskLoc & > ( _nextDeleted ) ; } <nl> + <nl> + DiskLoc myExtentLoc ( const DiskLoc & myLoc ) const { <nl> + _accessing ( ) ; <nl> + return DiskLoc ( myLoc . a ( ) , _extentOfs ) ; <nl> + } <nl> + Extent * myExtent ( const DiskLoc & myLoc ) { <nl> + _accessing ( ) ; <nl> + return DiskLoc ( myLoc . a ( ) , _extentOfs ) . ext ( ) ; <nl> + } <nl> + private : <nl> + <nl> + void _accessing ( ) const ; <nl> + <nl> + int _lengthWithHeaders ; <nl> + int _extentOfs ; <nl> + DiskLoc _nextDeleted ; <nl> + } ; <nl> + <nl> struct RecordStats { <nl> void record ( BSONObjBuilder & b ) ; <nl> <nl> namespace mongo { <nl> AtomicInt64 pageFaultExceptionsThrown ; <nl> } ; <nl> <nl> + / / mmmmmmmmmmmmmmmmmm <nl> + <nl> + inline DiskLoc Record : : getNext ( const DiskLoc & myLoc ) { <nl> + _accessing ( ) ; <nl> + if ( _nextOfs ! = DiskLoc : : NullOfs ) { <nl> + / * defensive * / <nl> + if ( _nextOfs > = 0 & & _nextOfs < 10 ) { <nl> + logContext ( " Assertion failure - Record : : getNext ( ) referencing a deleted record ? " ) ; <nl> + return DiskLoc ( ) ; <nl> + } <nl> + <nl> + return DiskLoc ( myLoc . a ( ) , _nextOfs ) ; <nl> + } <nl> + Extent * e = myExtent ( myLoc ) ; <nl> + while ( 1 ) { <nl> + if ( e - > xnext . isNull ( ) ) <nl> + return DiskLoc ( ) ; / / end of table . <nl> + e = e - > xnext . ext ( ) ; <nl> + if ( ! e - > firstRecord . isNull ( ) ) <nl> + break ; <nl> + / / entire extent could be empty , keep looking <nl> + } <nl> + return e - > firstRecord ; <nl> + } <nl> + <nl> + inline DiskLoc Record : : getPrev ( const DiskLoc & myLoc ) { <nl> + _accessing ( ) ; <nl> + <nl> + / / Check if we still have records on our current extent <nl> + if ( _prevOfs ! = DiskLoc : : NullOfs ) { <nl> + return DiskLoc ( myLoc . a ( ) , _prevOfs ) ; <nl> + } <nl> + <nl> + / / Get the current extent <nl> + Extent * e = myExtent ( myLoc ) ; <nl> + while ( 1 ) { <nl> + if ( e - > xprev . isNull ( ) ) { <nl> + / / There are no more extents before this one <nl> + return DiskLoc ( ) ; <nl> + } <nl> + <nl> + / / Move to the extent before this one <nl> + e = e - > xprev . ext ( ) ; <nl> + <nl> + if ( ! e - > lastRecord . isNull ( ) ) { <nl> + / / We have found a non empty extent <nl> + break ; <nl> + } <nl> + } <nl> <nl> + / / Return the last record in our new extent <nl> + return e - > lastRecord ; <nl> + } <nl> <nl> } <nl>
|
move Record declaration from pdfile to record . h
|
mongodb/mongo
|
889a5182325c0842a48c17dd252d02e3b919fbf2
|
2013-12-30T05:43:24Z
|
mmm a / jstests / sharding / hedging_metrics_server_status . js <nl> ppp b / jstests / sharding / hedging_metrics_server_status . js <nl> <nl> ( function ( ) { <nl> " use strict " ; <nl> <nl> + load ( " jstests / libs / fail_point_util . js " ) ; <nl> + <nl> / * <nl> * Verifies that the server status response has the hegingMetrics fields that we expect . <nl> * / <nl> function verifyServerStatusFields ( serverStatusResponse ) { <nl> } <nl> <nl> / * <nl> - * Verifies that the hedgingMetrics in the server status response is equal to the expected <nl> - * hedgingMetrics . <nl> + * Verifies that eventually the hedgingMetrics in the server status response is equal to <nl> + * the expected hedgingMetrics . <nl> * / <nl> function checkServerStatusHedgingMetrics ( mongosConn , expectedHedgingMetrics ) { <nl> - const serverStatus = assert . commandWorked ( mongosConn . adminCommand ( { serverStatus : 1 } ) ) ; <nl> - verifyServerStatusFields ( serverStatus ) ; <nl> - <nl> - assert . eq ( expectedHedgingMetrics . numTotalOperations , <nl> - serverStatus . hedgingMetrics . numTotalOperations ) ; <nl> - assert . eq ( expectedHedgingMetrics . numTotalHedgedOperations , <nl> - serverStatus . hedgingMetrics . numTotalHedgedOperations ) ; <nl> - assert . eq ( expectedHedgingMetrics . numAdvantageouslyHedgedOperations , <nl> - serverStatus . hedgingMetrics . numAdvantageouslyHedgedOperations ) ; <nl> + assert . soon ( <nl> + ( ) = > { <nl> + const serverStatus = assert . commandWorked ( mongosConn . adminCommand ( { serverStatus : 1 } ) ) ; <nl> + verifyServerStatusFields ( serverStatus ) ; <nl> + return bsonWoCompare ( serverStatus . hedgingMetrics , expectedHedgingMetrics ) = = = 0 ; <nl> + } , <nl> + ` expect the hedgingMetrics to eventually be equal to $ { tojson ( expectedHedgingMetrics ) } ` , <nl> + serverStatusCheckTimeoutMS ) ; <nl> } <nl> <nl> function setCommandDelay ( nodeConn , command , delay ) { <nl> function clearCommandDelay ( nodeConn ) { <nl> } ) ) ; <nl> } <nl> <nl> - const st = new ShardingTest ( { shards : 2 , rs : { nodes : 2 } } ) ; <nl> + const st = new ShardingTest ( { shards : 1 , rs : { nodes : 2 } , mongosOptions : { verbose : 2 } } ) ; <nl> const dbName = " foo " ; <nl> const collName = " bar " ; <nl> const ns = dbName + " . " + collName ; <nl> const testDB = st . s . getDB ( dbName ) ; <nl> + const serverStatusCheckTimeoutMS = 5000 ; <nl> <nl> assert . commandWorked ( st . s . adminCommand ( { enableSharding : dbName } ) ) ; <nl> st . ensurePrimaryShard ( dbName , st . shard0 . shardName ) ; <nl> <nl> + / / Force the mongos ' s replica set monitors to always include all the eligible nodes . <nl> + let ignoreLatencyFailPoint = configureFailPoint ( st . s , " serverSelectorIgnoresLatencyWindow " ) ; <nl> + <nl> + / / Force the mongos to connect to eligible hosts in alphabetical order of host names . <nl> + let targetHostsInAlphabeticalOrderFailPoint = <nl> + configureFailPoint ( st . s , " networkInterfaceConnectTargetHostsInAlphabeticalOrder " ) ; <nl> + let sortedNodes = [ . . . st . rs0 . nodes ] . sort ( ( node1 , node2 ) = > node1 . host . localeCompare ( node2 . host ) ) ; <nl> + <nl> let expectedHedgingMetrics = { <nl> numTotalOperations : 0 , <nl> numTotalHedgedOperations : 0 , <nl> numAdvantageouslyHedgedOperations : 0 <nl> } ; <nl> <nl> - assert . commandWorked ( <nl> - testDB . runCommand ( { query : { find : collName } , $ readPreference : { mode : " primary " } } ) ) ; <nl> + jsTestLog ( " Run a command with hedging disabled , and verify the metrics does not change " ) ; <nl> + assert . commandWorked ( testDB . runCommand ( <nl> + { count : collName , query : { x : { gte : 0 } } , $ readPreference : { mode : " primaryPreferred " } } ) ) ; <nl> checkServerStatusHedgingMetrics ( testDB , expectedHedgingMetrics ) ; <nl> <nl> - / / force an advantageous hedged read to succeed . <nl> - / / TODO : RSM may target reads differently in the future sending the first read to secondary . In this <nl> - / / case this test will fail . <nl> + jsTestLog ( " Run commands with hedging enabled , and verify the metrics are as expected " ) ; <nl> + <nl> + / / Make the command slower on the first target host , and verify there is an advantageous <nl> + / / hedged read . <nl> try { <nl> - setCommandDelay ( st . rs0 . getPrimary ( ) , " find " , 1000 ) ; <nl> - assert . commandWorked ( <nl> - testDB . runCommand ( { query : { find : collName } , $ readPreference : { mode : " nearest " } } ) ) ; <nl> + setCommandDelay ( sortedNodes [ 0 ] , " count " , 1000 ) ; <nl> + assert . commandWorked ( testDB . runCommand ( <nl> + { count : collName , query : { x : { gte : 0 } } , $ readPreference : { mode : " nearest " } } ) ) ; <nl> } finally { <nl> - clearCommandDelay ( st . rs0 . getPrimary ( ) ) ; <nl> + clearCommandDelay ( sortedNodes [ 0 ] ) ; <nl> } <nl> <nl> - expectedHedgingMetrics . numTotalOperations + = 2 ; <nl> + expectedHedgingMetrics . numTotalOperations + = 1 ; <nl> expectedHedgingMetrics . numTotalHedgedOperations + = 1 ; <nl> expectedHedgingMetrics . numAdvantageouslyHedgedOperations + = 1 ; <nl> checkServerStatusHedgingMetrics ( testDB , expectedHedgingMetrics ) ; <nl> <nl> - / / force an advantageous hedged read to hang . <nl> - / / TODO : RSM may target reads differently in the future sending the first read to secondary . In this <nl> - / / case this test will fail . <nl> + / / Make the command slower on the second target host , and verify there is no advantageous <nl> + / / hedged read . <nl> try { <nl> - setCommandDelay ( st . rs0 . getPrimary ( ) , " find " , 10 ) ; <nl> - setCommandDelay ( st . rs0 . getSecondaries ( ) [ 0 ] , " find " , 1000 ) ; <nl> + setCommandDelay ( sortedNodes [ 0 ] , " count " , 10 ) ; <nl> + setCommandDelay ( sortedNodes [ 1 ] , " count " , 1000 ) ; <nl> <nl> - assert . commandWorked ( <nl> - testDB . runCommand ( { query : { find : collName } , $ readPreference : { mode : " nearest " } } ) ) ; <nl> + assert . commandWorked ( testDB . runCommand ( <nl> + { count : collName , query : { x : { gte : 0 } } , $ readPreference : { mode : " nearest " } } ) ) ; <nl> } finally { <nl> - clearCommandDelay ( st . rs0 . nodes [ 0 ] ) ; <nl> - clearCommandDelay ( st . rs0 . nodes [ 1 ] ) ; <nl> + clearCommandDelay ( sortedNodes [ 0 ] ) ; <nl> + clearCommandDelay ( sortedNodes [ 1 ] ) ; <nl> } <nl> <nl> - expectedHedgingMetrics . numTotalOperations + = 2 ; <nl> + expectedHedgingMetrics . numTotalOperations + = 1 ; <nl> expectedHedgingMetrics . numTotalHedgedOperations + = 1 ; <nl> expectedHedgingMetrics . numAdvantageouslyHedgedOperations + = 0 ; <nl> checkServerStatusHedgingMetrics ( testDB , expectedHedgingMetrics ) ; <nl> + <nl> + ignoreLatencyFailPoint . off ( ) ; <nl> + targetHostsInAlphabeticalOrderFailPoint . off ( ) ; <nl> st . stop ( ) ; <nl> } ( ) ) ; <nl> mmm a / src / mongo / client / sdam / server_selector . cpp <nl> ppp b / src / mongo / client / sdam / server_selector . cpp <nl> <nl> # define MONGO_LOG_DEFAULT_COMPONENT : : mongo : : logger : : LogComponent : : kNetwork <nl> # include " mongo / client / sdam / topology_description . h " <nl> # include " mongo / platform / random . h " <nl> + # include " mongo / util / fail_point . h " <nl> # include " mongo / util / log . h " <nl> <nl> namespace mongo : : sdam { <nl> + MONGO_FAIL_POINT_DEFINE ( serverSelectorIgnoresLatencyWindow ) ; <nl> + <nl> ServerSelector : : ~ ServerSelector ( ) { } <nl> <nl> SdamServerSelector : : SdamServerSelector ( const ServerSelectionConfiguration & config ) <nl> boost : : optional < std : : vector < ServerDescriptionPtr > > SdamServerSelector : : selectSer <nl> _getCandidateServers ( & results , topologyDescription , criteria ) ; <nl> <nl> if ( results . size ( ) ) { <nl> + if ( MONGO_unlikely ( serverSelectorIgnoresLatencyWindow . shouldFail ( ) ) ) { <nl> + return results ; <nl> + } <nl> + <nl> ServerDescriptionPtr minServer = <nl> * std : : min_element ( results . begin ( ) , results . end ( ) , LatencyWindow : : rttCompareFn ) ; <nl> <nl> mmm a / src / mongo / executor / network_interface . cpp <nl> ppp b / src / mongo / executor / network_interface . cpp <nl> namespace executor { <nl> NetworkInterface : : NetworkInterface ( ) { } <nl> NetworkInterface : : ~ NetworkInterface ( ) { } <nl> <nl> + MONGO_FAIL_POINT_DEFINE ( networkInterfaceConnectTargetHostsInAlphabeticalOrder ) ; <nl> MONGO_FAIL_POINT_DEFINE ( networkInterfaceDiscardCommandsBeforeAcquireConn ) ; <nl> MONGO_FAIL_POINT_DEFINE ( networkInterfaceHangCommandsAfterAcquireConn ) ; <nl> MONGO_FAIL_POINT_DEFINE ( networkInterfaceAfterAcquireConn ) ; <nl> mmm a / src / mongo / executor / network_interface . h <nl> ppp b / src / mongo / executor / network_interface . h <nl> <nl> namespace mongo { <nl> namespace executor { <nl> <nl> + extern FailPoint networkInterfaceConnectTargetHostsInAlphabeticalOrder ; <nl> extern FailPoint networkInterfaceDiscardCommandsBeforeAcquireConn ; <nl> extern FailPoint networkInterfaceHangCommandsAfterAcquireConn ; <nl> extern FailPoint networkInterfaceAfterAcquireConn ; <nl> mmm a / src / mongo / executor / network_interface_tl . cpp <nl> ppp b / src / mongo / executor / network_interface_tl . cpp <nl> Status NetworkInterfaceTL : : startCommand ( const TaskExecutor : : CallbackHandle & cbHa <nl> } <nl> cmdState - > baton = baton ; <nl> <nl> + if ( _svcCtx & & cmdState - > requestOnAny . hedgeOptions ) { <nl> + auto hm = HedgingMetrics : : get ( _svcCtx ) ; <nl> + invariant ( hm ) ; <nl> + hm - > incrementNumTotalOperations ( ) ; <nl> + } <nl> + <nl> / * * <nl> * It is important that onFinish ( ) runs out of line . That said , we can ' t thenRunOn ( ) arbitrarily <nl> * without doing extra context switches and delaying execution . The cmdState promise can be <nl> Status NetworkInterfaceTL : : startCommand ( const TaskExecutor : : CallbackHandle & cbHa <nl> invariant ( cmdState - > requestManager ) ; <nl> RequestManager * rm = cmdState - > requestManager . get ( ) ; <nl> <nl> + if ( MONGO_unlikely ( networkInterfaceConnectTargetHostsInAlphabeticalOrder . shouldFail ( ) ) ) { <nl> + std : : sort ( request . target . begin ( ) , <nl> + request . target . end ( ) , <nl> + [ ] ( const HostAndPort & target1 , const HostAndPort & target2 ) { <nl> + return target1 . toString ( ) < target2 . toString ( ) ; <nl> + } ) ; <nl> + } <nl> + <nl> / / Attempt to get a connection to every target host <nl> for ( size_t idx = 0 ; idx < request . target . size ( ) & & ! rm - > usedAllConn ( ) ; + + idx ) { <nl> auto connFuture = _pool - > get ( request . target [ idx ] , request . sslMode , request . timeout ) ; <nl> void NetworkInterfaceTL : : RequestManager : : trySend ( <nl> <nl> LOGV2_DEBUG ( 4646300 , <nl> 2 , <nl> - " Sending request { request_id } with index { idx } " , <nl> + " Sending request { request_id } with index { idx } to { target } " , <nl> " request_id " _attr = cmdStatePtr - > requestOnAny . id , <nl> - " idx " _attr = idx ) ; <nl> + " idx " _attr = idx , <nl> + " target " _attr = cmdStatePtr - > requestOnAny . target [ idx ] ) ; <nl> <nl> auto req = getNextRequest ( ) ; <nl> if ( req ) { <nl> void NetworkInterfaceTL : : RequestManager : : trySend ( <nl> LOGV2_DEBUG ( <nl> 4647200 , <nl> 2 , <nl> - " Set MaxTimeMS to { maxTimeMS } for request { request_id } with index { idx } " , <nl> + " Set maxTimeMS to { maxTimeMS } for request { request_id } with index { idx } " , <nl> " maxTimeMS " _attr = maxTimeMS , <nl> " request_id " _attr = cmdStatePtr - > requestOnAny . id , <nl> " idx " _attr = idx ) ; <nl> } <nl> - } <nl> - if ( cmdStatePtr - > interface - > _svcCtx & & remoteReq . hedgeOptions ) { <nl> - auto hm = HedgingMetrics : : get ( cmdStatePtr - > interface - > _svcCtx ) ; <nl> - invariant ( hm ) ; <nl> - hm - > incrementNumTotalOperations ( ) ; <nl> - if ( req - > isHedge ) { <nl> + <nl> + if ( cmdStatePtr - > interface - > _svcCtx ) { <nl> + auto hm = HedgingMetrics : : get ( cmdStatePtr - > interface - > _svcCtx ) ; <nl> + invariant ( hm ) ; <nl> hm - > incrementNumTotalHedgedOperations ( ) ; <nl> } <nl> } <nl>
|
SERVER - 46694 Make hedging_metrics_server_status . js determinstic
|
mongodb/mongo
|
3c0fa6f8e04a518f9e05b1117d3478e5c9262ea6
|
2020-03-06T23:17:56Z
|
mmm a / contrib / Python / cntk / graph . py <nl> ppp b / contrib / Python / cntk / graph . py <nl> def __init__ ( self , op_name , params = None , name = None , reader = None ) : <nl> # Create sub - class construtor and more these <nl> self . reader = None <nl> <nl> - def is_input ( self ) : <nl> + def _is_input ( self ) : <nl> ' ' ' <nl> Returns : True if this node is an input node . <nl> ' ' ' <nl> def _to_config_recursively ( self , input_map , desc , unrolled_nodes , inputs , <nl> " % s = % s ( % s ) " % ( self . name , self . op_name , params ) <nl> desc . append ( line ) <nl> <nl> - if self . is_input ( ) : <nl> + if self . _is_input ( ) : <nl> if not self in input_map : <nl> input_map . _add_unmapped ( self ) <nl> inputs . add ( self ) <nl> mmm a / contrib / Python / cntk / reader . py <nl> ppp b / contrib / Python / cntk / reader . py <nl> def __init__ ( self , batch , node , input_alias = None , dynamic_axis = ' ' ) : <nl> ' you initalized LazyInputReader without valid batch data ' ) <nl> <nl> self . batch = batch <nl> - if not node . is_input ( ) : <nl> + if not node . _is_input ( ) : <nl> raise ValueError ( ' LazyInputReader needs an input node ' ) <nl> <nl> self . node = node <nl> def _serialize_unmapped_nodes ( self , filename ) : <nl> sample_sizes = collections . defaultdict ( list ) <nl> used_aliases = set ( ) <nl> for node in self . unmapped_nodes : <nl> - assert node . is_input ( ) <nl> + assert node . _is_input ( ) <nl> assert isinstance ( node . reader , LazyInputReader ) <nl> <nl> l = node . reader <nl>
|
Make node ' s is_input ( ) private
|
microsoft/CNTK
|
9bb106b66974ce1e5f39f4d5ba77031166ca0fc5
|
2016-05-04T08:42:37Z
|
mmm a / docker / build / installers / py27_conda . yml <nl> ppp b / docker / build / installers / py27_conda . yml <nl> dependencies : <nl> - grpcio - tools = = 1 . 4 . 0 <nl> - protobuf = = 3 . 4 . 0 # version 3 . 2 . 0 actually gives some parsing errors on the original protos <nl> - python - gflags <nl> + - utm <nl> mmm a / docker / build / installers / py27_requirements . txt <nl> ppp b / docker / build / installers / py27_requirements . txt <nl> catkin_pkg <nl> rospkg <nl> <nl> # Python tools <nl> + plyvel = = 0 . 9 <nl> pyproj <nl> shapely <nl> <nl> mmm a / docker / scripts / dev_start . sh <nl> ppp b / docker / scripts / dev_start . sh <nl> INCHINA = " no " <nl> LOCAL_IMAGE = " no " <nl> VERSION = " " <nl> ARCH = $ ( uname - m ) <nl> - VERSION_X86_64 = " dev - x86_64 - 20181026_1800 " <nl> + VERSION_X86_64 = " dev - x86_64 - 20181108_1630 " <nl> VERSION_AARCH64 = " dev - aarch64 - 20170927_1111 " <nl> VERSION_OPT = " " <nl> <nl> mmm a / modules / data / proto / BUILD <nl> ppp b / modules / data / proto / BUILD <nl> proto_library ( <nl> deps = [ " : static_info_proto_lib " ] , <nl> ) <nl> <nl> + proto_library ( <nl> + name = " record_proto_lib " , <nl> + srcs = [ " record . proto " ] , <nl> + deps = [ <nl> + " / / cyber / proto : record_proto " , <nl> + " / / modules / common / proto : drive_event_proto_lib " , <nl> + " / / modules / common / proto : geometry_proto_lib " , <nl> + " / / modules / dreamview / proto : hmi_status_proto_lib " , <nl> + ] , <nl> + ) <nl> + <nl> proto_library ( <nl> name = " warehouse_query_proto_lib " , <nl> srcs = [ " warehouse_query . proto " ] , <nl> new file mode 100644 <nl> index 00000000000 . . 66c65898960 <nl> mmm / dev / null <nl> ppp b / modules / data / proto / record . proto <nl> <nl> + syntax = " proto2 " ; <nl> + <nl> + package apollo . data ; <nl> + <nl> + import " cyber / proto / record . proto " ; <nl> + import " modules / common / proto / drive_event . proto " ; <nl> + import " modules / common / proto / geometry . proto " ; <nl> + import " modules / dreamview / proto / hmi_status . proto " ; <nl> + <nl> + / / Rich metadata for a Cyber record , which contains useful information for <nl> + / / warehousing needs . <nl> + message Record { <nl> + / / Unique ID to identify record . Generally it ' s useful to be sortable . So <nl> + / / we ' ll use < start time > _ < file_size > . <nl> + optional string id = 1 ; <nl> + <nl> + / / The input record to generate this proto . <nl> + optional string path = 2 ; <nl> + <nl> + / / Get from RecordReader . get_headerstring ( ) . Some useful fields are : <nl> + / / header . begin_time <nl> + / / header . end_time <nl> + / / header . size <nl> + optional apollo . cyber . proto . Header header = 3 ; <nl> + / / Get from RecordReader . get_channellist ( ) and get_messagenumber ( ) . <nl> + map < string , uint64 > channels = 4 ; <nl> + <nl> + / / Get from the first hmi_status message . Some useful fields are : <nl> + / / hmi_status . current_mode <nl> + / / hmi_status . current_map <nl> + / / hmi_status . current_vehicle <nl> + optional apollo . dreamview . HMIStatus hmi_status = 5 ; <nl> + <nl> + / / A disengagement is counted when DrivingMode changes from AUTO to EMERGENCY . <nl> + message Disengagement { <nl> + optional double time = 1 ; <nl> + optional apollo . common . PointLLH location = 2 ; <nl> + optional string desc = 3 ; <nl> + } <nl> + repeated Disengagement disengagements = 6 ; <nl> + <nl> + / / DriveEvent is an incident recorded by CarOps . <nl> + repeated apollo . common . DriveEvent drive_events = 7 ; <nl> + <nl> + message Stat { <nl> + / / Mileage stat by driving mode : { canbus . Chassis . DrivingMode : miles } . <nl> + map < string , float > mileages = 1 ; <nl> + <nl> + / / A downsampled position point list which forms a driving path . <nl> + repeated apollo . common . PointLLH driving_path = 2 ; <nl> + } <nl> + optional Stat stat = 8 ; <nl> + } <nl> new file mode 100755 <nl> index 00000000000 . . 96a809768f0 <nl> mmm / dev / null <nl> ppp b / modules / data / warehouse / importer / parse_record . py <nl> <nl> + # ! / usr / bin / env python <nl> + # - * - coding : UTF - 8 - * - <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + # Copyright 2018 The Apollo Authors . All Rights Reserved . <nl> + # <nl> + # Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + # you may not use this file except in compliance with the License . <nl> + # You may obtain a copy of the License at <nl> + # <nl> + # http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + # <nl> + # Unless required by applicable law or agreed to in writing , software <nl> + # distributed under the License is distributed on an " AS IS " BASIS , <nl> + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + # See the License for the specific language governing permissions and <nl> + # limitations under the License . <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + " " " <nl> + Parse Cyber record into apollo . data . Record . <nl> + <nl> + Use as command tool : parse_record . py < record > <nl> + Use as util lib : RecordParser . Parse ( < record_file_path > ) <nl> + " " " <nl> + <nl> + import math <nl> + import os <nl> + import sys <nl> + <nl> + import gflags <nl> + import glog <nl> + import utm <nl> + <nl> + import cyber . record <nl> + from cyber . proto . record_pb2 import Header <nl> + from modules . canbus . proto . chassis_pb2 import Chassis <nl> + from modules . data . proto . record_pb2 import Record <nl> + from modules . localization . proto . localization_pb2 import LocalizationEstimate <nl> + <nl> + gflags . DEFINE_float ( ' pos_sample_min_duration ' , 2 , ' In seconds . ' ) <nl> + gflags . DEFINE_float ( ' pos_sample_min_distance ' , 3 , ' In meters . ' ) <nl> + gflags . DEFINE_integer ( ' utm_zone_id ' , 10 , ' UTM zone id . ' ) <nl> + gflags . DEFINE_string ( ' utm_zone_letter ' , ' S ' , ' UTM zone letter . ' ) <nl> + <nl> + kChassisChannel = ' / apollo / canbus / chassis ' <nl> + kDriveEventChannel = ' / apollo / drive_event ' <nl> + kHMIStatusChannel = ' / apollo / hmi / hmi_status ' <nl> + kLocalizationChannel = ' / apollo / localization / pose ' <nl> + <nl> + <nl> + def utm_distance_meters ( pos0 , pos1 ) : <nl> + " " " Return distance of pos0 and pos1 in meters . " " " <nl> + return math . sqrt ( ( pos0 . x - pos1 . x ) * * 2 + <nl> + ( pos0 . y - pos1 . y ) * * 2 + <nl> + ( pos0 . z - pos1 . z ) * * 2 ) <nl> + <nl> + <nl> + def utm_distance_miles ( pos0 , pos1 ) : <nl> + " " " Return distance of pos0 and pos1 in miles . " " " <nl> + return 0 . 000621371 * utm_distance_meters ( pos0 , pos1 ) <nl> + <nl> + <nl> + class RecordParser ( object ) : <nl> + " " " Wrapper of a Cyber record . " " " <nl> + <nl> + @ staticmethod <nl> + def Parse ( record_file ) : <nl> + " " " Simple interface to parse a cyber record . " " " <nl> + parser = RecordParser ( record_file ) <nl> + parser . ParseMeta ( ) <nl> + parser . ParseMessages ( ) <nl> + return parser . record <nl> + <nl> + def __init__ ( self , record_file ) : <nl> + " " " Init input reader and output record . " " " <nl> + self . record = Record ( path = record_file ) <nl> + <nl> + self . _reader = cyber . record . RecordReader ( record_file ) <nl> + # State during processing messages . <nl> + self . _current_driving_mode = None <nl> + self . _last_position = None <nl> + # To sample driving path . <nl> + self . _last_position_sampled = None <nl> + self . _last_position_sampled_time = None <nl> + <nl> + def ParseMeta ( self ) : <nl> + " " " <nl> + Parse meta info which doesn ' t need to scan the record . <nl> + Currently we parse the record ID , header and channel list here . <nl> + " " " <nl> + self . record . header . ParseFromString ( self . _reader . get_headerstring ( ) ) <nl> + self . record . id = ' { } _ { } ' . format ( self . record . header . begin_time , <nl> + self . record . header . size ) <nl> + for chan in self . _reader . get_channellist ( ) : <nl> + self . record . channels [ chan ] = self . _reader . get_messagenumber ( chan ) <nl> + <nl> + def ParseMessages ( self ) : <nl> + " " " Process all messages . " " " <nl> + for channel , msg , _type , timestamp in self . _reader . read_messages ( ) : <nl> + if channel = = kHMIStatusChannel : <nl> + self . ProcessHMIStatus ( msg ) <nl> + elif channel = = kDriveEventChannel : <nl> + self . ProcessDriveEvent ( msg ) <nl> + elif channel = = kChassisChannel : <nl> + self . ProcessChassis ( msg ) <nl> + elif channel = = kLocalizationChannel : <nl> + self . ProcessLocalization ( msg ) <nl> + <nl> + def ProcessHMIStatus ( self , msg ) : <nl> + " " " Save HMIStatus . " " " <nl> + # Keep the first message and assume it doesn ' t change in one recording . <nl> + if not self . record . HasField ( ' hmi_status ' ) : <nl> + self . record . hmi_status . ParseFromString ( msg ) <nl> + <nl> + def ProcessDriveEvent ( self , msg ) : <nl> + " " " Save DriveEvents . " " " <nl> + self . _record . drive_events . add ( ) . ParseFromString ( message ) <nl> + <nl> + def ProcessChassis ( self , msg ) : <nl> + " " " Process Chassis , save disengagements . " " " <nl> + chassis = Chassis ( ) <nl> + chassis . ParseFromString ( msg ) <nl> + timestamp = chassis . header . timestamp_sec <nl> + if self . _current_driving_mode = = chassis . driving_mode : <nl> + # DrivingMode doesn ' t change . <nl> + return <nl> + # Save disengagement . <nl> + if ( self . _current_driving_mode = = Chassis . COMPLETE_AUTO_DRIVE and <nl> + chassis . driving_mode = = Chassis . EMERGENCY_MODE ) : <nl> + glog . info ( ' Disengagement found at ' , timestamp ) <nl> + disengagement = self . record . disengagements . add ( time = timestamp ) <nl> + if self . _last_position is not None : <nl> + lat , lon = utm . to_latlon ( self . _last_position . x , <nl> + self . _last_position . y , <nl> + gflags . FLAGS . utm_zone_id , <nl> + gflags . FLAGS . utm_zone_letter ) <nl> + disengagement . location . lat = lat <nl> + disengagement . location . lon = lon <nl> + # Update DrivingMode . <nl> + self . _current_driving_mode = chassis . driving_mode <nl> + <nl> + def ProcessLocalization ( self , msg ) : <nl> + " " " Process Localization , stat mileages and save driving path . " " " <nl> + localization = LocalizationEstimate ( ) <nl> + localization . ParseFromString ( msg ) <nl> + timestamp = localization . header . timestamp_sec <nl> + cur_pos = localization . pose . position <nl> + <nl> + # Stat mileages . <nl> + if ( self . _last_position is not None and <nl> + self . _current_driving_mode is not None ) : <nl> + driving_mode = Chassis . DrivingMode . Name ( self . _current_driving_mode ) <nl> + miles = utm_distance_miles ( self . _last_position , cur_pos ) <nl> + if driving_mode in self . record . stat . mileages : <nl> + self . record . stat . mileages [ driving_mode ] + = miles <nl> + else : <nl> + self . record . stat . mileages [ driving_mode ] = miles <nl> + <nl> + # Sample driving path . <nl> + G = gflags . FLAGS <nl> + if ( self . _last_position_sampled is None or <nl> + ( timestamp - self . _last_position_sampled_time > <nl> + G . pos_sample_min_duration and <nl> + utm_distance_meters ( self . _last_position_sampled , cur_pos ) > <nl> + G . pos_sample_min_distance ) ) : <nl> + self . _last_position_sampled = cur_pos <nl> + self . _last_position_sampled_time = timestamp <nl> + lat , lon = utm . to_latlon ( cur_pos . x , cur_pos . y , <nl> + G . utm_zone_id , G . utm_zone_letter ) <nl> + self . record . stat . driving_path . add ( lat = lat , lon = lon ) <nl> + # Update position . <nl> + self . _last_position = cur_pos <nl> + <nl> + <nl> + if __name__ = = ' __main__ ' : <nl> + gflags . FLAGS ( sys . argv ) <nl> + if len ( sys . argv ) > 0 : <nl> + print RecordParser . Parse ( sys . argv [ - 1 ] ) <nl>
|
Data : Add meta parser for record . ( )
|
ApolloAuto/apollo
|
0b7d870a57bb82bf346f4031e038a6391057b31f
|
2018-12-13T23:18:39Z
|
mmm a / hphp / runtime / vm / jit / irgen - state . h <nl> ppp b / hphp / runtime / vm / jit / irgen - state . h <nl> struct IRGS { <nl> * profile - translation counters in PGO mode . <nl> * / <nl> double profFactor { 1 } ; <nl> - <nl> - / * <nl> - * The function to use to create catch blocks when instructions that can <nl> - * throw are created with no catch block . The default ( when this function is <nl> - * null ) is to spill the stack and then leave . We allow a non - default <nl> - * basically for an minstr use case . This is reset every time we <nl> - * prepareForNextHHBC . <nl> - * / <nl> - std : : function < Block * ( ) > catchCreator ; <nl> } ; <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> mmm a / hphp / runtime / vm / jit / irgen . cpp <nl> ppp b / hphp / runtime / vm / jit / irgen . cpp <nl> SSATmp * genInstruction ( IRGS & env , IRInstruction * inst ) { <nl> } <nl> <nl> if ( inst - > mayRaiseError ( ) & & ! inst - > taken ( ) ) { <nl> - FTRACE ( 1 , " { } : creating { } catch block \ n " , <nl> - inst - > toString ( ) , <nl> - env . catchCreator ? " custom " : " " ) ; <nl> + FTRACE ( 1 , " { } : creating catch block \ n " , inst - > toString ( ) ) ; <nl> / * <nl> * If you hit this assertion , you ' re gen ' ing an IR instruction that can <nl> * throw after gen ' ing one that could write to the evaluation stack . This <nl> SSATmp * genInstruction ( IRGS & env , IRInstruction * inst ) { <nl> * information . <nl> * / <nl> check_catch_stack_state ( env , inst ) ; <nl> - inst - > setTaken ( <nl> - env . catchCreator ? env . catchCreator ( ) : create_catch_block ( env ) <nl> - ) ; <nl> + inst - > setTaken ( create_catch_block ( env ) ) ; <nl> } <nl> <nl> if ( inst - > mayRaiseError ( ) ) { <nl> void prepareForNextHHBC ( IRGS & env , <nl> env . bcStateStack . back ( ) . setOffset ( newSk . offset ( ) ) ; <nl> updateMarker ( env ) ; <nl> env . lastBcInst = lastBcInst ; <nl> - env . catchCreator = nullptr ; <nl> env . irb - > exceptionStackBoundary ( ) ; <nl> } <nl> <nl>
|
Remove IRGS : : catchCreator
|
facebook/hhvm
|
b35d451ce59a46618dbef1bf1c3437c289065639
|
2016-05-25T18:40:23Z
|
mmm a / BUILD <nl> ppp b / BUILD <nl> grpc_cc_library ( <nl> " grpc_lb_policy_cds " , <nl> " grpc_lb_policy_eds " , <nl> " grpc_lb_policy_lrs " , <nl> - " grpc_lb_policy_xds_routing " , <nl> + " grpc_lb_policy_xds_cluster_manager " , <nl> " grpc_resolver_xds " , <nl> ] , <nl> } , <nl> grpc_cc_library ( <nl> ) <nl> <nl> grpc_cc_library ( <nl> - name = " grpc_lb_policy_xds_routing " , <nl> + name = " grpc_lb_policy_xds_cluster_manager " , <nl> srcs = [ <nl> - " src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc " , <nl> + " src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc " , <nl> ] , <nl> external_deps = [ <nl> " absl / strings " , <nl> grpc_cc_library ( <nl> deps = [ <nl> " grpc_base " , <nl> " grpc_client_channel " , <nl> + " grpc_resolver_xds_header " , <nl> " grpc_xds_api_header " , <nl> ] , <nl> ) <nl> grpc_cc_library ( <nl> ] , <nl> ) <nl> <nl> + grpc_cc_library ( <nl> + name = " grpc_resolver_xds_header " , <nl> + hdrs = [ <nl> + " src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h " , <nl> + ] , <nl> + language = " c + + " , <nl> + ) <nl> + <nl> grpc_cc_library ( <nl> name = " grpc_resolver_xds " , <nl> srcs = [ <nl> mmm a / BUILD . gn <nl> ppp b / BUILD . gn <nl> config ( " grpc_config " ) { <nl> " src / core / ext / filters / client_channel / lb_policy / xds / eds . cc " , <nl> " src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc " , <nl> " src / core / ext / filters / client_channel / lb_policy / xds / xds . h " , <nl> - " src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc " , <nl> + " src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc " , <nl> " src / core / ext / filters / client_channel / lb_policy_factory . h " , <nl> " src / core / ext / filters / client_channel / lb_policy_registry . cc " , <nl> " src / core / ext / filters / client_channel / lb_policy_registry . h " , <nl> config ( " grpc_config " ) { <nl> " src / core / ext / filters / client_channel / resolver / fake / fake_resolver . h " , <nl> " src / core / ext / filters / client_channel / resolver / sockaddr / sockaddr_resolver . cc " , <nl> " src / core / ext / filters / client_channel / resolver / xds / xds_resolver . cc " , <nl> + " src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h " , <nl> " src / core / ext / filters / client_channel / resolver_factory . h " , <nl> " src / core / ext / filters / client_channel / resolver_registry . cc " , <nl> " src / core / ext / filters / client_channel / resolver_registry . h " , <nl> mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> add_library ( grpc <nl> src / core / ext / filters / client_channel / lb_policy / xds / cds . cc <nl> src / core / ext / filters / client_channel / lb_policy / xds / eds . cc <nl> src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc <nl> - src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc <nl> + src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc <nl> src / core / ext / filters / client_channel / lb_policy_registry . cc <nl> src / core / ext / filters / client_channel / local_subchannel_pool . cc <nl> src / core / ext / filters / client_channel / proxy_mapper_registry . cc <nl> mmm a / Makefile <nl> ppp b / Makefile <nl> LIBGRPC_SRC = \ <nl> src / core / ext / filters / client_channel / lb_policy / xds / cds . cc \ <nl> src / core / ext / filters / client_channel / lb_policy / xds / eds . cc \ <nl> src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc \ <nl> - src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc \ <nl> + src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc \ <nl> src / core / ext / filters / client_channel / lb_policy_registry . cc \ <nl> src / core / ext / filters / client_channel / local_subchannel_pool . cc \ <nl> src / core / ext / filters / client_channel / proxy_mapper_registry . cc \ <nl> src / core / ext / filters / client_channel / lb_policy / grpclb / grpclb_channel_secure . cc : $ <nl> src / core / ext / filters / client_channel / lb_policy / xds / cds . cc : $ ( OPENSSL_DEP ) <nl> src / core / ext / filters / client_channel / lb_policy / xds / eds . cc : $ ( OPENSSL_DEP ) <nl> src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc : $ ( OPENSSL_DEP ) <nl> - src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc : $ ( OPENSSL_DEP ) <nl> + src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc : $ ( OPENSSL_DEP ) <nl> src / core / ext / filters / client_channel / resolver / xds / xds_resolver . cc : $ ( OPENSSL_DEP ) <nl> src / core / ext / transport / chttp2 / client / secure / secure_channel_create . cc : $ ( OPENSSL_DEP ) <nl> src / core / ext / transport / chttp2 / server / secure / server_secure_chttp2 . cc : $ ( OPENSSL_DEP ) <nl> mmm a / build_autogenerated . yaml <nl> ppp b / build_autogenerated . yaml <nl> libs : <nl> - src / core / ext / filters / client_channel / resolver / dns / c_ares / grpc_ares_wrapper . h <nl> - src / core / ext / filters / client_channel / resolver / dns / dns_resolver_selection . h <nl> - src / core / ext / filters / client_channel / resolver / fake / fake_resolver . h <nl> + - src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h <nl> - src / core / ext / filters / client_channel / resolver_factory . h <nl> - src / core / ext / filters / client_channel / resolver_registry . h <nl> - src / core / ext / filters / client_channel / resolver_result_parsing . h <nl> libs : <nl> - src / core / ext / filters / client_channel / lb_policy / xds / cds . cc <nl> - src / core / ext / filters / client_channel / lb_policy / xds / eds . cc <nl> - src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc <nl> - - src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc <nl> + - src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc <nl> - src / core / ext / filters / client_channel / lb_policy_registry . cc <nl> - src / core / ext / filters / client_channel / local_subchannel_pool . cc <nl> - src / core / ext / filters / client_channel / proxy_mapper_registry . cc <nl> mmm a / config . m4 <nl> ppp b / config . m4 <nl> if test " $ PHP_GRPC " ! = " no " ; then <nl> src / core / ext / filters / client_channel / lb_policy / xds / cds . cc \ <nl> src / core / ext / filters / client_channel / lb_policy / xds / eds . cc \ <nl> src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc \ <nl> - src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc \ <nl> + src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc \ <nl> src / core / ext / filters / client_channel / lb_policy_registry . cc \ <nl> src / core / ext / filters / client_channel / local_subchannel_pool . cc \ <nl> src / core / ext / filters / client_channel / proxy_mapper_registry . cc \ <nl> mmm a / config . w32 <nl> ppp b / config . w32 <nl> if ( PHP_GRPC ! = " no " ) { <nl> " src \ \ core \ \ ext \ \ filters \ \ client_channel \ \ lb_policy \ \ xds \ \ cds . cc " + <nl> " src \ \ core \ \ ext \ \ filters \ \ client_channel \ \ lb_policy \ \ xds \ \ eds . cc " + <nl> " src \ \ core \ \ ext \ \ filters \ \ client_channel \ \ lb_policy \ \ xds \ \ lrs . cc " + <nl> - " src \ \ core \ \ ext \ \ filters \ \ client_channel \ \ lb_policy \ \ xds \ \ xds_routing . cc " + <nl> + " src \ \ core \ \ ext \ \ filters \ \ client_channel \ \ lb_policy \ \ xds \ \ xds_cluster_manager . cc " + <nl> " src \ \ core \ \ ext \ \ filters \ \ client_channel \ \ lb_policy_registry . cc " + <nl> " src \ \ core \ \ ext \ \ filters \ \ client_channel \ \ local_subchannel_pool . cc " + <nl> " src \ \ core \ \ ext \ \ filters \ \ client_channel \ \ proxy_mapper_registry . cc " + <nl> mmm a / doc / environment_variables . md <nl> ppp b / doc / environment_variables . md <nl> some configuration as environment variables that can be set . <nl> - tsi - traces tsi transport security <nl> - weighted_target_lb - traces weighted_target LB policy <nl> - xds_client - traces xds client <nl> + - xds_cluster_manager_lb - traces cluster manager LB policy <nl> - xds_resolver - traces xds resolver <nl> <nl> The following tracers will only run in binaries built in DEBUG mode . This is <nl> mmm a / gRPC - C + + . podspec <nl> ppp b / gRPC - C + + . podspec <nl> Pod : : Spec . new do | s | <nl> ' src / core / ext / filters / client_channel / resolver / dns / c_ares / grpc_ares_wrapper . h ' , <nl> ' src / core / ext / filters / client_channel / resolver / dns / dns_resolver_selection . h ' , <nl> ' src / core / ext / filters / client_channel / resolver / fake / fake_resolver . h ' , <nl> + ' src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h ' , <nl> ' src / core / ext / filters / client_channel / resolver_factory . h ' , <nl> ' src / core / ext / filters / client_channel / resolver_registry . h ' , <nl> ' src / core / ext / filters / client_channel / resolver_result_parsing . h ' , <nl> Pod : : Spec . new do | s | <nl> ' src / core / ext / filters / client_channel / resolver / dns / c_ares / grpc_ares_wrapper . h ' , <nl> ' src / core / ext / filters / client_channel / resolver / dns / dns_resolver_selection . h ' , <nl> ' src / core / ext / filters / client_channel / resolver / fake / fake_resolver . h ' , <nl> + ' src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h ' , <nl> ' src / core / ext / filters / client_channel / resolver_factory . h ' , <nl> ' src / core / ext / filters / client_channel / resolver_registry . h ' , <nl> ' src / core / ext / filters / client_channel / resolver_result_parsing . h ' , <nl> mmm a / gRPC - Core . podspec <nl> ppp b / gRPC - Core . podspec <nl> Pod : : Spec . new do | s | <nl> ' src / core / ext / filters / client_channel / lb_policy / xds / eds . cc ' , <nl> ' src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc ' , <nl> ' src / core / ext / filters / client_channel / lb_policy / xds / xds . h ' , <nl> - ' src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc ' , <nl> + ' src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc ' , <nl> ' src / core / ext / filters / client_channel / lb_policy_factory . h ' , <nl> ' src / core / ext / filters / client_channel / lb_policy_registry . cc ' , <nl> ' src / core / ext / filters / client_channel / lb_policy_registry . h ' , <nl> Pod : : Spec . new do | s | <nl> ' src / core / ext / filters / client_channel / resolver / fake / fake_resolver . h ' , <nl> ' src / core / ext / filters / client_channel / resolver / sockaddr / sockaddr_resolver . cc ' , <nl> ' src / core / ext / filters / client_channel / resolver / xds / xds_resolver . cc ' , <nl> + ' src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h ' , <nl> ' src / core / ext / filters / client_channel / resolver_factory . h ' , <nl> ' src / core / ext / filters / client_channel / resolver_registry . cc ' , <nl> ' src / core / ext / filters / client_channel / resolver_registry . h ' , <nl> Pod : : Spec . new do | s | <nl> ' src / core / ext / filters / client_channel / resolver / dns / c_ares / grpc_ares_wrapper . h ' , <nl> ' src / core / ext / filters / client_channel / resolver / dns / dns_resolver_selection . h ' , <nl> ' src / core / ext / filters / client_channel / resolver / fake / fake_resolver . h ' , <nl> + ' src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h ' , <nl> ' src / core / ext / filters / client_channel / resolver_factory . h ' , <nl> ' src / core / ext / filters / client_channel / resolver_registry . h ' , <nl> ' src / core / ext / filters / client_channel / resolver_result_parsing . h ' , <nl> mmm a / grpc . gemspec <nl> ppp b / grpc . gemspec <nl> Gem : : Specification . new do | s | <nl> s . files + = % w ( src / core / ext / filters / client_channel / lb_policy / xds / eds . cc ) <nl> s . files + = % w ( src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc ) <nl> s . files + = % w ( src / core / ext / filters / client_channel / lb_policy / xds / xds . h ) <nl> - s . files + = % w ( src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc ) <nl> + s . files + = % w ( src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc ) <nl> s . files + = % w ( src / core / ext / filters / client_channel / lb_policy_factory . h ) <nl> s . files + = % w ( src / core / ext / filters / client_channel / lb_policy_registry . cc ) <nl> s . files + = % w ( src / core / ext / filters / client_channel / lb_policy_registry . h ) <nl> Gem : : Specification . new do | s | <nl> s . files + = % w ( src / core / ext / filters / client_channel / resolver / fake / fake_resolver . h ) <nl> s . files + = % w ( src / core / ext / filters / client_channel / resolver / sockaddr / sockaddr_resolver . cc ) <nl> s . files + = % w ( src / core / ext / filters / client_channel / resolver / xds / xds_resolver . cc ) <nl> + s . files + = % w ( src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h ) <nl> s . files + = % w ( src / core / ext / filters / client_channel / resolver_factory . h ) <nl> s . files + = % w ( src / core / ext / filters / client_channel / resolver_registry . cc ) <nl> s . files + = % w ( src / core / ext / filters / client_channel / resolver_registry . h ) <nl> mmm a / grpc . gyp <nl> ppp b / grpc . gyp <nl> <nl> ' src / core / ext / filters / client_channel / lb_policy / xds / cds . cc ' , <nl> ' src / core / ext / filters / client_channel / lb_policy / xds / eds . cc ' , <nl> ' src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc ' , <nl> - ' src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc ' , <nl> + ' src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc ' , <nl> ' src / core / ext / filters / client_channel / lb_policy_registry . cc ' , <nl> ' src / core / ext / filters / client_channel / local_subchannel_pool . cc ' , <nl> ' src / core / ext / filters / client_channel / proxy_mapper_registry . cc ' , <nl> mmm a / package . xml <nl> ppp b / package . xml <nl> <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / lb_policy / xds / eds . cc " role = " src " / > <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc " role = " src " / > <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / lb_policy / xds / xds . h " role = " src " / > <nl> - < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc " role = " src " / > <nl> + < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc " role = " src " / > <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / lb_policy_factory . h " role = " src " / > <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / lb_policy_registry . cc " role = " src " / > <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / lb_policy_registry . h " role = " src " / > <nl> <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / resolver / fake / fake_resolver . h " role = " src " / > <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / resolver / sockaddr / sockaddr_resolver . cc " role = " src " / > <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / resolver / xds / xds_resolver . cc " role = " src " / > <nl> + < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h " role = " src " / > <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / resolver_factory . h " role = " src " / > <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / resolver_registry . cc " role = " src " / > <nl> < file baseinstalldir = " / " name = " src / core / ext / filters / client_channel / resolver_registry . h " role = " src " / > <nl> mmm a / src / core / ext / filters / client_channel / client_channel . cc <nl> ppp b / src / core / ext / filters / client_channel / client_channel . cc <nl> void ChannelData : : UpdateStateAndPickerLocked ( <nl> const char * reason , <nl> std : : unique_ptr < LoadBalancingPolicy : : SubchannelPicker > picker ) { <nl> / / Clean the control plane when entering IDLE . <nl> - if ( picker_ = = nullptr ) { <nl> + if ( picker = = nullptr | | state = = GRPC_CHANNEL_SHUTDOWN ) { <nl> health_check_service_name_ . reset ( ) ; <nl> saved_service_config_ . reset ( ) ; <nl> saved_config_selector_ . reset ( ) ; <nl> void ChannelData : : UpdateStateAndPickerLocked ( <nl> / / Note : Original value will be destroyed after the lock is released . <nl> picker_ . swap ( picker ) ; <nl> / / Clean the data plane if the updated picker is nullptr . <nl> - if ( picker_ = = nullptr ) { <nl> + if ( picker_ = = nullptr | | state = = GRPC_CHANNEL_SHUTDOWN ) { <nl> received_service_config_data_ = false ; <nl> / / Note : We save the objects to unref until after the lock is released . <nl> retry_throttle_data_to_unref = std : : move ( retry_throttle_data_ ) ; <nl> void ChannelData : : UpdateStateAndPickerLocked ( <nl> void ChannelData : : UpdateServiceConfigInDataPlaneLocked ( <nl> bool service_config_changed , <nl> RefCountedPtr < ConfigSelector > config_selector ) { <nl> + / / If the service config did not change and there is no new ConfigSelector , <nl> + / / retain the old one ( if any ) . <nl> + / / TODO ( roth ) : Consider whether this is really the right way to handle <nl> + / / this . We might instead want to decide this in ApplyServiceConfig ( ) <nl> + / / where we decide whether to stick with the saved service config . <nl> + if ( ! service_config_changed & & config_selector = = nullptr ) { <nl> + config_selector = saved_config_selector_ ; <nl> + } <nl> / / Check if ConfigSelector has changed . <nl> const bool config_selector_changed = <nl> saved_config_selector_ ! = config_selector ; <nl> class CallData : : QueuedPickCanceller { <nl> } <nl> if ( calld - > pick_canceller_ = = self & & error ! = GRPC_ERROR_NONE ) { <nl> / / Remove pick from list of queued picks . <nl> + calld - > MaybeInvokeConfigSelectorCommitCallback ( ) ; <nl> calld - > MaybeRemoveCallFromQueuedPicksLocked ( self - > elem_ ) ; <nl> / / Fail pending batches on the call . <nl> calld - > PendingBatchesFail ( self - > elem_ , GRPC_ERROR_REF ( error ) , <nl> bool CallData : : PickSubchannelLocked ( grpc_call_element * elem , <nl> connected_subchannel_ = <nl> chand - > GetConnectedSubchannelInDataPlane ( result . subchannel . get ( ) ) ; <nl> GPR_ASSERT ( connected_subchannel_ ! = nullptr ) ; <nl> - if ( retry_committed_ ) MaybeInvokeConfigSelectorCommitCallback ( ) ; <nl> + if ( ! enable_retries_ | | retry_committed_ ) { <nl> + MaybeInvokeConfigSelectorCommitCallback ( ) ; <nl> + } <nl> } <nl> lb_recv_trailing_metadata_ready_ = result . recv_trailing_metadata_ready ; <nl> * error = result . error ; <nl> mmm a / src / core / ext / filters / client_channel / config_selector . cc <nl> ppp b / src / core / ext / filters / client_channel / config_selector . cc <nl> <nl> # include < grpc / support / port_platform . h > <nl> <nl> # include " src / core / ext / filters / client_channel / config_selector . h " <nl> - <nl> # include " src / core / lib / channel / channel_args . h " <nl> <nl> - / / Channel arg key for ConfigSelector . <nl> - # define GRPC_ARG_CONFIG_SELECTOR " grpc . internal . config_selector " <nl> - <nl> namespace grpc_core { <nl> <nl> namespace { <nl> mmm a / src / core / ext / filters / client_channel / config_selector . h <nl> ppp b / src / core / ext / filters / client_channel / config_selector . h <nl> <nl> # include " src / core / lib / gprpp / ref_counted_ptr . h " <nl> # include " src / core / lib / transport / metadata_batch . h " <nl> <nl> + / / Channel arg key for ConfigSelector . <nl> + # define GRPC_ARG_CONFIG_SELECTOR " grpc . internal . config_selector " <nl> + <nl> namespace grpc_core { <nl> <nl> / / Internal API used to allow resolver implementations to override <nl> new file mode 100644 <nl> index 00000000000 . . fff6c411a08 <nl> mmm / dev / null <nl> ppp b / src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc <nl> <nl> + / / <nl> + / / Copyright 2018 gRPC authors . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + / / <nl> + <nl> + # include < grpc / support / port_platform . h > <nl> + <nl> + # include < inttypes . h > <nl> + # include < limits . h > <nl> + # include < string . h > <nl> + <nl> + # include " absl / container / inlined_vector . h " <nl> + # include " absl / strings / match . h " <nl> + # include " absl / strings / numbers . h " <nl> + # include " absl / strings / str_cat . h " <nl> + # include " absl / strings / str_join . h " <nl> + # include " absl / strings / str_split . h " <nl> + # include " absl / strings / string_view . h " <nl> + # include " re2 / re2 . h " <nl> + <nl> + # include < grpc / grpc . h > <nl> + <nl> + # include " src / core / ext / filters / client_channel / lb_policy . h " <nl> + # include " src / core / ext / filters / client_channel / lb_policy / child_policy_handler . h " <nl> + # include " src / core / ext / filters / client_channel / lb_policy_factory . h " <nl> + # include " src / core / ext / filters / client_channel / lb_policy_registry . h " <nl> + # include " src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h " <nl> + # include " src / core / ext / xds / xds_api . h " <nl> + # include " src / core / lib / channel / channel_args . h " <nl> + # include " src / core / lib / gpr / string . h " <nl> + # include " src / core / lib / gprpp / orphanable . h " <nl> + # include " src / core / lib / gprpp / ref_counted_ptr . h " <nl> + # include " src / core / lib / iomgr / timer . h " <nl> + # include " src / core / lib / iomgr / work_serializer . h " <nl> + # include " src / core / lib / transport / error_utils . h " <nl> + <nl> + # define GRPC_XDS_CLUSTER_MANAGER_CHILD_RETENTION_INTERVAL_MS ( 15 * 60 * 1000 ) <nl> + <nl> + namespace grpc_core { <nl> + <nl> + TraceFlag grpc_xds_cluster_manager_lb_trace ( false , " xds_cluster_manager_lb " ) ; <nl> + <nl> + namespace { <nl> + <nl> + constexpr char kXdsClusterManager [ ] = " xds_cluster_manager_experimental " ; <nl> + <nl> + / / Config for xds_cluster_manager LB policy . <nl> + class XdsClusterManagerLbConfig : public LoadBalancingPolicy : : Config { <nl> + public : <nl> + using ClusterMap = <nl> + std : : map < std : : string , RefCountedPtr < LoadBalancingPolicy : : Config > > ; <nl> + <nl> + XdsClusterManagerLbConfig ( ClusterMap cluster_map ) <nl> + : cluster_map_ ( std : : move ( cluster_map ) ) { } <nl> + <nl> + const char * name ( ) const override { return kXdsClusterManager ; } <nl> + <nl> + const ClusterMap & cluster_map ( ) const { return cluster_map_ ; } <nl> + <nl> + private : <nl> + ClusterMap cluster_map_ ; <nl> + } ; <nl> + <nl> + / / xds_cluster_manager LB policy . <nl> + class XdsClusterManagerLb : public LoadBalancingPolicy { <nl> + public : <nl> + explicit XdsClusterManagerLb ( Args args ) ; <nl> + <nl> + const char * name ( ) const override { return kXdsClusterManager ; } <nl> + <nl> + void UpdateLocked ( UpdateArgs args ) override ; <nl> + void ExitIdleLocked ( ) override ; <nl> + void ResetBackoffLocked ( ) override ; <nl> + <nl> + private : <nl> + / / A simple wrapper for ref - counting a picker from the child policy . <nl> + class ChildPickerWrapper : public RefCounted < ChildPickerWrapper > { <nl> + public : <nl> + ChildPickerWrapper ( std : : string name , <nl> + std : : unique_ptr < SubchannelPicker > picker ) <nl> + : name_ ( std : : move ( name ) ) , picker_ ( std : : move ( picker ) ) { } <nl> + PickResult Pick ( PickArgs args ) { return picker_ - > Pick ( args ) ; } <nl> + <nl> + const std : : string & name ( ) const { return name_ ; } <nl> + <nl> + private : <nl> + std : : string name_ ; <nl> + std : : unique_ptr < SubchannelPicker > picker_ ; <nl> + } ; <nl> + <nl> + / / Picks a child using prefix or path matching and then delegates to that <nl> + / / child ' s picker . <nl> + class ClusterPicker : public SubchannelPicker { <nl> + public : <nl> + / / Maintains a map of cluster names to pickers . <nl> + using ClusterMap = std : : map < absl : : string_view / * cluster_name * / , <nl> + RefCountedPtr < ChildPickerWrapper > > ; <nl> + <nl> + / / It is required that the keys of cluster_map have to live at least as long <nl> + / / as the ClusterPicker instance . <nl> + ClusterPicker ( ClusterMap cluster_map , <nl> + RefCountedPtr < XdsClusterManagerLbConfig > config ) <nl> + : cluster_map_ ( std : : move ( cluster_map ) ) , config_ ( std : : move ( config ) ) { } <nl> + <nl> + PickResult Pick ( PickArgs args ) override ; <nl> + <nl> + private : <nl> + ClusterMap cluster_map_ ; <nl> + / / Take a reference to config so that we can use <nl> + / / XdsApi : : RdsUpdate : : RdsRoute : : Matchers from it . <nl> + RefCountedPtr < XdsClusterManagerLbConfig > config_ ; <nl> + } ; <nl> + <nl> + / / Each ClusterChild holds a ref to its parent XdsClusterManagerLb . <nl> + class ClusterChild : public InternallyRefCounted < ClusterChild > { <nl> + public : <nl> + ClusterChild ( RefCountedPtr < XdsClusterManagerLb > xds_cluster_manager_policy , <nl> + const std : : string & name ) ; <nl> + ~ ClusterChild ( ) ; <nl> + <nl> + void Orphan ( ) override ; <nl> + <nl> + void UpdateLocked ( RefCountedPtr < LoadBalancingPolicy : : Config > config , <nl> + const ServerAddressList & addresses , <nl> + const grpc_channel_args * args ) ; <nl> + void ExitIdleLocked ( ) ; <nl> + void ResetBackoffLocked ( ) ; <nl> + void DeactivateLocked ( ) ; <nl> + <nl> + grpc_connectivity_state connectivity_state ( ) const { <nl> + return connectivity_state_ ; <nl> + } <nl> + RefCountedPtr < ChildPickerWrapper > picker_wrapper ( ) const { <nl> + return picker_wrapper_ ; <nl> + } <nl> + <nl> + private : <nl> + class Helper : public ChannelControlHelper { <nl> + public : <nl> + explicit Helper ( RefCountedPtr < ClusterChild > xds_cluster_manager_child ) <nl> + : xds_cluster_manager_child_ ( std : : move ( xds_cluster_manager_child ) ) { } <nl> + <nl> + ~ Helper ( ) { xds_cluster_manager_child_ . reset ( DEBUG_LOCATION , " Helper " ) ; } <nl> + <nl> + RefCountedPtr < SubchannelInterface > CreateSubchannel ( <nl> + const grpc_channel_args & args ) override ; <nl> + void UpdateState ( grpc_connectivity_state state , <nl> + const absl : : Status & status , <nl> + std : : unique_ptr < SubchannelPicker > picker ) override ; <nl> + void RequestReresolution ( ) override ; <nl> + void AddTraceEvent ( TraceSeverity severity , <nl> + absl : : string_view message ) override ; <nl> + <nl> + private : <nl> + RefCountedPtr < ClusterChild > xds_cluster_manager_child_ ; <nl> + } ; <nl> + <nl> + / / Methods for dealing with the child policy . <nl> + OrphanablePtr < LoadBalancingPolicy > CreateChildPolicyLocked ( <nl> + const grpc_channel_args * args ) ; <nl> + <nl> + static void OnDelayedRemovalTimer ( void * arg , grpc_error * error ) ; <nl> + void OnDelayedRemovalTimerLocked ( grpc_error * error ) ; <nl> + <nl> + / / The owning LB policy . <nl> + RefCountedPtr < XdsClusterManagerLb > xds_cluster_manager_policy_ ; <nl> + <nl> + / / Points to the corresponding key in children map . <nl> + const std : : string name_ ; <nl> + <nl> + OrphanablePtr < LoadBalancingPolicy > child_policy_ ; <nl> + <nl> + RefCountedPtr < ChildPickerWrapper > picker_wrapper_ ; <nl> + grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_IDLE ; <nl> + bool seen_failure_since_ready_ = false ; <nl> + <nl> + / / States for delayed removal . <nl> + grpc_timer delayed_removal_timer_ ; <nl> + grpc_closure on_delayed_removal_timer_ ; <nl> + bool delayed_removal_timer_callback_pending_ = false ; <nl> + bool shutdown_ = false ; <nl> + } ; <nl> + <nl> + ~ XdsClusterManagerLb ( ) ; <nl> + <nl> + void ShutdownLocked ( ) override ; <nl> + <nl> + void UpdateStateLocked ( ) ; <nl> + <nl> + / / Current config from the resolver . <nl> + RefCountedPtr < XdsClusterManagerLbConfig > config_ ; <nl> + <nl> + / / Internal state . <nl> + bool shutting_down_ = false ; <nl> + <nl> + / / Children . <nl> + std : : map < std : : string , OrphanablePtr < ClusterChild > > children_ ; <nl> + } ; <nl> + <nl> + / / <nl> + / / XdsClusterManagerLb : : ClusterPicker <nl> + / / <nl> + <nl> + XdsClusterManagerLb : : PickResult XdsClusterManagerLb : : ClusterPicker : : Pick ( <nl> + PickArgs args ) { <nl> + auto cluster_name = <nl> + args . call_state - > ExperimentalGetCallAttribute ( kXdsClusterAttribute ) ; <nl> + auto it = cluster_map_ . find ( cluster_name ) ; <nl> + if ( it ! = cluster_map_ . end ( ) ) { <nl> + return it - > second - > Pick ( args ) ; <nl> + } <nl> + PickResult result ; <nl> + result . type = PickResult : : PICK_FAILED ; <nl> + result . error = grpc_error_set_int ( <nl> + GRPC_ERROR_CREATE_FROM_COPIED_STRING ( <nl> + absl : : StrCat ( " xds cluster manager picker : unknown cluster \ " " , <nl> + cluster_name , " \ " " ) <nl> + . c_str ( ) ) , <nl> + GRPC_ERROR_INT_GRPC_STATUS , GRPC_STATUS_INTERNAL ) ; <nl> + return result ; <nl> + } <nl> + <nl> + / / <nl> + / / XdsClusterManagerLb <nl> + / / <nl> + <nl> + XdsClusterManagerLb : : XdsClusterManagerLb ( Args args ) <nl> + : LoadBalancingPolicy ( std : : move ( args ) ) { } <nl> + <nl> + XdsClusterManagerLb : : ~ XdsClusterManagerLb ( ) { <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_cluster_manager_lb_trace ) ) { <nl> + gpr_log ( <nl> + GPR_INFO , <nl> + " [ xds_cluster_manager_lb % p ] destroying xds_cluster_manager LB policy " , <nl> + this ) ; <nl> + } <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ShutdownLocked ( ) { <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_cluster_manager_lb_trace ) ) { <nl> + gpr_log ( GPR_INFO , " [ xds_cluster_manager_lb % p ] shutting down " , this ) ; <nl> + } <nl> + shutting_down_ = true ; <nl> + children_ . clear ( ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ExitIdleLocked ( ) { <nl> + for ( auto & p : children_ ) p . second - > ExitIdleLocked ( ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ResetBackoffLocked ( ) { <nl> + for ( auto & p : children_ ) p . second - > ResetBackoffLocked ( ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : UpdateLocked ( UpdateArgs args ) { <nl> + if ( shutting_down_ ) return ; <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_cluster_manager_lb_trace ) ) { <nl> + gpr_log ( GPR_INFO , " [ xds_cluster_manager_lb % p ] Received update " , this ) ; <nl> + } <nl> + / / Update config . <nl> + config_ = std : : move ( args . config ) ; <nl> + / / Deactivate the children not in the new config . <nl> + for ( const auto & p : children_ ) { <nl> + const std : : string & name = p . first ; <nl> + ClusterChild * child = p . second . get ( ) ; <nl> + if ( config_ - > cluster_map ( ) . find ( name ) = = config_ - > cluster_map ( ) . end ( ) ) { <nl> + child - > DeactivateLocked ( ) ; <nl> + } <nl> + } <nl> + / / Add or update the children in the new config . <nl> + for ( const auto & p : config_ - > cluster_map ( ) ) { <nl> + const std : : string & name = p . first ; <nl> + const RefCountedPtr < LoadBalancingPolicy : : Config > & config = p . second ; <nl> + auto it = children_ . find ( name ) ; <nl> + if ( it = = children_ . end ( ) ) { <nl> + it = children_ <nl> + . emplace ( name , MakeOrphanable < ClusterChild > ( <nl> + Ref ( DEBUG_LOCATION , " ClusterChild " ) , name ) ) <nl> + . first ; <nl> + } <nl> + it - > second - > UpdateLocked ( config , args . addresses , args . args ) ; <nl> + } <nl> + UpdateStateLocked ( ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : UpdateStateLocked ( ) { <nl> + / / Also count the number of children in each state , to determine the <nl> + / / overall state . <nl> + size_t num_ready = 0 ; <nl> + size_t num_connecting = 0 ; <nl> + size_t num_idle = 0 ; <nl> + size_t num_transient_failures = 0 ; <nl> + for ( const auto & p : children_ ) { <nl> + const auto & child_name = p . first ; <nl> + const ClusterChild * child = p . second . get ( ) ; <nl> + / / Skip the children that are not in the latest update . <nl> + if ( config_ - > cluster_map ( ) . find ( child_name ) = = <nl> + config_ - > cluster_map ( ) . end ( ) ) { <nl> + continue ; <nl> + } <nl> + switch ( child - > connectivity_state ( ) ) { <nl> + case GRPC_CHANNEL_READY : { <nl> + + + num_ready ; <nl> + break ; <nl> + } <nl> + case GRPC_CHANNEL_CONNECTING : { <nl> + + + num_connecting ; <nl> + break ; <nl> + } <nl> + case GRPC_CHANNEL_IDLE : { <nl> + + + num_idle ; <nl> + break ; <nl> + } <nl> + case GRPC_CHANNEL_TRANSIENT_FAILURE : { <nl> + + + num_transient_failures ; <nl> + break ; <nl> + } <nl> + default : <nl> + GPR_UNREACHABLE_CODE ( return ) ; <nl> + } <nl> + } <nl> + / / Determine aggregated connectivity state . <nl> + grpc_connectivity_state connectivity_state ; <nl> + if ( num_ready > 0 ) { <nl> + connectivity_state = GRPC_CHANNEL_READY ; <nl> + } else if ( num_connecting > 0 ) { <nl> + connectivity_state = GRPC_CHANNEL_CONNECTING ; <nl> + } else if ( num_idle > 0 ) { <nl> + connectivity_state = GRPC_CHANNEL_IDLE ; <nl> + } else { <nl> + connectivity_state = GRPC_CHANNEL_TRANSIENT_FAILURE ; <nl> + } <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_cluster_manager_lb_trace ) ) { <nl> + gpr_log ( GPR_INFO , " [ xds_cluster_manager_lb % p ] connectivity changed to % s " , <nl> + this , ConnectivityStateName ( connectivity_state ) ) ; <nl> + } <nl> + std : : unique_ptr < SubchannelPicker > picker ; <nl> + absl : : Status status ; <nl> + switch ( connectivity_state ) { <nl> + case GRPC_CHANNEL_READY : { <nl> + ClusterPicker : : ClusterMap cluster_map ; <nl> + for ( const auto & p : config_ - > cluster_map ( ) ) { <nl> + const std : : string & cluster_name = p . first ; <nl> + RefCountedPtr < ChildPickerWrapper > & child_picker = <nl> + cluster_map [ cluster_name ] ; <nl> + child_picker = children_ [ cluster_name ] - > picker_wrapper ( ) ; <nl> + if ( child_picker = = nullptr ) { <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_cluster_manager_lb_trace ) ) { <nl> + gpr_log ( <nl> + GPR_INFO , <nl> + " [ xds_cluster_manager_lb % p ] child % s has not yet returned a " <nl> + " picker ; creating a QueuePicker . " , <nl> + this , cluster_name . c_str ( ) ) ; <nl> + } <nl> + child_picker = MakeRefCounted < ChildPickerWrapper > ( <nl> + cluster_name , absl : : make_unique < QueuePicker > ( <nl> + Ref ( DEBUG_LOCATION , " QueuePicker " ) ) ) ; <nl> + } <nl> + } <nl> + picker = <nl> + absl : : make_unique < ClusterPicker > ( std : : move ( cluster_map ) , config_ ) ; <nl> + break ; <nl> + } <nl> + case GRPC_CHANNEL_CONNECTING : <nl> + case GRPC_CHANNEL_IDLE : <nl> + picker = <nl> + absl : : make_unique < QueuePicker > ( Ref ( DEBUG_LOCATION , " QueuePicker " ) ) ; <nl> + break ; <nl> + default : <nl> + grpc_error * error = grpc_error_set_int ( <nl> + GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> + " TRANSIENT_FAILURE from XdsClusterManagerLb " ) , <nl> + GRPC_ERROR_INT_GRPC_STATUS , GRPC_STATUS_UNAVAILABLE ) ; <nl> + status = grpc_error_to_absl_status ( error ) ; <nl> + picker = absl : : make_unique < TransientFailurePicker > ( error ) ; <nl> + } <nl> + channel_control_helper ( ) - > UpdateState ( connectivity_state , status , <nl> + std : : move ( picker ) ) ; <nl> + } <nl> + <nl> + / / <nl> + / / XdsClusterManagerLb : : ClusterChild <nl> + / / <nl> + <nl> + XdsClusterManagerLb : : ClusterChild : : ClusterChild ( <nl> + RefCountedPtr < XdsClusterManagerLb > xds_cluster_manager_policy , <nl> + const std : : string & name ) <nl> + : xds_cluster_manager_policy_ ( std : : move ( xds_cluster_manager_policy ) ) , <nl> + name_ ( name ) { <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_cluster_manager_lb_trace ) ) { <nl> + gpr_log ( GPR_INFO , <nl> + " [ xds_cluster_manager_lb % p ] created ClusterChild % p for % s " , <nl> + xds_cluster_manager_policy_ . get ( ) , this , name_ . c_str ( ) ) ; <nl> + } <nl> + GRPC_CLOSURE_INIT ( & on_delayed_removal_timer_ , OnDelayedRemovalTimer , this , <nl> + grpc_schedule_on_exec_ctx ) ; <nl> + } <nl> + <nl> + XdsClusterManagerLb : : ClusterChild : : ~ ClusterChild ( ) { <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_cluster_manager_lb_trace ) ) { <nl> + gpr_log ( GPR_INFO , <nl> + " [ xds_cluster_manager_lb % p ] ClusterChild % p : destroying " <nl> + " child " , <nl> + xds_cluster_manager_policy_ . get ( ) , this ) ; <nl> + } <nl> + xds_cluster_manager_policy_ . reset ( DEBUG_LOCATION , " ClusterChild " ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ClusterChild : : Orphan ( ) { <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_cluster_manager_lb_trace ) ) { <nl> + gpr_log ( GPR_INFO , <nl> + " [ xds_cluster_manager_lb % p ] ClusterChild % p % s : " <nl> + " shutting down child " , <nl> + xds_cluster_manager_policy_ . get ( ) , this , name_ . c_str ( ) ) ; <nl> + } <nl> + / / Remove the child policy ' s interested_parties pollset_set from the <nl> + / / xDS policy . <nl> + grpc_pollset_set_del_pollset_set ( <nl> + child_policy_ - > interested_parties ( ) , <nl> + xds_cluster_manager_policy_ - > interested_parties ( ) ) ; <nl> + child_policy_ . reset ( ) ; <nl> + / / Drop our ref to the child ' s picker , in case it ' s holding a ref to <nl> + / / the child . <nl> + picker_wrapper_ . reset ( ) ; <nl> + if ( delayed_removal_timer_callback_pending_ ) { <nl> + grpc_timer_cancel ( & delayed_removal_timer_ ) ; <nl> + } <nl> + shutdown_ = true ; <nl> + Unref ( ) ; <nl> + } <nl> + <nl> + OrphanablePtr < LoadBalancingPolicy > <nl> + XdsClusterManagerLb : : ClusterChild : : CreateChildPolicyLocked ( <nl> + const grpc_channel_args * args ) { <nl> + LoadBalancingPolicy : : Args lb_policy_args ; <nl> + lb_policy_args . work_serializer = <nl> + xds_cluster_manager_policy_ - > work_serializer ( ) ; <nl> + lb_policy_args . args = args ; <nl> + lb_policy_args . channel_control_helper = <nl> + absl : : make_unique < Helper > ( this - > Ref ( DEBUG_LOCATION , " Helper " ) ) ; <nl> + OrphanablePtr < LoadBalancingPolicy > lb_policy = <nl> + MakeOrphanable < ChildPolicyHandler > ( std : : move ( lb_policy_args ) , <nl> + & grpc_xds_cluster_manager_lb_trace ) ; <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_cluster_manager_lb_trace ) ) { <nl> + gpr_log ( GPR_INFO , <nl> + " [ xds_cluster_manager_lb % p ] ClusterChild % p % s : Created " <nl> + " new child " <nl> + " policy handler % p " , <nl> + xds_cluster_manager_policy_ . get ( ) , this , name_ . c_str ( ) , <nl> + lb_policy . get ( ) ) ; <nl> + } <nl> + / / Add the xDS ' s interested_parties pollset_set to that of the newly created <nl> + / / child policy . This will make the child policy progress upon activity on <nl> + / / xDS LB , which in turn is tied to the application ' s call . <nl> + grpc_pollset_set_add_pollset_set ( <nl> + lb_policy - > interested_parties ( ) , <nl> + xds_cluster_manager_policy_ - > interested_parties ( ) ) ; <nl> + return lb_policy ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ClusterChild : : UpdateLocked ( <nl> + RefCountedPtr < LoadBalancingPolicy : : Config > config , <nl> + const ServerAddressList & addresses , const grpc_channel_args * args ) { <nl> + if ( xds_cluster_manager_policy_ - > shutting_down_ ) return ; <nl> + / / Update child weight . <nl> + / / Reactivate if needed . <nl> + if ( delayed_removal_timer_callback_pending_ ) { <nl> + delayed_removal_timer_callback_pending_ = false ; <nl> + grpc_timer_cancel ( & delayed_removal_timer_ ) ; <nl> + } <nl> + / / Create child policy if needed . <nl> + if ( child_policy_ = = nullptr ) { <nl> + child_policy_ = CreateChildPolicyLocked ( args ) ; <nl> + } <nl> + / / Construct update args . <nl> + UpdateArgs update_args ; <nl> + update_args . config = std : : move ( config ) ; <nl> + update_args . addresses = addresses ; <nl> + update_args . args = grpc_channel_args_copy ( args ) ; <nl> + / / Update the policy . <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_cluster_manager_lb_trace ) ) { <nl> + gpr_log ( GPR_INFO , <nl> + " [ xds_cluster_manager_lb % p ] ClusterChild % p % s : " <nl> + " Updating child " <nl> + " policy handler % p " , <nl> + xds_cluster_manager_policy_ . get ( ) , this , name_ . c_str ( ) , <nl> + child_policy_ . get ( ) ) ; <nl> + } <nl> + child_policy_ - > UpdateLocked ( std : : move ( update_args ) ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ClusterChild : : ExitIdleLocked ( ) { <nl> + child_policy_ - > ExitIdleLocked ( ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ClusterChild : : ResetBackoffLocked ( ) { <nl> + child_policy_ - > ResetBackoffLocked ( ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ClusterChild : : DeactivateLocked ( ) { <nl> + / / If already deactivated , don ' t do that again . <nl> + if ( delayed_removal_timer_callback_pending_ = = true ) return ; <nl> + / / Set the child weight to 0 so that future picker won ' t contain this child . <nl> + / / Start a timer to delete the child . <nl> + Ref ( DEBUG_LOCATION , " ClusterChild + timer " ) . release ( ) ; <nl> + grpc_timer_init ( & delayed_removal_timer_ , <nl> + ExecCtx : : Get ( ) - > Now ( ) + <nl> + GRPC_XDS_CLUSTER_MANAGER_CHILD_RETENTION_INTERVAL_MS , <nl> + & on_delayed_removal_timer_ ) ; <nl> + delayed_removal_timer_callback_pending_ = true ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ClusterChild : : OnDelayedRemovalTimer ( <nl> + void * arg , grpc_error * error ) { <nl> + ClusterChild * self = static_cast < ClusterChild * > ( arg ) ; <nl> + GRPC_ERROR_REF ( error ) ; / / Ref owned by the lambda <nl> + self - > xds_cluster_manager_policy_ - > work_serializer ( ) - > Run ( <nl> + [ self , error ] ( ) { self - > OnDelayedRemovalTimerLocked ( error ) ; } , <nl> + DEBUG_LOCATION ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ClusterChild : : OnDelayedRemovalTimerLocked ( <nl> + grpc_error * error ) { <nl> + delayed_removal_timer_callback_pending_ = false ; <nl> + if ( error = = GRPC_ERROR_NONE & & ! shutdown_ ) { <nl> + xds_cluster_manager_policy_ - > children_ . erase ( name_ ) ; <nl> + } <nl> + Unref ( DEBUG_LOCATION , " ClusterChild + timer " ) ; <nl> + GRPC_ERROR_UNREF ( error ) ; <nl> + } <nl> + <nl> + / / <nl> + / / XdsClusterManagerLb : : ClusterChild : : Helper <nl> + / / <nl> + <nl> + RefCountedPtr < SubchannelInterface > <nl> + XdsClusterManagerLb : : ClusterChild : : Helper : : CreateSubchannel ( <nl> + const grpc_channel_args & args ) { <nl> + if ( xds_cluster_manager_child_ - > xds_cluster_manager_policy_ - > shutting_down_ ) <nl> + return nullptr ; <nl> + return xds_cluster_manager_child_ - > xds_cluster_manager_policy_ <nl> + - > channel_control_helper ( ) <nl> + - > CreateSubchannel ( args ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ClusterChild : : Helper : : UpdateState ( <nl> + grpc_connectivity_state state , const absl : : Status & status , <nl> + std : : unique_ptr < SubchannelPicker > picker ) { <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_cluster_manager_lb_trace ) ) { <nl> + gpr_log ( <nl> + GPR_INFO , <nl> + " [ xds_cluster_manager_lb % p ] child % s : received update : state = % s ( % s ) " <nl> + " picker = % p " , <nl> + xds_cluster_manager_child_ - > xds_cluster_manager_policy_ . get ( ) , <nl> + xds_cluster_manager_child_ - > name_ . c_str ( ) , ConnectivityStateName ( state ) , <nl> + status . ToString ( ) . c_str ( ) , picker . get ( ) ) ; <nl> + } <nl> + if ( xds_cluster_manager_child_ - > xds_cluster_manager_policy_ - > shutting_down_ ) <nl> + return ; <nl> + / / Cache the picker in the ClusterChild . <nl> + xds_cluster_manager_child_ - > picker_wrapper_ = <nl> + MakeRefCounted < ChildPickerWrapper > ( xds_cluster_manager_child_ - > name_ , <nl> + std : : move ( picker ) ) ; <nl> + / / Decide what state to report for aggregation purposes . <nl> + / / If we haven ' t seen a failure since the last time we were in state <nl> + / / READY , then we report the state change as - is . However , once we do see <nl> + / / a failure , we report TRANSIENT_FAILURE and ignore any subsequent state <nl> + / / changes until we go back into state READY . <nl> + if ( ! xds_cluster_manager_child_ - > seen_failure_since_ready_ ) { <nl> + if ( state = = GRPC_CHANNEL_TRANSIENT_FAILURE ) { <nl> + xds_cluster_manager_child_ - > seen_failure_since_ready_ = true ; <nl> + } <nl> + } else { <nl> + if ( state ! = GRPC_CHANNEL_READY ) return ; <nl> + xds_cluster_manager_child_ - > seen_failure_since_ready_ = false ; <nl> + } <nl> + xds_cluster_manager_child_ - > connectivity_state_ = state ; <nl> + / / Notify the LB policy . <nl> + xds_cluster_manager_child_ - > xds_cluster_manager_policy_ - > UpdateStateLocked ( ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ClusterChild : : Helper : : RequestReresolution ( ) { <nl> + if ( xds_cluster_manager_child_ - > xds_cluster_manager_policy_ - > shutting_down_ ) <nl> + return ; <nl> + xds_cluster_manager_child_ - > xds_cluster_manager_policy_ <nl> + - > channel_control_helper ( ) <nl> + - > RequestReresolution ( ) ; <nl> + } <nl> + <nl> + void XdsClusterManagerLb : : ClusterChild : : Helper : : AddTraceEvent ( <nl> + TraceSeverity severity , absl : : string_view message ) { <nl> + if ( xds_cluster_manager_child_ - > xds_cluster_manager_policy_ - > shutting_down_ ) <nl> + return ; <nl> + xds_cluster_manager_child_ - > xds_cluster_manager_policy_ <nl> + - > channel_control_helper ( ) <nl> + - > AddTraceEvent ( severity , message ) ; <nl> + } <nl> + <nl> + / / <nl> + / / factory <nl> + / / <nl> + <nl> + class XdsClusterManagerLbFactory : public LoadBalancingPolicyFactory { <nl> + public : <nl> + OrphanablePtr < LoadBalancingPolicy > CreateLoadBalancingPolicy ( <nl> + LoadBalancingPolicy : : Args args ) const override { <nl> + return MakeOrphanable < XdsClusterManagerLb > ( std : : move ( args ) ) ; <nl> + } <nl> + <nl> + const char * name ( ) const override { return kXdsClusterManager ; } <nl> + <nl> + RefCountedPtr < LoadBalancingPolicy : : Config > ParseLoadBalancingConfig ( <nl> + const Json & json , grpc_error * * error ) const override { <nl> + GPR_DEBUG_ASSERT ( error ! = nullptr & & * error = = GRPC_ERROR_NONE ) ; <nl> + if ( json . type ( ) = = Json : : Type : : JSON_NULL ) { <nl> + / / xds_cluster_manager was mentioned as a policy in the deprecated <nl> + / / loadBalancingPolicy field or in the client API . <nl> + * error = GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> + " field : loadBalancingPolicy error : xds_cluster_manager policy requires " <nl> + " configuration . Please use loadBalancingConfig field of service " <nl> + " config instead . " ) ; <nl> + return nullptr ; <nl> + } <nl> + std : : vector < grpc_error * > error_list ; <nl> + XdsClusterManagerLbConfig : : ClusterMap cluster_map ; <nl> + std : : set < std : : string / * cluster_name * / > clusters_to_be_used ; <nl> + auto it = json . object_value ( ) . find ( " children " ) ; <nl> + if ( it = = json . object_value ( ) . end ( ) ) { <nl> + error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> + " field : children error : required field not present " ) ) ; <nl> + } else if ( it - > second . type ( ) ! = Json : : Type : : OBJECT ) { <nl> + error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> + " field : children error : type should be object " ) ) ; <nl> + } else { <nl> + for ( const auto & p : it - > second . object_value ( ) ) { <nl> + const std : : string & child_name = p . first ; <nl> + if ( child_name . empty ( ) ) { <nl> + error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> + " field : children element error : name cannot be empty " ) ) ; <nl> + continue ; <nl> + } <nl> + RefCountedPtr < LoadBalancingPolicy : : Config > child_config ; <nl> + std : : vector < grpc_error * > child_errors = <nl> + ParseChildConfig ( p . second , & child_config ) ; <nl> + if ( ! child_errors . empty ( ) ) { <nl> + / / Can ' t use GRPC_ERROR_CREATE_FROM_VECTOR ( ) here , because the error <nl> + / / string is not static in this case . <nl> + grpc_error * error = GRPC_ERROR_CREATE_FROM_COPIED_STRING ( <nl> + absl : : StrCat ( " field : children name : " , child_name ) . c_str ( ) ) ; <nl> + for ( grpc_error * child_error : child_errors ) { <nl> + error = grpc_error_add_child ( error , child_error ) ; <nl> + } <nl> + error_list . push_back ( error ) ; <nl> + } else { <nl> + cluster_map [ child_name ] = std : : move ( child_config ) ; <nl> + clusters_to_be_used . insert ( child_name ) ; <nl> + } <nl> + } <nl> + } <nl> + if ( cluster_map . empty ( ) ) { <nl> + error_list . push_back ( <nl> + GRPC_ERROR_CREATE_FROM_STATIC_STRING ( " no valid children configured " ) ) ; <nl> + } <nl> + if ( ! error_list . empty ( ) ) { <nl> + * error = GRPC_ERROR_CREATE_FROM_VECTOR ( <nl> + " xds_cluster_manager_experimental LB policy config " , & error_list ) ; <nl> + return nullptr ; <nl> + } <nl> + return MakeRefCounted < XdsClusterManagerLbConfig > ( std : : move ( cluster_map ) ) ; <nl> + } <nl> + <nl> + private : <nl> + static std : : vector < grpc_error * > ParseChildConfig ( <nl> + const Json & json , <nl> + RefCountedPtr < LoadBalancingPolicy : : Config > * child_config ) { <nl> + std : : vector < grpc_error * > error_list ; <nl> + if ( json . type ( ) ! = Json : : Type : : OBJECT ) { <nl> + error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> + " value should be of type object " ) ) ; <nl> + return error_list ; <nl> + } <nl> + auto it = json . object_value ( ) . find ( " childPolicy " ) ; <nl> + if ( it = = json . object_value ( ) . end ( ) ) { <nl> + error_list . push_back ( <nl> + GRPC_ERROR_CREATE_FROM_STATIC_STRING ( " did not find childPolicy " ) ) ; <nl> + } else { <nl> + grpc_error * parse_error = GRPC_ERROR_NONE ; <nl> + * child_config = LoadBalancingPolicyRegistry : : ParseLoadBalancingConfig ( <nl> + it - > second , & parse_error ) ; <nl> + if ( * child_config = = nullptr ) { <nl> + GPR_DEBUG_ASSERT ( parse_error ! = GRPC_ERROR_NONE ) ; <nl> + std : : vector < grpc_error * > child_errors ; <nl> + child_errors . push_back ( parse_error ) ; <nl> + error_list . push_back ( <nl> + GRPC_ERROR_CREATE_FROM_VECTOR ( " field : childPolicy " , & child_errors ) ) ; <nl> + } <nl> + } <nl> + return error_list ; <nl> + } <nl> + } ; <nl> + <nl> + } / / namespace <nl> + <nl> + } / / namespace grpc_core <nl> + <nl> + / / <nl> + / / Plugin registration <nl> + / / <nl> + <nl> + void grpc_lb_policy_xds_cluster_manager_init ( ) { <nl> + grpc_core : : LoadBalancingPolicyRegistry : : Builder : : <nl> + RegisterLoadBalancingPolicyFactory ( <nl> + absl : : make_unique < grpc_core : : XdsClusterManagerLbFactory > ( ) ) ; <nl> + } <nl> + <nl> + void grpc_lb_policy_xds_cluster_manager_shutdown ( ) { } <nl> deleted file mode 100644 <nl> index 22de026aefa . . 00000000000 <nl> mmm a / src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc <nl> ppp / dev / null <nl> <nl> - / / <nl> - / / Copyright 2018 gRPC authors . <nl> - / / <nl> - / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> - / / you may not use this file except in compliance with the License . <nl> - / / You may obtain a copy of the License at <nl> - / / <nl> - / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> - / / <nl> - / / Unless required by applicable law or agreed to in writing , software <nl> - / / distributed under the License is distributed on an " AS IS " BASIS , <nl> - / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> - / / See the License for the specific language governing permissions and <nl> - / / limitations under the License . <nl> - / / <nl> - <nl> - # include < grpc / support / port_platform . h > <nl> - <nl> - # include < inttypes . h > <nl> - # include < limits . h > <nl> - # include < string . h > <nl> - <nl> - # include " absl / container / inlined_vector . h " <nl> - # include " absl / strings / match . h " <nl> - # include " absl / strings / numbers . h " <nl> - # include " absl / strings / str_cat . h " <nl> - # include " absl / strings / str_join . h " <nl> - # include " absl / strings / str_split . h " <nl> - # include " absl / strings / string_view . h " <nl> - # include " re2 / re2 . h " <nl> - <nl> - # include < grpc / grpc . h > <nl> - <nl> - # include " src / core / ext / filters / client_channel / lb_policy . h " <nl> - # include " src / core / ext / filters / client_channel / lb_policy / child_policy_handler . h " <nl> - # include " src / core / ext / filters / client_channel / lb_policy_factory . h " <nl> - # include " src / core / ext / filters / client_channel / lb_policy_registry . h " <nl> - # include " src / core / ext / xds / xds_api . h " <nl> - # include " src / core / lib / channel / channel_args . h " <nl> - # include " src / core / lib / gpr / string . h " <nl> - # include " src / core / lib / gprpp / orphanable . h " <nl> - # include " src / core / lib / gprpp / ref_counted_ptr . h " <nl> - # include " src / core / lib / iomgr / timer . h " <nl> - # include " src / core / lib / iomgr / work_serializer . h " <nl> - # include " src / core / lib / transport / error_utils . h " <nl> - <nl> - # define GRPC_XDS_ROUTING_CHILD_RETENTION_INTERVAL_MS ( 15 * 60 * 1000 ) <nl> - <nl> - namespace grpc_core { <nl> - <nl> - TraceFlag grpc_xds_routing_lb_trace ( false , " xds_routing_lb " ) ; <nl> - <nl> - namespace { <nl> - <nl> - constexpr char kXdsRouting [ ] = " xds_routing_experimental " ; <nl> - <nl> - / / Config for xds_routing LB policy . <nl> - class XdsRoutingLbConfig : public LoadBalancingPolicy : : Config { <nl> - public : <nl> - struct Route { <nl> - XdsApi : : Route : : Matchers matchers ; <nl> - std : : string action ; <nl> - } ; <nl> - using RouteTable = std : : vector < Route > ; <nl> - using ActionMap = <nl> - std : : map < std : : string , RefCountedPtr < LoadBalancingPolicy : : Config > > ; <nl> - <nl> - XdsRoutingLbConfig ( ActionMap action_map , RouteTable route_table ) <nl> - : action_map_ ( std : : move ( action_map ) ) , <nl> - route_table_ ( std : : move ( route_table ) ) { } <nl> - <nl> - const char * name ( ) const override { return kXdsRouting ; } <nl> - <nl> - const ActionMap & action_map ( ) const { return action_map_ ; } <nl> - <nl> - const RouteTable & route_table ( ) const { return route_table_ ; } <nl> - <nl> - private : <nl> - ActionMap action_map_ ; <nl> - RouteTable route_table_ ; <nl> - } ; <nl> - <nl> - / / xds_routing LB policy . <nl> - class XdsRoutingLb : public LoadBalancingPolicy { <nl> - public : <nl> - explicit XdsRoutingLb ( Args args ) ; <nl> - <nl> - const char * name ( ) const override { return kXdsRouting ; } <nl> - <nl> - void UpdateLocked ( UpdateArgs args ) override ; <nl> - void ExitIdleLocked ( ) override ; <nl> - void ResetBackoffLocked ( ) override ; <nl> - <nl> - private : <nl> - / / A simple wrapper for ref - counting a picker from the child policy . <nl> - class ChildPickerWrapper : public RefCounted < ChildPickerWrapper > { <nl> - public : <nl> - ChildPickerWrapper ( std : : string name , <nl> - std : : unique_ptr < SubchannelPicker > picker ) <nl> - : name_ ( std : : move ( name ) ) , picker_ ( std : : move ( picker ) ) { } <nl> - PickResult Pick ( PickArgs args ) { return picker_ - > Pick ( args ) ; } <nl> - <nl> - const std : : string & name ( ) const { return name_ ; } <nl> - <nl> - private : <nl> - std : : string name_ ; <nl> - std : : unique_ptr < SubchannelPicker > picker_ ; <nl> - } ; <nl> - <nl> - / / Picks a child using prefix or path matching and then delegates to that <nl> - / / child ' s picker . <nl> - class RoutePicker : public SubchannelPicker { <nl> - public : <nl> - struct Route { <nl> - const XdsApi : : Route : : Matchers * matchers ; <nl> - RefCountedPtr < ChildPickerWrapper > picker ; <nl> - } ; <nl> - <nl> - / / Maintains an ordered xds route table as provided by RDS response . <nl> - using RouteTable = std : : vector < Route > ; <nl> - <nl> - RoutePicker ( RouteTable route_table , <nl> - RefCountedPtr < XdsRoutingLbConfig > config ) <nl> - : route_table_ ( std : : move ( route_table ) ) , config_ ( std : : move ( config ) ) { } <nl> - <nl> - PickResult Pick ( PickArgs args ) override ; <nl> - <nl> - private : <nl> - RouteTable route_table_ ; <nl> - / / Take a reference to config so that we can use <nl> - / / XdsApi : : Route : : Matchers from it . <nl> - RefCountedPtr < XdsRoutingLbConfig > config_ ; <nl> - } ; <nl> - <nl> - / / Each XdsRoutingChild holds a ref to its parent XdsRoutingLb . <nl> - class XdsRoutingChild : public InternallyRefCounted < XdsRoutingChild > { <nl> - public : <nl> - XdsRoutingChild ( RefCountedPtr < XdsRoutingLb > xds_routing_policy , <nl> - const std : : string & name ) ; <nl> - ~ XdsRoutingChild ( ) ; <nl> - <nl> - void Orphan ( ) override ; <nl> - <nl> - void UpdateLocked ( RefCountedPtr < LoadBalancingPolicy : : Config > config , <nl> - const ServerAddressList & addresses , <nl> - const grpc_channel_args * args ) ; <nl> - void ExitIdleLocked ( ) ; <nl> - void ResetBackoffLocked ( ) ; <nl> - void DeactivateLocked ( ) ; <nl> - <nl> - grpc_connectivity_state connectivity_state ( ) const { <nl> - return connectivity_state_ ; <nl> - } <nl> - RefCountedPtr < ChildPickerWrapper > picker_wrapper ( ) const { <nl> - return picker_wrapper_ ; <nl> - } <nl> - <nl> - private : <nl> - class Helper : public ChannelControlHelper { <nl> - public : <nl> - explicit Helper ( RefCountedPtr < XdsRoutingChild > xds_routing_child ) <nl> - : xds_routing_child_ ( std : : move ( xds_routing_child ) ) { } <nl> - <nl> - ~ Helper ( ) { xds_routing_child_ . reset ( DEBUG_LOCATION , " Helper " ) ; } <nl> - <nl> - RefCountedPtr < SubchannelInterface > CreateSubchannel ( <nl> - const grpc_channel_args & args ) override ; <nl> - void UpdateState ( grpc_connectivity_state state , <nl> - const absl : : Status & status , <nl> - std : : unique_ptr < SubchannelPicker > picker ) override ; <nl> - void RequestReresolution ( ) override ; <nl> - void AddTraceEvent ( TraceSeverity severity , <nl> - absl : : string_view message ) override ; <nl> - <nl> - private : <nl> - RefCountedPtr < XdsRoutingChild > xds_routing_child_ ; <nl> - } ; <nl> - <nl> - / / Methods for dealing with the child policy . <nl> - OrphanablePtr < LoadBalancingPolicy > CreateChildPolicyLocked ( <nl> - const grpc_channel_args * args ) ; <nl> - <nl> - static void OnDelayedRemovalTimer ( void * arg , grpc_error * error ) ; <nl> - void OnDelayedRemovalTimerLocked ( grpc_error * error ) ; <nl> - <nl> - / / The owning LB policy . <nl> - RefCountedPtr < XdsRoutingLb > xds_routing_policy_ ; <nl> - <nl> - / / Points to the corresponding key in XdsRoutingLb : : actions_ . <nl> - const std : : string name_ ; <nl> - <nl> - OrphanablePtr < LoadBalancingPolicy > child_policy_ ; <nl> - <nl> - RefCountedPtr < ChildPickerWrapper > picker_wrapper_ ; <nl> - grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_IDLE ; <nl> - bool seen_failure_since_ready_ = false ; <nl> - <nl> - / / States for delayed removal . <nl> - grpc_timer delayed_removal_timer_ ; <nl> - grpc_closure on_delayed_removal_timer_ ; <nl> - bool delayed_removal_timer_callback_pending_ = false ; <nl> - bool shutdown_ = false ; <nl> - } ; <nl> - <nl> - ~ XdsRoutingLb ( ) ; <nl> - <nl> - void ShutdownLocked ( ) override ; <nl> - <nl> - void UpdateStateLocked ( ) ; <nl> - <nl> - / / Current config from the resolver . <nl> - RefCountedPtr < XdsRoutingLbConfig > config_ ; <nl> - <nl> - / / Internal state . <nl> - bool shutting_down_ = false ; <nl> - <nl> - / / Children . <nl> - std : : map < std : : string , OrphanablePtr < XdsRoutingChild > > actions_ ; <nl> - } ; <nl> - <nl> - / / <nl> - / / XdsRoutingLb : : RoutePicker <nl> - / / <nl> - <nl> - bool PathMatch ( const absl : : string_view & path , <nl> - const XdsApi : : Route : : Matchers : : PathMatcher & path_matcher ) { <nl> - switch ( path_matcher . type ) { <nl> - case XdsApi : : Route : : Matchers : : PathMatcher : : PathMatcherType : : PREFIX : <nl> - return absl : : StartsWith ( path , path_matcher . string_matcher ) ; <nl> - case XdsApi : : Route : : Matchers : : PathMatcher : : PathMatcherType : : PATH : <nl> - return path = = path_matcher . string_matcher ; <nl> - case XdsApi : : Route : : Matchers : : PathMatcher : : PathMatcherType : : REGEX : <nl> - return RE2 : : FullMatch ( path . data ( ) , * path_matcher . regex_matcher ) ; <nl> - default : <nl> - return false ; <nl> - } <nl> - } <nl> - <nl> - absl : : optional < absl : : string_view > GetMetadataValue ( <nl> - const std : : string & key , <nl> - LoadBalancingPolicy : : MetadataInterface * initial_metadata , <nl> - std : : string * concatenated_value ) { <nl> - / / Find all values for the specified key . <nl> - GPR_DEBUG_ASSERT ( initial_metadata ! = nullptr ) ; <nl> - absl : : InlinedVector < absl : : string_view , 1 > values ; <nl> - for ( const auto p : * initial_metadata ) { <nl> - if ( p . first = = key ) values . push_back ( p . second ) ; <nl> - } <nl> - / / If none found , no match . <nl> - if ( values . empty ( ) ) return absl : : nullopt ; <nl> - / / If exactly one found , return it as - is . <nl> - if ( values . size ( ) = = 1 ) return values . front ( ) ; <nl> - / / If more than one found , concatenate the values , using <nl> - / / * concatenated_values as a temporary holding place for the <nl> - / / concatenated string . <nl> - * concatenated_value = absl : : StrJoin ( values , " , " ) ; <nl> - return * concatenated_value ; <nl> - } <nl> - <nl> - bool HeaderMatchHelper ( <nl> - const XdsApi : : Route : : Matchers : : HeaderMatcher & header_matcher , <nl> - LoadBalancingPolicy : : MetadataInterface * initial_metadata ) { <nl> - std : : string concatenated_value ; <nl> - absl : : optional < absl : : string_view > value ; <nl> - / / Note : If we ever allow binary headers here , we still need to <nl> - / / special - case ignore " grpc - tags - bin " and " grpc - trace - bin " , since <nl> - / / they are not visible to the LB policy in grpc - go . <nl> - if ( absl : : EndsWith ( header_matcher . name , " - bin " ) | | <nl> - header_matcher . name = = " grpc - previous - rpc - attempts " ) { <nl> - value = absl : : nullopt ; <nl> - } else if ( header_matcher . name = = " content - type " ) { <nl> - value = " application / grpc " ; <nl> - } else { <nl> - value = GetMetadataValue ( header_matcher . name , initial_metadata , <nl> - & concatenated_value ) ; <nl> - } <nl> - if ( ! value . has_value ( ) ) { <nl> - if ( header_matcher . type = = <nl> - XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : PRESENT ) { <nl> - return ! header_matcher . present_match ; <nl> - } else { <nl> - / / For all other header matcher types , we need the header value to <nl> - / / exist to consider matches . <nl> - return false ; <nl> - } <nl> - } <nl> - switch ( header_matcher . type ) { <nl> - case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : EXACT : <nl> - return value . value ( ) = = header_matcher . string_matcher ; <nl> - case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : REGEX : <nl> - return RE2 : : FullMatch ( value . value ( ) . data ( ) , * header_matcher . regex_match ) ; <nl> - case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : RANGE : <nl> - int64_t int_value ; <nl> - if ( ! absl : : SimpleAtoi ( value . value ( ) , & int_value ) ) { <nl> - return false ; <nl> - } <nl> - return int_value > = header_matcher . range_start & & <nl> - int_value < header_matcher . range_end ; <nl> - case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : PREFIX : <nl> - return absl : : StartsWith ( value . value ( ) , header_matcher . string_matcher ) ; <nl> - case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : SUFFIX : <nl> - return absl : : EndsWith ( value . value ( ) , header_matcher . string_matcher ) ; <nl> - default : <nl> - return false ; <nl> - } <nl> - } <nl> - <nl> - bool HeadersMatch ( <nl> - const std : : vector < XdsApi : : Route : : Matchers : : HeaderMatcher > & header_matchers , <nl> - LoadBalancingPolicy : : MetadataInterface * initial_metadata ) { <nl> - for ( const auto & header_matcher : header_matchers ) { <nl> - bool match = HeaderMatchHelper ( header_matcher , initial_metadata ) ; <nl> - if ( header_matcher . invert_match ) match = ! match ; <nl> - if ( ! match ) return false ; <nl> - } <nl> - return true ; <nl> - } <nl> - <nl> - bool UnderFraction ( const uint32_t fraction_per_million ) { <nl> - / / Generate a random number in [ 0 , 1000000 ) . <nl> - const uint32_t random_number = rand ( ) % 1000000 ; <nl> - return random_number < fraction_per_million ; <nl> - } <nl> - <nl> - XdsRoutingLb : : PickResult XdsRoutingLb : : RoutePicker : : Pick ( PickArgs args ) { <nl> - for ( const Route & route : route_table_ ) { <nl> - / / Path matching . <nl> - if ( ! PathMatch ( args . path , route . matchers - > path_matcher ) ) continue ; <nl> - / / Header Matching . <nl> - if ( ! HeadersMatch ( route . matchers - > header_matchers , args . initial_metadata ) ) { <nl> - continue ; <nl> - } <nl> - / / Match fraction check <nl> - if ( route . matchers - > fraction_per_million . has_value ( ) & & <nl> - ! UnderFraction ( route . matchers - > fraction_per_million . value ( ) ) ) { <nl> - continue ; <nl> - } <nl> - / / Found a match <nl> - return route . picker - > Pick ( args ) ; <nl> - } <nl> - PickResult result ; <nl> - result . type = PickResult : : PICK_FAILED ; <nl> - result . error = <nl> - grpc_error_set_int ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " xds routing picker : no matching route " ) , <nl> - GRPC_ERROR_INT_GRPC_STATUS , GRPC_STATUS_INTERNAL ) ; <nl> - return result ; <nl> - } <nl> - <nl> - / / <nl> - / / XdsRoutingLb <nl> - / / <nl> - <nl> - XdsRoutingLb : : XdsRoutingLb ( Args args ) : LoadBalancingPolicy ( std : : move ( args ) ) { } <nl> - <nl> - XdsRoutingLb : : ~ XdsRoutingLb ( ) { <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_routing_lb_trace ) ) { <nl> - gpr_log ( GPR_INFO , " [ xds_routing_lb % p ] destroying xds_routing LB policy " , <nl> - this ) ; <nl> - } <nl> - } <nl> - <nl> - void XdsRoutingLb : : ShutdownLocked ( ) { <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_routing_lb_trace ) ) { <nl> - gpr_log ( GPR_INFO , " [ xds_routing_lb % p ] shutting down " , this ) ; <nl> - } <nl> - shutting_down_ = true ; <nl> - actions_ . clear ( ) ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : ExitIdleLocked ( ) { <nl> - for ( auto & p : actions_ ) p . second - > ExitIdleLocked ( ) ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : ResetBackoffLocked ( ) { <nl> - for ( auto & p : actions_ ) p . second - > ResetBackoffLocked ( ) ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : UpdateLocked ( UpdateArgs args ) { <nl> - if ( shutting_down_ ) return ; <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_routing_lb_trace ) ) { <nl> - gpr_log ( GPR_INFO , " [ xds_routing_lb % p ] Received update " , this ) ; <nl> - } <nl> - / / Update config . <nl> - config_ = std : : move ( args . config ) ; <nl> - / / Deactivate the actions not in the new config . <nl> - for ( const auto & p : actions_ ) { <nl> - const std : : string & name = p . first ; <nl> - XdsRoutingChild * child = p . second . get ( ) ; <nl> - if ( config_ - > action_map ( ) . find ( name ) = = config_ - > action_map ( ) . end ( ) ) { <nl> - child - > DeactivateLocked ( ) ; <nl> - } <nl> - } <nl> - / / Add or update the actions in the new config . <nl> - for ( const auto & p : config_ - > action_map ( ) ) { <nl> - const std : : string & name = p . first ; <nl> - const RefCountedPtr < LoadBalancingPolicy : : Config > & config = p . second ; <nl> - auto it = actions_ . find ( name ) ; <nl> - if ( it = = actions_ . end ( ) ) { <nl> - it = actions_ <nl> - . emplace ( name , MakeOrphanable < XdsRoutingChild > ( <nl> - Ref ( DEBUG_LOCATION , " XdsRoutingChild " ) , name ) ) <nl> - . first ; <nl> - } <nl> - it - > second - > UpdateLocked ( config , args . addresses , args . args ) ; <nl> - } <nl> - } <nl> - <nl> - void XdsRoutingLb : : UpdateStateLocked ( ) { <nl> - / / Also count the number of children in each state , to determine the <nl> - / / overall state . <nl> - size_t num_ready = 0 ; <nl> - size_t num_connecting = 0 ; <nl> - size_t num_idle = 0 ; <nl> - size_t num_transient_failures = 0 ; <nl> - for ( const auto & p : actions_ ) { <nl> - const auto & child_name = p . first ; <nl> - const XdsRoutingChild * child = p . second . get ( ) ; <nl> - / / Skip the actions that are not in the latest update . <nl> - if ( config_ - > action_map ( ) . find ( child_name ) = = config_ - > action_map ( ) . end ( ) ) { <nl> - continue ; <nl> - } <nl> - switch ( child - > connectivity_state ( ) ) { <nl> - case GRPC_CHANNEL_READY : { <nl> - + + num_ready ; <nl> - break ; <nl> - } <nl> - case GRPC_CHANNEL_CONNECTING : { <nl> - + + num_connecting ; <nl> - break ; <nl> - } <nl> - case GRPC_CHANNEL_IDLE : { <nl> - + + num_idle ; <nl> - break ; <nl> - } <nl> - case GRPC_CHANNEL_TRANSIENT_FAILURE : { <nl> - + + num_transient_failures ; <nl> - break ; <nl> - } <nl> - default : <nl> - GPR_UNREACHABLE_CODE ( return ) ; <nl> - } <nl> - } <nl> - / / Determine aggregated connectivity state . <nl> - grpc_connectivity_state connectivity_state ; <nl> - if ( num_ready > 0 ) { <nl> - connectivity_state = GRPC_CHANNEL_READY ; <nl> - } else if ( num_connecting > 0 ) { <nl> - connectivity_state = GRPC_CHANNEL_CONNECTING ; <nl> - } else if ( num_idle > 0 ) { <nl> - connectivity_state = GRPC_CHANNEL_IDLE ; <nl> - } else { <nl> - connectivity_state = GRPC_CHANNEL_TRANSIENT_FAILURE ; <nl> - } <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_routing_lb_trace ) ) { <nl> - gpr_log ( GPR_INFO , " [ xds_routing_lb % p ] connectivity changed to % s " , this , <nl> - ConnectivityStateName ( connectivity_state ) ) ; <nl> - } <nl> - std : : unique_ptr < SubchannelPicker > picker ; <nl> - absl : : Status status ; <nl> - switch ( connectivity_state ) { <nl> - case GRPC_CHANNEL_READY : { <nl> - RoutePicker : : RouteTable route_table ; <nl> - for ( const auto & config_route : config_ - > route_table ( ) ) { <nl> - RoutePicker : : Route route ; <nl> - route . matchers = & config_route . matchers ; <nl> - route . picker = actions_ [ config_route . action ] - > picker_wrapper ( ) ; <nl> - if ( route . picker = = nullptr ) { <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_routing_lb_trace ) ) { <nl> - gpr_log ( GPR_INFO , <nl> - " [ xds_routing_lb % p ] child % s has not yet returned a " <nl> - " picker ; creating a QueuePicker . " , <nl> - this , config_route . action . c_str ( ) ) ; <nl> - } <nl> - route . picker = MakeRefCounted < ChildPickerWrapper > ( <nl> - config_route . action , absl : : make_unique < QueuePicker > ( <nl> - Ref ( DEBUG_LOCATION , " QueuePicker " ) ) ) ; <nl> - } <nl> - route_table . push_back ( std : : move ( route ) ) ; <nl> - } <nl> - picker = absl : : make_unique < RoutePicker > ( std : : move ( route_table ) , config_ ) ; <nl> - break ; <nl> - } <nl> - case GRPC_CHANNEL_CONNECTING : <nl> - case GRPC_CHANNEL_IDLE : <nl> - picker = <nl> - absl : : make_unique < QueuePicker > ( Ref ( DEBUG_LOCATION , " QueuePicker " ) ) ; <nl> - break ; <nl> - default : <nl> - grpc_error * error = grpc_error_set_int ( <nl> - GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " TRANSIENT_FAILURE from XdsRoutingLb " ) , <nl> - GRPC_ERROR_INT_GRPC_STATUS , GRPC_STATUS_UNAVAILABLE ) ; <nl> - status = grpc_error_to_absl_status ( error ) ; <nl> - picker = absl : : make_unique < TransientFailurePicker > ( error ) ; <nl> - } <nl> - channel_control_helper ( ) - > UpdateState ( connectivity_state , status , <nl> - std : : move ( picker ) ) ; <nl> - } <nl> - <nl> - / / <nl> - / / XdsRoutingLb : : XdsRoutingChild <nl> - / / <nl> - <nl> - XdsRoutingLb : : XdsRoutingChild : : XdsRoutingChild ( <nl> - RefCountedPtr < XdsRoutingLb > xds_routing_policy , const std : : string & name ) <nl> - : xds_routing_policy_ ( std : : move ( xds_routing_policy ) ) , name_ ( name ) { <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_routing_lb_trace ) ) { <nl> - gpr_log ( GPR_INFO , " [ xds_routing_lb % p ] created XdsRoutingChild % p for % s " , <nl> - xds_routing_policy_ . get ( ) , this , name_ . c_str ( ) ) ; <nl> - } <nl> - GRPC_CLOSURE_INIT ( & on_delayed_removal_timer_ , OnDelayedRemovalTimer , this , <nl> - grpc_schedule_on_exec_ctx ) ; <nl> - } <nl> - <nl> - XdsRoutingLb : : XdsRoutingChild : : ~ XdsRoutingChild ( ) { <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_routing_lb_trace ) ) { <nl> - gpr_log ( GPR_INFO , <nl> - " [ xds_routing_lb % p ] XdsRoutingChild % p : destroying child " , <nl> - xds_routing_policy_ . get ( ) , this ) ; <nl> - } <nl> - xds_routing_policy_ . reset ( DEBUG_LOCATION , " XdsRoutingChild " ) ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : XdsRoutingChild : : Orphan ( ) { <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_routing_lb_trace ) ) { <nl> - gpr_log ( GPR_INFO , <nl> - " [ xds_routing_lb % p ] XdsRoutingChild % p % s : shutting down child " , <nl> - xds_routing_policy_ . get ( ) , this , name_ . c_str ( ) ) ; <nl> - } <nl> - / / Remove the child policy ' s interested_parties pollset_set from the <nl> - / / xDS policy . <nl> - grpc_pollset_set_del_pollset_set ( child_policy_ - > interested_parties ( ) , <nl> - xds_routing_policy_ - > interested_parties ( ) ) ; <nl> - child_policy_ . reset ( ) ; <nl> - / / Drop our ref to the child ' s picker , in case it ' s holding a ref to <nl> - / / the child . <nl> - picker_wrapper_ . reset ( ) ; <nl> - if ( delayed_removal_timer_callback_pending_ ) { <nl> - grpc_timer_cancel ( & delayed_removal_timer_ ) ; <nl> - } <nl> - shutdown_ = true ; <nl> - Unref ( ) ; <nl> - } <nl> - <nl> - OrphanablePtr < LoadBalancingPolicy > <nl> - XdsRoutingLb : : XdsRoutingChild : : CreateChildPolicyLocked ( <nl> - const grpc_channel_args * args ) { <nl> - LoadBalancingPolicy : : Args lb_policy_args ; <nl> - lb_policy_args . work_serializer = xds_routing_policy_ - > work_serializer ( ) ; <nl> - lb_policy_args . args = args ; <nl> - lb_policy_args . channel_control_helper = <nl> - absl : : make_unique < Helper > ( this - > Ref ( DEBUG_LOCATION , " Helper " ) ) ; <nl> - OrphanablePtr < LoadBalancingPolicy > lb_policy = <nl> - MakeOrphanable < ChildPolicyHandler > ( std : : move ( lb_policy_args ) , <nl> - & grpc_xds_routing_lb_trace ) ; <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_routing_lb_trace ) ) { <nl> - gpr_log ( GPR_INFO , <nl> - " [ xds_routing_lb % p ] XdsRoutingChild % p % s : Created new child " <nl> - " policy handler % p " , <nl> - xds_routing_policy_ . get ( ) , this , name_ . c_str ( ) , lb_policy . get ( ) ) ; <nl> - } <nl> - / / Add the xDS ' s interested_parties pollset_set to that of the newly created <nl> - / / child policy . This will make the child policy progress upon activity on <nl> - / / xDS LB , which in turn is tied to the application ' s call . <nl> - grpc_pollset_set_add_pollset_set ( lb_policy - > interested_parties ( ) , <nl> - xds_routing_policy_ - > interested_parties ( ) ) ; <nl> - return lb_policy ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : XdsRoutingChild : : UpdateLocked ( <nl> - RefCountedPtr < LoadBalancingPolicy : : Config > config , <nl> - const ServerAddressList & addresses , const grpc_channel_args * args ) { <nl> - if ( xds_routing_policy_ - > shutting_down_ ) return ; <nl> - / / Update child weight . <nl> - / / Reactivate if needed . <nl> - if ( delayed_removal_timer_callback_pending_ ) { <nl> - delayed_removal_timer_callback_pending_ = false ; <nl> - grpc_timer_cancel ( & delayed_removal_timer_ ) ; <nl> - } <nl> - / / Create child policy if needed . <nl> - if ( child_policy_ = = nullptr ) { <nl> - child_policy_ = CreateChildPolicyLocked ( args ) ; <nl> - } <nl> - / / Construct update args . <nl> - UpdateArgs update_args ; <nl> - update_args . config = std : : move ( config ) ; <nl> - update_args . addresses = addresses ; <nl> - update_args . args = grpc_channel_args_copy ( args ) ; <nl> - / / Update the policy . <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_routing_lb_trace ) ) { <nl> - gpr_log ( GPR_INFO , <nl> - " [ xds_routing_lb % p ] XdsRoutingChild % p % s : Updating child " <nl> - " policy handler % p " , <nl> - xds_routing_policy_ . get ( ) , this , name_ . c_str ( ) , <nl> - child_policy_ . get ( ) ) ; <nl> - } <nl> - child_policy_ - > UpdateLocked ( std : : move ( update_args ) ) ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : XdsRoutingChild : : ExitIdleLocked ( ) { <nl> - child_policy_ - > ExitIdleLocked ( ) ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : XdsRoutingChild : : ResetBackoffLocked ( ) { <nl> - child_policy_ - > ResetBackoffLocked ( ) ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : XdsRoutingChild : : DeactivateLocked ( ) { <nl> - / / If already deactivated , don ' t do that again . <nl> - if ( delayed_removal_timer_callback_pending_ = = true ) return ; <nl> - / / Set the child weight to 0 so that future picker won ' t contain this child . <nl> - / / Start a timer to delete the child . <nl> - Ref ( DEBUG_LOCATION , " XdsRoutingChild + timer " ) . release ( ) ; <nl> - grpc_timer_init ( <nl> - & delayed_removal_timer_ , <nl> - ExecCtx : : Get ( ) - > Now ( ) + GRPC_XDS_ROUTING_CHILD_RETENTION_INTERVAL_MS , <nl> - & on_delayed_removal_timer_ ) ; <nl> - delayed_removal_timer_callback_pending_ = true ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : XdsRoutingChild : : OnDelayedRemovalTimer ( void * arg , <nl> - grpc_error * error ) { <nl> - XdsRoutingChild * self = static_cast < XdsRoutingChild * > ( arg ) ; <nl> - GRPC_ERROR_REF ( error ) ; / / Ref owned by the lambda <nl> - self - > xds_routing_policy_ - > work_serializer ( ) - > Run ( <nl> - [ self , error ] ( ) { self - > OnDelayedRemovalTimerLocked ( error ) ; } , <nl> - DEBUG_LOCATION ) ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : XdsRoutingChild : : OnDelayedRemovalTimerLocked ( <nl> - grpc_error * error ) { <nl> - delayed_removal_timer_callback_pending_ = false ; <nl> - if ( error = = GRPC_ERROR_NONE & & ! shutdown_ ) { <nl> - xds_routing_policy_ - > actions_ . erase ( name_ ) ; <nl> - } <nl> - Unref ( DEBUG_LOCATION , " XdsRoutingChild + timer " ) ; <nl> - GRPC_ERROR_UNREF ( error ) ; <nl> - } <nl> - <nl> - / / <nl> - / / XdsRoutingLb : : XdsRoutingChild : : Helper <nl> - / / <nl> - <nl> - RefCountedPtr < SubchannelInterface > <nl> - XdsRoutingLb : : XdsRoutingChild : : Helper : : CreateSubchannel ( <nl> - const grpc_channel_args & args ) { <nl> - if ( xds_routing_child_ - > xds_routing_policy_ - > shutting_down_ ) return nullptr ; <nl> - return xds_routing_child_ - > xds_routing_policy_ - > channel_control_helper ( ) <nl> - - > CreateSubchannel ( args ) ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : XdsRoutingChild : : Helper : : UpdateState ( <nl> - grpc_connectivity_state state , const absl : : Status & status , <nl> - std : : unique_ptr < SubchannelPicker > picker ) { <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_routing_lb_trace ) ) { <nl> - gpr_log ( GPR_INFO , <nl> - " [ xds_routing_lb % p ] child % s : received update : state = % s ( % s ) " <nl> - " picker = % p " , <nl> - xds_routing_child_ - > xds_routing_policy_ . get ( ) , <nl> - xds_routing_child_ - > name_ . c_str ( ) , ConnectivityStateName ( state ) , <nl> - status . ToString ( ) . c_str ( ) , picker . get ( ) ) ; <nl> - } <nl> - if ( xds_routing_child_ - > xds_routing_policy_ - > shutting_down_ ) return ; <nl> - / / Cache the picker in the XdsRoutingChild . <nl> - xds_routing_child_ - > picker_wrapper_ = MakeRefCounted < ChildPickerWrapper > ( <nl> - xds_routing_child_ - > name_ , std : : move ( picker ) ) ; <nl> - / / Decide what state to report for aggregation purposes . <nl> - / / If we haven ' t seen a failure since the last time we were in state <nl> - / / READY , then we report the state change as - is . However , once we do see <nl> - / / a failure , we report TRANSIENT_FAILURE and ignore any subsequent state <nl> - / / changes until we go back into state READY . <nl> - if ( ! xds_routing_child_ - > seen_failure_since_ready_ ) { <nl> - if ( state = = GRPC_CHANNEL_TRANSIENT_FAILURE ) { <nl> - xds_routing_child_ - > seen_failure_since_ready_ = true ; <nl> - } <nl> - } else { <nl> - if ( state ! = GRPC_CHANNEL_READY ) return ; <nl> - xds_routing_child_ - > seen_failure_since_ready_ = false ; <nl> - } <nl> - xds_routing_child_ - > connectivity_state_ = state ; <nl> - / / Notify the LB policy . <nl> - xds_routing_child_ - > xds_routing_policy_ - > UpdateStateLocked ( ) ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : XdsRoutingChild : : Helper : : RequestReresolution ( ) { <nl> - if ( xds_routing_child_ - > xds_routing_policy_ - > shutting_down_ ) return ; <nl> - xds_routing_child_ - > xds_routing_policy_ - > channel_control_helper ( ) <nl> - - > RequestReresolution ( ) ; <nl> - } <nl> - <nl> - void XdsRoutingLb : : XdsRoutingChild : : Helper : : AddTraceEvent ( <nl> - TraceSeverity severity , absl : : string_view message ) { <nl> - if ( xds_routing_child_ - > xds_routing_policy_ - > shutting_down_ ) return ; <nl> - xds_routing_child_ - > xds_routing_policy_ - > channel_control_helper ( ) <nl> - - > AddTraceEvent ( severity , message ) ; <nl> - } <nl> - <nl> - / / <nl> - / / factory <nl> - / / <nl> - <nl> - class XdsRoutingLbFactory : public LoadBalancingPolicyFactory { <nl> - public : <nl> - OrphanablePtr < LoadBalancingPolicy > CreateLoadBalancingPolicy ( <nl> - LoadBalancingPolicy : : Args args ) const override { <nl> - return MakeOrphanable < XdsRoutingLb > ( std : : move ( args ) ) ; <nl> - } <nl> - <nl> - const char * name ( ) const override { return kXdsRouting ; } <nl> - <nl> - RefCountedPtr < LoadBalancingPolicy : : Config > ParseLoadBalancingConfig ( <nl> - const Json & json , grpc_error * * error ) const override { <nl> - GPR_DEBUG_ASSERT ( error ! = nullptr & & * error = = GRPC_ERROR_NONE ) ; <nl> - if ( json . type ( ) = = Json : : Type : : JSON_NULL ) { <nl> - / / xds_routing was mentioned as a policy in the deprecated <nl> - / / loadBalancingPolicy field or in the client API . <nl> - * error = GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : loadBalancingPolicy error : xds_routing policy requires " <nl> - " configuration . Please use loadBalancingConfig field of service " <nl> - " config instead . " ) ; <nl> - return nullptr ; <nl> - } <nl> - std : : vector < grpc_error * > error_list ; <nl> - / / action map . <nl> - XdsRoutingLbConfig : : ActionMap action_map ; <nl> - std : : set < std : : string / * action_name * / > actions_to_be_used ; <nl> - auto it = json . object_value ( ) . find ( " actions " ) ; <nl> - if ( it = = json . object_value ( ) . end ( ) ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : actions error : required field not present " ) ) ; <nl> - } else if ( it - > second . type ( ) ! = Json : : Type : : OBJECT ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : actions error : type should be object " ) ) ; <nl> - } else { <nl> - for ( const auto & p : it - > second . object_value ( ) ) { <nl> - if ( p . first . empty ( ) ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : actions element error : name cannot be empty " ) ) ; <nl> - continue ; <nl> - } <nl> - RefCountedPtr < LoadBalancingPolicy : : Config > child_config ; <nl> - std : : vector < grpc_error * > child_errors = <nl> - ParseChildConfig ( p . second , & child_config ) ; <nl> - if ( ! child_errors . empty ( ) ) { <nl> - / / Can ' t use GRPC_ERROR_CREATE_FROM_VECTOR ( ) here , because the error <nl> - / / string is not static in this case . <nl> - grpc_error * error = GRPC_ERROR_CREATE_FROM_COPIED_STRING ( <nl> - absl : : StrCat ( " field : actions name : " , p . first ) . c_str ( ) ) ; <nl> - for ( grpc_error * child_error : child_errors ) { <nl> - error = grpc_error_add_child ( error , child_error ) ; <nl> - } <nl> - error_list . push_back ( error ) ; <nl> - } else { <nl> - action_map [ p . first ] = std : : move ( child_config ) ; <nl> - actions_to_be_used . insert ( p . first ) ; <nl> - } <nl> - } <nl> - } <nl> - if ( action_map . empty ( ) ) { <nl> - error_list . push_back ( <nl> - GRPC_ERROR_CREATE_FROM_STATIC_STRING ( " no valid actions configured " ) ) ; <nl> - } <nl> - XdsRoutingLbConfig : : RouteTable route_table ; <nl> - it = json . object_value ( ) . find ( " routes " ) ; <nl> - if ( it = = json . object_value ( ) . end ( ) ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : routes error : required field not present " ) ) ; <nl> - } else if ( it - > second . type ( ) ! = Json : : Type : : ARRAY ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : routes error : type should be array " ) ) ; <nl> - } else { <nl> - const Json : : Array & array = it - > second . array_value ( ) ; <nl> - for ( size_t i = 0 ; i < array . size ( ) ; + + i ) { <nl> - XdsRoutingLbConfig : : Route route ; <nl> - std : : vector < grpc_error * > route_errors = <nl> - ParseRoute ( array [ i ] , action_map , & route , & actions_to_be_used ) ; <nl> - if ( ! route_errors . empty ( ) ) { <nl> - / / Can ' t use GRPC_ERROR_CREATE_FROM_VECTOR ( ) here , because the error <nl> - / / string is not static in this case . <nl> - grpc_error * error = GRPC_ERROR_CREATE_FROM_COPIED_STRING ( <nl> - absl : : StrCat ( " field : routes element : " , i , " error " ) . c_str ( ) ) ; <nl> - for ( grpc_error * route_error : route_errors ) { <nl> - error = grpc_error_add_child ( error , route_error ) ; <nl> - } <nl> - error_list . push_back ( error ) ; <nl> - } <nl> - route_table . emplace_back ( std : : move ( route ) ) ; <nl> - } <nl> - } <nl> - if ( route_table . empty ( ) ) { <nl> - grpc_error * error = <nl> - GRPC_ERROR_CREATE_FROM_STATIC_STRING ( " no valid routes configured " ) ; <nl> - error_list . push_back ( error ) ; <nl> - } <nl> - if ( ! actions_to_be_used . empty ( ) ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " some actions were not referenced by any route " ) ) ; <nl> - } <nl> - if ( ! error_list . empty ( ) ) { <nl> - * error = GRPC_ERROR_CREATE_FROM_VECTOR ( <nl> - " xds_routing_experimental LB policy config " , & error_list ) ; <nl> - return nullptr ; <nl> - } <nl> - return MakeRefCounted < XdsRoutingLbConfig > ( std : : move ( action_map ) , <nl> - std : : move ( route_table ) ) ; <nl> - } <nl> - <nl> - private : <nl> - static std : : vector < grpc_error * > ParseChildConfig ( <nl> - const Json & json , <nl> - RefCountedPtr < LoadBalancingPolicy : : Config > * child_config ) { <nl> - std : : vector < grpc_error * > error_list ; <nl> - if ( json . type ( ) ! = Json : : Type : : OBJECT ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " value should be of type object " ) ) ; <nl> - return error_list ; <nl> - } <nl> - auto it = json . object_value ( ) . find ( " childPolicy " ) ; <nl> - if ( it = = json . object_value ( ) . end ( ) ) { <nl> - error_list . push_back ( <nl> - GRPC_ERROR_CREATE_FROM_STATIC_STRING ( " did not find childPolicy " ) ) ; <nl> - } else { <nl> - grpc_error * parse_error = GRPC_ERROR_NONE ; <nl> - * child_config = LoadBalancingPolicyRegistry : : ParseLoadBalancingConfig ( <nl> - it - > second , & parse_error ) ; <nl> - if ( * child_config = = nullptr ) { <nl> - GPR_DEBUG_ASSERT ( parse_error ! = GRPC_ERROR_NONE ) ; <nl> - std : : vector < grpc_error * > child_errors ; <nl> - child_errors . push_back ( parse_error ) ; <nl> - error_list . push_back ( <nl> - GRPC_ERROR_CREATE_FROM_VECTOR ( " field : childPolicy " , & child_errors ) ) ; <nl> - } <nl> - } <nl> - return error_list ; <nl> - } <nl> - <nl> - static std : : vector < grpc_error * > ParseRoute ( <nl> - const Json & json , const XdsRoutingLbConfig : : ActionMap & action_map , <nl> - XdsRoutingLbConfig : : Route * route , <nl> - std : : set < std : : string / * action_name * / > * actions_to_be_used ) { <nl> - std : : vector < grpc_error * > error_list ; <nl> - if ( json . type ( ) ! = Json : : Type : : OBJECT ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " value should be of type object " ) ) ; <nl> - return error_list ; <nl> - } <nl> - / / Parse and ensure one and only one path matcher is set : prefix , path , or <nl> - / / regex . <nl> - bool path_matcher_seen = false ; <nl> - auto it = json . object_value ( ) . find ( " prefix " ) ; <nl> - if ( it ! = json . object_value ( ) . end ( ) ) { <nl> - if ( it - > second . type ( ) ! = Json : : Type : : STRING ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : prefix error : should be string " ) ) ; <nl> - } else { <nl> - path_matcher_seen = true ; <nl> - route - > matchers . path_matcher . type = <nl> - XdsApi : : Route : : Matchers : : PathMatcher : : PathMatcherType : : PREFIX ; <nl> - route - > matchers . path_matcher . string_matcher = it - > second . string_value ( ) ; <nl> - } <nl> - } <nl> - it = json . object_value ( ) . find ( " path " ) ; <nl> - if ( it ! = json . object_value ( ) . end ( ) ) { <nl> - if ( path_matcher_seen ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : path error : other path matcher already specified " ) ) ; <nl> - } else { <nl> - path_matcher_seen = true ; <nl> - if ( it - > second . type ( ) ! = Json : : Type : : STRING ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : path error : should be string " ) ) ; <nl> - } else { <nl> - route - > matchers . path_matcher . type = <nl> - XdsApi : : Route : : Matchers : : PathMatcher : : PathMatcherType : : PATH ; <nl> - route - > matchers . path_matcher . string_matcher = <nl> - it - > second . string_value ( ) ; <nl> - } <nl> - } <nl> - } <nl> - it = json . object_value ( ) . find ( " regex " ) ; <nl> - if ( it ! = json . object_value ( ) . end ( ) ) { <nl> - if ( path_matcher_seen ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : regex error : other path matcher already specified " ) ) ; <nl> - } else { <nl> - path_matcher_seen = true ; <nl> - if ( it - > second . type ( ) ! = Json : : Type : : STRING ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : regex error : should be string " ) ) ; <nl> - } else { <nl> - route - > matchers . path_matcher . type = <nl> - XdsApi : : Route : : Matchers : : PathMatcher : : PathMatcherType : : REGEX ; <nl> - route - > matchers . path_matcher . regex_matcher = <nl> - absl : : make_unique < RE2 > ( it - > second . string_value ( ) ) ; <nl> - } <nl> - } <nl> - } <nl> - if ( ! path_matcher_seen ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " one path matcher : prefix , path , or regex is required " ) ) ; <nl> - } <nl> - / / Parse Header Matcher : headers . <nl> - it = json . object_value ( ) . find ( " headers " ) ; <nl> - if ( it ! = json . object_value ( ) . end ( ) ) { <nl> - if ( it - > second . type ( ) ! = Json : : Type : : ARRAY ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : headers error : should be array " ) ) ; <nl> - } else { <nl> - const Json : : Array & array = it - > second . array_value ( ) ; <nl> - for ( size_t i = 0 ; i < array . size ( ) ; + + i ) { <nl> - const Json & header_json = array [ i ] ; <nl> - if ( header_json . type ( ) ! = Json : : Type : : OBJECT ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " value should be of type object " ) ) ; <nl> - } else { <nl> - route - > matchers . header_matchers . emplace_back ( ) ; <nl> - XdsApi : : Route : : Matchers : : HeaderMatcher & header_matcher = <nl> - route - > matchers . header_matchers . back ( ) ; <nl> - auto header_it = header_json . object_value ( ) . find ( " name " ) ; <nl> - if ( header_it = = header_json . object_value ( ) . end ( ) ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : name error : required field missing " ) ) ; <nl> - } else { <nl> - if ( header_it - > second . type ( ) ! = Json : : Type : : STRING ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : name error : should be string " ) ) ; <nl> - } else { <nl> - header_matcher . name = header_it - > second . string_value ( ) ; <nl> - } <nl> - } <nl> - header_it = header_json . object_value ( ) . find ( " invert_match " ) ; <nl> - if ( header_it ! = header_json . object_value ( ) . end ( ) ) { <nl> - if ( header_it - > second . type ( ) = = Json : : Type : : JSON_TRUE ) { <nl> - header_matcher . invert_match = true ; <nl> - } else if ( header_it - > second . type ( ) = = Json : : Type : : JSON_FALSE ) { <nl> - header_matcher . invert_match = false ; <nl> - } else { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : present_match error : should be boolean " ) ) ; <nl> - } <nl> - } <nl> - / / Parse and ensure one and only one header matcher is set per <nl> - / / header matcher . <nl> - bool header_matcher_seen = false ; <nl> - header_it = header_json . object_value ( ) . find ( " exact_match " ) ; <nl> - if ( header_it ! = header_json . object_value ( ) . end ( ) ) { <nl> - header_matcher_seen = true ; <nl> - if ( header_it - > second . type ( ) ! = Json : : Type : : STRING ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : exact_match error : should be string " ) ) ; <nl> - } else { <nl> - header_matcher . type = XdsApi : : Route : : Matchers : : HeaderMatcher : : <nl> - HeaderMatcherType : : EXACT ; <nl> - header_matcher . string_matcher = <nl> - header_it - > second . string_value ( ) ; <nl> - } <nl> - } <nl> - header_it = header_json . object_value ( ) . find ( " regex_match " ) ; <nl> - if ( header_it ! = header_json . object_value ( ) . end ( ) ) { <nl> - if ( header_matcher_seen ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : regex_match error : other header matcher already " <nl> - " specified " ) ) ; <nl> - } else { <nl> - header_matcher_seen = true ; <nl> - if ( header_it - > second . type ( ) ! = Json : : Type : : STRING ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : regex_match error : should be string " ) ) ; <nl> - } else { <nl> - header_matcher . type = XdsApi : : Route : : Matchers : : HeaderMatcher : : <nl> - HeaderMatcherType : : REGEX ; <nl> - header_matcher . regex_match = <nl> - absl : : make_unique < RE2 > ( header_it - > second . string_value ( ) ) ; <nl> - } <nl> - } <nl> - } <nl> - header_it = header_json . object_value ( ) . find ( " range_match " ) ; <nl> - if ( header_it ! = header_json . object_value ( ) . end ( ) ) { <nl> - if ( header_matcher_seen ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : range_match error : other header matcher already " <nl> - " specified " ) ) ; <nl> - } else { <nl> - header_matcher_seen = true ; <nl> - if ( header_it - > second . type ( ) ! = Json : : Type : : OBJECT ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : range_match error : should be object " ) ) ; <nl> - } else { <nl> - auto range_it = <nl> - header_it - > second . object_value ( ) . find ( " start " ) ; <nl> - if ( range_it ! = header_it - > second . object_value ( ) . end ( ) ) { <nl> - if ( range_it - > second . type ( ) ! = Json : : Type : : NUMBER ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : start error : should be of number " ) ) ; <nl> - } else { <nl> - header_matcher . range_start = gpr_parse_nonnegative_int ( <nl> - range_it - > second . string_value ( ) . c_str ( ) ) ; <nl> - } <nl> - } else { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : start missing " ) ) ; <nl> - } <nl> - range_it = header_it - > second . object_value ( ) . find ( " end " ) ; <nl> - if ( range_it ! = header_it - > second . object_value ( ) . end ( ) ) { <nl> - if ( range_it - > second . type ( ) ! = Json : : Type : : NUMBER ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : end error : should be of number " ) ) ; <nl> - } else { <nl> - header_matcher . range_end = gpr_parse_nonnegative_int ( <nl> - range_it - > second . string_value ( ) . c_str ( ) ) ; <nl> - } <nl> - } else { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : end missing " ) ) ; <nl> - } <nl> - if ( header_matcher . range_end > header_matcher . range_start ) { <nl> - header_matcher . type = XdsApi : : Route : : Matchers : : <nl> - HeaderMatcher : : HeaderMatcherType : : RANGE ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - header_it = header_json . object_value ( ) . find ( " present_match " ) ; <nl> - if ( header_it ! = header_json . object_value ( ) . end ( ) ) { <nl> - if ( header_matcher_seen ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : present_match error : other header matcher already " <nl> - " specified " ) ) ; <nl> - } else { <nl> - header_matcher_seen = true ; <nl> - if ( header_it - > second . type ( ) = = Json : : Type : : JSON_TRUE ) { <nl> - header_matcher . type = XdsApi : : Route : : Matchers : : HeaderMatcher : : <nl> - HeaderMatcherType : : PRESENT ; <nl> - header_matcher . present_match = true ; <nl> - } else if ( header_it - > second . type ( ) = = Json : : Type : : JSON_FALSE ) { <nl> - header_matcher . type = XdsApi : : Route : : Matchers : : HeaderMatcher : : <nl> - HeaderMatcherType : : PRESENT ; <nl> - header_matcher . present_match = false ; <nl> - } else { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : present_match error : should be boolean " ) ) ; <nl> - } <nl> - } <nl> - } <nl> - header_it = header_json . object_value ( ) . find ( " prefix_match " ) ; <nl> - if ( header_it ! = header_json . object_value ( ) . end ( ) ) { <nl> - if ( header_matcher_seen ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : prefix_match error : other header matcher already " <nl> - " specified " ) ) ; <nl> - } else { <nl> - header_matcher_seen = true ; <nl> - if ( header_it - > second . type ( ) ! = Json : : Type : : STRING ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : prefix_match error : should be string " ) ) ; <nl> - } else { <nl> - header_matcher . type = XdsApi : : Route : : Matchers : : HeaderMatcher : : <nl> - HeaderMatcherType : : PREFIX ; <nl> - header_matcher . string_matcher = <nl> - header_it - > second . string_value ( ) ; <nl> - } <nl> - } <nl> - } <nl> - header_it = header_json . object_value ( ) . find ( " suffix_match " ) ; <nl> - if ( header_it ! = header_json . object_value ( ) . end ( ) ) { <nl> - if ( header_matcher_seen ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : suffix_match error : other header matcher already " <nl> - " specified " ) ) ; <nl> - } else { <nl> - header_matcher_seen = true ; <nl> - if ( header_it - > second . type ( ) ! = Json : : Type : : STRING ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : suffix_match error : should be string " ) ) ; <nl> - } else { <nl> - header_matcher . type = XdsApi : : Route : : Matchers : : HeaderMatcher : : <nl> - HeaderMatcherType : : SUFFIX ; <nl> - header_matcher . string_matcher = <nl> - header_it - > second . string_value ( ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - } <nl> - } <nl> - } <nl> - / / Parse Fraction numerator . <nl> - it = json . object_value ( ) . find ( " match_fraction " ) ; <nl> - if ( it ! = json . object_value ( ) . end ( ) ) { <nl> - if ( it - > second . type ( ) ! = Json : : Type : : NUMBER ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : match_fraction error : must be of type number " ) ) ; <nl> - } else { <nl> - route - > matchers . fraction_per_million = <nl> - gpr_parse_nonnegative_int ( it - > second . string_value ( ) . c_str ( ) ) ; <nl> - } <nl> - } <nl> - / / Parse action . <nl> - it = json . object_value ( ) . find ( " action " ) ; <nl> - if ( it = = json . object_value ( ) . end ( ) ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : action error : required field missing " ) ) ; <nl> - } else if ( it - > second . type ( ) ! = Json : : Type : : STRING ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : action error : should be of type string " ) ) ; <nl> - } else { <nl> - route - > action = it - > second . string_value ( ) ; <nl> - if ( route - > action . empty ( ) ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - " field : action error : cannot be empty " ) ) ; <nl> - } else { <nl> - / / Validate action exists and mark it as used . <nl> - if ( action_map . find ( route - > action ) = = action_map . end ( ) ) { <nl> - error_list . push_back ( GRPC_ERROR_CREATE_FROM_STATIC_STRING ( <nl> - absl : : StrCat ( " field : action error : " , route - > action , <nl> - " does not exist " ) <nl> - . c_str ( ) ) ) ; <nl> - } <nl> - actions_to_be_used - > erase ( route - > action ) ; <nl> - } <nl> - } <nl> - return error_list ; <nl> - } <nl> - } ; <nl> - <nl> - } / / namespace <nl> - <nl> - } / / namespace grpc_core <nl> - <nl> - / / <nl> - / / Plugin registration <nl> - / / <nl> - <nl> - void grpc_lb_policy_xds_routing_init ( ) { <nl> - grpc_core : : LoadBalancingPolicyRegistry : : Builder : : <nl> - RegisterLoadBalancingPolicyFactory ( <nl> - absl : : make_unique < grpc_core : : XdsRoutingLbFactory > ( ) ) ; <nl> - } <nl> - <nl> - void grpc_lb_policy_xds_routing_shutdown ( ) { } <nl> mmm a / src / core / ext / filters / client_channel / resolver / xds / xds_resolver . cc <nl> ppp b / src / core / ext / filters / client_channel / resolver / xds / xds_resolver . cc <nl> <nl> <nl> # include < grpc / support / port_platform . h > <nl> <nl> + # include " absl / strings / match . h " <nl> # include " absl / strings / str_join . h " <nl> + # include " absl / strings / str_split . h " <nl> + # include " re2 / re2 . h " <nl> <nl> # include " src / core / ext / filters / client_channel / config_selector . h " <nl> # include " src / core / ext / filters / client_channel / resolver_registry . h " <nl> namespace grpc_core { <nl> <nl> TraceFlag grpc_xds_resolver_trace ( false , " xds_resolver " ) ; <nl> <nl> + const char * kXdsClusterAttribute = " xds_cluster_name " ; <nl> + <nl> namespace { <nl> <nl> / / <nl> class XdsResolver : public Resolver { <nl> : Resolver ( std : : move ( args . work_serializer ) , <nl> std : : move ( args . result_handler ) ) , <nl> args_ ( grpc_channel_args_copy ( args . args ) ) , <nl> - interested_parties_ ( args . pollset_set ) , <nl> - config_selector_ ( MakeRefCounted < XdsConfigSelector > ( ) ) { <nl> + interested_parties_ ( args . pollset_set ) { <nl> char * path = args . uri - > path ; <nl> if ( path [ 0 ] = = ' / ' ) + + path ; <nl> server_name_ = path ; <nl> class XdsResolver : public Resolver { <nl> RefCountedPtr < XdsResolver > resolver_ ; <nl> } ; <nl> <nl> - class XdsConfigSelector : public ConfigSelector { <nl> + class ClusterState <nl> + : public RefCounted < ClusterState , PolymorphicRefCount , false > { <nl> public : <nl> - CallConfig GetCallConfig ( GetCallConfigArgs args ) override { <nl> - return CallConfig ( ) ; <nl> - } <nl> + using ClusterStateMap = <nl> + std : : map < std : : string , std : : unique_ptr < ClusterState > > ; <nl> + <nl> + ClusterState ( const std : : string & cluster_name , <nl> + ClusterStateMap * cluster_state_map ) <nl> + : it_ ( cluster_state_map <nl> + - > emplace ( cluster_name , std : : unique_ptr < ClusterState > ( this ) ) <nl> + . first ) { } <nl> + const std : : string & cluster ( ) const { return it_ - > first ; } <nl> + <nl> + private : <nl> + ClusterStateMap : : iterator it_ ; <nl> } ; <nl> <nl> - / / Returns the weighted_clusters action name to use from <nl> - / / weighted_cluster_index_map_ for a WeightedClusters route action . <nl> - std : : string WeightedClustersActionName ( <nl> - const std : : vector < XdsApi : : Route : : ClusterWeight > & weighted_clusters ) ; <nl> + class XdsConfigSelector : public ConfigSelector { <nl> + public : <nl> + XdsConfigSelector ( RefCountedPtr < XdsResolver > resolver , <nl> + const std : : vector < XdsApi : : Route > & routes ) ; <nl> + ~ XdsConfigSelector ( ) ; <nl> + CallConfig GetCallConfig ( GetCallConfigArgs args ) override ; <nl> <nl> - / / Updates weighted_cluster_index_map_ that will <nl> - / / determine the names of the WeightedCluster actions for the current update . <nl> - void UpdateWeightedClusterIndexMap ( const std : : vector < XdsApi : : Route > & routes ) ; <nl> + private : <nl> + struct Route { <nl> + XdsApi : : Route route ; <nl> + absl : : InlinedVector < std : : pair < uint32_t , absl : : string_view > , 2 > <nl> + weighted_cluster_state ; <nl> + } ; <nl> + using RouteTable = std : : vector < Route > ; <nl> + <nl> + void MaybeAddCluster ( const std : : string & name ) ; <nl> <nl> - / / Create the service config generated by the list of routes . <nl> - grpc_error * CreateServiceConfig ( const std : : vector < XdsApi : : Route > & routes , <nl> - RefCountedPtr < ServiceConfig > * service_config ) ; <nl> + RefCountedPtr < XdsResolver > resolver_ ; <nl> + RouteTable route_table_ ; <nl> + std : : map < absl : : string_view , RefCountedPtr < ClusterState > > clusters_ ; <nl> + } ; <nl> + <nl> + void OnListenerChanged ( std : : vector < XdsApi : : Route > routes ) ; <nl> + grpc_error * CreateServiceConfig ( RefCountedPtr < ServiceConfig > * service_config ) ; <nl> + void OnError ( grpc_error * error ) ; <nl> + void PropagateUpdate ( ) ; <nl> + void MaybeRemoveUnusedClusters ( ) ; <nl> <nl> std : : string server_name_ ; <nl> const grpc_channel_args * args_ ; <nl> grpc_pollset_set * interested_parties_ ; <nl> OrphanablePtr < XdsClient > xds_client_ ; <nl> - RefCountedPtr < XdsConfigSelector > config_selector_ ; <nl> - <nl> - / / 2 - level map to store WeightedCluster action names . <nl> - / / Top level map is keyed by cluster names without weight like a_b_c ; bottom <nl> - / / level map is keyed by cluster names + weights like a10_b50_c40 . <nl> - struct ClusterNamesInfo { <nl> - uint64_t next_index = 0 ; <nl> - std : : map < std : : string / * cluster names + weights * / , <nl> - uint64_t / * policy index number * / > <nl> - cluster_weights_map ; <nl> - } ; <nl> - using WeightedClusterIndexMap = <nl> - std : : map < std : : string / * cluster names * / , ClusterNamesInfo > ; <nl> - <nl> - / / Cache of action names for WeightedCluster targets in the current <nl> - / / service config . <nl> - WeightedClusterIndexMap weighted_cluster_index_map_ ; <nl> + ClusterState : : ClusterStateMap cluster_state_map_ ; <nl> + std : : vector < XdsApi : : Route > current_update_ ; <nl> } ; <nl> <nl> / / <nl> void XdsResolver : : ListenerWatcher : : OnListenerChanged ( <nl> gpr_log ( GPR_INFO , " [ xds_resolver % p ] received updated listener data " , <nl> resolver_ . get ( ) ) ; <nl> } <nl> - Result result ; <nl> - grpc_error * error = <nl> - resolver_ - > CreateServiceConfig ( routes , & result . service_config ) ; <nl> - if ( error ! = GRPC_ERROR_NONE ) { <nl> - OnError ( error ) ; <nl> - return ; <nl> - } <nl> - if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_resolver_trace ) ) { <nl> - gpr_log ( GPR_INFO , " [ xds_resolver % p ] generated service config : % s " , <nl> - resolver_ . get ( ) , result . service_config - > json_string ( ) . c_str ( ) ) ; <nl> - } <nl> - grpc_arg new_args [ ] = { <nl> - resolver_ - > xds_client_ - > MakeChannelArg ( ) , <nl> - resolver_ - > config_selector_ - > MakeChannelArg ( ) , <nl> - } ; <nl> - result . args = grpc_channel_args_copy_and_add ( resolver_ - > args_ , new_args , <nl> - GPR_ARRAY_SIZE ( new_args ) ) ; <nl> - resolver_ - > result_handler ( ) - > ReturnResult ( std : : move ( result ) ) ; <nl> + resolver_ - > OnListenerChanged ( std : : move ( routes ) ) ; <nl> } <nl> <nl> void XdsResolver : : ListenerWatcher : : OnError ( grpc_error * error ) { <nl> if ( resolver_ - > xds_client_ = = nullptr ) return ; <nl> gpr_log ( GPR_ERROR , " [ xds_resolver % p ] received error : % s " , resolver_ . get ( ) , <nl> grpc_error_string ( error ) ) ; <nl> - grpc_arg xds_client_arg = resolver_ - > xds_client_ - > MakeChannelArg ( ) ; <nl> - Result result ; <nl> - result . args = <nl> - grpc_channel_args_copy_and_add ( resolver_ - > args_ , & xds_client_arg , 1 ) ; <nl> - result . service_config_error = error ; <nl> - resolver_ - > result_handler ( ) - > ReturnResult ( std : : move ( result ) ) ; <nl> + resolver_ - > OnError ( error ) ; <nl> } <nl> <nl> void XdsResolver : : ListenerWatcher : : OnResourceDoesNotExist ( ) { <nl> void XdsResolver : : ListenerWatcher : : OnResourceDoesNotExist ( ) { <nl> } <nl> <nl> / / <nl> - / / XdsResolver <nl> + / / XdsResolver : : XdsConfigSelector <nl> / / <nl> <nl> - void XdsResolver : : StartLocked ( ) { <nl> - grpc_error * error = GRPC_ERROR_NONE ; <nl> - xds_client_ = MakeOrphanable < XdsClient > ( <nl> - work_serializer ( ) , interested_parties_ , server_name_ , <nl> - absl : : make_unique < ListenerWatcher > ( Ref ( ) ) , * args_ , & error ) ; <nl> - if ( error ! = GRPC_ERROR_NONE ) { <nl> - gpr_log ( GPR_ERROR , <nl> - " Failed to create xds client - - channel will remain in " <nl> - " TRANSIENT_FAILURE : % s " , <nl> - grpc_error_string ( error ) ) ; <nl> - result_handler ( ) - > ReturnError ( error ) ; <nl> + XdsResolver : : XdsConfigSelector : : XdsConfigSelector ( <nl> + RefCountedPtr < XdsResolver > resolver , <nl> + const std : : vector < XdsApi : : Route > & routes ) <nl> + : resolver_ ( std : : move ( resolver ) ) { <nl> + / / 1 . Construct the route table <nl> + / / 2 Update resolver ' s cluster state map <nl> + / / 3 . Construct cluster list to hold on to entries in the cluster state <nl> + / / map . <nl> + / / Reserve the necessary entries up - front to avoid reallocation as we add <nl> + / / elements . This is necessary because the string_view in the entry ' s <nl> + / / weighted_cluster_state field points to the memory in the route field , so <nl> + / / moving the entry in a reallocation will cause the string_view to point to <nl> + / / invalid data . <nl> + route_table_ . reserve ( routes . size ( ) ) ; <nl> + for ( auto & route : routes ) { <nl> + route_table_ . emplace_back ( ) ; <nl> + auto & route_entry = route_table_ . back ( ) ; <nl> + route_entry . route = route ; <nl> + if ( route . weighted_clusters . empty ( ) ) { <nl> + MaybeAddCluster ( route . cluster_name ) ; <nl> + } else { <nl> + uint32_t end = 0 ; <nl> + for ( const auto & weighted_cluster : route_entry . route . weighted_clusters ) { <nl> + MaybeAddCluster ( weighted_cluster . name ) ; <nl> + end + = weighted_cluster . weight ; <nl> + route_entry . weighted_cluster_state . emplace_back ( end , <nl> + weighted_cluster . name ) ; <nl> + } <nl> + } <nl> } <nl> } <nl> <nl> - std : : string CreateServiceConfigActionCluster ( const std : : string & cluster_name ) { <nl> - return absl : : StrFormat ( <nl> - " \ " cds : % s \ " : { \ n " <nl> - " \ " childPolicy \ " : [ { \ n " <nl> - " \ " cds_experimental \ " : { \ n " <nl> - " \ " cluster \ " : \ " % s \ " \ n " <nl> - " } \ n " <nl> - " } ] \ n " <nl> - " } " , <nl> - cluster_name , cluster_name ) ; <nl> + XdsResolver : : XdsConfigSelector : : ~ XdsConfigSelector ( ) { <nl> + clusters_ . clear ( ) ; <nl> + resolver_ - > MaybeRemoveUnusedClusters ( ) ; <nl> } <nl> <nl> - std : : string CreateServiceConfigRoute ( const std : : string & action_name , <nl> - const XdsApi : : Route & route ) { <nl> - std : : vector < std : : string > headers ; <nl> - for ( const auto & header : route . matchers . header_matchers ) { <nl> - std : : string header_matcher ; <nl> - switch ( header . type ) { <nl> - case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : EXACT : <nl> - header_matcher = absl : : StrFormat ( " \ " exact_match \ " : \ " % s \ " " , <nl> - header . string_matcher ) ; <nl> - break ; <nl> - case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : REGEX : <nl> - header_matcher = absl : : StrFormat ( " \ " regex_match \ " : \ " % s \ " " , <nl> - header . regex_match - > pattern ( ) ) ; <nl> - break ; <nl> - case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : RANGE : <nl> - header_matcher = absl : : StrFormat ( <nl> - " \ " range_match \ " : { \ n " <nl> - " \ " start \ " : % d , \ n " <nl> - " \ " end \ " : % d \ n " <nl> - " } " , <nl> - header . range_start , header . range_end ) ; <nl> - break ; <nl> - case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : PRESENT : <nl> - header_matcher = <nl> - absl : : StrFormat ( " \ " present_match \ " : % s " , <nl> - header . present_match ? " true " : " false " ) ; <nl> - break ; <nl> - case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : PREFIX : <nl> - header_matcher = absl : : StrFormat ( <nl> - " \ " prefix_match \ " : \ " % s \ " " , header . string_matcher ) ; <nl> - break ; <nl> - case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : SUFFIX : <nl> - header_matcher = absl : : StrFormat ( <nl> - " \ " suffix_match \ " : \ " % s \ " " , header . string_matcher ) ; <nl> - break ; <nl> - default : <nl> - break ; <nl> - } <nl> - std : : vector < std : : string > header_parts ; <nl> - header_parts . push_back ( <nl> - absl : : StrFormat ( " { \ n " <nl> - " \ " name \ " : \ " % s \ " , \ n " , <nl> - header . name ) ) ; <nl> - header_parts . push_back ( header_matcher ) ; <nl> - if ( header . invert_match ) { <nl> - header_parts . push_back ( <nl> - absl : : StrFormat ( " , \ n " <nl> - " \ " invert_match \ " : true " ) ) ; <nl> + void XdsResolver : : XdsConfigSelector : : MaybeAddCluster ( const std : : string & name ) { <nl> + if ( clusters_ . find ( name ) = = clusters_ . end ( ) ) { <nl> + auto it = resolver_ - > cluster_state_map_ . find ( name ) ; <nl> + if ( it = = resolver_ - > cluster_state_map_ . end ( ) ) { <nl> + auto new_cluster_state = <nl> + MakeRefCounted < ClusterState > ( name , & resolver_ - > cluster_state_map_ ) ; <nl> + clusters_ [ new_cluster_state - > cluster ( ) ] = std : : move ( new_cluster_state ) ; <nl> + } else { <nl> + clusters_ [ it - > second - > cluster ( ) ] = it - > second - > Ref ( ) ; <nl> } <nl> - header_parts . push_back ( <nl> - absl : : StrFormat ( " \ n " <nl> - " } " ) ) ; <nl> - headers . push_back ( absl : : StrJoin ( header_parts , " " ) ) ; <nl> - } <nl> - std : : vector < std : : string > headers_service_config ; <nl> - if ( ! headers . empty ( ) ) { <nl> - headers_service_config . push_back ( " \ " headers \ " : [ \ n " ) ; <nl> - headers_service_config . push_back ( absl : : StrJoin ( headers , " , " ) ) ; <nl> - headers_service_config . push_back ( " ] , \ n " ) ; <nl> } <nl> - std : : string path_match_str ; <nl> - switch ( route . matchers . path_matcher . type ) { <nl> + } <nl> + <nl> + bool PathMatch ( const absl : : string_view & path , <nl> + const XdsApi : : Route : : Matchers : : PathMatcher & path_matcher ) { <nl> + switch ( path_matcher . type ) { <nl> case XdsApi : : Route : : Matchers : : PathMatcher : : PathMatcherType : : PREFIX : <nl> - path_match_str = absl : : StrFormat ( <nl> - " \ " prefix \ " : \ " % s \ " , \ n " , route . matchers . path_matcher . string_matcher ) ; <nl> - break ; <nl> + return absl : : StartsWith ( path , path_matcher . string_matcher ) ; <nl> case XdsApi : : Route : : Matchers : : PathMatcher : : PathMatcherType : : PATH : <nl> - path_match_str = absl : : StrFormat ( <nl> - " \ " path \ " : \ " % s \ " , \ n " , route . matchers . path_matcher . string_matcher ) ; <nl> - break ; <nl> + return path = = path_matcher . string_matcher ; <nl> case XdsApi : : Route : : Matchers : : PathMatcher : : PathMatcherType : : REGEX : <nl> - path_match_str = <nl> - absl : : StrFormat ( " \ " regex \ " : \ " % s \ " , \ n " , <nl> - route . matchers . path_matcher . regex_matcher - > pattern ( ) ) ; <nl> - break ; <nl> + return RE2 : : FullMatch ( path . data ( ) , * path_matcher . regex_matcher ) ; <nl> + default : <nl> + return false ; <nl> } <nl> - return absl : : StrFormat ( <nl> - " { \ n " <nl> - " % s " <nl> - " % s " <nl> - " % s " <nl> - " \ " action \ " : \ " % s \ " \ n " <nl> - " } " , <nl> - path_match_str , absl : : StrJoin ( headers_service_config , " " ) , <nl> - route . matchers . fraction_per_million . has_value ( ) <nl> - ? absl : : StrFormat ( " \ " match_fraction \ " : % d , \ n " , <nl> - route . matchers . fraction_per_million . value ( ) ) <nl> - : " " , <nl> - action_name ) ; <nl> } <nl> <nl> - / / Create the service config for one weighted cluster . <nl> - std : : string CreateServiceConfigActionWeightedCluster ( <nl> - const std : : string & name , <nl> - const std : : vector < XdsApi : : Route : : ClusterWeight > & clusters ) { <nl> - std : : vector < std : : string > config_parts ; <nl> - config_parts . push_back ( <nl> - absl : : StrFormat ( " \ " weighted : % s \ " : { \ n " <nl> - " \ " childPolicy \ " : [ { \ n " <nl> - " \ " weighted_target_experimental \ " : { \ n " <nl> - " \ " targets \ " : { \ n " , <nl> - name ) ) ; <nl> - std : : vector < std : : string > weighted_targets ; <nl> - weighted_targets . reserve ( clusters . size ( ) ) ; <nl> - for ( const auto & cluster_weight : clusters ) { <nl> - weighted_targets . push_back ( absl : : StrFormat ( <nl> - " \ " % s \ " : { \ n " <nl> - " \ " weight \ " : % d , \ n " <nl> - " \ " childPolicy \ " : [ { \ n " <nl> - " \ " cds_experimental \ " : { \ n " <nl> - " \ " cluster \ " : \ " % s \ " \ n " <nl> - " } \ n " <nl> - " } ] \ n " <nl> - " } " , <nl> - cluster_weight . name , cluster_weight . weight , cluster_weight . name ) ) ; <nl> + absl : : optional < absl : : string_view > GetMetadataValue ( <nl> + const std : : string & target_key , grpc_metadata_batch * initial_metadata , <nl> + std : : string * concatenated_value ) { <nl> + / / Find all values for the specified key . <nl> + GPR_DEBUG_ASSERT ( initial_metadata ! = nullptr ) ; <nl> + absl : : InlinedVector < absl : : string_view , 1 > values ; <nl> + for ( grpc_linked_mdelem * md = initial_metadata - > list . head ; md ! = nullptr ; <nl> + md = md - > next ) { <nl> + absl : : string_view key = StringViewFromSlice ( GRPC_MDKEY ( md - > md ) ) ; <nl> + absl : : string_view value = StringViewFromSlice ( GRPC_MDVALUE ( md - > md ) ) ; <nl> + if ( target_key = = key ) values . push_back ( value ) ; <nl> } <nl> - config_parts . push_back ( absl : : StrJoin ( weighted_targets , " , \ n " ) ) ; <nl> - config_parts . push_back ( <nl> - " } \ n " <nl> - " } \ n " <nl> - " } ] \ n " <nl> - " } " ) ; <nl> - return absl : : StrJoin ( config_parts , " " ) ; <nl> + / / If none found , no match . <nl> + if ( values . empty ( ) ) return absl : : nullopt ; <nl> + / / If exactly one found , return it as - is . <nl> + if ( values . size ( ) = = 1 ) return values . front ( ) ; <nl> + / / If more than one found , concatenate the values , using <nl> + / / * concatenated_values as a temporary holding place for the <nl> + / / concatenated string . <nl> + * concatenated_value = absl : : StrJoin ( values , " , " ) ; <nl> + return * concatenated_value ; <nl> } <nl> <nl> - struct WeightedClustersKeys { <nl> - std : : string cluster_names_key ; <nl> - std : : string cluster_weights_key ; <nl> - } ; <nl> + bool HeaderMatchHelper ( <nl> + const XdsApi : : Route : : Matchers : : HeaderMatcher & header_matcher , <nl> + grpc_metadata_batch * initial_metadata ) { <nl> + std : : string concatenated_value ; <nl> + absl : : optional < absl : : string_view > value ; <nl> + / / Note : If we ever allow binary headers here , we still need to <nl> + / / special - case ignore " grpc - tags - bin " and " grpc - trace - bin " , since <nl> + / / they are not visible to the LB policy in grpc - go . <nl> + if ( absl : : EndsWith ( header_matcher . name , " - bin " ) | | <nl> + header_matcher . name = = " grpc - previous - rpc - attempts " ) { <nl> + value = absl : : nullopt ; <nl> + } else if ( header_matcher . name = = " content - type " ) { <nl> + value = " application / grpc " ; <nl> + } else { <nl> + value = GetMetadataValue ( header_matcher . name , initial_metadata , <nl> + & concatenated_value ) ; <nl> + } <nl> + if ( ! value . has_value ( ) ) { <nl> + if ( header_matcher . type = = <nl> + XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : PRESENT ) { <nl> + return ! header_matcher . present_match ; <nl> + } else { <nl> + / / For all other header matcher types , we need the header value to <nl> + / / exist to consider matches . <nl> + return false ; <nl> + } <nl> + } <nl> + switch ( header_matcher . type ) { <nl> + case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : EXACT : <nl> + return value . value ( ) = = header_matcher . string_matcher ; <nl> + case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : REGEX : <nl> + return RE2 : : FullMatch ( value . value ( ) . data ( ) , * header_matcher . regex_match ) ; <nl> + case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : RANGE : <nl> + int64_t int_value ; <nl> + if ( ! absl : : SimpleAtoi ( value . value ( ) , & int_value ) ) { <nl> + return false ; <nl> + } <nl> + return int_value > = header_matcher . range_start & & <nl> + int_value < header_matcher . range_end ; <nl> + case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : PREFIX : <nl> + return absl : : StartsWith ( value . value ( ) , header_matcher . string_matcher ) ; <nl> + case XdsApi : : Route : : Matchers : : HeaderMatcher : : HeaderMatcherType : : SUFFIX : <nl> + return absl : : EndsWith ( value . value ( ) , header_matcher . string_matcher ) ; <nl> + default : <nl> + return false ; <nl> + } <nl> + } <nl> <nl> - / / Returns the cluster names and weights key or the cluster names only key . <nl> - WeightedClustersKeys GetWeightedClustersKey ( <nl> - const std : : vector < XdsApi : : Route : : ClusterWeight > & weighted_clusters ) { <nl> - std : : set < std : : string > cluster_names ; <nl> - std : : set < std : : string > cluster_weights ; <nl> - for ( const auto & cluster_weight : weighted_clusters ) { <nl> - cluster_names . emplace ( absl : : StrFormat ( " % s " , cluster_weight . name ) ) ; <nl> - cluster_weights . emplace ( <nl> - absl : : StrFormat ( " % s_ % d " , cluster_weight . name , cluster_weight . weight ) ) ; <nl> + bool HeadersMatch ( <nl> + const std : : vector < XdsApi : : Route : : Matchers : : HeaderMatcher > & header_matchers , <nl> + grpc_metadata_batch * initial_metadata ) { <nl> + for ( const auto & header_matcher : header_matchers ) { <nl> + bool match = HeaderMatchHelper ( header_matcher , initial_metadata ) ; <nl> + if ( header_matcher . invert_match ) match = ! match ; <nl> + if ( ! match ) return false ; <nl> } <nl> - return { absl : : StrJoin ( cluster_names , " _ " ) , <nl> - absl : : StrJoin ( cluster_weights , " _ " ) } ; <nl> + return true ; <nl> } <nl> <nl> - std : : string XdsResolver : : WeightedClustersActionName ( <nl> - const std : : vector < XdsApi : : Route : : ClusterWeight > & weighted_clusters ) { <nl> - WeightedClustersKeys keys = GetWeightedClustersKey ( weighted_clusters ) ; <nl> - auto cluster_names_map_it = <nl> - weighted_cluster_index_map_ . find ( keys . cluster_names_key ) ; <nl> - GPR_ASSERT ( cluster_names_map_it ! = weighted_cluster_index_map_ . end ( ) ) ; <nl> - const auto & cluster_weights_map = <nl> - cluster_names_map_it - > second . cluster_weights_map ; <nl> - auto cluster_weights_map_it = <nl> - cluster_weights_map . find ( keys . cluster_weights_key ) ; <nl> - GPR_ASSERT ( cluster_weights_map_it ! = cluster_weights_map . end ( ) ) ; <nl> - return absl : : StrFormat ( " % s_ % d " , keys . cluster_names_key , <nl> - cluster_weights_map_it - > second ) ; <nl> + bool UnderFraction ( const uint32_t fraction_per_million ) { <nl> + / / Generate a random number in [ 0 , 1000000 ) . <nl> + const uint32_t random_number = rand ( ) % 1000000 ; <nl> + return random_number < fraction_per_million ; <nl> } <nl> <nl> - void XdsResolver : : UpdateWeightedClusterIndexMap ( <nl> - const std : : vector < XdsApi : : Route > & routes ) { <nl> - / / Construct a list of unique WeightedCluster <nl> - / / actions which we need to process : to find action names <nl> - std : : map < std : : string / * cluster_weights_key * / , <nl> - std : : string / * cluster_names_key * / > <nl> - actions_to_process ; <nl> - for ( const auto & route : routes ) { <nl> - if ( ! route . weighted_clusters . empty ( ) ) { <nl> - WeightedClustersKeys keys = <nl> - GetWeightedClustersKey ( route . weighted_clusters ) ; <nl> - auto action_it = actions_to_process . find ( keys . cluster_weights_key ) ; <nl> - if ( action_it = = actions_to_process . end ( ) ) { <nl> - actions_to_process [ std : : move ( keys . cluster_weights_key ) ] = <nl> - std : : move ( keys . cluster_names_key ) ; <nl> - } <nl> + ConfigSelector : : CallConfig XdsResolver : : XdsConfigSelector : : GetCallConfig ( <nl> + GetCallConfigArgs args ) { <nl> + for ( const auto & entry : route_table_ ) { <nl> + / / Path matching . <nl> + if ( ! PathMatch ( StringViewFromSlice ( * args . path ) , <nl> + entry . route . matchers . path_matcher ) ) { <nl> + continue ; <nl> } <nl> - } <nl> - / / First pass of all unique WeightedCluster actions : if the exact same <nl> - / / weighted target policy ( same clusters and weights ) appears in the old map , <nl> - / / then that old action name is taken again and should be moved to the new <nl> - / / map ; any other action names from the old set of actions are candidates for <nl> - / / reuse . <nl> - XdsResolver : : WeightedClusterIndexMap new_weighted_cluster_index_map ; <nl> - for ( auto action_it = actions_to_process . begin ( ) ; <nl> - action_it ! = actions_to_process . end ( ) ; ) { <nl> - const std : : string & cluster_names_key = action_it - > second ; <nl> - const std : : string & cluster_weights_key = action_it - > first ; <nl> - auto old_cluster_names_map_it = <nl> - weighted_cluster_index_map_ . find ( cluster_names_key ) ; <nl> - if ( old_cluster_names_map_it ! = weighted_cluster_index_map_ . end ( ) ) { <nl> - / / Add cluster_names_key to the new map and copy next_index . <nl> - auto & new_cluster_names_info = <nl> - new_weighted_cluster_index_map [ cluster_names_key ] ; <nl> - new_cluster_names_info . next_index = <nl> - old_cluster_names_map_it - > second . next_index ; <nl> - / / Lookup cluster_weights_key in old map . <nl> - auto & old_cluster_weights_map = <nl> - old_cluster_names_map_it - > second . cluster_weights_map ; <nl> - auto old_cluster_weights_map_it = <nl> - old_cluster_weights_map . find ( cluster_weights_key ) ; <nl> - if ( old_cluster_weights_map_it ! = old_cluster_weights_map . end ( ) ) { <nl> - / / same policy found , move from old map to new map . <nl> - new_cluster_names_info . cluster_weights_map [ cluster_weights_key ] = <nl> - old_cluster_weights_map_it - > second ; <nl> - old_cluster_weights_map . erase ( old_cluster_weights_map_it ) ; <nl> - / / This action has been added to new map , so no need to process it <nl> - / / again . <nl> - action_it = actions_to_process . erase ( action_it ) ; <nl> - continue ; <nl> - } <nl> + / / Header Matching . <nl> + if ( ! HeadersMatch ( entry . route . matchers . header_matchers , <nl> + args . initial_metadata ) ) { <nl> + continue ; <nl> } <nl> - + + action_it ; <nl> - } <nl> - / / Second pass of all remaining unique WeightedCluster actions : if clusters <nl> - / / for a new action are the same as an old unused action , reuse the name . If <nl> - / / clusters differ , use a brand new name . <nl> - for ( const auto & action : actions_to_process ) { <nl> - const std : : string & cluster_names_key = action . second ; <nl> - const std : : string & cluster_weights_key = action . first ; <nl> - auto & new_cluster_names_info = <nl> - new_weighted_cluster_index_map [ cluster_names_key ] ; <nl> - auto & old_cluster_weights_map = <nl> - weighted_cluster_index_map_ [ cluster_names_key ] . cluster_weights_map ; <nl> - auto old_cluster_weights_it = old_cluster_weights_map . begin ( ) ; <nl> - if ( old_cluster_weights_it ! = old_cluster_weights_map . end ( ) ) { <nl> - / / There is something to reuse : this action uses the same set <nl> - / / of clusters as a previous action and that action name is not <nl> - / / already taken . <nl> - new_cluster_names_info . cluster_weights_map [ cluster_weights_key ] = <nl> - old_cluster_weights_it - > second ; <nl> - / / Remove the name from being able to reuse again . <nl> - old_cluster_weights_map . erase ( old_cluster_weights_it ) ; <nl> + / / Match fraction check <nl> + if ( entry . route . matchers . fraction_per_million . has_value ( ) & & <nl> + ! UnderFraction ( entry . route . matchers . fraction_per_million . value ( ) ) ) { <nl> + continue ; <nl> + } <nl> + / / Found a route match <nl> + absl : : string_view cluster_name ; <nl> + if ( entry . route . weighted_clusters . empty ( ) ) { <nl> + cluster_name = entry . route . cluster_name ; <nl> } else { <nl> - / / There is nothing to reuse , take the next index to use and <nl> - / / increment . <nl> - new_cluster_names_info . cluster_weights_map [ cluster_weights_key ] = <nl> - new_cluster_names_info . next_index + + ; <nl> + const uint32_t key = <nl> + rand ( ) % <nl> + entry . weighted_cluster_state [ entry . weighted_cluster_state . size ( ) - 1 ] <nl> + . first ; <nl> + / / Find the index in weighted clusters corresponding to key . <nl> + size_t mid = 0 ; <nl> + size_t start_index = 0 ; <nl> + size_t end_index = entry . weighted_cluster_state . size ( ) - 1 ; <nl> + size_t index = 0 ; <nl> + while ( end_index > start_index ) { <nl> + mid = ( start_index + end_index ) / 2 ; <nl> + if ( entry . weighted_cluster_state [ mid ] . first > key ) { <nl> + end_index = mid ; <nl> + } else if ( entry . weighted_cluster_state [ mid ] . first < key ) { <nl> + start_index = mid + 1 ; <nl> + } else { <nl> + index = mid + 1 ; <nl> + break ; <nl> + } <nl> + } <nl> + if ( index = = 0 ) index = start_index ; <nl> + GPR_ASSERT ( entry . weighted_cluster_state [ index ] . first > key ) ; <nl> + cluster_name = entry . weighted_cluster_state [ index ] . second ; <nl> } <nl> + auto it = clusters_ . find ( cluster_name ) ; <nl> + GPR_ASSERT ( it ! = clusters_ . end ( ) ) ; <nl> + XdsResolver * resolver = <nl> + static_cast < XdsResolver * > ( resolver_ - > Ref ( ) . release ( ) ) ; <nl> + ClusterState * cluster_state = it - > second - > Ref ( ) . release ( ) ; <nl> + CallConfig call_config ; <nl> + call_config . call_attributes [ kXdsClusterAttribute ] = it - > first ; <nl> + call_config . on_call_committed = [ resolver , cluster_state ] ( ) { <nl> + cluster_state - > Unref ( ) ; <nl> + ExecCtx : : Run ( <nl> + / / TODO ( roth ) : This hop into the ExecCtx is being done to avoid <nl> + / / entering the WorkSerializer while holding the client channel data <nl> + / / plane mutex , since that can lead to deadlocks . However , we should <nl> + / / not have to solve this problem in each individual ConfigSelector <nl> + / / implementation . When we have time , we should fix the client channel <nl> + / / code to avoid this by not invoking the <nl> + / / CallConfig : : on_call_committed callback until after it has released <nl> + / / the data plane mutex . <nl> + DEBUG_LOCATION , <nl> + GRPC_CLOSURE_CREATE ( <nl> + [ ] ( void * arg , grpc_error * / * error * / ) { <nl> + auto * resolver = static_cast < XdsResolver * > ( arg ) ; <nl> + resolver - > work_serializer ( ) - > Run ( <nl> + [ resolver ] ( ) { <nl> + resolver - > MaybeRemoveUnusedClusters ( ) ; <nl> + resolver - > Unref ( ) ; <nl> + } , <nl> + DEBUG_LOCATION ) ; <nl> + } , <nl> + resolver , nullptr ) , <nl> + GRPC_ERROR_NONE ) ; <nl> + } ; <nl> + return call_config ; <nl> + } <nl> + return CallConfig ( ) ; <nl> + } <nl> + <nl> + / / <nl> + / / XdsResolver <nl> + / / <nl> + <nl> + void XdsResolver : : StartLocked ( ) { <nl> + grpc_error * error = GRPC_ERROR_NONE ; <nl> + xds_client_ = MakeOrphanable < XdsClient > ( <nl> + work_serializer ( ) , interested_parties_ , server_name_ , <nl> + absl : : make_unique < ListenerWatcher > ( Ref ( ) ) , * args_ , & error ) ; <nl> + if ( error ! = GRPC_ERROR_NONE ) { <nl> + gpr_log ( GPR_ERROR , <nl> + " Failed to create xds client - - channel will remain in " <nl> + " TRANSIENT_FAILURE : % s " , <nl> + grpc_error_string ( error ) ) ; <nl> + result_handler ( ) - > ReturnError ( error ) ; <nl> } <nl> - weighted_cluster_index_map_ = std : : move ( new_weighted_cluster_index_map ) ; <nl> + } <nl> + <nl> + void XdsResolver : : OnListenerChanged ( std : : vector < XdsApi : : Route > routes ) { <nl> + / / Save the update in the resolver . <nl> + current_update_ = std : : move ( routes ) ; <nl> + / / Propagate the update by creating XdsConfigSelector , CreateServiceConfig , <nl> + / / and ReturnResult . <nl> + PropagateUpdate ( ) ; <nl> } <nl> <nl> grpc_error * XdsResolver : : CreateServiceConfig ( <nl> - const std : : vector < XdsApi : : Route > & routes , <nl> RefCountedPtr < ServiceConfig > * service_config ) { <nl> - UpdateWeightedClusterIndexMap ( routes ) ; <nl> - std : : vector < std : : string > actions_vector ; <nl> - std : : vector < std : : string > route_table ; <nl> - std : : set < std : : string > actions_set ; <nl> - for ( const auto & route : routes ) { <nl> - const std : : string action_name = <nl> - route . weighted_clusters . empty ( ) <nl> - ? route . cluster_name <nl> - : WeightedClustersActionName ( route . weighted_clusters ) ; <nl> - if ( actions_set . find ( action_name ) = = actions_set . end ( ) ) { <nl> - actions_set . emplace ( action_name ) ; <nl> - actions_vector . push_back ( <nl> - route . weighted_clusters . empty ( ) <nl> - ? CreateServiceConfigActionCluster ( action_name ) <nl> - : CreateServiceConfigActionWeightedCluster ( <nl> - action_name , route . weighted_clusters ) ) ; <nl> - } <nl> - route_table . push_back ( CreateServiceConfigRoute ( <nl> - absl : : StrFormat ( " % s : % s " , <nl> - route . weighted_clusters . empty ( ) ? " cds " : " weighted " , <nl> - action_name ) , <nl> - route ) ) ; <nl> + std : : vector < std : : string > clusters ; <nl> + for ( const auto & cluster : cluster_state_map_ ) { <nl> + clusters . push_back ( <nl> + absl : : StrFormat ( " \ " % s \ " : { \ n " <nl> + " \ " childPolicy \ " : [ { \ n " <nl> + " \ " cds_experimental \ " : { \ n " <nl> + " \ " cluster \ " : \ " % s \ " \ n " <nl> + " } \ n " <nl> + " } ] \ n " <nl> + " } " , <nl> + cluster . first , cluster . first ) ) ; <nl> } <nl> std : : vector < std : : string > config_parts ; <nl> config_parts . push_back ( <nl> " { \ n " <nl> " \ " loadBalancingConfig \ " : [ \ n " <nl> - " { \ " xds_routing_experimental \ " : { \ n " <nl> - " \ " actions \ " : { \ n " ) ; <nl> - config_parts . push_back ( absl : : StrJoin ( actions_vector , " , \ n " ) ) ; <nl> - config_parts . push_back ( <nl> - " } , \ n " <nl> - " \ " routes \ " : [ \ n " ) ; <nl> - config_parts . push_back ( absl : : StrJoin ( route_table , " , \ n " ) ) ; <nl> + " { \ " xds_cluster_manager_experimental \ " : { \ n " <nl> + " \ " children \ " : { \ n " ) ; <nl> + config_parts . push_back ( absl : : StrJoin ( clusters , " , \ n " ) ) ; <nl> config_parts . push_back ( <nl> - " ] \ n " <nl> + " } \ n " <nl> " } } \ n " <nl> " ] \ n " <nl> " } " ) ; <nl> grpc_error * XdsResolver : : CreateServiceConfig ( <nl> return error ; <nl> } <nl> <nl> + void XdsResolver : : OnError ( grpc_error * error ) { <nl> + grpc_arg xds_client_arg = xds_client_ - > MakeChannelArg ( ) ; <nl> + Result result ; <nl> + result . args = grpc_channel_args_copy_and_add ( args_ , & xds_client_arg , 1 ) ; <nl> + result . service_config_error = error ; <nl> + result_handler ( ) - > ReturnResult ( std : : move ( result ) ) ; <nl> + } <nl> + <nl> + void XdsResolver : : PropagateUpdate ( ) { <nl> + / / First create XdsConfigSelector , which may add new entries to the cluster <nl> + / / state map , and then CreateServiceConfig for LB policies . <nl> + auto config_selector = <nl> + MakeRefCounted < XdsConfigSelector > ( Ref ( ) , current_update_ ) ; <nl> + Result result ; <nl> + grpc_error * error = CreateServiceConfig ( & result . service_config ) ; <nl> + if ( error ! = GRPC_ERROR_NONE ) { <nl> + OnError ( error ) ; <nl> + return ; <nl> + } <nl> + if ( GRPC_TRACE_FLAG_ENABLED ( grpc_xds_resolver_trace ) ) { <nl> + gpr_log ( GPR_INFO , " [ xds_resolver % p ] generated service config : % s " , this , <nl> + result . service_config - > json_string ( ) . c_str ( ) ) ; <nl> + } <nl> + grpc_arg new_args [ ] = { <nl> + xds_client_ - > MakeChannelArg ( ) , <nl> + config_selector - > MakeChannelArg ( ) , <nl> + } ; <nl> + result . args = <nl> + grpc_channel_args_copy_and_add ( args_ , new_args , GPR_ARRAY_SIZE ( new_args ) ) ; <nl> + result_handler ( ) - > ReturnResult ( std : : move ( result ) ) ; <nl> + } <nl> + <nl> + void XdsResolver : : MaybeRemoveUnusedClusters ( ) { <nl> + bool update_needed = false ; <nl> + for ( auto it = cluster_state_map_ . begin ( ) ; it ! = cluster_state_map_ . end ( ) ; ) { <nl> + if ( it - > second - > RefIfNonZero ( ) ) { <nl> + it - > second - > Unref ( ) ; <nl> + + + it ; <nl> + } else { <nl> + update_needed = true ; <nl> + it = cluster_state_map_ . erase ( it ) ; <nl> + } <nl> + } <nl> + if ( update_needed & & xds_client_ ! = nullptr ) { <nl> + / / Propagate the update by creating XdsConfigSelector , CreateServiceConfig , <nl> + / / and ReturnResult . <nl> + PropagateUpdate ( ) ; <nl> + } <nl> + } <nl> + <nl> / / <nl> / / Factory <nl> / / <nl> new file mode 100644 <nl> index 00000000000 . . 72a80a97e1f <nl> mmm / dev / null <nl> ppp b / src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h <nl> <nl> + / / <nl> + / / Copyright 2019 gRPC authors . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + / / <nl> + <nl> + # ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_XDS_XDS_RESOLVER_H <nl> + # define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_XDS_XDS_RESOLVER_H <nl> + <nl> + # include < grpc / support / port_platform . h > <nl> + <nl> + namespace grpc_core { <nl> + <nl> + extern const char * kXdsClusterAttribute ; <nl> + <nl> + } / / namespace grpc_core <nl> + <nl> + # endif / * GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_XDS_XDS_RESOLVER_H * / <nl> mmm a / src / core / ext / filters / client_channel / resolving_lb_policy . cc <nl> ppp b / src / core / ext / filters / client_channel / resolving_lb_policy . cc <nl> void ResolvingLoadBalancingPolicy : : OnResolverResultChangedLocked ( <nl> / / later use . <nl> RefCountedPtr < ConfigSelector > config_selector = <nl> ConfigSelector : : GetFromChannelArgs ( * result . args ) ; <nl> + / / Remove the config selector from channel args so that we ' re not holding <nl> + / / unnecessary refs that cause it to be destroyed somewhere other than in the <nl> + / / WorkSerializer . <nl> + const char * arg_name = GRPC_ARG_CONFIG_SELECTOR ; <nl> + grpc_channel_args * new_args = <nl> + grpc_channel_args_copy_and_remove ( result . args , & arg_name , 1 ) ; <nl> + grpc_channel_args_destroy ( result . args ) ; <nl> + result . args = new_args ; <nl> / / Create or update LB policy , as needed . <nl> if ( service_config_result . lb_policy_config ! = nullptr ) { <nl> CreateOrUpdateLbPolicyLocked ( <nl> mmm a / src / core / plugin_registry / grpc_plugin_registry . cc <nl> ppp b / src / core / plugin_registry / grpc_plugin_registry . cc <nl> void grpc_lb_policy_eds_init ( void ) ; <nl> void grpc_lb_policy_eds_shutdown ( void ) ; <nl> void grpc_lb_policy_lrs_init ( void ) ; <nl> void grpc_lb_policy_lrs_shutdown ( void ) ; <nl> - void grpc_lb_policy_xds_routing_init ( void ) ; <nl> - void grpc_lb_policy_xds_routing_shutdown ( void ) ; <nl> + void grpc_lb_policy_xds_cluster_manager_init ( void ) ; <nl> + void grpc_lb_policy_xds_cluster_manager_shutdown ( void ) ; <nl> void grpc_resolver_xds_init ( void ) ; <nl> void grpc_resolver_xds_shutdown ( void ) ; <nl> # endif <nl> void grpc_register_built_in_plugins ( void ) { <nl> grpc_lb_policy_eds_shutdown ) ; <nl> grpc_register_plugin ( grpc_lb_policy_lrs_init , <nl> grpc_lb_policy_lrs_shutdown ) ; <nl> - grpc_register_plugin ( grpc_lb_policy_xds_routing_init , <nl> - grpc_lb_policy_xds_routing_shutdown ) ; <nl> + grpc_register_plugin ( grpc_lb_policy_xds_cluster_manager_init , <nl> + grpc_lb_policy_xds_cluster_manager_shutdown ) ; <nl> grpc_register_plugin ( grpc_resolver_xds_init , <nl> grpc_resolver_xds_shutdown ) ; <nl> # endif <nl> mmm a / src / python / grpcio / grpc_core_dependencies . py <nl> ppp b / src / python / grpcio / grpc_core_dependencies . py <nl> <nl> ' src / core / ext / filters / client_channel / lb_policy / xds / cds . cc ' , <nl> ' src / core / ext / filters / client_channel / lb_policy / xds / eds . cc ' , <nl> ' src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc ' , <nl> - ' src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc ' , <nl> + ' src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc ' , <nl> ' src / core / ext / filters / client_channel / lb_policy_registry . cc ' , <nl> ' src / core / ext / filters / client_channel / local_subchannel_pool . cc ' , <nl> ' src / core / ext / filters / client_channel / proxy_mapper_registry . cc ' , <nl> mmm a / test / cpp / end2end / xds_end2end_test . cc <nl> ppp b / test / cpp / end2end / xds_end2end_test . cc <nl> TEST_P ( BasicTest , Vanilla ) { <nl> backends_ [ i ] - > backend_service ( ) - > request_count ( ) ) ; <nl> } <nl> / / Check LB policy name for the channel . <nl> - EXPECT_EQ ( ( GetParam ( ) . use_xds_resolver ( ) ? " xds_routing_experimental " <nl> + EXPECT_EQ ( ( GetParam ( ) . use_xds_resolver ( ) ? " xds_cluster_manager_experimental " <nl> : " eds_experimental " ) , <nl> channel_ - > GetLoadBalancingPolicyName ( ) ) ; <nl> } <nl> TEST_P ( LdsRdsTest , XdsRoutingClusterUpdateClustersWithPickingDelays ) { <nl> StartBackend ( 0 ) ; <nl> sending_rpc . join ( ) ; <nl> / / Make sure RPCs go to the correct backend : <nl> - / / Before moving routing to XdsConfigSelector , 2 to backend 1 ; <nl> - / / TODO ( donnadionne ) : After moving routing to XdsConfigSelector , 1 for each <nl> - / / backend . <nl> - EXPECT_EQ ( 0 , backends_ [ 0 ] - > backend_service ( ) - > request_count ( ) ) ; <nl> - EXPECT_EQ ( 2 , backends_ [ 1 ] - > backend_service ( ) - > request_count ( ) ) ; <nl> + EXPECT_EQ ( 1 , backends_ [ 0 ] - > backend_service ( ) - > request_count ( ) ) ; <nl> + EXPECT_EQ ( 1 , backends_ [ 1 ] - > backend_service ( ) - > request_count ( ) ) ; <nl> } <nl> <nl> TEST_P ( LdsRdsTest , XdsRoutingHeadersMatching ) { <nl> mmm a / tools / doxygen / Doxyfile . c + + . internal <nl> ppp b / tools / doxygen / Doxyfile . c + + . internal <nl> src / core / ext / filters / client_channel / lb_policy / xds / cds . cc \ <nl> src / core / ext / filters / client_channel / lb_policy / xds / eds . cc \ <nl> src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc \ <nl> src / core / ext / filters / client_channel / lb_policy / xds / xds . h \ <nl> - src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc \ <nl> + src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc \ <nl> src / core / ext / filters / client_channel / lb_policy_factory . h \ <nl> src / core / ext / filters / client_channel / lb_policy_registry . cc \ <nl> src / core / ext / filters / client_channel / lb_policy_registry . h \ <nl> src / core / ext / filters / client_channel / resolver / fake / fake_resolver . cc \ <nl> src / core / ext / filters / client_channel / resolver / fake / fake_resolver . h \ <nl> src / core / ext / filters / client_channel / resolver / sockaddr / sockaddr_resolver . cc \ <nl> src / core / ext / filters / client_channel / resolver / xds / xds_resolver . cc \ <nl> + src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h \ <nl> src / core / ext / filters / client_channel / resolver_factory . h \ <nl> src / core / ext / filters / client_channel / resolver_registry . cc \ <nl> src / core / ext / filters / client_channel / resolver_registry . h \ <nl> mmm a / tools / doxygen / Doxyfile . core . internal <nl> ppp b / tools / doxygen / Doxyfile . core . internal <nl> src / core / ext / filters / client_channel / lb_policy / xds / cds . cc \ <nl> src / core / ext / filters / client_channel / lb_policy / xds / eds . cc \ <nl> src / core / ext / filters / client_channel / lb_policy / xds / lrs . cc \ <nl> src / core / ext / filters / client_channel / lb_policy / xds / xds . h \ <nl> - src / core / ext / filters / client_channel / lb_policy / xds / xds_routing . cc \ <nl> + src / core / ext / filters / client_channel / lb_policy / xds / xds_cluster_manager . cc \ <nl> src / core / ext / filters / client_channel / lb_policy_factory . h \ <nl> src / core / ext / filters / client_channel / lb_policy_registry . cc \ <nl> src / core / ext / filters / client_channel / lb_policy_registry . h \ <nl> src / core / ext / filters / client_channel / resolver / fake / fake_resolver . h \ <nl> src / core / ext / filters / client_channel / resolver / sockaddr / README . md \ <nl> src / core / ext / filters / client_channel / resolver / sockaddr / sockaddr_resolver . cc \ <nl> src / core / ext / filters / client_channel / resolver / xds / xds_resolver . cc \ <nl> + src / core / ext / filters / client_channel / resolver / xds / xds_resolver . h \ <nl> src / core / ext / filters / client_channel / resolver_factory . h \ <nl> src / core / ext / filters / client_channel / resolver_registry . cc \ <nl> src / core / ext / filters / client_channel / resolver_registry . h \ <nl> mmm a / tools / internal_ci / linux / grpc_xds_bazel_python_test_in_docker . sh <nl> ppp b / tools / internal_ci / linux / grpc_xds_bazel_python_test_in_docker . sh <nl> bazel build / / src / python / grpcio_tests / tests_py3_only / interop : xds_interop_client <nl> <nl> # Test cases " path_matching " and " header_matching " are not included in " all " , <nl> # because not all interop clients in all languages support these new tests . <nl> - GRPC_VERBOSITY = debug GRPC_TRACE = xds_client , xds_resolver , xds_routing_lb , cds_lb , eds_lb , priority_lb , weighted_target_lb , lrs_lb " $ PYTHON " \ <nl> + GRPC_VERBOSITY = debug GRPC_TRACE = xds_client , xds_resolver , xds_cluster_manager_lb , cds_lb , eds_lb , priority_lb , weighted_target_lb , lrs_lb " $ PYTHON " \ <nl> tools / run_tests / run_xds_tests . py \ <nl> - - test_case = " all , path_matching , header_matching " \ <nl> - - project_id = grpc - testing \ <nl> mmm a / tools / internal_ci / linux / grpc_xds_bazel_test_in_docker . sh <nl> ppp b / tools / internal_ci / linux / grpc_xds_bazel_test_in_docker . sh <nl> bazel build test / cpp / interop : xds_interop_client <nl> # <nl> # TODO : remove " path_matching " and " header_matching " from - - test_case after <nl> # they are added into " all " . <nl> - GRPC_VERBOSITY = debug GRPC_TRACE = xds_client , xds_resolver , xds_routing_lb , cds_lb , eds_lb , priority_lb , weighted_target_lb , lrs_lb " $ PYTHON " \ <nl> + GRPC_VERBOSITY = debug GRPC_TRACE = xds_client , xds_resolver , xds_cluster_manager_lb , cds_lb , eds_lb , priority_lb , weighted_target_lb , lrs_lb " $ PYTHON " \ <nl> tools / run_tests / run_xds_tests . py \ <nl> - - test_case = " all , path_matching , header_matching " \ <nl> - - project_id = grpc - testing \ <nl> mmm a / tools / internal_ci / linux / grpc_xds_csharp_test_in_docker . sh <nl> ppp b / tools / internal_ci / linux / grpc_xds_csharp_test_in_docker . sh <nl> python tools / run_tests / run_tests . py - l csharp - c opt - - build_only <nl> # <nl> # TODO ( jtattermusch ) : remove " path_matching " and " header_matching " from <nl> # - - test_case after they are added into " all " . <nl> - GRPC_VERBOSITY = debug GRPC_TRACE = xds_client , xds_resolver , xds_routing_lb , cds_lb , eds_lb , priority_lb , weighted_target_lb , lrs_lb " $ PYTHON " \ <nl> + GRPC_VERBOSITY = debug GRPC_TRACE = xds_client , xds_resolver , xds_cluster_manager_lb , cds_lb , eds_lb , priority_lb , weighted_target_lb , lrs_lb " $ PYTHON " \ <nl> tools / run_tests / run_xds_tests . py \ <nl> - - test_case = " all , path_matching , header_matching " \ <nl> - - project_id = grpc - testing \ <nl> mmm a / tools / internal_ci / linux / grpc_xds_php_test_in_docker . sh <nl> ppp b / tools / internal_ci / linux / grpc_xds_php_test_in_docker . sh <nl> export CC = / usr / bin / gcc <nl> composer install & & \ <nl> . / bin / generate_proto_php . sh ) <nl> <nl> - GRPC_VERBOSITY = debug GRPC_TRACE = xds_client , xds_resolver , xds_routing_lb , cds_lb , eds_lb , priority_lb , weighted_target_lb , lrs_lb " $ PYTHON " \ <nl> + GRPC_VERBOSITY = debug GRPC_TRACE = xds_client , xds_resolver , xds_cluster_manager_lb , cds_lb , eds_lb , priority_lb , weighted_target_lb , lrs_lb " $ PYTHON " \ <nl> tools / run_tests / run_xds_tests . py \ <nl> - - test_case = " all , path_matching , header_matching " \ <nl> - - project_id = grpc - testing \ <nl> mmm a / tools / internal_ci / linux / grpc_xds_ruby_test_in_docker . sh <nl> ppp b / tools / internal_ci / linux / grpc_xds_ruby_test_in_docker . sh <nl> touch " $ TOOLS_DIR " / src / proto / grpc / health / v1 / __init__ . py <nl> <nl> ( cd src / ruby & & bundle & & rake compile ) <nl> <nl> - GRPC_VERBOSITY = debug GRPC_TRACE = xds_client , xds_resolver , xds_routing_lb , cds_lb , eds_lb , priority_lb , weighted_target_lb , lrs_lb " $ PYTHON " \ <nl> + GRPC_VERBOSITY = debug GRPC_TRACE = xds_client , xds_resolver , xds_cluster_manager_lb , cds_lb , eds_lb , priority_lb , weighted_target_lb , lrs_lb " $ PYTHON " \ <nl> tools / run_tests / run_xds_tests . py \ <nl> - - test_case = " all , path_matching , header_matching " \ <nl> - - project_id = grpc - testing \ <nl>
|
Moving XDS Routing functionalities from LB policy into XdsConfigSelector
|
grpc/grpc
|
ffb560090ab2e47935faeee7c58ef29adcc933a3
|
2020-09-11T22:44:10Z
|
mmm a / src / app / file_system . h <nl> ppp b / src / app / file_system . h <nl> <nl> # define APP_FILE_SYSTEM_H_INCLUDED <nl> # pragma once <nl> <nl> + # include " base / mutex . h " <nl> + <nl> # include < string > <nl> # include < vector > <nl> <nl> namespace app { <nl> <nl> bool dirExists ( const std : : string & path ) ; <nl> <nl> + void lock ( ) { m_mutex . lock ( ) ; } <nl> + void unlock ( ) { m_mutex . unlock ( ) ; } <nl> + <nl> + private : <nl> + base : : mutex m_mutex ; <nl> + } ; <nl> + <nl> + class LockFS { <nl> + public : <nl> + LockFS ( FileSystemModule * fs ) : m_fs ( fs ) { <nl> + m_fs - > lock ( ) ; <nl> + } <nl> + ~ LockFS ( ) { <nl> + m_fs - > unlock ( ) ; <nl> + } <nl> + private : <nl> + FileSystemModule * m_fs ; <nl> } ; <nl> <nl> class IFileItem { <nl> mmm a / src / app / palettes_loader . cpp <nl> ppp b / src / app / palettes_loader . cpp <nl> void PalettesLoader : : threadLoadPalettes ( ) <nl> if ( path . empty ( ) ) <nl> return ; <nl> <nl> - IFileItem * item = FileSystemModule : : instance ( ) - > getFileItemFromPath ( path ) ; <nl> + FileSystemModule * fs = FileSystemModule : : instance ( ) ; <nl> + LockFS lock ( fs ) ; <nl> + <nl> + IFileItem * item = fs - > getFileItemFromPath ( path ) ; <nl> if ( ! item ) <nl> return ; <nl> <nl> mmm a / src / app / ui / file_selector . cpp <nl> ppp b / src / app / ui / file_selector . cpp <nl> std : : string FileSelector : : show ( const std : : string & title , <nl> { <nl> std : : string result ; <nl> <nl> - FileSystemModule : : instance ( ) - > refresh ( ) ; <nl> + FileSystemModule * fs = FileSystemModule : : instance ( ) ; <nl> + LockFS lock ( fs ) ; <nl> + <nl> + fs - > refresh ( ) ; <nl> <nl> if ( ! navigation_history ) { <nl> navigation_history = new FileItemList ( ) ; <nl> std : : string FileSelector : : show ( const std : : string & title , <nl> if ( base : : get_file_path ( initialPath ) . empty ( ) ) { <nl> / / Get the saved ` path ' in the configuration file . <nl> std : : string path = get_config_string ( " FileSelect " , " CurrentDirectory " , " " ) ; <nl> - start_folder = FileSystemModule : : instance ( ) - > getFileItemFromPath ( path ) ; <nl> + start_folder = fs - > getFileItemFromPath ( path ) ; <nl> <nl> / / Is the folder find ? <nl> if ( ! start_folder ) { <nl> / / If the ` path ' doesn ' t exist . <nl> - if ( path . empty ( ) | | ( ! FileSystemModule : : instance ( ) - > dirExists ( path ) ) ) { <nl> + if ( path . empty ( ) | | ( ! fs - > dirExists ( path ) ) ) { <nl> / / We can get the current path from the system . <nl> # ifdef HAVE_DRIVES <nl> int drive = _al_getdrive ( ) ; <nl> std : : string FileSelector : : show ( const std : : string & title , <nl> start_folder_path = base : : fix_path_separators ( start_folder_path ) ; <nl> <nl> if ( ! start_folder ) <nl> - start_folder = FileSystemModule : : instance ( ) - > getFileItemFromPath ( start_folder_path ) ; <nl> + start_folder = fs - > getFileItemFromPath ( start_folder_path ) ; <nl> <nl> PRINTF ( " start_folder_path = % s ( % p ) \ n " , start_folder_path . c_str ( ) , start_folder ) ; <nl> <nl> std : : string FileSelector : : show ( const std : : string & title , <nl> buf = base : : fix_path_separators ( buf ) ; <nl> <nl> / / we can check if ' buf ' is a folder , so we have to enter in it <nl> - enter_folder = FileSystemModule : : instance ( ) - > getFileItemFromPath ( buf ) ; <nl> + enter_folder = fs - > getFileItemFromPath ( buf ) ; <nl> } <nl> } <nl> else { <nl>
|
Add a mutex to access to the FileSystemModule
|
aseprite/aseprite
|
95fbfd9fe7ec5b8d56a6b70c0c7c3282861c52c4
|
2014-04-24T11:51:59Z
|
mmm a / osquery / registry . h <nl> ppp b / osquery / registry . h <nl> <nl> <nl> namespace osquery { <nl> <nl> - <nl> / / A simple registry system for making values available by key across <nl> / / components . <nl> / / <nl>
|
Update registry . h
|
osquery/osquery
|
8cff961173e8c793f42c4cb1d317fa33b1715008
|
2014-08-30T22:03:06Z
|
mmm a / emcc . py <nl> ppp b / emcc . py <nl> def need_llvm_debug_info ( ) : <nl> compile_only = has_dash_c or has_dash_S or has_dash_E <nl> <nl> def add_link_flag ( i , f ) : <nl> - # Filter out libraries that musl includes in libc itself , or which we <nl> - # otherwise provide implicitly . <nl> - if f in ( ' - lm ' , ' - lrt ' , ' - ldl ' , ' - lpthread ' ) : <nl> - return <nl> if f . startswith ( ' - l ' ) : <nl> libs . append ( ( i , f [ 2 : ] ) ) <nl> if f . startswith ( ' - L ' ) : <nl> def worker_js_script ( proxy_worker_filename ) : <nl> def process_libraries ( libs , lib_dirs , temp_files ) : <nl> libraries = [ ] <nl> consumed = [ ] <nl> + suffixes = list ( STATICLIB_ENDINGS + DYNAMICLIB_ENDINGS ) <nl> <nl> # Find library files <nl> for i , lib in libs : <nl> logger . debug ( ' looking for library " % s " ' , lib ) <nl> - suffixes = list ( STATICLIB_ENDINGS + DYNAMICLIB_ENDINGS ) <nl> <nl> found = False <nl> for prefix in LIB_PREFIXES : <nl> def process_libraries ( libs , lib_dirs , temp_files ) : <nl> break <nl> if found : <nl> break <nl> + <nl> if not found : <nl> - jslibs = building . path_to_system_js_libraries ( lib ) <nl> - if jslibs : <nl> + jslibs = building . map_to_js_libs ( lib ) <nl> + if jslibs is not None : <nl> libraries + = [ ( i , jslib ) for jslib in jslibs ] <nl> consumed . append ( i ) <nl> <nl> mmm a / tools / building . py <nl> ppp b / tools / building . py <nl> def is_wasm ( filename ) : <nl> # Given the name of a special Emscripten - implemented system library , returns an <nl> # array of absolute paths to JS library files inside emscripten / src / that <nl> # corresponds to the library name . <nl> - def path_to_system_js_libraries ( library_name ) : <nl> + def map_to_js_libs ( library_name ) : <nl> # Some native libraries are implemented in Emscripten as system side JS libraries <nl> - js_system_libraries = { <nl> - ' c ' : ' ' , <nl> - ' dl ' : ' ' , <nl> - ' EGL ' : ' library_egl . js ' , <nl> + library_map = { <nl> + ' c ' : [ ] , <nl> + ' dl ' : [ ] , <nl> + ' EGL ' : [ ' library_egl . js ' ] , <nl> ' GL ' : [ ' library_webgl . js ' , ' library_html5_webgl . js ' ] , <nl> ' webgl . js ' : [ ' library_webgl . js ' , ' library_html5_webgl . js ' ] , <nl> - ' GLESv2 ' : ' library_webgl . js ' , <nl> + ' GLESv2 ' : [ ' library_webgl . js ' ] , <nl> # N . b . there is no GLESv3 to link to ( note [ f ] in https : / / www . khronos . org / registry / implementers_guide . html ) <nl> - ' GLEW ' : ' library_glew . js ' , <nl> - ' glfw ' : ' library_glfw . js ' , <nl> - ' glfw3 ' : ' library_glfw . js ' , <nl> - ' GLU ' : ' ' , <nl> - ' glut ' : ' library_glut . js ' , <nl> - ' m ' : ' ' , <nl> - ' openal ' : ' library_openal . js ' , <nl> - ' rt ' : ' ' , <nl> - ' pthread ' : ' ' , <nl> - ' X11 ' : ' library_xlib . js ' , <nl> - ' SDL ' : ' library_sdl . js ' , <nl> - ' stdc + + ' : ' ' , <nl> - ' uuid ' : ' library_uuid . js ' , <nl> - ' websocket ' : ' library_websocket . js ' <nl> + ' GLEW ' : [ ' library_glew . js ' ] , <nl> + ' glfw ' : [ ' library_glfw . js ' ] , <nl> + ' glfw3 ' : [ ' library_glfw . js ' ] , <nl> + ' GLU ' : [ ] , <nl> + ' glut ' : [ ' library_glut . js ' ] , <nl> + ' m ' : [ ] , <nl> + ' openal ' : [ ' library_openal . js ' ] , <nl> + ' rt ' : [ ] , <nl> + ' pthread ' : [ ] , <nl> + ' X11 ' : [ ' library_xlib . js ' ] , <nl> + ' SDL ' : [ ' library_sdl . js ' ] , <nl> + ' stdc + + ' : [ ] , <nl> + ' uuid ' : [ ' library_uuid . js ' ] , <nl> + ' websocket ' : [ ' library_websocket . js ' ] <nl> } <nl> - library_files = [ ] <nl> - if library_name in js_system_libraries : <nl> - if len ( js_system_libraries [ library_name ] ) : <nl> - lib = js_system_libraries [ library_name ] if isinstance ( js_system_libraries [ library_name ] , list ) else [ js_system_libraries [ library_name ] ] <nl> - library_files + = lib <nl> - logger . debug ( ' Linking in JS library ' + str ( lib ) ) <nl> <nl> - elif library_name . endswith ( ' . js ' ) and os . path . isfile ( path_from_root ( ' src ' , ' library_ ' + library_name ) ) : <nl> - library_files + = [ ' library_ ' + library_name ] <nl> + if library_name in library_map : <nl> + libs = library_map [ library_name ] <nl> + logger . debug ( ' Mapping library ` % s ` to JS libraries : % s ' % ( library_name , libs ) ) <nl> + return libs <nl> <nl> - return library_files <nl> + if library_name . endswith ( ' . js ' ) and os . path . isfile ( path_from_root ( ' src ' , ' library_ ' + library_name ) ) : <nl> + return [ ' library_ ' + library_name ] <nl> + <nl> + return None <nl> <nl> <nl> def emit_wasm_source_map ( wasm_file , map_file ) : <nl>
|
Cleanup mapping of ` - l ` flags to JS libraries . NFC . ( )
|
emscripten-core/emscripten
|
d37feeee3e936b508cde8b0d0daef4d11082aaf7
|
2020-10-27T17:51:07Z
|
mmm a / plugins / net_plugin / net_plugin . cpp <nl> ppp b / plugins / net_plugin / net_plugin . cpp <nl> namespace eosio { <nl> } <nl> reset ( ) ; <nl> sent_handshake_count = 0 ; <nl> - trx_in_progress_size = 0 ; <nl> node_id = fc : : sha256 ( ) ; <nl> last_handshake_recv = handshake_message ( ) ; <nl> last_handshake_sent = handshake_message ( ) ; <nl>
|
Do not clear trx_in_progress on close since low priority app lambda callbacks can still be in progress .
|
EOSIO/eos
|
a48c7448b21ba172e06c2186e1de01bfc948a801
|
2019-09-26T11:30:31Z
|
diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / CocosDenshion Mac . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / CocosDenshion Mac . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . 1870f59b66fc <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / CocosDenshion Mac . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A03F2E9817814268006731B9 " <nl> + BuildableName = " libCocosDenshion Mac . a " <nl> + BlueprintName = " CocosDenshion Mac " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / CocosDenshion iOS . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / CocosDenshion iOS . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . 34c974cecc52 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / CocosDenshion iOS . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A07A4F9F178387730073F6A7 " <nl> + BuildableName = " libCocosDenshion iOS . a " <nl> + BlueprintName = " CocosDenshion iOS " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / box2d Mac . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / box2d Mac . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . 0f1d9cdfd4e6 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / box2d Mac . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A03F2D5D1780BDF7006731B9 " <nl> + BuildableName = " libbox2d Mac . a " <nl> + BlueprintName = " box2d Mac " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / box2d iOS . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / box2d iOS . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . ce1292726ff7 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / box2d iOS . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A07A4F3C1783876B0073F6A7 " <nl> + BuildableName = " libbox2d iOS . a " <nl> + BlueprintName = " box2d iOS " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / build all libs Mac . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / build all libs Mac . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . e6ce8f455fd0 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / build all libs Mac . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A03F2E8E178141C1006731B9 " <nl> + BuildableName = " build all libs Mac " <nl> + BlueprintName = " build all libs Mac " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / build all libs iOS . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / build all libs iOS . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . b18e432d5a16 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / build all libs iOS . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A07A4E0B178386390073F6A7 " <nl> + BuildableName = " build all libs iOS " <nl> + BlueprintName = " build all libs iOS " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / chipmunk Mac . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / chipmunk Mac . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . 7ad4845c340f <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / chipmunk Mac . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A03F2B781780BD04006731B9 " <nl> + BuildableName = " libchipmunk Mac . a " <nl> + BlueprintName = " chipmunk Mac " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / chipmunk iOS . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / chipmunk iOS . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . dd188a35da23 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / chipmunk iOS . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A07A4EFD178387670073F6A7 " <nl> + BuildableName = " libchipmunk iOS . a " <nl> + BlueprintName = " chipmunk iOS " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx Mac . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx Mac . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . 915e5e12592a <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx Mac . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " 1551A33E158F2AB200E66CFE " <nl> + BuildableName = " libcocos2dx Mac . a " <nl> + BlueprintName = " cocos2dx Mac " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx iOS . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx iOS . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . b87bc89c89d7 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx iOS . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A07A4C241783777C0073F6A7 " <nl> + BuildableName = " libcocos2dx iOS . a " <nl> + BlueprintName = " cocos2dx iOS " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx - extensions Mac . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx - extensions Mac . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . 8b3b8c3ae953 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx - extensions Mac . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A03F2FC117814595006731B9 " <nl> + BuildableName = " libcocos2dx - extensions Mac . a " <nl> + BlueprintName = " cocos2dx - extensions Mac " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx - extensions iOS . xcscheme b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx - extensions iOS . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . 31472285587f <nl> mmm / dev / null <nl> ppp b / build / cocos2d_libs . xcodeproj / xcshareddata / xcschemes / cocos2dx - extensions iOS . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A07A4E111783867C0073F6A7 " <nl> + BuildableName = " libcocos2dx - extensions iOS . a " <nl> + BlueprintName = " cocos2dx - extensions iOS " <nl> + ReferencedContainer = " container : cocos2d_libs . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / Test cpp Mac . xcscheme b / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / Test cpp Mac . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . 4745b9566e93 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / Test cpp Mac . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " 1D6058900D05DD3D006BFB54 " <nl> + BuildableName = " Test cpp Mac . app " <nl> + BlueprintName = " Test cpp Mac " <nl> + ReferencedContainer = " container : cocos2d_samples . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < MacroExpansion > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " 1D6058900D05DD3D006BFB54 " <nl> + BuildableName = " Test cpp Mac . app " <nl> + BlueprintName = " Test cpp Mac " <nl> + ReferencedContainer = " container : cocos2d_samples . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / MacroExpansion > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < BuildableProductRunnable > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " 1D6058900D05DD3D006BFB54 " <nl> + BuildableName = " Test cpp Mac . app " <nl> + BlueprintName = " Test cpp Mac " <nl> + ReferencedContainer = " container : cocos2d_samples . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildableProductRunnable > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < BuildableProductRunnable > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " 1D6058900D05DD3D006BFB54 " <nl> + BuildableName = " Test cpp Mac . app " <nl> + BlueprintName = " Test cpp Mac " <nl> + ReferencedContainer = " container : cocos2d_samples . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildableProductRunnable > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / Test cpp iOS . xcscheme b / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / Test cpp iOS . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . c90d0cb99567 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / Test cpp iOS . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A07A517F1783A1D20073F6A7 " <nl> + BuildableName = " Test cpp iOS . app " <nl> + BlueprintName = " Test cpp iOS " <nl> + ReferencedContainer = " container : cocos2d_samples . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < MacroExpansion > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A07A517F1783A1D20073F6A7 " <nl> + BuildableName = " Test cpp iOS . app " <nl> + BlueprintName = " Test cpp iOS " <nl> + ReferencedContainer = " container : cocos2d_samples . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / MacroExpansion > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < BuildableProductRunnable > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A07A517F1783A1D20073F6A7 " <nl> + BuildableName = " Test cpp iOS . app " <nl> + BlueprintName = " Test cpp iOS " <nl> + ReferencedContainer = " container : cocos2d_samples . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildableProductRunnable > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < BuildableProductRunnable > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A07A517F1783A1D20073F6A7 " <nl> + BuildableName = " Test cpp iOS . app " <nl> + BlueprintName = " Test cpp iOS " <nl> + ReferencedContainer = " container : cocos2d_samples . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildableProductRunnable > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / build all samples Mac . xcscheme b / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / build all samples Mac . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . 917d3d415207 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / build all samples Mac . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A035ACBB1782469700987F6C " <nl> + BuildableName = " build all samples Mac " <nl> + BlueprintName = " build all samples Mac " <nl> + ReferencedContainer = " container : cocos2d_samples . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl> diff - - git a / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / build all samples iOS . xcscheme b / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / build all samples iOS . xcscheme <nl> new file mode 100644 <nl> index 000000000000 . . 28132244ba06 <nl> mmm / dev / null <nl> ppp b / build / cocos2d_samples . xcodeproj / xcshareddata / xcschemes / build all samples iOS . xcscheme <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < Scheme <nl> + LastUpgradeVersion = " 0500 " <nl> + version = " 1 . 3 " > <nl> + < BuildAction <nl> + parallelizeBuildables = " YES " <nl> + buildImplicitDependencies = " YES " > <nl> + < BuildActionEntries > <nl> + < BuildActionEntry <nl> + buildForTesting = " YES " <nl> + buildForRunning = " YES " <nl> + buildForProfiling = " YES " <nl> + buildForArchiving = " YES " <nl> + buildForAnalyzing = " YES " > <nl> + < BuildableReference <nl> + BuildableIdentifier = " primary " <nl> + BlueprintIdentifier = " A07A517B1783A1CC0073F6A7 " <nl> + BuildableName = " build all samples iOS " <nl> + BlueprintName = " build all samples iOS " <nl> + ReferencedContainer = " container : cocos2d_samples . xcodeproj " > <nl> + < / BuildableReference > <nl> + < / BuildActionEntry > <nl> + < / BuildActionEntries > <nl> + < / BuildAction > <nl> + < TestAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + buildConfiguration = " Debug " > <nl> + < Testables > <nl> + < / Testables > <nl> + < / TestAction > <nl> + < LaunchAction <nl> + selectedDebuggerIdentifier = " Xcode . DebuggerFoundation . Debugger . LLDB " <nl> + selectedLauncherIdentifier = " Xcode . DebuggerFoundation . Launcher . LLDB " <nl> + launchStyle = " 0 " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Debug " <nl> + ignoresPersistentStateOnLaunch = " NO " <nl> + debugDocumentVersioning = " YES " <nl> + allowLocationSimulation = " YES " > <nl> + < AdditionalOptions > <nl> + < / AdditionalOptions > <nl> + < / LaunchAction > <nl> + < ProfileAction <nl> + shouldUseLaunchSchemeArgsEnv = " YES " <nl> + savedToolIdentifier = " " <nl> + useCustomWorkingDirectory = " NO " <nl> + buildConfiguration = " Release " <nl> + debugDocumentVersioning = " YES " > <nl> + < / ProfileAction > <nl> + < AnalyzeAction <nl> + buildConfiguration = " Debug " > <nl> + < / AnalyzeAction > <nl> + < ArchiveAction <nl> + buildConfiguration = " Release " <nl> + revealArchiveInOrganizer = " YES " > <nl> + < / ArchiveAction > <nl> + < / Scheme > <nl>
|
Re - add xcode ' scheme ' files .
|
cocos2d/cocos2d-x
|
2e473027c16fcc037e5e35f685610e81575b6d7c
|
2014-03-10T03:58:33Z
|
mmm a / src / test / script_tests . cpp <nl> ppp b / src / test / script_tests . cpp <nl> static CScript ScriptFromHex ( const std : : string & str ) <nl> return CScript ( data . begin ( ) , data . end ( ) ) ; <nl> } <nl> <nl> - static CMutableTransaction TxFromHex ( const std : : string & str ) <nl> - { <nl> - CMutableTransaction tx ; <nl> - VectorReader ( SER_DISK , SERIALIZE_TRANSACTION_NO_WITNESS , ParseHex ( str ) , 0 ) > > tx ; <nl> - return tx ; <nl> - } <nl> - <nl> - static std : : vector < CTxOut > TxOutsFromJSON ( const UniValue & univalue ) <nl> - { <nl> - assert ( univalue . isArray ( ) ) ; <nl> - std : : vector < CTxOut > prevouts ; <nl> - for ( size_t i = 0 ; i < univalue . size ( ) ; + + i ) { <nl> - CTxOut txout ; <nl> - VectorReader ( SER_DISK , 0 , ParseHex ( univalue [ i ] . get_str ( ) ) , 0 ) > > txout ; <nl> - prevouts . push_back ( std : : move ( txout ) ) ; <nl> - } <nl> - return prevouts ; <nl> - } <nl> - <nl> - static CScriptWitness ScriptWitnessFromJSON ( const UniValue & univalue ) <nl> - { <nl> - assert ( univalue . isArray ( ) ) ; <nl> - CScriptWitness scriptwitness ; <nl> - for ( size_t i = 0 ; i < univalue . size ( ) ; + + i ) { <nl> - auto bytes = ParseHex ( univalue [ i ] . get_str ( ) ) ; <nl> - scriptwitness . stack . push_back ( std : : move ( bytes ) ) ; <nl> - } <nl> - return scriptwitness ; <nl> - } <nl> - <nl> BOOST_AUTO_TEST_CASE ( script_FindAndDelete ) <nl> { <nl> / / Exercise the FindAndDelete functionality <nl> BOOST_AUTO_TEST_CASE ( script_HasValidOps ) <nl> <nl> # if defined ( HAVE_CONSENSUS_LIB ) <nl> <nl> + static CMutableTransaction TxFromHex ( const std : : string & str ) <nl> + { <nl> + CMutableTransaction tx ; <nl> + VectorReader ( SER_DISK , SERIALIZE_TRANSACTION_NO_WITNESS , ParseHex ( str ) , 0 ) > > tx ; <nl> + return tx ; <nl> + } <nl> + <nl> + static std : : vector < CTxOut > TxOutsFromJSON ( const UniValue & univalue ) <nl> + { <nl> + assert ( univalue . isArray ( ) ) ; <nl> + std : : vector < CTxOut > prevouts ; <nl> + for ( size_t i = 0 ; i < univalue . size ( ) ; + + i ) { <nl> + CTxOut txout ; <nl> + VectorReader ( SER_DISK , 0 , ParseHex ( univalue [ i ] . get_str ( ) ) , 0 ) > > txout ; <nl> + prevouts . push_back ( std : : move ( txout ) ) ; <nl> + } <nl> + return prevouts ; <nl> + } <nl> + <nl> + static CScriptWitness ScriptWitnessFromJSON ( const UniValue & univalue ) <nl> + { <nl> + assert ( univalue . isArray ( ) ) ; <nl> + CScriptWitness scriptwitness ; <nl> + for ( size_t i = 0 ; i < univalue . size ( ) ; + + i ) { <nl> + auto bytes = ParseHex ( univalue [ i ] . get_str ( ) ) ; <nl> + scriptwitness . stack . push_back ( std : : move ( bytes ) ) ; <nl> + } <nl> + return scriptwitness ; <nl> + } <nl> + <nl> / * Test simple ( successful ) usage of bitcoinconsensus_verify_script * / <nl> BOOST_AUTO_TEST_CASE ( bitcoinconsensus_verify_script_returns_true ) <nl> { <nl>
|
Merge : test : Fix - Wunused - function warnings if configured - - without - libs
|
bitcoin/bitcoin
|
152ddb31975875b8801043ea8342a7354357e282
|
2020-10-19T07:18:16Z
|
mmm a / examples / coroutine / behavior / do - while . php <nl> ppp b / examples / coroutine / behavior / do - while . php <nl> <nl> < ? php <nl> Swoole \ Coroutine : : set ( [ <nl> ' max_death_ms ' = > 2000 , <nl> + ' death_loop_threshold ' = > 5 , <nl> ] ) ; <nl> echo " start \ n " ; <nl> go ( function ( ) { <nl> mmm a / include / coroutine . h <nl> ppp b / include / coroutine . h <nl> class Coroutine <nl> inline bool is_schedulable ( ) <nl> { <nl> loop_times + + ; <nl> - if ( ( Coroutine : : max_death_msec ) > 0 & & ( last_schedule_msec > 0 ) & & loop_times > = loop_threshold ) <nl> + if ( Coroutine : : max_death_msec > 0 & & last_schedule_msec > 0 & & loop_threshold > 0 & & loop_times > = loop_threshold ) <nl> { <nl> int64_t now_msec = swTimer_get_absolute_msec ( ) ; <nl> return ( now_msec - last_schedule_msec > Coroutine : : max_death_msec ) ; <nl> class Coroutine <nl> <nl> static inline void set_max_death_ms ( long max_ms ) <nl> { <nl> - <nl> max_death_msec = max_ms ; <nl> } <nl> <nl> + static inline void set_loop_threshold ( long threshold ) <nl> + { <nl> + <nl> + loop_threshold = threshold ; <nl> + } <nl> + <nl> # ifdef SW_LOG_TRACE_OPEN <nl> static inline long get_cid ( Coroutine * co ) <nl> { <nl> mmm a / src / coroutine / base . cc <nl> ppp b / src / coroutine / base . cc <nl> Coroutine * Coroutine : : call_stack [ SW_MAX_CORO_NESTING_LEVEL ] ; <nl> long Coroutine : : last_cid = 0 ; <nl> uint64_t Coroutine : : peak_num = 0 ; <nl> long Coroutine : : max_death_msec = 0 ; <nl> - long Coroutine : : loop_threshold = 1000 ; <nl> + long Coroutine : : loop_threshold = 0 ; <nl> coro_php_yield_t Coroutine : : on_yield = nullptr ; <nl> coro_php_resume_t Coroutine : : on_resume = nullptr ; <nl> coro_php_close_t Coroutine : : on_close = nullptr ; <nl> void Coroutine : : yield ( ) <nl> Coroutine : : on_yield ( task ) ; <nl> } <nl> Coroutine : : call_stack_size - - ; <nl> + # ifdef SW_CORO_DEATH_LOOP_PROTECTION <nl> mark_schedule ( ) ; <nl> + # endif <nl> ctx . SwapOut ( ) ; <nl> } <nl> <nl> void Coroutine : : resume ( ) <nl> { <nl> Coroutine : : on_resume ( task ) ; <nl> } <nl> + # ifdef SW_CORO_DEATH_LOOP_PROTECTION <nl> mark_schedule ( ) ; <nl> + # endif <nl> Coroutine : : call_stack [ Coroutine : : call_stack_size + + ] = this ; <nl> ctx . SwapIn ( ) ; <nl> if ( ctx . end ) <nl> void Coroutine : : yield_naked ( ) <nl> { <nl> state = SW_CORO_WAITING ; <nl> Coroutine : : call_stack_size - - ; <nl> + # ifdef SW_CORO_DEATH_LOOP_PROTECTION <nl> mark_schedule ( ) ; <nl> + # endif <nl> ctx . SwapOut ( ) ; <nl> } <nl> <nl> void Coroutine : : resume_naked ( ) <nl> { <nl> state = SW_CORO_RUNNING ; <nl> + # ifdef SW_CORO_DEATH_LOOP_PROTECTION <nl> mark_schedule ( ) ; <nl> + # endif <nl> Coroutine : : call_stack [ Coroutine : : call_stack_size + + ] = this ; <nl> ctx . SwapIn ( ) ; <nl> if ( ctx . end ) <nl> mmm a / swoole_config . h <nl> ppp b / swoole_config . h <nl> <nl> # define SW_DEFAULT_C_STACK_SIZE ( 2 * 1024 * 1024 ) <nl> # define SW_MAX_CORO_NUM_LIMIT 9223372036854775807LL <nl> # define SW_MAX_CORO_NESTING_LEVEL 128 <nl> + # define SW_CORO_DEATH_LOOP_PROTECTION 0 <nl> <nl> # define SW_CORO_SWAP_BAILOUT <nl> / / # define SW_CORO_ZEND_TRY <nl> mmm a / swoole_coroutine . cc <nl> ppp b / swoole_coroutine . cc <nl> void PHPCoroutine : : init ( ) <nl> Coroutine : : set_on_yield ( on_yield ) ; <nl> Coroutine : : set_on_resume ( on_resume ) ; <nl> Coroutine : : set_on_close ( on_close ) ; <nl> - <nl> + # ifdef SW_CORO_DEATH_LOOP_PROTECTION <nl> try_reset_opcode ( ) ; <nl> + # endif <nl> } <nl> <nl> inline void PHPCoroutine : : vm_stack_init ( void ) <nl> mmm a / swoole_coroutine_util . cc <nl> ppp b / swoole_coroutine_util . cc <nl> static PHP_METHOD ( swoole_coroutine_util , set ) <nl> Coroutine : : set_max_death_ms ( _value ) ; <nl> } <nl> } <nl> + if ( php_swoole_array_get_value ( vht , " death_loop_threshold " , v ) ) <nl> + { <nl> + long _value = zval_get_long ( v ) ; <nl> + if ( _value ) <nl> + { <nl> + Coroutine : : set_loop_threshold ( _value ) ; <nl> + } <nl> + } <nl> zval_ptr_dtor ( zset ) ; <nl> } <nl> <nl> mmm a / tests / swoole_coroutine / death_loop / do - while . phpt <nl> ppp b / tests / swoole_coroutine / death_loop / do - while . phpt <nl> swoole_coroutine : do - while with opcache enable <nl> < ? php <nl> Swoole \ Coroutine : : set ( [ <nl> ' max_death_ms ' = > 2000 , <nl> + ' death_loop_threshold ' = > 20 , <nl> ] ) ; <nl> $ exit = false ; <nl> echo " start \ n " ; <nl> mmm a / tests / swoole_coroutine / death_loop / do - while2 . phpt <nl> ppp b / tests / swoole_coroutine / death_loop / do - while2 . phpt <nl> swoole_coroutine : do - while without opcache enable <nl> < ? php <nl> Swoole \ Coroutine : : set ( [ <nl> ' max_death_ms ' = > 2000 , <nl> + ' death_loop_threshold ' = > 20 , <nl> ] ) ; <nl> $ exit = false ; <nl> echo " start \ n " ; <nl> mmm a / tests / swoole_coroutine / death_loop / for . phpt <nl> ppp b / tests / swoole_coroutine / death_loop / for . phpt <nl> swoole_coroutine : for <nl> < ? php <nl> Swoole \ Coroutine : : set ( [ <nl> ' max_death_ms ' = > 2000 , <nl> + ' death_loop_threshold ' = > 20 , <nl> ] ) ; <nl> $ exit = false ; <nl> echo " start \ n " ; <nl> mmm a / tests / swoole_coroutine / death_loop / goto . phpt <nl> ppp b / tests / swoole_coroutine / death_loop / goto . phpt <nl> swoole_coroutine : while <nl> < ? php <nl> Swoole \ Coroutine : : set ( [ <nl> ' max_death_ms ' = > 2000 , <nl> + ' death_loop_threshold ' = > 20 , <nl> ] ) ; <nl> $ exit = false ; <nl> echo " start \ n " ; <nl> mmm a / tests / swoole_coroutine / death_loop / while . phpt <nl> ppp b / tests / swoole_coroutine / death_loop / while . phpt <nl> require __DIR__ . ' / . . / . . / include / skipif . inc ' ; <nl> < ? php <nl> Swoole \ Coroutine : : set ( [ <nl> ' max_death_ms ' = > 2000 , <nl> + ' death_loop_threshold ' = > 20 , <nl> ] ) ; <nl> $ exit = false ; <nl> echo " start \ n " ; <nl> mmm a / tests / swoole_coroutine / death_loop / while2 . phpt <nl> ppp b / tests / swoole_coroutine / death_loop / while2 . phpt <nl> require __DIR__ . ' / . . / . . / include / skipif . inc ' ; <nl> < ? php <nl> Swoole \ Coroutine : : set ( [ <nl> ' max_death_ms ' = > 2000 , <nl> + ' death_loop_threshold ' = > 20 , <nl> ] ) ; <nl> $ exit = false ; <nl> echo " start \ n " ; <nl>
|
improve
|
swoole/swoole-src
|
710c99172b8a8629e4d436c948f9099c2a867236
|
2019-01-22T08:20:14Z
|
mmm a / Makefile <nl> ppp b / Makefile <nl> endif <nl> # it is useful for pip install compiling - on - the - fly <nl> OS : = $ ( shell uname ) <nl> ifeq ( $ ( OS ) , Darwin ) <nl> - export CC = $ ( if $ ( shell which gcc - 6 ) , gcc - 6 , clang ) <nl> - export CXX = $ ( if $ ( shell which g + + - 6 ) , g + + - 6 , clang + + ) <nl> + export CC = $ ( if $ ( shell which gcc - 6 ) , gcc - 6 , $ ( if $ ( shell which gcc - mp - 6 ) , gcc - mp - 6 , clang ) ) <nl> + export CXX = $ ( if $ ( shell which g + + - 6 ) , g + + - 6 , $ ( if $ ( shell which g + + - mp - 6 ) , g + + - mp - 6 , clang + + ) ) <nl> endif <nl> <nl> export LDFLAGS = - pthread - lm $ ( ADD_LDFLAGS ) $ ( DMLC_LDFLAGS ) $ ( PLUGIN_LDFLAGS ) <nl>
|
Add option on OSX to use macports ( )
|
dmlc/xgboost
|
4b9d4883874d45cacbda86ff7d7d5c43f1e23475
|
2016-10-18T16:56:00Z
|
mmm a / tensorflow / python / eager / function . py <nl> ppp b / tensorflow / python / eager / function . py <nl> <nl> from tensorflow . python . ops import functional_ops <nl> from tensorflow . python . ops import gradients_impl <nl> from tensorflow . python . ops import resource_variable_ops <nl> + from tensorflow . python . platform import tf_logging as logging <nl> from tensorflow . python . util import compat <nl> from tensorflow . python . util import nest <nl> from tensorflow . python . util import tf_decorator <nl> <nl> BACKWARD_FUNCTION_ATTRIBUTE_NAME <nl> ] <nl> <nl> + CacheKey = collections . namedtuple ( " CacheKey " , [ <nl> + " input_signature " , " parent_graph " , " device_functions " , " colocation_stack " , <nl> + " uses_xla " <nl> + ] ) <nl> + <nl> <nl> def _parse_func_attrs ( attributes ) : <nl> " " " Convert the keyword arguments into function_def attributes . <nl> def _cache_key ( self , args , kwargs ) : <nl> " " " Computes the cache key given inputs and execution context . " " " <nl> if self . _input_signature is None : <nl> inputs = ( args , kwargs ) if kwargs else args <nl> - cache_key = pywrap_tensorflow . TFE_Py_EncodeArg ( inputs ) <nl> + input_signature = pywrap_tensorflow . TFE_Py_EncodeArg ( inputs ) <nl> else : <nl> del args , kwargs <nl> - cache_key = self . _flat_input_signature <nl> + input_signature = self . _flat_input_signature <nl> <nl> ctx = context . context ( ) <nl> with ops . init_scope ( ) : <nl> # The graph , or whether we ' re executing eagerly , should be a part of the <nl> # cache key so we don ' t improperly capture tensors such as variables . <nl> executing_eagerly = ctx . executing_eagerly ( ) <nl> - execution_context = executing_eagerly or ops . get_default_graph ( ) <nl> + parent_graph = None if executing_eagerly else ops . get_default_graph ( ) <nl> <nl> # pylint : disable = protected - access <nl> default_graph = ops . get_default_graph ( ) <nl> def _cache_key ( self , args , kwargs ) : <nl> else : <nl> device_functions = ( ) <nl> # pylint : enable = protected - access <nl> - return ( cache_key , execution_context , device_functions , colocation_stack , <nl> - uses_xla ) <nl> + return CacheKey ( input_signature , parent_graph , device_functions , <nl> + colocation_stack , uses_xla ) <nl> <nl> def _canonicalize_function_inputs ( self , * args , * * kwargs ) : <nl> " " " Canonicalizes ` args ` and ` kwargs ` . <nl> def _maybe_define_function ( self , args , kwargs ) : <nl> " must be hashable . " ) <nl> <nl> if graph_function is None : <nl> + logging . vlog ( 1 , <nl> + " Creating new FuncGraph for Python function % r ( key : % r ) " , <nl> + self . _python_function . __name__ , cache_key ) <nl> if self . _input_signature is None : <nl> arglen = len ( args ) <nl> else : <nl>
|
Log when a new FuncGraph is created .
|
tensorflow/tensorflow
|
a51e09caf77453c4713686888082dae7b6cfa5f8
|
2018-11-20T19:51:31Z
|
mmm a / dbms / include / DB / IO / CachedCompressedReadBuffer . h <nl> ppp b / dbms / include / DB / IO / CachedCompressedReadBuffer . h <nl> class CachedCompressedReadBuffer : public ReadBuffer <nl> pos + = offset_in_decompressed_block ; <nl> } <nl> } <nl> - <nl> + / * <nl> size_t readBig ( char * to , size_t n ) <nl> { <nl> / / / Если кэш используется , то будем читать через него . <nl> class CachedCompressedReadBuffer : public ReadBuffer <nl> <nl> return res ; <nl> } <nl> - } <nl> + } * / <nl> } ; <nl> <nl> } <nl>
|
clickhouse : CachedCompressedReadBuffer is not wuite fixed yet ; commenting it again . [ # METR - 9633 ]
|
ClickHouse/ClickHouse
|
589ed293c2d9d559de4e4a4ba401a7643a27fdf8
|
2014-01-14T14:57:19Z
|
mmm a / db / commands / mr . cpp <nl> ppp b / db / commands / mr . cpp <nl> namespace mongo { <nl> / / global JS map / reduce hashmap <nl> / / we use a standard JS object which means keys are only simple types <nl> / / we could also add a real hashmap from a library , still we need to add object comparison methods <nl> - _scope - > setObject ( " _mrMap " , BSONObj ( ) , false ) ; <nl> + / / _scope - > setObject ( " _mrMap " , BSONObj ( ) , false ) ; <nl> + ScriptingFunction init = _scope - > createFunction ( " _emitCt = 0 ; _mrMap = { } ; " ) ; <nl> + _scope - > invoke ( init , 0 , 0 , 0 , true ) ; <nl> <nl> / / js function to run reduce on all keys <nl> / / redfunc = _scope - > createFunction ( " for ( var key in hashmap ) { print ( ' Key is ' + key ) ; list = hashmap [ key ] ; ret = reduce ( key , list ) ; print ( ' Value is ' + ret ) ; } ; " ) ; <nl> namespace mongo { <nl> _jsMode = jsMode ; <nl> if ( jsMode ) { <nl> / / emit function that stays in JS <nl> - _scope - > setFunction ( " emit " , " function ( key , value ) { list = _mrMap [ key ] ; if ( ! list ) { list = [ ] ; _mrMap [ key ] = list ; } list . push ( value ) ; } " ) ; <nl> + _scope - > setFunction ( " emit " , " function ( key , value ) { + + _emitCt ; list = _mrMap [ key ] ; if ( ! list ) { list = [ ] ; _mrMap [ key ] = list ; } list . push ( value ) ; } " ) ; <nl> } else { <nl> / / emit now populates C + + map <nl> _scope - > injectNative ( " emit " , fast_emit , this ) ; <nl> mmm a / db / commands / mr . h <nl> ppp b / db / commands / mr . h <nl> namespace mongo { <nl> <nl> const bool isOnDisk ( ) { return _onDisk ; } <nl> <nl> - long long numEmits ( ) const { return _numEmits ; } <nl> + long long numEmits ( ) const { if ( _jsMode ) return _scope - > getNumberLongLong ( " _emitCt " ) ; return _numEmits ; } <nl> <nl> void switchMode ( bool jsMode ) ; <nl> <nl>
|
SERVER - 2976 : fixed the emit count in js mode
|
mongodb/mongo
|
acb028bdcd34d2908d7f354dd98932213abb6ad1
|
2011-05-12T18:16:05Z
|
mmm a / tensorflow / core / kernels / save_restore_tensor . cc <nl> ppp b / tensorflow / core / kernels / save_restore_tensor . cc <nl> Status RestoreTensorsV2 ( OpKernelContext * context , const Tensor & prefix , <nl> / / TODO ( zongheng ) : consider measuring speed and issuing concurrent lookups <nl> / / within a fixed memory budget . <nl> TensorShape restored_full_shape ; <nl> + DataType restored_dtype ; <nl> Tensor * restored_tensor = nullptr ; <nl> for ( auto i : sorted_name_idx ) { <nl> const string & tensor_name = tensor_names_flat ( i ) ; <nl> const string & shape_and_slice = shape_and_slices_flat ( i ) ; <nl> <nl> TF_RETURN_IF_ERROR ( <nl> - reader . LookupTensorShape ( tensor_name , & restored_full_shape ) ) ; <nl> + reader . LookupDtypeAndShape ( tensor_name , <nl> + & restored_dtype , & restored_full_shape ) ) ; <nl> <nl> if ( shape_and_slice . empty ( ) ) { <nl> / / Lookup the full tensor . <nl> Status RestoreTensorsV2 ( OpKernelContext * context , const Tensor & prefix , <nl> TF_RETURN_IF_ERROR ( <nl> reader . LookupSlice ( tensor_name , parsed_slice , restored_tensor ) ) ; <nl> } <nl> - if ( dtypes [ i ] ! = restored_tensor - > dtype ( ) ) { <nl> + if ( restored_dtype ! = restored_tensor - > dtype ( ) ) { <nl> return errors : : InvalidArgument ( <nl> " tensor_name = " , tensor_name , " ; expected dtype " , <nl> - DataTypeString ( dtypes [ i ] ) , " does not equal restored dtype " , <nl> + DataTypeString ( restored_dtype ) , " does not equal restored dtype " , <nl> DataTypeString ( restored_tensor - > dtype ( ) ) ) ; <nl> } <nl> } <nl>
|
BUG : check original dtype with restore dtype
|
tensorflow/tensorflow
|
0f1b0d6a031c883ca531b4469110eb034637b120
|
2018-07-24T03:04:54Z
|
mmm a / src / google / protobuf / map . h <nl> ppp b / src / google / protobuf / map . h <nl> class MapIterator { <nl> private : <nl> typename hash_map < Key , value_type * > : : iterator it_ ; <nl> <nl> - friend Map < Key , T > ; <nl> + friend class Map < Key , T > ; <nl> } ; <nl> <nl> / / google : : protobuf : : Map is an associative container type used to store protobuf map <nl>
|
Fix ' error : a class - key must be used when declaring a friend ' compile error .
|
protocolbuffers/protobuf
|
0fab06062f3be27a061e2062e113083ecefa5146
|
2014-11-18T16:37:37Z
|
mmm a / test / mjsunit / mjsunit . status <nl> ppp b / test / mjsunit / mjsunit . status <nl> <nl> ' arguments - load - across - eval ' : [ SKIP ] , <nl> ' arguments - read - and - assignment ' : [ SKIP ] , <nl> ' array - bounds - check - removal ' : [ SKIP ] , <nl> + ' array - constructor ' : [ SKIP ] , <nl> ' array - elements - from - array - prototype - chain ' : [ SKIP ] , <nl> + ' array - functions - prototype - misc ' : [ SKIP ] , <nl> ' array - join ' : [ SKIP ] , <nl> ' array - length - number - conversion ' : [ SKIP ] , <nl> ' array - literal - feedback ' : [ SKIP ] , <nl> <nl> ' regress / regress - 2071 ' : [ SKIP ] , <nl> ' regress / regress - 2132 ' : [ SKIP ] , <nl> ' regress / regress - 2163 ' : [ SKIP ] , <nl> + ' regress / regress - 2318 ' : [ SKIP ] , <nl> ' regress / regress - 2339 ' : [ SKIP ] , <nl> ' regress / regress - 2444 ' : [ SKIP ] , <nl> ' regress / regress - 244 ' : [ SKIP ] , <nl> <nl> ' regress / regress - 263 ' : [ SKIP ] , <nl> ' regress / regress - 265 ' : [ SKIP ] , <nl> ' regress / regress - 269 ' : [ SKIP ] , <nl> + ' regress / regress - 2790 ' : [ SKIP ] , <nl> ' regress / regress - 2825 ' : [ SKIP ] , <nl> ' regress / regress - 286 ' : [ SKIP ] , <nl> ' regress / regress - 298269 ' : [ SKIP ] , <nl> <nl> ' regress / regress - 4121 ' : [ SKIP ] , <nl> ' regress / regress - 419663 ' : [ SKIP ] , <nl> ' regress / regress - 4255 - 4 ' : [ SKIP ] , <nl> + ' regress / regress - 430201 ' : [ SKIP ] , <nl> + ' regress / regress - 430201 - b ' : [ SKIP ] , <nl> ' regress / regress - 4309 - 3 ' : [ SKIP ] , <nl> ' regress / regress - 4320 ' : [ SKIP ] , <nl> ' regress / regress - 4325 ' : [ SKIP ] , <nl> mmm a / test / test262 / test262 . status <nl> ppp b / test / test262 / test262 . status <nl> <nl> ' language / computed - property - names / object / accessor / getter - super ' : [ SKIP ] , <nl> ' language / computed - property - names / object / accessor / setter - super ' : [ SKIP ] , <nl> ' language / computed - property - names / object / method / super ' : [ SKIP ] , <nl> + ' language / default - parameters / class - definitions ' : [ SKIP ] , <nl> + ' language / default - parameters / generators ' : [ SKIP ] , <nl> + ' language / default - parameters / param - ref - uninitialized ' : [ SKIP ] , <nl> ' language / expressions / delete / 11 . 4 . 1 - 4 . a - 5 ' : [ SKIP ] , <nl> ' language / expressions / delete / 11 . 4 . 1 - 4 . a - 6 ' : [ SKIP ] , <nl> + ' language / expressions / object / method - definition / name - super - param ' : [ SKIP ] , <nl> ' language / expressions / object / method - definition / name - super - prop - body ' : [ SKIP ] , <nl> ' language / expressions / object / prop - def - id - eval - error ' : [ SKIP ] , <nl> ' language / expressions / tagged - template / call - expression - context - no - strict ' : [ SKIP ] , <nl>
|
[ Ignition ] Skip some more mjsunit and test262 tests on ignition .
|
v8/v8
|
aa858ffbbd86a835f93a60c818ebf9532fbae823
|
2015-11-09T14:16:26Z
|
mmm a / src / compiler / ast - graph - builder . cc <nl> ppp b / src / compiler / ast - graph - builder . cc <nl> Node * AstGraphBuilder : : BuildStoreExternal ( ExternalReference reference , <nl> <nl> <nl> Node * AstGraphBuilder : : BuildToBoolean ( Node * input ) { <nl> - / / TODO ( titzer ) : This should be in a JSOperatorReducer . <nl> + / / TODO ( bmeurer , mstarzinger ) : Refactor this into a separate optimization <nl> + / / method . <nl> switch ( input - > opcode ( ) ) { <nl> - case IrOpcode : : kInt32Constant : <nl> - return jsgraph_ - > BooleanConstant ( ! Int32Matcher ( input ) . Is ( 0 ) ) ; <nl> - case IrOpcode : : kFloat64Constant : <nl> - return jsgraph_ - > BooleanConstant ( ! Float64Matcher ( input ) . Is ( 0 ) ) ; <nl> case IrOpcode : : kNumberConstant : <nl> return jsgraph_ - > BooleanConstant ( ! NumberMatcher ( input ) . Is ( 0 ) ) ; <nl> case IrOpcode : : kHeapConstant : { <nl> Handle < Object > object = HeapObjectMatcher < Object > ( input ) . Value ( ) . handle ( ) ; <nl> return jsgraph_ - > BooleanConstant ( object - > BooleanValue ( ) ) ; <nl> } <nl> + case IrOpcode : : kJSEqual : <nl> + case IrOpcode : : kJSNotEqual : <nl> + case IrOpcode : : kJSStrictEqual : <nl> + case IrOpcode : : kJSStrictNotEqual : <nl> + case IrOpcode : : kJSLessThan : <nl> + case IrOpcode : : kJSLessThanOrEqual : <nl> + case IrOpcode : : kJSGreaterThan : <nl> + case IrOpcode : : kJSGreaterThanOrEqual : <nl> + case IrOpcode : : kJSUnaryNot : <nl> + case IrOpcode : : kJSToBoolean : <nl> + case IrOpcode : : kJSDeleteProperty : <nl> + case IrOpcode : : kJSHasProperty : <nl> + case IrOpcode : : kJSInstanceOf : <nl> + return input ; <nl> default : <nl> break ; <nl> } <nl> - if ( NodeProperties : : IsTyped ( input ) ) { <nl> - Type * upper = NodeProperties : : GetBounds ( input ) . upper ; <nl> - if ( upper - > Is ( Type : : Boolean ( ) ) ) return input ; <nl> - } <nl> - <nl> return NewNode ( javascript ( ) - > ToBoolean ( ) , input ) ; <nl> } <nl> <nl>
|
[ turbofan ] The AstGraphBuilder does not need to care about types .
|
v8/v8
|
f1db38cae07f873e21ac57d2ff0cdc57134906c9
|
2015-06-17T05:43:31Z
|
mmm a / hphp / runtime / ext / json / JSON_parser . cpp <nl> ppp b / hphp / runtime / ext / json / JSON_parser . cpp <nl> enum class Mode { <nl> ARRAY = 4 <nl> } ; <nl> <nl> - / * * <nl> - * These are the types of containers that can be returned <nl> - * depending on the options used for json_decode . <nl> - * <nl> - * Objects are not included here . <nl> - * / <nl> - enum class ContainerType { <nl> - PHP_ARRAYS = 1 , <nl> - COLLECTIONS = 2 , <nl> - HACK_ARRAYS = 3 , <nl> - } ; <nl> - <nl> namespace { <nl> <nl> NEVER_INLINE <nl> static void object_set ( Variant & var , <nl> const String & key , <nl> const Variant & value , <nl> int assoc , <nl> - ContainerType container_type ) { <nl> + JSONContainerType container_type ) { <nl> if ( ! assoc ) { <nl> / / We know it is stdClass , and everything is public ( and dynamic ) . <nl> if ( key . empty ( ) ) { <nl> static void object_set ( Variant & var , <nl> var . getObjectData ( ) - > o_set ( key , value ) ; <nl> } <nl> } else { <nl> - if ( container_type = = ContainerType : : COLLECTIONS ) { <nl> + if ( container_type = = JSONContainerType : : COLLECTIONS ) { <nl> auto keyTV = make_tv < KindOfString > ( key . get ( ) ) ; <nl> collections : : set ( var . getObjectData ( ) , & keyTV , value . asCell ( ) ) ; <nl> - } else if ( container_type = = ContainerType : : HACK_ARRAYS ) { <nl> + } else if ( container_type = = JSONContainerType : : HACK_ARRAYS ) { <nl> forceToDict ( var ) . set ( key , value ) ; <nl> } else { <nl> forceToArray ( var ) . set ( key , value ) ; <nl> static void object_set ( Variant & var , <nl> static void attach_zval ( json_parser * json , <nl> const String & key , <nl> int assoc , <nl> - ContainerType container_type ) { <nl> + JSONContainerType container_type ) { <nl> if ( json - > top < 1 ) { <nl> return ; <nl> } <nl> static void attach_zval ( json_parser * json , <nl> auto up_mode = json - > stack [ json - > top - 1 ] . mode ; <nl> <nl> if ( up_mode = = Mode : : ARRAY ) { <nl> - if ( container_type = = ContainerType : : COLLECTIONS ) { <nl> + if ( container_type = = JSONContainerType : : COLLECTIONS ) { <nl> collections : : append ( root . getObjectData ( ) , child . asCell ( ) ) ; <nl> } else { <nl> root . toArrRef ( ) . append ( child ) ; <nl> static void attach_zval ( json_parser * json , <nl> } <nl> } <nl> <nl> - ContainerType get_container_type_from_options ( int64_t options ) { <nl> + JSONContainerType get_container_type_from_options ( int64_t options ) { <nl> if ( ( options & k_JSON_FB_STABLE_MAPS ) | | <nl> ( options & k_JSON_FB_COLLECTIONS ) ) { <nl> - return ContainerType : : COLLECTIONS ; <nl> + return JSONContainerType : : COLLECTIONS ; <nl> } <nl> <nl> if ( options & k_JSON_FB_HACK_ARRAYS ) { <nl> - return ContainerType : : HACK_ARRAYS ; <nl> + return JSONContainerType : : HACK_ARRAYS ; <nl> } <nl> <nl> - return ContainerType : : PHP_ARRAYS ; <nl> + return JSONContainerType : : PHP_ARRAYS ; <nl> } <nl> <nl> / * * <nl> bool JSON_parser ( Variant & z , const char * p , int length , bool const assoc , <nl> <nl> / * < fb > * / <nl> bool const loose = options & k_JSON_FB_LOOSE ; <nl> - ContainerType const container_type = get_container_type_from_options ( options ) ; <nl> + JSONContainerType const container_type = <nl> + get_container_type_from_options ( options ) ; <nl> int qchr = 0 ; <nl> int8_t const * byte_class ; <nl> int8_t const ( * next_state_table ) [ 32 ] ; <nl> bool JSON_parser ( Variant & z , const char * p , int length , bool const assoc , <nl> top . unset ( ) ; <nl> } <nl> / * < fb > * / <nl> - if ( container_type = = ContainerType : : COLLECTIONS ) { <nl> + if ( container_type = = JSONContainerType : : COLLECTIONS ) { <nl> / / stable_maps is meaningless <nl> top = req : : make < c_Map > ( ) ; <nl> } else { <nl> bool JSON_parser ( Variant & z , const char * p , int length , bool const assoc , <nl> if ( ! assoc ) { <nl> top = SystemLib : : AllocStdClassObject ( ) ; <nl> / * < fb > * / <nl> - } else if ( container_type = = ContainerType : : HACK_ARRAYS ) { <nl> + } else if ( container_type = = JSONContainerType : : HACK_ARRAYS ) { <nl> top = Array : : CreateDict ( ) ; <nl> / * < / fb > * / <nl> } else { <nl> bool JSON_parser ( Variant & z , const char * p , int length , bool const assoc , <nl> top . unset ( ) ; <nl> } <nl> / * < fb > * / <nl> - if ( container_type = = ContainerType : : COLLECTIONS ) { <nl> + if ( container_type = = JSONContainerType : : COLLECTIONS ) { <nl> top = req : : make < c_Vector > ( ) ; <nl> - } else if ( container_type = = ContainerType : : HACK_ARRAYS ) { <nl> + } else if ( container_type = = JSONContainerType : : HACK_ARRAYS ) { <nl> top = Array : : CreateVec ( ) ; <nl> } else { <nl> top = Array : : Create ( ) ; <nl> bool JSON_parser ( Variant & z , const char * p , int length , bool const assoc , <nl> Variant mval ; <nl> json_create_zval ( mval , * buf , type , options ) ; <nl> auto & top = json - > stack [ json - > top ] . val ; <nl> - if ( container_type = = ContainerType : : COLLECTIONS ) { <nl> + if ( container_type = = JSONContainerType : : COLLECTIONS ) { <nl> collections : : append ( top . getObjectData ( ) , mval . asCell ( ) ) ; <nl> } else { <nl> top . toArrRef ( ) . append ( mval ) ; <nl> bool JSON_parser ( Variant & z , const char * p , int length , bool const assoc , <nl> case Mode : : ARRAY : <nl> if ( type ! = - 1 ) { <nl> auto & top = json - > stack [ json - > top ] . val ; <nl> - if ( container_type = = ContainerType : : COLLECTIONS ) { <nl> + if ( container_type = = JSONContainerType : : COLLECTIONS ) { <nl> collections : : append ( top . getObjectData ( ) , mval . asCell ( ) ) ; <nl> } else { <nl> top . toArrRef ( ) . append ( mval ) ; <nl> mmm a / hphp / runtime / ext / json / JSON_parser . h <nl> ppp b / hphp / runtime / ext / json / JSON_parser . h <nl> <nl> <nl> namespace HPHP { <nl> <nl> + / * * <nl> + * These are the types of containers that can be returned <nl> + * depending on the options used for json_decode . <nl> + * <nl> + * Objects are not included here . <nl> + * / <nl> + enum class JSONContainerType { <nl> + PHP_ARRAYS = 1 , <nl> + COLLECTIONS = 2 , <nl> + HACK_ARRAYS = 3 , <nl> + } ; <nl> + <nl> struct StringBuffer ; <nl> struct Variant ; <nl> <nl> mmm a / hphp / runtime / ext / json / jsonc_parser . cpp <nl> ppp b / hphp / runtime / ext / json / jsonc_parser . cpp <nl> const char * json_get_last_error_msg ( ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> Variant json_object_to_variant ( json_object * new_obj , const bool assoc , <nl> - const bool stable_maps , const bool collections ) ; <nl> + const JSONContainerType container_type ) ; <nl> <nl> Variant json_type_array_to_variant ( json_object * new_obj , const bool assoc , <nl> - const bool stable_maps , <nl> - const bool collections ) { <nl> + const JSONContainerType container_type ) { <nl> int i , nb ; <nl> Variant var , tmpvar ; <nl> nb = json_object_array_length ( new_obj ) ; <nl> - if ( collections ) { <nl> - var = req : : make < c_Vector > ( ) ; <nl> - } else { <nl> - var = Array : : Create ( ) ; <nl> + switch ( container_type ) { <nl> + case JSONContainerType : : COLLECTIONS : <nl> + var = req : : make < c_Vector > ( ) ; <nl> + break ; <nl> + case JSONContainerType : : HACK_ARRAYS : <nl> + var = Array : : CreateVec ( ) ; <nl> + break ; <nl> + case JSONContainerType : : PHP_ARRAYS : <nl> + var = Array : : Create ( ) ; <nl> + break ; <nl> } <nl> + <nl> for ( i = 0 ; i < nb ; i + + ) { <nl> tmpvar = json_object_to_variant ( json_object_array_get_idx ( new_obj , i ) , <nl> - assoc , stable_maps , collections ) ; <nl> - if ( collections ) { <nl> + assoc , container_type ) ; <nl> + if ( container_type = = JSONContainerType : : COLLECTIONS ) { <nl> collections : : append ( var . getObjectData ( ) , tmpvar . asCell ( ) ) ; <nl> } else { <nl> var . asArrRef ( ) . append ( tmpvar ) ; <nl> Variant json_type_array_to_variant ( json_object * new_obj , const bool assoc , <nl> } <nl> <nl> Variant json_type_object_to_variant ( json_object * new_obj , const bool assoc , <nl> - const bool stable_maps , <nl> - const bool collections ) { <nl> + const JSONContainerType container_type ) { <nl> struct json_object_iterator it , itEnd ; <nl> json_object * jobj ; <nl> Variant var , tmpvar ; <nl> <nl> - if ( collections ) { <nl> - var = req : : make < c_Map > ( ) ; <nl> - } else if ( assoc ) { <nl> - var = Array : : Create ( ) ; <nl> - } else { <nl> + if ( ! assoc ) { <nl> var = SystemLib : : AllocStdClassObject ( ) ; <nl> + } else { <nl> + switch ( container_type ) { <nl> + case JSONContainerType : : COLLECTIONS : <nl> + var = req : : make < c_Map > ( ) ; <nl> + break ; <nl> + case JSONContainerType : : HACK_ARRAYS : <nl> + var = Array : : CreateDict ( ) ; <nl> + break ; <nl> + case JSONContainerType : : PHP_ARRAYS : <nl> + var = Array : : Create ( ) ; <nl> + break ; <nl> + } <nl> } <nl> <nl> it = json_object_iter_begin ( new_obj ) ; <nl> Variant json_type_object_to_variant ( json_object * new_obj , const bool assoc , <nl> while ( ! json_object_iter_equal ( & it , & itEnd ) ) { <nl> String key ( json_object_iter_peek_name ( & it ) , CopyString ) ; <nl> jobj = json_object_iter_peek_value ( & it ) ; <nl> - tmpvar = json_object_to_variant ( jobj , assoc , stable_maps , collections ) ; <nl> + tmpvar = json_object_to_variant ( jobj , assoc , container_type ) ; <nl> <nl> if ( ! assoc ) { <nl> if ( key . empty ( ) ) { <nl> Variant json_type_object_to_variant ( json_object * new_obj , const bool assoc , <nl> var . getObjectData ( ) - > o_set ( key , tmpvar ) ; <nl> } <nl> } else { <nl> - if ( collections ) { <nl> - auto keyTV = make_tv < KindOfString > ( key . get ( ) ) ; <nl> - collections : : set ( var . getObjectData ( ) , & keyTV , tmpvar . asCell ( ) ) ; <nl> - } else { <nl> - forceToArray ( var ) . set ( key , tmpvar ) ; <nl> + switch ( container_type ) { <nl> + case JSONContainerType : : COLLECTIONS : { <nl> + auto keyTV = make_tv < KindOfString > ( key . get ( ) ) ; <nl> + collections : : set ( var . getObjectData ( ) , & keyTV , tmpvar . asCell ( ) ) ; <nl> + break ; <nl> + } <nl> + case JSONContainerType : : HACK_ARRAYS : <nl> + forceToDict ( var ) . set ( key , tmpvar ) ; <nl> + break ; <nl> + case JSONContainerType : : PHP_ARRAYS : <nl> + forceToArray ( var ) . set ( key , tmpvar ) ; <nl> + break ; <nl> } <nl> } <nl> json_object_iter_next ( & it ) ; <nl> Variant json_type_object_to_variant ( json_object * new_obj , const bool assoc , <nl> } <nl> <nl> Variant json_object_to_variant ( json_object * new_obj , const bool assoc , <nl> - const bool stable_maps , const bool collections ) { <nl> + const JSONContainerType container_type ) { <nl> json_type type ; <nl> int64_t i64 ; <nl> <nl> Variant json_object_to_variant ( json_object * new_obj , const bool assoc , <nl> if ( ! ( i64 = = INT64_MAX | | i64 = = INT64_MIN ) ) { <nl> return Variant ( i64 ) ; <nl> } <nl> - FOLLY_FALLTHROUGH <nl> + FOLLY_FALLTHROUGH ; <nl> <nl> case json_type_double : <nl> return Variant ( json_object_get_double ( new_obj ) ) ; <nl> Variant json_object_to_variant ( json_object * new_obj , const bool assoc , <nl> return Variant ( Variant : : NullInit ( ) ) ; <nl> <nl> case json_type_array : <nl> - return json_type_array_to_variant ( new_obj , assoc , stable_maps , <nl> - collections ) ; <nl> + return json_type_array_to_variant ( new_obj , assoc , container_type ) ; <nl> <nl> case json_type_object : <nl> - return json_type_object_to_variant ( new_obj , assoc , stable_maps , <nl> - collections ) ; <nl> + return json_type_object_to_variant ( new_obj , assoc , container_type ) ; <nl> <nl> default : <nl> / / warning type < type > not yet implemented <nl> bool JSON_parser ( Variant & return_value , const char * data , int data_len , <nl> / / if ( ! ( options & k_JSON_FB_LOOSE ) ) { <nl> / / json_tokener_set_flags ( tok , JSON_TOKENER_STRICT ) ; <nl> / / } <nl> - <nl> - bool const stable_maps = options & k_JSON_FB_STABLE_MAPS ; <nl> - bool const collections = stable_maps | | options & k_JSON_FB_COLLECTIONS ; <nl> + JSONContainerType container_type = JSONContainerType : : PHP_ARRAYS ; <nl> + if ( options & ( k_JSON_FB_STABLE_MAPS | k_JSON_FB_COLLECTIONS ) ) { <nl> + assoc = true ; <nl> + container_type = JSONContainerType : : COLLECTIONS ; <nl> + } else if ( options & k_JSON_FB_HACK_ARRAYS ) { <nl> + container_type = JSONContainerType : : HACK_ARRAYS ; <nl> + } <nl> <nl> new_obj = json_tokener_parse_ex ( tok , data , data_len ) ; <nl> if ( json_tokener_get_error ( tok ) = = json_tokener_continue ) { <nl> bool JSON_parser ( Variant & return_value , const char * data , int data_len , <nl> } <nl> <nl> if ( new_obj ) { <nl> - return_value = json_object_to_variant ( new_obj , assoc , stable_maps , <nl> - collections ) ; <nl> + return_value = json_object_to_variant ( new_obj , assoc , container_type ) ; <nl> json_object_put ( new_obj ) ; <nl> retval = true ; <nl> } else { <nl>
|
Support JSON_FB_HACK_ARRAYS when using json - c
|
facebook/hhvm
|
94f3323bdfc219f66c0c52efa393612829704ec8
|
2018-01-18T17:24:31Z
|
mmm a / tensorflow / lite / kernels / internal / optimized / depthwiseconv_uint8_3x3_filter . h <nl> ppp b / tensorflow / lite / kernels / internal / optimized / depthwiseconv_uint8_3x3_filter . h <nl> limitations under the License . <nl> # ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_DEPTHWISECONV_UINT8_3X3_FILTER_H_ <nl> # define TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_DEPTHWISECONV_UINT8_3X3_FILTER_H_ <nl> <nl> + # include < cstddef > <nl> # include < memory > <nl> <nl> # include " profiling / instrumentation . h " <nl> struct ProcessPerDepth < DepthwiseConvImplementation : : kUseNeon3x3DotProduct > { <nl> " zip1 v24 . 8h , v22 . 8h , v23 . 8h \ n " <nl> " ld1 { v7 . d } [ 0 ] , [ x13 ] , x9 \ n " <nl> " zip2 v22 . 8h , v22 . 8h , v23 . 8h \ n " <nl> - " sdot v21 . 4s , v22 . 16b , v2 . 16b \ n " <nl> - " sdot v20 . 4s , v24 . 16b , v2 . 16b \ n " <nl> + " . word 0x4e8296d5 / / sdot v21 . 4s , v22 . 16b , v2 . 16b \ n " <nl> + " . word 0x4e829714 / / sdot v20 . 4s , v24 . 16b , v2 . 16b \ n " <nl> " ld1 { v6 . d } [ 0 ] , [ x13 ] , x9 \ n " <nl> " zip1 v23 . 16b , v16 . 16b , v7 . 16b \ n " <nl> " eor v23 . 16b , v23 . 16b , v0 . 16b \ n " <nl> struct ProcessPerDepth < DepthwiseConvImplementation : : kUseNeon3x3DotProduct > { <nl> " zip1 v26 . 8h , v23 . 8h , v25 . 8h \ n " <nl> " ld1 { v4 . d } [ 0 ] , [ x13 ] , x9 \ n " <nl> " zip2 v23 . 8h , v23 . 8h , v25 . 8h \ n " <nl> - " sdot v21 . 4s , v23 . 16b , v2 . 16b \ n " <nl> - " sdot v20 . 4s , v26 . 16b , v2 . 16b \ n " <nl> + " . word 0x4e8296f5 / / sdot v21 . 4s , v23 . 16b , v2 . 16b \ n " <nl> + " . word 0x4e829754 / / sdot v20 . 4s , v26 . 16b , v2 . 16b \ n " <nl> " ld1 { v3 . d } [ 0 ] , [ x13 ] \ n " <nl> " zip1 v25 . 16b , v5 . 16b , v4 . 16b \ n " <nl> " stp q26 , q23 , [ % [ shuffled_filter_data ] , # 32 ] \ n " <nl> struct ProcessPerDepth < DepthwiseConvImplementation : : kUseNeon3x3DotProduct > { <nl> " zip1 v24 . 8h , v22 . 8h , v23 . 8h \ n " <nl> " zip2 v22 . 8h , v22 . 8h , v23 . 8h \ n " <nl> " stp q24 , q22 , [ % [ shuffled_filter_data ] , # 64 ] \ n " <nl> - " sdot v21 . 4s , v22 . 16b , v2 . 16b \ n " <nl> + " . word 0x4e8296d5 / / sdot v21 . 4s , v22 . 16b , v2 . 16b \ n " <nl> " ldr q22 , [ % [ bias_data ] ] \ n " <nl> " ldr q23 , [ % [ bias_data ] , x12 ] \ n " <nl> - " sdot v20 . 4s , v24 . 16b , v2 . 16b \ n " <nl> + " . word 0x4e829714 / / sdot v20 . 4s , v24 . 16b , v2 . 16b \ n " <nl> " add % [ shuffled_filter_data ] , x2 , # 96 \ n " / / = 96 <nl> " mla v22 . 4s , v20 . 4s , v1 . 4s \ n " <nl> " mla v23 . 4s , v21 . 4s , v1 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " ldr q25 , [ x10 , x12 ] \ n " <nl> " ldr x12 , [ sp , # 88 ] \ n " / / 8 - byte Folded Reload <nl> " shl v3 . 4s , v20 . 4s , # 8 \ n " <nl> - " sdot v31 . 4s , v20 . 16b , v24 . 16b \ n " <nl> - " sdot v8 . 4s , v19 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e98969f / / sdot v31 . 4s , v20 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e989668 / / sdot v8 . 4s , v19 . 16b , v24 . 16b \ n " <nl> " ldr q26 , [ x10 , x12 ] \ n " <nl> " ldr x12 , [ sp , # 112 ] \ n " / / 8 - byte Folded Reload <nl> - " sdot v9 . 4s , v18 . 16b , v24 . 16b \ n " <nl> - " sdot v10 . 4s , v18 . 16b , v25 . 16b \ n " <nl> + " . word 0x4e989649 / / sdot v9 . 4s , v18 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e99964a / / sdot v10 . 4s , v18 . 16b , v25 . 16b \ n " <nl> " str q3 , [ sp , # 192 ] \ n " / / 16 - byte Folded Spill <nl> " ldr q27 , [ x10 , x12 ] \ n " <nl> " stp % [ scratch_block_data ] , x13 , [ sp , # 152 ] \ n " / / 8 - byte Folded Spill <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " ldr x13 , [ sp , # 144 ] \ n " / / 8 - byte Folded Reload <nl> " b DC_KERNEL_NO_MULT_5 \ n " <nl> " DC_KERNEL_NO_MULT_4 : \ n " / / in Loop : Header = BB225_5 Depth = 3 <nl> - " sdot v31 . 4s , v18 . 16b , v14 . 16b \ n " <nl> - " sdot v8 . 4s , v18 . 16b , v23 . 16b \ n " <nl> - " sdot v9 . 4s , v19 . 16b , v25 . 16b \ n " <nl> - " sdot v31 . 4s , v19 . 16b , v23 . 16b \ n " <nl> - " sdot v10 . 4s , v19 . 16b , v26 . 16b \ n " <nl> - " sdot v8 . 4s , v20 . 16b , v25 . 16b \ n " <nl> - " sdot v9 . 4s , v20 . 16b , v26 . 16b \ n " <nl> + " . word 0x4e8e965f / / sdot v31 . 4s , v18 . 16b , v14 . 16b \ n " <nl> + " . word 0x4e979648 / / sdot v8 . 4s , v18 . 16b , v23 . 16b \ n " <nl> + " . word 0x4e999669 / / sdot v9 . 4s , v19 . 16b , v25 . 16b \ n " <nl> + " . word 0x4e97967f / / sdot v31 . 4s , v19 . 16b , v23 . 16b \ n " <nl> + " . word 0x4e9a966a / / sdot v10 . 4s , v19 . 16b , v26 . 16b \ n " <nl> + " . word 0x4e999688 / / sdot v8 . 4s , v20 . 16b , v25 . 16b \ n " <nl> + " . word 0x4e9a9689 / / sdot v9 . 4s , v20 . 16b , v26 . 16b \ n " <nl> " sqrdmulh v31 . 4s , v31 . 4s , v1 . 4s \ n " <nl> - " sdot v10 . 4s , v20 . 16b , v27 . 16b \ n " <nl> + " . word 0x4e9b968a / / sdot v10 . 4s , v20 . 16b , v27 . 16b \ n " <nl> " sqrdmulh v8 . 4s , v8 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v9 . 4s , v9 . 4s , v1 . 4s \ n " <nl> " sqrshl v31 . 4s , v31 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " mov v9 . 16b , v21 . 16b \ n " <nl> " mov v10 . 16b , v21 . 16b \ n " <nl> " mov v11 . 16b , v21 . 16b \ n " <nl> - " sdot v8 . 4s , v29 . 16b , v14 . 16b \ n " <nl> - " sdot v9 . 4s , v29 . 16b , v23 . 16b \ n " <nl> - " sdot v10 . 4s , v29 . 16b , v24 . 16b \ n " <nl> - " sdot v8 . 4s , v30 . 16b , v23 . 16b \ n " <nl> - " sdot v11 . 4s , v29 . 16b , v25 . 16b \ n " <nl> - " sdot v9 . 4s , v30 . 16b , v24 . 16b \ n " <nl> - " sdot v10 . 4s , v30 . 16b , v25 . 16b \ n " <nl> - " sdot v8 . 4s , v5 . 16b , v24 . 16b \ n " <nl> - " sdot v11 . 4s , v30 . 16b , v26 . 16b \ n " <nl> - " sdot v9 . 4s , v5 . 16b , v25 . 16b \ n " <nl> - " sdot v10 . 4s , v5 . 16b , v26 . 16b \ n " <nl> + " . word 0x4e8e97a8 / / sdot v8 . 4s , v29 . 16b , v14 . 16b \ n " <nl> + " . word 0x4e9797a9 / / sdot v9 . 4s , v29 . 16b , v23 . 16b \ n " <nl> + " . word 0x4e9897aa / / sdot v10 . 4s , v29 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e9797c8 / / sdot v8 . 4s , v30 . 16b , v23 . 16b \ n " <nl> + " . word 0x4e9997ab / / sdot v11 . 4s , v29 . 16b , v25 . 16b \ n " <nl> + " . word 0x4e9897c9 / / sdot v9 . 4s , v30 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e9997ca / / sdot v10 . 4s , v30 . 16b , v25 . 16b \ n " <nl> + " . word 0x4e9894a8 / / sdot v8 . 4s , v5 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e9a97cb / / sdot v11 . 4s , v30 . 16b , v26 . 16b \ n " <nl> + " . word 0x4e9994a9 / / sdot v9 . 4s , v5 . 16b , v25 . 16b \ n " <nl> + " . word 0x4e9a94aa / / sdot v10 . 4s , v5 . 16b , v26 . 16b \ n " <nl> " sqrdmulh v22 . 4s , v8 . 4s , v1 . 4s \ n " <nl> " rev32 v12 . 8h , v23 . 8h \ n " <nl> " rev32 v13 . 8h , v24 . 8h \ n " <nl> - " sdot v11 . 4s , v5 . 16b , v27 . 16b \ n " <nl> + " . word 0x4e9b94ab / / sdot v11 . 4s , v5 . 16b , v27 . 16b \ n " <nl> " sqrdmulh v23 . 4s , v9 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v24 . 4s , v10 . 4s , v1 . 4s \ n " <nl> " sqrshl v22 . 4s , v22 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " mov v11 . 16b , v21 . 16b \ n " <nl> " trn1 v12 . 8h , v12 . 8h , v23 . 8h \ n " <nl> " trn1 v13 . 8h , v13 . 8h , v24 . 8h \ n " <nl> - " sdot v9 . 4s , v18 . 16b , v31 . 16b \ n " <nl> + " . word 0x4e9f9649 / / sdot v9 . 4s , v18 . 16b , v31 . 16b \ n " <nl> " st1 { v8 . s } [ 3 ] , [ x10 ] \ n " <nl> " mov v8 . 16b , v21 . 16b \ n " <nl> " trn1 v14 . 8h , v4 . 8h , v25 . 8h \ n " <nl> - " sdot v10 . 4s , v18 . 16b , v12 . 16b \ n " <nl> - " sdot v11 . 4s , v18 . 16b , v13 . 16b \ n " <nl> - " sdot v9 . 4s , v19 . 16b , v12 . 16b \ n " <nl> + " . word 0x4e8c964a / / sdot v10 . 4s , v18 . 16b , v12 . 16b \ n " <nl> + " . word 0x4e8d964b / / sdot v11 . 4s , v18 . 16b , v13 . 16b \ n " <nl> + " . word 0x4e8c9669 / / sdot v9 . 4s , v19 . 16b , v12 . 16b \ n " <nl> " trn1 v15 . 8h , v15 . 8h , v26 . 8h \ n " <nl> - " sdot v8 . 4s , v18 . 16b , v14 . 16b \ n " <nl> - " sdot v10 . 4s , v19 . 16b , v13 . 16b \ n " <nl> - " sdot v11 . 4s , v19 . 16b , v14 . 16b \ n " <nl> - " sdot v9 . 4s , v20 . 16b , v13 . 16b \ n " <nl> + " . word 0x4e8e9648 / / sdot v8 . 4s , v18 . 16b , v14 . 16b \ n " <nl> + " . word 0x4e8d966a / / sdot v10 . 4s , v19 . 16b , v13 . 16b \ n " <nl> + " . word 0x4e8e966b / / sdot v11 . 4s , v19 . 16b , v14 . 16b \ n " <nl> + " . word 0x4e8d9689 / / sdot v9 . 4s , v20 . 16b , v13 . 16b \ n " <nl> " trn1 v3 . 8h , v3 . 8h , v27 . 8h \ n " <nl> - " sdot v8 . 4s , v19 . 16b , v15 . 16b \ n " <nl> - " sdot v10 . 4s , v20 . 16b , v14 . 16b \ n " <nl> - " sdot v11 . 4s , v20 . 16b , v15 . 16b \ n " <nl> + " . word 0x4e8f9668 / / sdot v8 . 4s , v19 . 16b , v15 . 16b \ n " <nl> + " . word 0x4e8e968a / / sdot v10 . 4s , v20 . 16b , v14 . 16b \ n " <nl> + " . word 0x4e8f968b / / sdot v11 . 4s , v20 . 16b , v15 . 16b \ n " <nl> " sqrdmulh v9 . 4s , v9 . 4s , v1 . 4s \ n " <nl> - " sdot v8 . 4s , v20 . 16b , v3 . 16b \ n " <nl> + " . word 0x4e839688 / / sdot v8 . 4s , v20 . 16b , v3 . 16b \ n " <nl> " sqrdmulh v10 . 4s , v10 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v11 . 4s , v11 . 4s , v1 . 4s \ n " <nl> " sqrshl v9 . 4s , v9 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " mov v11 . 16b , v21 . 16b \ n " <nl> " st1 { v8 . s } [ 3 ] , [ x10 ] \ n " <nl> " mov v8 . 16b , v21 . 16b \ n " <nl> - " sdot v9 . 4s , v29 . 16b , v31 . 16b \ n " <nl> - " sdot v10 . 4s , v29 . 16b , v12 . 16b \ n " <nl> - " sdot v11 . 4s , v29 . 16b , v13 . 16b \ n " <nl> - " sdot v8 . 4s , v29 . 16b , v14 . 16b \ n " <nl> - " sdot v9 . 4s , v30 . 16b , v12 . 16b \ n " <nl> - " sdot v10 . 4s , v30 . 16b , v13 . 16b \ n " <nl> - " sdot v11 . 4s , v30 . 16b , v14 . 16b \ n " <nl> - " sdot v8 . 4s , v30 . 16b , v15 . 16b \ n " <nl> - " sdot v9 . 4s , v5 . 16b , v13 . 16b \ n " <nl> - " sdot v10 . 4s , v5 . 16b , v14 . 16b \ n " <nl> - " sdot v11 . 4s , v5 . 16b , v15 . 16b \ n " <nl> - " sdot v8 . 4s , v5 . 16b , v3 . 16b \ n " <nl> + " . word 0x4e9f97a9 / / sdot v9 . 4s , v29 . 16b , v31 . 16b \ n " <nl> + " . word 0x4e8c97aa / / sdot v10 . 4s , v29 . 16b , v12 . 16b \ n " <nl> + " . word 0x4e8d97ab / / sdot v11 . 4s , v29 . 16b , v13 . 16b \ n " <nl> + " . word 0x4e8e97a8 / / sdot v8 . 4s , v29 . 16b , v14 . 16b \ n " <nl> + " . word 0x4e8c97c9 / / sdot v9 . 4s , v30 . 16b , v12 . 16b \ n " <nl> + " . word 0x4e8d97ca / / sdot v10 . 4s , v30 . 16b , v13 . 16b \ n " <nl> + " . word 0x4e8e97cb / / sdot v11 . 4s , v30 . 16b , v14 . 16b \ n " <nl> + " . word 0x4e8f97c8 / / sdot v8 . 4s , v30 . 16b , v15 . 16b \ n " <nl> + " . word 0x4e8d94a9 / / sdot v9 . 4s , v5 . 16b , v13 . 16b \ n " <nl> + " . word 0x4e8e94aa / / sdot v10 . 4s , v5 . 16b , v14 . 16b \ n " <nl> + " . word 0x4e8f94ab / / sdot v11 . 4s , v5 . 16b , v15 . 16b \ n " <nl> + " . word 0x4e8394a8 / / sdot v8 . 4s , v5 . 16b , v3 . 16b \ n " <nl> " sqrdmulh v3 . 4s , v9 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v31 . 4s , v10 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v9 . 4s , v11 . 4s , v1 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " mov v9 . 16b , v21 . 16b \ n " <nl> " mov v10 . 16b , v21 . 16b \ n " <nl> " add w17 , w17 , # 1 \ n " / / = 1 <nl> - " sdot v31 . 4s , v20 . 16b , v24 . 16b \ n " <nl> - " sdot v8 . 4s , v19 . 16b , v24 . 16b \ n " <nl> - " sdot v9 . 4s , v18 . 16b , v24 . 16b \ n " <nl> - " sdot v10 . 4s , v18 . 16b , v25 . 16b \ n " <nl> + " . word 0x4e98969f / / sdot v31 . 4s , v20 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e989668 / / sdot v8 . 4s , v19 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e989649 / / sdot v9 . 4s , v18 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e99964a / / sdot v10 . 4s , v18 . 16b , v25 . 16b \ n " <nl> " st1 { v3 . s } [ 3 ] , [ x10 ] \ n " <nl> " add % [ scratch_block_data ] , x0 , % [ bias_data ] \ n " <nl> " add x12 , x12 , # 32 \ n " / / = 32 <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " add % [ scratch_block_data ] , x6 , x0 \ n " <nl> " b DC_KERNEL_NO_MULT_11 \ n " <nl> " DC_KERNEL_NO_MULT_10 : \ n " / / in Loop : Header = BB225_11 Depth = 3 <nl> - " sdot v31 . 4s , v18 . 16b , v14 . 16b \ n " <nl> - " sdot v8 . 4s , v18 . 16b , v23 . 16b \ n " <nl> - " sdot v9 . 4s , v19 . 16b , v25 . 16b \ n " <nl> - " sdot v31 . 4s , v19 . 16b , v23 . 16b \ n " <nl> - " sdot v10 . 4s , v19 . 16b , v26 . 16b \ n " <nl> - " sdot v8 . 4s , v20 . 16b , v25 . 16b \ n " <nl> - " sdot v9 . 4s , v20 . 16b , v26 . 16b \ n " <nl> + " . word 0x4e8e965f / / sdot v31 . 4s , v18 . 16b , v14 . 16b \ n " <nl> + " . word 0x4e979648 / / sdot v8 . 4s , v18 . 16b , v23 . 16b \ n " <nl> + " . word 0x4e999669 / / sdot v9 . 4s , v19 . 16b , v25 . 16b \ n " <nl> + " . word 0x4e97967f / / sdot v31 . 4s , v19 . 16b , v23 . 16b \ n " <nl> + " . word 0x4e9a966a / / sdot v10 . 4s , v19 . 16b , v26 . 16b \ n " <nl> + " . word 0x4e999688 / / sdot v8 . 4s , v20 . 16b , v25 . 16b \ n " <nl> + " . word 0x4e9a9689 / / sdot v9 . 4s , v20 . 16b , v26 . 16b \ n " <nl> " sqrdmulh v3 . 4s , v31 . 4s , v1 . 4s \ n " <nl> - " sdot v10 . 4s , v20 . 16b , v27 . 16b \ n " <nl> + " . word 0x4e9b968a / / sdot v10 . 4s , v20 . 16b , v27 . 16b \ n " <nl> " sqrdmulh v31 . 4s , v8 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v8 . 4s , v9 . 4s , v1 . 4s \ n " <nl> " sqrshl v3 . 4s , v3 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " sli v27 . 4s , v13 . 4s , # 24 \ n " <nl> " ushr v13 . 4s , v13 . 4s , # 8 \ n " <nl> " st1 { v3 . s } [ 3 ] , [ x6 ] \ n " <nl> - " sdot v31 . 4s , v20 . 16b , v24 . 16b \ n " <nl> - " sdot v8 . 4s , v19 . 16b , v24 . 16b \ n " <nl> - " sdot v9 . 4s , v18 . 16b , v24 . 16b \ n " <nl> - " sdot v10 . 4s , v18 . 16b , v25 . 16b \ n " <nl> + " . word 0x4e98969f / / sdot v31 . 4s , v20 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e989668 / / sdot v8 . 4s , v19 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e989649 / / sdot v9 . 4s , v18 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e99964a / / sdot v10 . 4s , v18 . 16b , v25 . 16b \ n " <nl> " add x12 , x12 , x16 \ n " <nl> " DC_KERNEL_NO_MULT_11 : \ n " / / Parent Loop BB225_26 Depth = 1 <nl> / / Parent Loop BB225_13 Depth = 2 <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " DC_KERNEL_NO_MULT_19 : \ n " / / in Loop : Header = BB225_20 Depth = 4 <nl> " mov v3 . 16b , v21 . 16b \ n " <nl> " mov v11 . 16b , v22 . 16b \ n " <nl> - " sdot v3 . 4s , v18 . 16b , v23 . 16b \ n " <nl> - " sdot v11 . 4s , v7 . 16b , v24 . 16b \ n " <nl> - " sdot v3 . 4s , v19 . 16b , v25 . 16b \ n " <nl> - " sdot v11 . 4s , v16 . 16b , v26 . 16b \ n " <nl> - " sdot v3 . 4s , v20 . 16b , v27 . 16b \ n " <nl> - " sdot v11 . 4s , v17 . 16b , v28 . 16b \ n " <nl> + " . word 0x4e979643 / / sdot v3 . 4s , v18 . 16b , v23 . 16b \ n " <nl> + " . word 0x4e9894eb / / sdot v11 . 4s , v7 . 16b , v24 . 16b \ n " <nl> + " . word 0x4e999663 / / sdot v3 . 4s , v19 . 16b , v25 . 16b \ n " <nl> + " . word 0x4e9a960b / / sdot v11 . 4s , v16 . 16b , v26 . 16b \ n " <nl> + " . word 0x4e9b9683 / / sdot v3 . 4s , v20 . 16b , v27 . 16b \ n " <nl> + " . word 0x4e9c962b / / sdot v11 . 4s , v17 . 16b , v28 . 16b \ n " <nl> " sqrdmulh v3 . 4s , v3 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v11 . 4s , v11 . 4s , v1 . 4s \ n " <nl> " sqrshl v3 . 4s , v3 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " DC_KERNEL_NO_MULT_STRIDE_4 : \ n " / / in Loop : Header = BB227_5 Depth = 3 <nl> " mov v23 . 16b , v24 . 16b \ n " <nl> " mov v10 . 16b , v24 . 16b \ n " <nl> - " sdot v23 . 4s , v25 . 16b , v30 . 16b \ n " <nl> - " sdot v10 . 4s , v25 . 16b , v28 . 16b \ n " <nl> - " sdot v23 . 4s , v26 . 16b , v29 . 16b \ n " <nl> - " sdot v10 . 4s , v26 . 16b , v31 . 16b \ n " <nl> - " sdot v23 . 4s , v27 . 16b , v28 . 16b \ n " <nl> - " sdot v10 . 4s , v27 . 16b , v8 . 16b \ n " <nl> + " . word 0x4e9e9737 / / sdot v23 . 4s , v25 . 16b , v30 . 16b \ n " <nl> + " . word 0x4e9c972a / / sdot v10 . 4s , v25 . 16b , v28 . 16b \ n " <nl> + " . word 0x4e9d9757 / / sdot v23 . 4s , v26 . 16b , v29 . 16b \ n " <nl> + " . word 0x4e9f974a / / sdot v10 . 4s , v26 . 16b , v31 . 16b \ n " <nl> + " . word 0x4e9c9777 / / sdot v23 . 4s , v27 . 16b , v28 . 16b \ n " <nl> + " . word 0x4e88976a / / sdot v10 . 4s , v27 . 16b , v8 . 16b \ n " <nl> " sqrdmulh v23 . 4s , v23 . 4s , v3 . 4s \ n " <nl> " ubfiz % [ scratch_block_data ] , x28 , # 5 , # 27 \ n " <nl> " rev32 v13 . 8h , v28 . 8h \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " mov v23 . 16b , v24 . 16b \ n " <nl> " trn1 v30 . 8h , v12 . 8h , v20 . 8h \ n " <nl> " trn1 v31 . 8h , v13 . 8h , v21 . 8h \ n " <nl> - " sdot v28 . 4s , v25 . 16b , v29 . 16b \ n " <nl> + " . word 0x4e9d973c / / sdot v28 . 4s , v25 . 16b , v29 . 16b \ n " <nl> " rev32 v9 . 8h , v9 . 8h \ n " <nl> " trn1 v10 . 8h , v14 . 8h , v22 . 8h \ n " <nl> - " sdot v23 . 4s , v25 . 16b , v31 . 16b \ n " <nl> - " sdot v28 . 4s , v26 . 16b , v30 . 16b \ n " <nl> + " . word 0x4e9f9737 / / sdot v23 . 4s , v25 . 16b , v31 . 16b \ n " <nl> + " . word 0x4e9e975c / / sdot v28 . 4s , v26 . 16b , v30 . 16b \ n " <nl> " trn1 v9 . 8h , v9 . 8h , v8 . 8h \ n " <nl> - " sdot v23 . 4s , v26 . 16b , v10 . 16b \ n " <nl> - " sdot v28 . 4s , v27 . 16b , v31 . 16b \ n " <nl> - " sdot v23 . 4s , v27 . 16b , v9 . 16b \ n " <nl> + " . word 0x4e8a9757 / / sdot v23 . 4s , v26 . 16b , v10 . 16b \ n " <nl> + " . word 0x4e9f977c / / sdot v28 . 4s , v27 . 16b , v31 . 16b \ n " <nl> + " . word 0x4e899777 / / sdot v23 . 4s , v27 . 16b , v9 . 16b \ n " <nl> " sqrdmulh v28 . 4s , v28 . 4s , v3 . 4s \ n " <nl> " sqrdmulh v23 . 4s , v23 . 4s , v3 . 4s \ n " <nl> " sqrshl v28 . 4s , v28 . 4s , v4 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " DC_KERNEL_NO_MULT_STRIDE_6 : \ n " / / in Loop : Header = BB227_7 Depth = 3 <nl> " mov v8 . 16b , v24 . 16b \ n " <nl> " mov v10 . 16b , v24 . 16b \ n " <nl> - " sdot v8 . 4s , v25 . 16b , v30 . 16b \ n " <nl> - " sdot v8 . 4s , v26 . 16b , v29 . 16b \ n " <nl> - " sdot v10 . 4s , v25 . 16b , v28 . 16b \ n " <nl> - " sdot v8 . 4s , v27 . 16b , v28 . 16b \ n " <nl> - " sdot v10 . 4s , v26 . 16b , v31 . 16b \ n " <nl> - " sdot v10 . 4s , v27 . 16b , v9 . 16b \ n " <nl> + " . word 0x4e9e9728 / / sdot v8 . 4s , v25 . 16b , v30 . 16b \ n " <nl> + " . word 0x4e9d9748 / / sdot v8 . 4s , v26 . 16b , v29 . 16b \ n " <nl> + " . word 0x4e9c972a / / sdot v10 . 4s , v25 . 16b , v28 . 16b \ n " <nl> + " . word 0x4e9c9768 / / sdot v8 . 4s , v27 . 16b , v28 . 16b \ n " <nl> + " . word 0x4e9f974a / / sdot v10 . 4s , v26 . 16b , v31 . 16b \ n " <nl> + " . word 0x4e89976a / / sdot v10 . 4s , v27 . 16b , v9 . 16b \ n " <nl> " sqrdmulh v8 . 4s , v8 . 4s , v3 . 4s \ n " <nl> " sqrdmulh v10 . 4s , v10 . 4s , v3 . 4s \ n " <nl> " sqrshl v8 . 4s , v8 . 4s , v4 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " DC_KERNEL_NO_MULT_STRIDE_14 : \ n " / / in Loop : Header = BB227_17 Depth = 2 <nl> " mov v14 . 16b , v30 . 16b \ n " <nl> " mov v15 . 16b , v31 . 16b \ n " <nl> - " sdot v14 . 4s , v24 . 16b , v13 . 16b \ n " <nl> - " sdot v14 . 4s , v26 . 16b , v8 . 16b \ n " <nl> - " sdot v15 . 4s , v25 . 16b , v11 . 16b \ n " <nl> - " sdot v14 . 4s , v28 . 16b , v10 . 16b \ n " <nl> - " sdot v15 . 4s , v27 . 16b , v9 . 16b \ n " <nl> - " sdot v15 . 4s , v29 . 16b , v12 . 16b \ n " <nl> + " . word 0x4e8d970e / / sdot v14 . 4s , v24 . 16b , v13 . 16b \ n " <nl> + " . word 0x4e88974e / / sdot v14 . 4s , v26 . 16b , v8 . 16b \ n " <nl> + " . word 0x4e8b972f / / sdot v15 . 4s , v25 . 16b , v11 . 16b \ n " <nl> + " . word 0x4e8a978e / / sdot v14 . 4s , v28 . 16b , v10 . 16b \ n " <nl> + " . word 0x4e89976f / / sdot v15 . 4s , v27 . 16b , v9 . 16b \ n " <nl> + " . word 0x4e8c97af / / sdot v15 . 4s , v29 . 16b , v12 . 16b \ n " <nl> " sqrdmulh v14 . 4s , v14 . 4s , v3 . 4s \ n " <nl> " sqrdmulh v15 . 4s , v15 . 4s , v3 . 4s \ n " <nl> " sqrshl v14 . 4s , v14 . 4s , v4 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " b . eq DC_KERNEL_NO_MULT_STRIDE_16 \ n " <nl> / / % bb . 15 : / / in Loop : Header = BB227_17 Depth = 2 <nl> " mov v14 . 16b , v30 . 16b \ n " <nl> - " sdot v14 . 4s , v24 . 16b , v13 . 16b \ n " <nl> + " . word 0x4e8d970e / / sdot v14 . 4s , v24 . 16b , v13 . 16b \ n " <nl> " mov v13 . 16b , v31 . 16b \ n " <nl> - " sdot v13 . 4s , v25 . 16b , v11 . 16b \ n " <nl> - " sdot v14 . 4s , v26 . 16b , v8 . 16b \ n " <nl> - " sdot v13 . 4s , v27 . 16b , v9 . 16b \ n " <nl> - " sdot v14 . 4s , v28 . 16b , v10 . 16b \ n " <nl> - " sdot v13 . 4s , v29 . 16b , v12 . 16b \ n " <nl> + " . word 0x4e8b972d / / sdot v13 . 4s , v25 . 16b , v11 . 16b \ n " <nl> + " . word 0x4e88974e / / sdot v14 . 4s , v26 . 16b , v8 . 16b \ n " <nl> + " . word 0x4e89976d / / sdot v13 . 4s , v27 . 16b , v9 . 16b \ n " <nl> + " . word 0x4e8a978e / / sdot v14 . 4s , v28 . 16b , v10 . 16b \ n " <nl> + " . word 0x4e8c97ad / / sdot v13 . 4s , v29 . 16b , v12 . 16b \ n " <nl> " sqrdmulh v8 . 4s , v14 . 4s , v3 . 4s \ n " <nl> " sqrdmulh v9 . 4s , v13 . 4s , v3 . 4s \ n " <nl> " sqrshl v8 . 4s , v8 . 4s , v4 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " ldr x6 , [ sp , # 96 ] \ n " / / 8 - byte Folded Reload <nl> " mov v29 . 16b , v22 . 16b \ n " <nl> " mov v30 . 16b , v22 . 16b \ n " <nl> - " sdot v28 . 4s , v20 . 16b , v31 . 16b \ n " <nl> - " sdot v29 . 4s , v19 . 16b , v31 . 16b \ n " <nl> - " sdot v30 . 4s , v18 . 16b , v31 . 16b \ n " <nl> + " . word 0x4e9f969c / / sdot v28 . 4s , v20 . 16b , v31 . 16b \ n " <nl> + " . word 0x4e9f967d / / sdot v29 . 4s , v19 . 16b , v31 . 16b \ n " <nl> + " . word 0x4e9f965e / / sdot v30 . 4s , v18 . 16b , v31 . 16b \ n " <nl> " mov v31 . 16b , v22 . 16b \ n " <nl> " mov x13 , xzr \ n " <nl> " shl v25 . 4s , v18 . 4s , # 8 \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " shl v27 . 4s , v20 . 4s , # 8 \ n " <nl> " mov v21 . s [ 3 ] , w12 \ n " <nl> " mov v24 . s [ 3 ] , w3 \ n " <nl> - " sdot v31 . 4s , v18 . 16b , v8 . 16b \ n " <nl> + " . word 0x4e88965f / / sdot v31 . 4s , v18 . 16b , v8 . 16b \ n " <nl> " mov x12 , x19 \ n " <nl> " b DC_KERNEL_MULT_5 \ n " <nl> " DC_KERNEL_MULT_4 : \ n " / / in Loop : Header = BB205_5 Depth = 3 <nl> - " sdot v28 . 4s , v18 . 16b , v21 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v18 . 16b , v21 . 4b [ 2 ] \ n " <nl> - " sdot v30 . 4s , v19 . 16b , v23 . 4b [ 2 ] \ n " <nl> - " sdot v28 . 4s , v19 . 16b , v21 . 4b [ 2 ] \ n " <nl> - " sdot v31 . 4s , v19 . 16b , v24 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v20 . 16b , v23 . 4b [ 2 ] \ n " <nl> - " sdot v30 . 4s , v20 . 16b , v24 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e25c / / sdot v28 . 4s , v18 . 16b , v21 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95ea5d / / sdot v29 . 4s , v18 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f97ea7e / / sdot v30 . 4s , v19 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f95ea7c / / sdot v28 . 4s , v19 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f98e27f / / sdot v31 . 4s , v19 . 16b , v24 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97ea9d / / sdot v29 . 4s , v20 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f98e29e / / sdot v30 . 4s , v20 . 16b , v24 . 4b [ 0 ] \ n " <nl> " sqrdmulh v28 . 4s , v28 . 4s , v1 . 4s \ n " <nl> - " sdot v31 . 4s , v20 . 16b , v24 . 4b [ 2 ] \ n " <nl> + " . word 0x4f98ea9f / / sdot v31 . 4s , v20 . 16b , v24 . 4b [ 2 ] \ n " <nl> " sqrdmulh v29 . 4s , v29 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v30 . 4s , v30 . 4s , v1 . 4s \ n " <nl> " sqrshl v28 . 4s , v28 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " ld1 { v24 . s } [ 3 ] , [ % [ output_block_data ] ] \ n " <nl> " mov v29 . 16b , v22 . 16b \ n " <nl> " mov v30 . 16b , v22 . 16b \ n " <nl> - " sdot v28 . 4s , v25 . 16b , v21 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e33c / / sdot v28 . 4s , v25 . 16b , v21 . 4b [ 0 ] \ n " <nl> " mov v31 . 16b , v22 . 16b \ n " <nl> - " sdot v29 . 4s , v25 . 16b , v21 . 4b [ 2 ] \ n " <nl> - " sdot v30 . 4s , v25 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v28 . 4s , v26 . 16b , v21 . 4b [ 2 ] \ n " <nl> - " sdot v31 . 4s , v25 . 16b , v23 . 4b [ 2 ] \ n " <nl> - " sdot v29 . 4s , v26 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v30 . 4s , v26 . 16b , v23 . 4b [ 2 ] \ n " <nl> - " sdot v28 . 4s , v27 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v31 . 4s , v26 . 16b , v24 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v27 . 16b , v23 . 4b [ 2 ] \ n " <nl> - " sdot v30 . 4s , v27 . 16b , v24 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95eb3d / / sdot v29 . 4s , v25 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f97e33e / / sdot v30 . 4s , v25 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95eb5c / / sdot v28 . 4s , v26 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f97eb3f / / sdot v31 . 4s , v25 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f97e35d / / sdot v29 . 4s , v26 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97eb5e / / sdot v30 . 4s , v26 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f97e37c / / sdot v28 . 4s , v27 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f98e35f / / sdot v31 . 4s , v26 . 16b , v24 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97eb7d / / sdot v29 . 4s , v27 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f98e37e / / sdot v30 . 4s , v27 . 16b , v24 . 4b [ 0 ] \ n " <nl> " sqrdmulh v28 . 4s , v28 . 4s , v1 . 4s \ n " <nl> - " sdot v31 . 4s , v27 . 16b , v24 . 4b [ 2 ] \ n " <nl> + " . word 0x4f98eb7f / / sdot v31 . 4s , v27 . 16b , v24 . 4b [ 2 ] \ n " <nl> " sqrdmulh v29 . 4s , v29 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v30 . 4s , v30 . 4s , v1 . 4s \ n " <nl> " sqrshl v28 . 4s , v28 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " st1 { v28 . s } [ 3 ] , [ % [ output_block_data ] ] \ n " <nl> " ushr v28 . 2d , v21 . 2d , # 16 \ n " <nl> " ushr v9 . 2d , v23 . 2d , # 16 \ n " <nl> - " sdot v29 . 4s , v18 . 16b , v28 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9ce25d / / sdot v29 . 4s , v18 . 16b , v28 . 4b [ 0 ] \ n " <nl> " mov v8 . 16b , v22 . 16b \ n " <nl> - " sdot v30 . 4s , v18 . 16b , v28 . 4b [ 2 ] \ n " <nl> - " sdot v31 . 4s , v18 . 16b , v9 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v19 . 16b , v28 . 4b [ 2 ] \ n " <nl> + " . word 0x4f9cea5e / / sdot v30 . 4s , v18 . 16b , v28 . 4b [ 2 ] \ n " <nl> + " . word 0x4f89e25f / / sdot v31 . 4s , v18 . 16b , v9 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9cea7d / / sdot v29 . 4s , v19 . 16b , v28 . 4b [ 2 ] \ n " <nl> " ushr v10 . 2d , v24 . 2d , # 16 \ n " <nl> - " sdot v8 . 4s , v18 . 16b , v9 . 4b [ 2 ] \ n " <nl> - " sdot v30 . 4s , v19 . 16b , v9 . 4b [ 0 ] \ n " <nl> - " sdot v31 . 4s , v19 . 16b , v9 . 4b [ 2 ] \ n " <nl> - " sdot v29 . 4s , v20 . 16b , v9 . 4b [ 0 ] \ n " <nl> - " sdot v8 . 4s , v19 . 16b , v10 . 4b [ 0 ] \ n " <nl> - " sdot v30 . 4s , v20 . 16b , v9 . 4b [ 2 ] \ n " <nl> - " sdot v31 . 4s , v20 . 16b , v10 . 4b [ 0 ] \ n " <nl> + " . word 0x4f89ea48 / / sdot v8 . 4s , v18 . 16b , v9 . 4b [ 2 ] \ n " <nl> + " . word 0x4f89e27e / / sdot v30 . 4s , v19 . 16b , v9 . 4b [ 0 ] \ n " <nl> + " . word 0x4f89ea7f / / sdot v31 . 4s , v19 . 16b , v9 . 4b [ 2 ] \ n " <nl> + " . word 0x4f89e29d / / sdot v29 . 4s , v20 . 16b , v9 . 4b [ 0 ] \ n " <nl> + " . word 0x4f8ae268 / / sdot v8 . 4s , v19 . 16b , v10 . 4b [ 0 ] \ n " <nl> + " . word 0x4f89ea9e / / sdot v30 . 4s , v20 . 16b , v9 . 4b [ 2 ] \ n " <nl> + " . word 0x4f8ae29f / / sdot v31 . 4s , v20 . 16b , v10 . 4b [ 0 ] \ n " <nl> " sqrdmulh v29 . 4s , v29 . 4s , v1 . 4s \ n " <nl> - " sdot v8 . 4s , v20 . 16b , v10 . 4b [ 2 ] \ n " <nl> + " . word 0x4f8aea88 / / sdot v8 . 4s , v20 . 16b , v10 . 4b [ 2 ] \ n " <nl> " sqrdmulh v30 . 4s , v30 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v31 . 4s , v31 . 4s , v1 . 4s \ n " <nl> " sqrshl v29 . 4s , v29 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " add % [ output_block_data ] , x28 , x12 \ n " <nl> " mov v31 . 16b , v22 . 16b \ n " <nl> " mov v8 . 16b , v22 . 16b \ n " <nl> - " sdot v30 . 4s , v25 . 16b , v28 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9ce33e / / sdot v30 . 4s , v25 . 16b , v28 . 4b [ 0 ] \ n " <nl> " st1 { v29 . s } [ 3 ] , [ % [ output_block_data ] ] \ n " <nl> " mov v29 . 16b , v22 . 16b \ n " <nl> - " sdot v31 . 4s , v25 . 16b , v28 . 4b [ 2 ] \ n " <nl> - " sdot v8 . 4s , v25 . 16b , v9 . 4b [ 0 ] \ n " <nl> - " sdot v30 . 4s , v26 . 16b , v28 . 4b [ 2 ] \ n " <nl> - " sdot v29 . 4s , v25 . 16b , v9 . 4b [ 2 ] \ n " <nl> - " sdot v31 . 4s , v26 . 16b , v9 . 4b [ 0 ] \ n " <nl> - " sdot v8 . 4s , v26 . 16b , v9 . 4b [ 2 ] \ n " <nl> - " sdot v30 . 4s , v27 . 16b , v9 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v26 . 16b , v10 . 4b [ 0 ] \ n " <nl> - " sdot v31 . 4s , v27 . 16b , v9 . 4b [ 2 ] \ n " <nl> - " sdot v8 . 4s , v27 . 16b , v10 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9ceb3f / / sdot v31 . 4s , v25 . 16b , v28 . 4b [ 2 ] \ n " <nl> + " . word 0x4f89e328 / / sdot v8 . 4s , v25 . 16b , v9 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9ceb5e / / sdot v30 . 4s , v26 . 16b , v28 . 4b [ 2 ] \ n " <nl> + " . word 0x4f89eb3d / / sdot v29 . 4s , v25 . 16b , v9 . 4b [ 2 ] \ n " <nl> + " . word 0x4f89e35f / / sdot v31 . 4s , v26 . 16b , v9 . 4b [ 0 ] \ n " <nl> + " . word 0x4f89eb48 / / sdot v8 . 4s , v26 . 16b , v9 . 4b [ 2 ] \ n " <nl> + " . word 0x4f89e37e / / sdot v30 . 4s , v27 . 16b , v9 . 4b [ 0 ] \ n " <nl> + " . word 0x4f8ae35d / / sdot v29 . 4s , v26 . 16b , v10 . 4b [ 0 ] \ n " <nl> + " . word 0x4f89eb7f / / sdot v31 . 4s , v27 . 16b , v9 . 4b [ 2 ] \ n " <nl> + " . word 0x4f8ae368 / / sdot v8 . 4s , v27 . 16b , v10 . 4b [ 0 ] \ n " <nl> " sqrdmulh v28 . 4s , v30 . 4s , v1 . 4s \ n " <nl> - " sdot v29 . 4s , v27 . 16b , v10 . 4b [ 2 ] \ n " <nl> + " . word 0x4f8aeb7d / / sdot v29 . 4s , v27 . 16b , v10 . 4b [ 2 ] \ n " <nl> " sqrdmulh v30 . 4s , v31 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v31 . 4s , v8 . 4s , v1 . 4s \ n " <nl> " sqrshl v28 . 4s , v28 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " add % [ output_block_data ] , x3 , x12 \ n " <nl> " ushr v21 . 2d , v21 . 2d , # 32 \ n " <nl> " ushr v24 . 2d , v24 . 2d , # 32 \ n " <nl> - " sdot v28 . 4s , v20 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v19 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v30 . 4s , v18 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v31 . 4s , v18 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f97e29c / / sdot v28 . 4s , v20 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e27d / / sdot v29 . 4s , v19 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e25e / / sdot v30 . 4s , v18 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97ea5f / / sdot v31 . 4s , v18 . 16b , v23 . 4b [ 2 ] \ n " <nl> " st1 { v8 . s } [ 3 ] , [ % [ output_block_data ] ] \ n " <nl> " add x12 , x12 , x10 \ n " <nl> " DC_KERNEL_MULT_5 : \ n " / / Parent Loop BB205_22 Depth = 1 <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " add x12 , x20 , x12 \ n " <nl> " b DC_KERNEL_MULT_9 \ n " <nl> " DC_KERNEL_MULT_8 : \ n " / / in Loop : Header = BB205_9 Depth = 3 <nl> - " sdot v28 . 4s , v18 . 16b , v21 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v18 . 16b , v21 . 4b [ 2 ] \ n " <nl> - " sdot v30 . 4s , v19 . 16b , v23 . 4b [ 2 ] \ n " <nl> - " sdot v28 . 4s , v19 . 16b , v21 . 4b [ 2 ] \ n " <nl> - " sdot v31 . 4s , v19 . 16b , v24 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v20 . 16b , v23 . 4b [ 2 ] \ n " <nl> - " sdot v30 . 4s , v20 . 16b , v24 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e25c / / sdot v28 . 4s , v18 . 16b , v21 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95ea5d / / sdot v29 . 4s , v18 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f97ea7e / / sdot v30 . 4s , v19 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f95ea7c / / sdot v28 . 4s , v19 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f98e27f / / sdot v31 . 4s , v19 . 16b , v24 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97ea9d / / sdot v29 . 4s , v20 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f98e29e / / sdot v30 . 4s , v20 . 16b , v24 . 4b [ 0 ] \ n " <nl> " sqrdmulh v25 . 4s , v28 . 4s , v1 . 4s \ n " <nl> - " sdot v31 . 4s , v20 . 16b , v24 . 4b [ 2 ] \ n " <nl> + " . word 0x4f98ea9f / / sdot v31 . 4s , v20 . 16b , v24 . 4b [ 2 ] \ n " <nl> " sqrdmulh v26 . 4s , v29 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v27 . 4s , v30 . 4s , v1 . 4s \ n " <nl> " sqrshl v25 . 4s , v25 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " ushr v21 . 2d , v21 . 2d , # 8 \ n " <nl> " ushr v24 . 2d , v24 . 2d , # 8 \ n " <nl> " st1 { v25 . s } [ 3 ] , [ x20 ] \ n " <nl> - " sdot v28 . 4s , v20 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v19 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v30 . 4s , v18 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v31 . 4s , v18 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f97e29c / / sdot v28 . 4s , v20 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e27d / / sdot v29 . 4s , v19 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e25e / / sdot v30 . 4s , v18 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97ea5f / / sdot v31 . 4s , v18 . 16b , v23 . 4b [ 2 ] \ n " <nl> " add % [ output_block_data ] , x3 , x15 \ n " <nl> " DC_KERNEL_MULT_9 : \ n " / / Parent Loop BB205_22 Depth = 1 <nl> / / Parent Loop BB205_11 Depth = 2 <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " DC_KERNEL_MULT_15 : \ n " / / in Loop : Header = BB205_16 Depth = 4 <nl> " mov v25 . 16b , v21 . 16b \ n " <nl> " mov v26 . 16b , v22 . 16b \ n " <nl> - " sdot v25 . 4s , v18 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v26 . 4s , v7 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v25 . 4s , v19 . 16b , v23 . 4b [ 2 ] \ n " <nl> - " sdot v26 . 4s , v16 . 16b , v23 . 4b [ 2 ] \ n " <nl> - " sdot v25 . 4s , v20 . 16b , v24 . 4b [ 0 ] \ n " <nl> - " sdot v26 . 4s , v17 . 16b , v24 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e259 / / sdot v25 . 4s , v18 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e0fa / / sdot v26 . 4s , v7 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97ea79 / / sdot v25 . 4s , v19 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f97ea1a / / sdot v26 . 4s , v16 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f98e299 / / sdot v25 . 4s , v20 . 16b , v24 . 4b [ 0 ] \ n " <nl> + " . word 0x4f98e23a / / sdot v26 . 4s , v17 . 16b , v24 . 4b [ 0 ] \ n " <nl> " sqrdmulh v25 . 4s , v25 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v26 . 4s , v26 . 4s , v1 . 4s \ n " <nl> " sqrshl v25 . 4s , v25 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " mov v27 . 16b , v20 . 16b \ n " <nl> " ld1 { v23 . s } [ 1 ] , [ x22 ] \ n " <nl> " ushr v29 . 2d , v21 . 2d , # 16 \ n " <nl> - " sdot v25 . 4s , v5 . 16b , v29 . 4b [ 0 ] \ n " <nl> - " sdot v27 . 4s , v6 . 16b , v29 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9de0b9 / / sdot v25 . 4s , v5 . 16b , v29 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9de0db / / sdot v27 . 4s , v6 . 16b , v29 . 4b [ 0 ] \ n " <nl> " mov v26 . 16b , v19 . 16b \ n " <nl> " mov v28 . 16b , v20 . 16b \ n " <nl> - " sdot v25 . 4s , v7 . 16b , v29 . 4b [ 2 ] \ n " <nl> - " sdot v27 . 4s , v16 . 16b , v29 . 4b [ 2 ] \ n " <nl> + " . word 0x4f9de8f9 / / sdot v25 . 4s , v7 . 16b , v29 . 4b [ 2 ] \ n " <nl> + " . word 0x4f9dea1b / / sdot v27 . 4s , v16 . 16b , v29 . 4b [ 2 ] \ n " <nl> " ushr v29 . 2d , v22 . 2d , # 16 \ n " <nl> - " sdot v26 . 4s , v5 . 16b , v29 . 4b [ 0 ] \ n " <nl> - " sdot v28 . 4s , v6 . 16b , v29 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9de0ba / / sdot v26 . 4s , v5 . 16b , v29 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9de0dc / / sdot v28 . 4s , v6 . 16b , v29 . 4b [ 0 ] \ n " <nl> " mov v24 . 16b , v19 . 16b \ n " <nl> - " sdot v26 . 4s , v7 . 16b , v29 . 4b [ 2 ] \ n " <nl> - " sdot v28 . 4s , v16 . 16b , v29 . 4b [ 2 ] \ n " <nl> - " sdot v25 . 4s , v17 . 16b , v29 . 4b [ 0 ] \ n " <nl> - " sdot v27 . 4s , v18 . 16b , v29 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9de8fa / / sdot v26 . 4s , v7 . 16b , v29 . 4b [ 2 ] \ n " <nl> + " . word 0x4f9dea1c / / sdot v28 . 4s , v16 . 16b , v29 . 4b [ 2 ] \ n " <nl> + " . word 0x4f9de239 / / sdot v25 . 4s , v17 . 16b , v29 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9de25b / / sdot v27 . 4s , v18 . 16b , v29 . 4b [ 0 ] \ n " <nl> " ushr v29 . 2d , v23 . 2d , # 16 \ n " <nl> - " sdot v26 . 4s , v17 . 16b , v29 . 4b [ 0 ] \ n " <nl> - " sdot v28 . 4s , v18 . 16b , v29 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9de23a / / sdot v26 . 4s , v17 . 16b , v29 . 4b [ 0 ] \ n " <nl> + " . word 0x4f9de25c / / sdot v28 . 4s , v18 . 16b , v29 . 4b [ 0 ] \ n " <nl> " mov v29 . 16b , v19 . 16b \ n " <nl> - " sdot v24 . 4s , v5 . 16b , v21 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v5 . 16b , v22 . 4b [ 0 ] \ n " <nl> - " sdot v24 . 4s , v7 . 16b , v21 . 4b [ 2 ] \ n " <nl> - " sdot v29 . 4s , v7 . 16b , v22 . 4b [ 2 ] \ n " <nl> - " sdot v24 . 4s , v17 . 16b , v22 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v17 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e0b8 / / sdot v24 . 4s , v5 . 16b , v21 . 4b [ 0 ] \ n " <nl> + " . word 0x4f96e0bd / / sdot v29 . 4s , v5 . 16b , v22 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e8f8 / / sdot v24 . 4s , v7 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f96e8fd / / sdot v29 . 4s , v7 . 16b , v22 . 4b [ 2 ] \ n " <nl> + " . word 0x4f96e238 / / sdot v24 . 4s , v17 . 16b , v22 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e23d / / sdot v29 . 4s , v17 . 16b , v23 . 4b [ 0 ] \ n " <nl> " sqrdmulh v24 . 4s , v24 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v29 . 4s , v29 . 4s , v1 . 4s \ n " <nl> " sqrshl v24 . 4s , v24 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " str s24 , [ x19 ] \ n " <nl> " st1 { v24 . s } [ 1 ] , [ x22 ] \ n " <nl> " mov v24 . 16b , v20 . 16b \ n " <nl> - " sdot v29 . 4s , v6 . 16b , v21 . 4b [ 0 ] \ n " <nl> - " sdot v24 . 4s , v6 . 16b , v22 . 4b [ 0 ] \ n " <nl> - " sdot v29 . 4s , v16 . 16b , v21 . 4b [ 2 ] \ n " <nl> - " sdot v24 . 4s , v16 . 16b , v22 . 4b [ 2 ] \ n " <nl> - " sdot v29 . 4s , v18 . 16b , v22 . 4b [ 0 ] \ n " <nl> - " sdot v24 . 4s , v18 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e0dd / / sdot v29 . 4s , v6 . 16b , v21 . 4b [ 0 ] \ n " <nl> + " . word 0x4f96e0d8 / / sdot v24 . 4s , v6 . 16b , v22 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95ea1d / / sdot v29 . 4s , v16 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f96ea18 / / sdot v24 . 4s , v16 . 16b , v22 . 4b [ 2 ] \ n " <nl> + " . word 0x4f96e25d / / sdot v29 . 4s , v18 . 16b , v22 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e258 / / sdot v24 . 4s , v18 . 16b , v23 . 4b [ 0 ] \ n " <nl> " sqrdmulh v29 . 4s , v29 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v24 . 4s , v24 . 4s , v1 . 4s \ n " <nl> " sqrshl v29 . 4s , v29 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " mov v24 . 16b , v19 . 16b \ n " <nl> " ld1 { v23 . s } [ 1 ] , [ x25 ] \ n " <nl> " mov v25 . 16b , v19 . 16b \ n " <nl> - " sdot v24 . 4s , v5 . 16b , v21 . 4b [ 0 ] \ n " <nl> - " sdot v25 . 4s , v5 . 16b , v22 . 4b [ 0 ] \ n " <nl> - " sdot v24 . 4s , v7 . 16b , v21 . 4b [ 2 ] \ n " <nl> - " sdot v25 . 4s , v7 . 16b , v22 . 4b [ 2 ] \ n " <nl> - " sdot v24 . 4s , v17 . 16b , v22 . 4b [ 0 ] \ n " <nl> - " sdot v25 . 4s , v17 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e0b8 / / sdot v24 . 4s , v5 . 16b , v21 . 4b [ 0 ] \ n " <nl> + " . word 0x4f96e0b9 / / sdot v25 . 4s , v5 . 16b , v22 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e8f8 / / sdot v24 . 4s , v7 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f96e8f9 / / sdot v25 . 4s , v7 . 16b , v22 . 4b [ 2 ] \ n " <nl> + " . word 0x4f96e238 / / sdot v24 . 4s , v17 . 16b , v22 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e239 / / sdot v25 . 4s , v17 . 16b , v23 . 4b [ 0 ] \ n " <nl> " sqrdmulh v24 . 4s , v24 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v25 . 4s , v25 . 4s , v1 . 4s \ n " <nl> " sqrshl v24 . 4s , v24 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " str s24 , [ x19 ] \ n " <nl> " st1 { v24 . s } [ 1 ] , [ x22 ] \ n " <nl> " mov v24 . 16b , v20 . 16b \ n " <nl> - " sdot v25 . 4s , v6 . 16b , v21 . 4b [ 0 ] \ n " <nl> - " sdot v24 . 4s , v6 . 16b , v22 . 4b [ 0 ] \ n " <nl> - " sdot v25 . 4s , v16 . 16b , v21 . 4b [ 2 ] \ n " <nl> - " sdot v24 . 4s , v16 . 16b , v22 . 4b [ 2 ] \ n " <nl> - " sdot v25 . 4s , v18 . 16b , v22 . 4b [ 0 ] \ n " <nl> - " sdot v24 . 4s , v18 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e0d9 / / sdot v25 . 4s , v6 . 16b , v21 . 4b [ 0 ] \ n " <nl> + " . word 0x4f96e0d8 / / sdot v24 . 4s , v6 . 16b , v22 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95ea19 / / sdot v25 . 4s , v16 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f96ea18 / / sdot v24 . 4s , v16 . 16b , v22 . 4b [ 2 ] \ n " <nl> + " . word 0x4f96e259 / / sdot v25 . 4s , v18 . 16b , v22 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e258 / / sdot v24 . 4s , v18 . 16b , v23 . 4b [ 0 ] \ n " <nl> " sqrdmulh v25 . 4s , v25 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v24 . 4s , v24 . 4s , v1 . 4s \ n " <nl> " sqrshl v25 . 4s , v25 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> " ld1 { v21 . s } [ 3 ] , [ x22 ] \ n " <nl> " cmp w15 , # 2 \ n " / / = 2 <nl> " ccmp x5 , x20 , # 0 , ne \ n " <nl> - " sdot v23 . 4s , v17 . 16b , v22 . 4b [ 0 ] \ n " <nl> - " sdot v24 . 4s , v18 . 16b , v22 . 4b [ 0 ] \ n " <nl> - " sdot v23 . 4s , v5 . 16b , v21 . 4b [ 0 ] \ n " <nl> - " sdot v24 . 4s , v6 . 16b , v21 . 4b [ 0 ] \ n " <nl> - " sdot v23 . 4s , v7 . 16b , v21 . 4b [ 2 ] \ n " <nl> - " sdot v24 . 4s , v16 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f96e237 / / sdot v23 . 4s , v17 . 16b , v22 . 4b [ 0 ] \ n " <nl> + " . word 0x4f96e258 / / sdot v24 . 4s , v18 . 16b , v22 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e0b7 / / sdot v23 . 4s , v5 . 16b , v21 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e0d8 / / sdot v24 . 4s , v6 . 16b , v21 . 4b [ 0 ] \ n " <nl> + " . word 0x4f95e8f7 / / sdot v23 . 4s , v7 . 16b , v21 . 4b [ 2 ] \ n " <nl> + " . word 0x4f95ea18 / / sdot v24 . 4s , v16 . 16b , v21 . 4b [ 2 ] \ n " <nl> " sqrdmulh v23 . 4s , v23 . 4s , v1 . 4s \ n " <nl> " sqrdmulh v24 . 4s , v24 . 4s , v1 . 4s \ n " <nl> " sqrshl v23 . 4s , v23 . 4s , v2 . 4s \ n " <nl> struct KernelMacroBlock < DepthwiseConvImplementation : : kUseNeon3x3DotProduct , <nl> / / % bb . 9 : / / in Loop : Header = BB206_11 Depth = 2 <nl> " mov v25 . 16b , v19 . 16b \ n " <nl> " mov v26 . 16b , v20 . 16b \ n " <nl> - " sdot v25 . 4s , v17 . 16b , v24 . 4b [ 0 ] \ n " <nl> - " sdot v26 . 4s , v18 . 16b , v24 . 4b [ 0 ] \ n " <nl> - " sdot v25 . 4s , v5 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v26 . 4s , v6 . 16b , v23 . 4b [ 0 ] \ n " <nl> - " sdot v25 . 4s , v7 . 16b , v23 . 4b [ 2 ] \ n " <nl> - " sdot v26 . 4s , v16 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f98e239 / / sdot v25 . 4s , v17 . 16b , v24 . 4b [ 0 ] \ n " <nl> + " . word 0x4f98e25a / / sdot v26 . 4s , v18 . 16b , v24 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e0b9 / / sdot v25 . 4s , v5 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e0da / / sdot v26 . 4s , v6 . 16b , v23 . 4b [ 0 ] \ n " <nl> + " . word 0x4f97e8f9 / / sdot v25 . 4s , v7 . 16b , v23 . 4b [ 2 ] \ n " <nl> + " . word 0x4f97ea1a / / sdot v26 . 4s , v16 . 16b , v23 . 4b [ 2 ] \ n " <nl> " ushr v23 . 2d , v21 . 2d , # 32 \ n " <nl> " sqrdmulh v21 . 4s , v25 . 4s , v1 . 4s \ n " <nl> " ushr v24 . 2d , v22 . 2d , # 32 \ n " <nl>
|
DepthwiseConv , dot - product kernel asm , hard - encode sdot instructions .
|
tensorflow/tensorflow
|
cd9dabf397ebedd70fd3ea3745fc9c2711d6fb19
|
2019-05-14T23:11:01Z
|
mmm a / utils / report / clickhouse - report <nl> ppp b / utils / report / clickhouse - report <nl> <nl> <nl> # Also dump some system info ( can contain some private data ) and get trace from running clickhouse - server process <nl> # sh - x clickhouse - report system gdb > ch . ` hostname ` . ` date ' + % Y % M % ' ' d % H % M % ' ' S ' ` . dmp 2 > & 1 <nl> - # curl https : / / raw . githubusercontent . com / yandex / ClickHouse / master / utils / report / clickhouse - report system gdb | sh - x > ch . ` hostname ` . ` date ' + % Y % M % ' ' d % H % M % ' ' S ' ` . dmp 2 > & 1 <nl> + # curl https : / / raw . githubusercontent . com / yandex / ClickHouse / master / utils / report / clickhouse - report | sh - s - x system gdb > ch . ` hostname ` . ` date ' + % Y % M % ' ' d % H % M % ' ' S ' ` . dmp 2 > & 1 <nl> <nl> <nl> for i in " $ @ " ; do <nl> for i in " $ @ " ; do <nl> esac <nl> done <nl> <nl> + tail - n200 / var / log / clickhouse - server / clickhouse - server . err . log <nl> + tail - n200 / var / log / clickhouse - server / clickhouse - server . log <nl> + tail - n100 / var / log / clickhouse - server / stderr <nl> + <nl> clickhouse - client - q ' SELECT * FROM system . events FORMAT PrettyCompactNoEscapes ' <nl> clickhouse - client - q ' SELECT * FROM system . metrics FORMAT PrettyCompactNoEscapes ' <nl> clickhouse - client - q ' SELECT * FROM system . asynchronous_metrics FORMAT PrettyCompactNoEscapes ' <nl> clickhouse - client - q ' SELECT * FROM system . parts FORMAT PrettyCompactNoEscapes ' <nl> clickhouse - client - q ' SELECT * FROM system . replication_queue FORMAT PrettyCompactNoEscapes ' <nl> clickhouse - client - q ' SELECT * FROM system . replicas FORMAT PrettyCompactNoEscapes ' <nl> clickhouse - client - q ' SELECT * FROM system . dictionaries FORMAT PrettyCompactNoEscapes ' <nl> - tail - n200 / var / log / clickhouse - server / clickhouse - server . err . log <nl> - tail - n200 / var / log / clickhouse - server / clickhouse - server . log <nl> - tail - n100 / var / log / clickhouse - server / stderr <nl>
|
Better clickhouse - report
|
ClickHouse/ClickHouse
|
8a612c8e939a9ca200a857ffca58d90e56115e21
|
2018-04-13T12:34:14Z
|
mmm a / xbmc / settings / SkinSettings . cpp <nl> ppp b / xbmc / settings / SkinSettings . cpp <nl> bool CSkinSettings : : Load ( const TiXmlNode * settings ) <nl> while ( pChild ) <nl> { <nl> std : : string settingName = XMLUtils : : GetAttribute ( pChild , XML_ATTR_NAME ) ; <nl> - if ( pChild - > Attribute ( " type " ) & & StringUtils : : EqualsNoCase ( pChild - > Attribute ( XML_ATTR_TYPE ) , " string " ) ) <nl> + std : : string settingType = XMLUtils : : GetAttribute ( pChild , XML_ATTR_TYPE ) ; <nl> + if ( settingType = = " string " ) <nl> { / / string setting <nl> CSkinString string ; <nl> string . name = settingName ; <nl>
|
[ skinsettings ] setting type of skin settings needn ' t be compared case - insensitive ( we write them , we read them )
|
xbmc/xbmc
|
4b784397e6434cbba5a778068698a4c276c9fc78
|
2014-07-01T20:08:40Z
|
mmm a / docs / ABI / Mangling . rst <nl> ppp b / docs / ABI / Mangling . rst <nl> Mangling <nl> mmmmmm - - <nl> : : <nl> <nl> - mangled - name : : = ' _S ' global <nl> + mangled - name : : = ' $ S ' global <nl> <nl> All Swift - mangled names begin with this prefix . <nl> <nl> mmm a / test / stdlib / Metal . swift <nl> ppp b / test / stdlib / Metal . swift <nl> <nl> / / RUN : % empty - directory ( % t ) <nl> - / / RUN : % target - build - swift % s - o % t / a . out4 - swift - version 4 & & % target - run % t / a . out4 <nl> + / / RUN : % target - build - swift % s - o % t / a . out4 - swift - version 4 & & % target - codesign % t / a . out4 & & % target - run % t / a . out4 <nl> / / REQUIRES : objc_interop <nl> / / UNSUPPORTED : OS = watchos <nl> <nl>
|
Merge remote - tracking branch ' origin / master ' into master - next
|
apple/swift
|
7e8368613a6183b15b4157253fca10aecaa55fe8
|
2018-08-13T20:30:09Z
|
mmm a / modules / stitching / src / motion_estimators . cpp <nl> ppp b / modules / stitching / src / motion_estimators . cpp <nl> struct CalcRotation <nl> K_from ( 0 , 0 ) = cameras [ edge . from ] . focal ; <nl> K_from ( 1 , 1 ) = cameras [ edge . from ] . focal * cameras [ edge . from ] . aspect ; <nl> K_from ( 0 , 2 ) = cameras [ edge . from ] . ppx ; <nl> - K_from ( 0 , 2 ) = cameras [ edge . from ] . ppy ; <nl> + K_from ( 1 , 2 ) = cameras [ edge . from ] . ppy ; <nl> <nl> Mat_ < double > K_to = Mat : : eye ( 3 , 3 , CV_64F ) ; <nl> K_to ( 0 , 0 ) = cameras [ edge . to ] . focal ; <nl> K_to ( 1 , 1 ) = cameras [ edge . to ] . focal * cameras [ edge . to ] . aspect ; <nl> K_to ( 0 , 2 ) = cameras [ edge . to ] . ppx ; <nl> - K_to ( 0 , 2 ) = cameras [ edge . to ] . ppy ; <nl> + K_to ( 1 , 2 ) = cameras [ edge . to ] . ppy ; <nl> <nl> Mat R = K_from . inv ( ) * pairwise_matches [ pair_idx ] . H . inv ( ) * K_to ; <nl> cameras [ edge . to ] . R = cameras [ edge . from ] . R * R ; <nl>
|
Fixed a bug
|
opencv/opencv
|
58fa401b4d0cefe763e4b307802f34c96a942a44
|
2013-06-14T06:43:20Z
|
mmm a / test / ClangImporter / Inputs / custom - modules / UnimportableMembers . h <nl> ppp b / test / ClangImporter / Inputs / custom - modules / UnimportableMembers . h <nl> <nl> + <nl> + typedef __INTPTR_TYPE__ intptr_t ; <nl> + <nl> __attribute__ ( ( objc_root_class ) ) <nl> @ interface Base <nl> - ( instancetype ) init ; <nl> @ end <nl> <nl> @ interface IncompleteDesignatedInitializers : Base <nl> - - ( instancetype ) initFirst : ( long ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> - - ( instancetype ) initSecond : ( long ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> - - ( instancetype ) initMissing : ( long ) x , . . . __attribute__ ( ( objc_designated_initializer ) ) ; <nl> - - ( instancetype ) initConveniently : ( long ) x ; <nl> + - ( instancetype ) initFirst : ( intptr_t ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> + - ( instancetype ) initSecond : ( intptr_t ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> + - ( instancetype ) initMissing : ( intptr_t ) x , . . . __attribute__ ( ( objc_designated_initializer ) ) ; <nl> + - ( instancetype ) initConveniently : ( intptr_t ) x ; <nl> @ end <nl> @ interface IncompleteDesignatedInitializers ( CategoryConvenience ) <nl> - - ( instancetype ) initCategory : ( long ) x ; <nl> + - ( instancetype ) initCategory : ( intptr_t ) x ; <nl> @ end <nl> <nl> @ interface IncompleteConvenienceInitializers : Base <nl> - - ( instancetype ) initFirst : ( long ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> - - ( instancetype ) initSecond : ( long ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> - - ( instancetype ) initMissing : ( long ) x , . . . ; <nl> - - ( instancetype ) initConveniently : ( long ) x ; <nl> + - ( instancetype ) initFirst : ( intptr_t ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> + - ( instancetype ) initSecond : ( intptr_t ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> + - ( instancetype ) initMissing : ( intptr_t ) x , . . . ; <nl> + - ( instancetype ) initConveniently : ( intptr_t ) x ; <nl> @ end <nl> @ interface IncompleteConvenienceInitializers ( CategoryConvenience ) <nl> - - ( instancetype ) initCategory : ( long ) x ; <nl> + - ( instancetype ) initCategory : ( intptr_t ) x ; <nl> @ end <nl> <nl> @ interface IncompleteUnknownInitializers : Base <nl> - - ( instancetype ) initFirst : ( long ) x ; <nl> - - ( instancetype ) initSecond : ( long ) x ; <nl> - - ( instancetype ) initMissing : ( long ) x , . . . ; <nl> - - ( instancetype ) initConveniently : ( long ) x ; <nl> + - ( instancetype ) initFirst : ( intptr_t ) x ; <nl> + - ( instancetype ) initSecond : ( intptr_t ) x ; <nl> + - ( instancetype ) initMissing : ( intptr_t ) x , . . . ; <nl> + - ( instancetype ) initConveniently : ( intptr_t ) x ; <nl> @ end <nl> @ interface IncompleteUnknownInitializers ( CategoryConvenience ) <nl> - - ( instancetype ) initCategory : ( long ) x ; <nl> + - ( instancetype ) initCategory : ( intptr_t ) x ; <nl> @ end <nl> <nl> @ interface IncompleteDesignatedInitializersWithCategory : Base <nl> - - ( instancetype ) initFirst : ( long ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> - - ( instancetype ) initMissing : ( long ) x , . . . __attribute__ ( ( objc_designated_initializer ) ) ; <nl> - - ( instancetype ) initConveniently : ( long ) x ; <nl> + - ( instancetype ) initFirst : ( intptr_t ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> + - ( instancetype ) initMissing : ( intptr_t ) x , . . . __attribute__ ( ( objc_designated_initializer ) ) ; <nl> + - ( instancetype ) initConveniently : ( intptr_t ) x ; <nl> @ end <nl> @ interface IncompleteDesignatedInitializersWithCategory ( / * class extension * / ) <nl> - - ( instancetype ) initSecond : ( long ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> - - ( instancetype ) initCategory : ( long ) x ; <nl> + - ( instancetype ) initSecond : ( intptr_t ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> + - ( instancetype ) initCategory : ( intptr_t ) x ; <nl> @ end <nl> <nl> @ interface DesignatedInitializerInAnotherModule : Base <nl> - - ( instancetype ) initFirst : ( long ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> - - ( instancetype ) initSecond : ( long ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> - - ( instancetype ) initMissing : ( long ) x , . . . __attribute__ ( ( objc_designated_initializer ) ) ; <nl> - - ( instancetype ) initConveniently : ( long ) x ; <nl> + - ( instancetype ) initFirst : ( intptr_t ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> + - ( instancetype ) initSecond : ( intptr_t ) x __attribute__ ( ( objc_designated_initializer ) ) ; <nl> + - ( instancetype ) initMissing : ( intptr_t ) x , . . . __attribute__ ( ( objc_designated_initializer ) ) ; <nl> + - ( instancetype ) initConveniently : ( intptr_t ) x ; <nl> @ end <nl> @ interface DesignatedInitializerInAnotherModule ( CategoryConvenience ) <nl> - - ( instancetype ) initCategory : ( long ) x ; <nl> + - ( instancetype ) initCategory : ( intptr_t ) x ; <nl> @ end <nl>
|
Merge pull request from compnerd / universally - long
|
apple/swift
|
0081dec69faf3efe89b9b5f5b820394771ce4733
|
2019-03-29T02:08:46Z
|
mmm a / js / apps / system / aardvark / frontend / js / routers / router . js <nl> ppp b / js / apps / system / aardvark / frontend / js / routers / router . js <nl> <nl> if ( this . dashboardView ) { <nl> this . dashboardView . resize ( ) ; <nl> } <nl> - if ( this . graphView ) { <nl> - this . graphView . handleResize ( $ ( " # content " ) . width ( ) ) ; <nl> + if ( this . graphManagementView ) { <nl> + this . graphManagementView . handleResize ( $ ( " # content " ) . width ( ) ) ; <nl> } <nl> - / * <nl> - var oldWidth = $ ( ' # content ' ) . width ( ) ; <nl> - var containerWidth = $ ( window ) . width ( ) - 70 ; <nl> - var spanWidth = 240 ; <nl> - var divider = containerWidth / spanWidth ; <nl> - var roundDiv = parseInt ( divider , 10 ) ; <nl> - var newWidth = roundDiv * spanWidth - 2 ; <nl> - if ( newWidth ! = = oldWidth & & this . graphView ) { <nl> - this . graphView . handleResize ( newWidth ) ; <nl> - } <nl> - * / <nl> } , <nl> <nl> userManagement : function ( ) { <nl> mmm a / js / apps / system / aardvark / frontend / js / views / graphManagementView . js <nl> ppp b / js / apps / system / aardvark / frontend / js / views / graphManagementView . js <nl> <nl> } , true ) ; <nl> } , <nl> <nl> + handleResize : function ( w ) { <nl> + if ( ! this . width | | this . width ! = = w ) { <nl> + this . width = w ; <nl> + if ( this . ui ) { <nl> + this . ui . changeWidth ( w ) ; <nl> + } <nl> + } <nl> + } , <nl> + <nl> addNewGraph : function ( e ) { <nl> e . preventDefault ( ) ; <nl> this . createEditGraphModal ( ) ; <nl> } , <nl> <nl> - deleteGraph : function ( e ) { <nl> + deleteGraph : function ( ) { <nl> var self = this ; <nl> var name = $ ( " # editGraphName " ) [ 0 ] . value ; <nl> this . collection . get ( name ) . destroy ( { <nl> <nl> editedVertexCollections = _ . pluck ( $ ( ' # newVertexCollections ' ) . select2 ( " data " ) , " text " ) , <nl> edgeDefinitions = [ ] , <nl> newEdgeDefinitions = { } , <nl> - self = this , <nl> collection , <nl> from , <nl> to , <nl>
|
Added resizing to new version of graph viewer
|
arangodb/arangodb
|
f43a45f6c1196eab5143ef466d74d0f294402a27
|
2014-06-30T08:26:17Z
|
mmm a / tensorflow / core / kernels / mkl_conv_ops . cc <nl> ppp b / tensorflow / core / kernels / mkl_conv_ops . cc <nl> class MklQuantizedConv2DSumReluOp <nl> { " sum " , { scale_summand / scale_output } } ) ; <nl> else <nl> params . post_op_params . push_back ( <nl> - { " sum " , { 2 . 0 * scale_summand / scale_output } } ) ; <nl> + { " sum " , { 2 . 0f * scale_summand / scale_output } } ) ; <nl> } else { <nl> params . post_op_params . push_back ( { " sum " , { 1 . 0 } } ) ; <nl> } <nl>
|
Fix - - config = mkl clang compilation error .
|
tensorflow/tensorflow
|
50bdd7183c408dc04c3c4e13c839780d3d39b160
|
2018-11-19T22:52:41Z
|
mmm a / include / LightGBM / json11 . hpp <nl> ppp b / include / LightGBM / json11 . hpp <nl> <nl> # include < utility > <nl> # include < vector > <nl> <nl> - # ifdef _MSC_VER <nl> - # if _MSC_VER < = 1800 / / VS 2013 <nl> - # ifndef noexcept <nl> - # define noexcept throw ( ) <nl> - # endif <nl> - <nl> - # ifndef snprintf <nl> - # define snprintf _snprintf_s <nl> - # endif <nl> - # endif <nl> - # endif <nl> - <nl> namespace json11 { <nl> <nl> enum JsonParse { <nl> mmm a / include / LightGBM / meta . h <nl> ppp b / include / LightGBM / meta . h <nl> typedef void ( * AllgatherFunction ) ( char * input , comm_size_t input_size , const comm <nl> <nl> # define NO_SPECIFIC ( - 1 ) <nl> <nl> - # if ( _MSC_VER < = 1800 ) <nl> - # define __func__ __FUNCTION__ <nl> - # endif <nl> - <nl> } / / namespace LightGBM <nl> <nl> # endif / / LightGBM_META_H_ <nl>
|
Removed legacy code ( )
|
microsoft/LightGBM
|
a295f6b0679d116c7f6388f420da355099e7f9b1
|
2019-04-30T14:01:06Z
|
mmm a / hphp / tools / tc - print / repo - wrapper . cpp <nl> ppp b / hphp / tools / tc - print / repo - wrapper . cpp <nl> RepoWrapper : : RepoWrapper ( const char * repoSchema , <nl> <nl> std : : string hhasLib ; <nl> auto const phpLib = get_systemlib ( & hhasLib ) ; <nl> - always_assert ( ! hhasLib . empty ( ) & & ! phpLib . empty ( ) ) ; <nl> - auto phpUnit = compile_string ( phpLib . c_str ( ) , phpLib . size ( ) , <nl> - " systemlib . php " , <nl> - Native : : s_systemNativeFuncs ) ; <nl> - addUnit ( phpUnit ) ; <nl> - auto hhasUnit = compile_string ( hhasLib . c_str ( ) , hhasLib . size ( ) , <nl> - " systemlib . hhas " , <nl> - Native : : s_systemNativeFuncs ) ; <nl> - addUnit ( hhasUnit ) ; <nl> + if ( ! phpLib . empty ( ) ) { <nl> + auto phpUnit = compile_string ( phpLib . c_str ( ) , phpLib . size ( ) , <nl> + " systemlib . php " , <nl> + Native : : s_systemNativeFuncs ) ; <nl> + addUnit ( phpUnit ) ; <nl> + } <nl> + if ( ! hhasLib . empty ( ) ) { <nl> + auto hhasUnit = compile_string ( hhasLib . c_str ( ) , hhasLib . size ( ) , <nl> + " systemlib . hhas " , <nl> + Native : : s_systemNativeFuncs ) ; <nl> + addUnit ( hhasUnit ) ; <nl> + } <nl> <nl> SystemLib : : s_inited = true ; <nl> } <nl>
|
Do not expect existence of hhas systemlib
|
facebook/hhvm
|
c3c7d1855ea4fd13846eaeed497a326c7f6b00c0
|
2019-01-18T08:46:37Z
|
mmm a / tensorflow / tensorflow . bzl <nl> ppp b / tensorflow / tensorflow . bzl <nl> def _cuda_copts ( ) : <nl> " @ local_config_cuda / / cuda : using_nvcc " : ( <nl> common_cuda_opts + <nl> [ <nl> - " - nvcc_options = relaxed - constexpr " , <nl> + " - nvcc_options = expt - relaxed - constexpr " , <nl> " - nvcc_options = ftz = true " , <nl> ] <nl> ) , <nl>
|
Fix : replace deprecated nvcc flag with its replacement . ( )
|
tensorflow/tensorflow
|
988b53e1ba38900d1cac0fe49357d7fbeab8925a
|
2016-10-28T22:39:21Z
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.