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 / wasm / wasm - code - manager . cc <nl> ppp b / src / wasm / wasm - code - manager . cc <nl> void WasmCode : : DecrementRefCount ( Vector < WasmCode * const > code_vec ) { <nl> if ( engine ) engine - > FreeDeadCode ( dead_code ) ; <nl> } <nl> <nl> + WasmCodeAllocator : : OptionalLock : : ~ OptionalLock ( ) { <nl> + if ( allocator_ ) allocator_ - > mutex_ . Unlock ( ) ; <nl> + } <nl> + <nl> + void WasmCodeAllocator : : OptionalLock : : Lock ( WasmCodeAllocator * allocator ) { <nl> + DCHECK ( ! is_locked ( ) ) ; <nl> + allocator_ = allocator ; <nl> + allocator - > mutex_ . Lock ( ) ; <nl> + } <nl> + <nl> WasmCodeAllocator : : WasmCodeAllocator ( WasmCodeManager * code_manager , <nl> VirtualMemory code_space , <nl> bool can_request_more , <nl> WasmCodeAllocator : : ~ WasmCodeAllocator ( ) { <nl> committed_code_space ( ) ) ; <nl> } <nl> <nl> + void WasmCodeAllocator : : Init ( NativeModule * native_module ) { <nl> + DCHECK_EQ ( 1 , owned_code_space_ . size ( ) ) ; <nl> + native_module - > AddCodeSpace ( owned_code_space_ [ 0 ] . region ( ) , { } ) ; <nl> + } <nl> + <nl> namespace { <nl> / / On Windows , we cannot commit a region that straddles different reservations <nl> / / of virtual memory . Because we bump - allocate , and because , if we need more <nl> size_t ReservationSize ( size_t code_size_estimate , int num_declared_functions , <nl> Vector < byte > WasmCodeAllocator : : AllocateForCode ( NativeModule * native_module , <nl> size_t size ) { <nl> return AllocateForCodeInRegion ( <nl> - native_module , size , { kNullAddress , std : : numeric_limits < size_t > : : max ( ) } ) ; <nl> + native_module , size , { kNullAddress , std : : numeric_limits < size_t > : : max ( ) } , <nl> + WasmCodeAllocator : : OptionalLock { } ) ; <nl> } <nl> <nl> Vector < byte > WasmCodeAllocator : : AllocateForCodeInRegion ( <nl> - NativeModule * native_module , size_t size , base : : AddressRegion region ) { <nl> - base : : RecursiveMutexGuard lock ( & mutex_ ) ; <nl> + NativeModule * native_module , size_t size , base : : AddressRegion region , <nl> + const WasmCodeAllocator : : OptionalLock & optional_lock ) { <nl> + OptionalLock new_lock ; <nl> + if ( ! optional_lock . is_locked ( ) ) new_lock . Lock ( this ) ; <nl> + const auto & locked_lock = <nl> + optional_lock . is_locked ( ) ? optional_lock : new_lock ; <nl> + DCHECK ( locked_lock . is_locked ( ) ) ; <nl> DCHECK_EQ ( code_manager_ , native_module - > engine ( ) - > code_manager ( ) ) ; <nl> DCHECK_LT ( 0 , size ) ; <nl> v8 : : PageAllocator * page_allocator = GetPlatformPageAllocator ( ) ; <nl> Vector < byte > WasmCodeAllocator : : AllocateForCodeInRegion ( <nl> code_manager_ - > AssignRange ( new_region , native_module ) ; <nl> free_code_space_ . Merge ( new_region ) ; <nl> owned_code_space_ . emplace_back ( std : : move ( new_mem ) ) ; <nl> - native_module - > AddCodeSpace ( new_region ) ; <nl> + native_module - > AddCodeSpace ( new_region , locked_lock ) ; <nl> <nl> code_space = free_code_space_ . Allocate ( size ) ; <nl> DCHECK ( ! code_space . is_empty ( ) ) ; <nl> Vector < byte > WasmCodeAllocator : : AllocateForCodeInRegion ( <nl> } <nl> <nl> bool WasmCodeAllocator : : SetExecutable ( bool executable ) { <nl> - base : : RecursiveMutexGuard lock ( & mutex_ ) ; <nl> + base : : MutexGuard lock ( & mutex_ ) ; <nl> if ( is_executable_ = = executable ) return true ; <nl> TRACE_HEAP ( " Setting module % p as executable : % d . \ n " , this , executable ) ; <nl> <nl> void WasmCodeAllocator : : FreeCode ( Vector < WasmCode * const > codes ) { <nl> freed_code_size_ . fetch_add ( code_size ) ; <nl> <nl> / / Merge { freed_regions } into { freed_code_space_ } and discard full pages . <nl> - base : : RecursiveMutexGuard guard ( & mutex_ ) ; <nl> + base : : MutexGuard guard ( & mutex_ ) ; <nl> PageAllocator * allocator = GetPlatformPageAllocator ( ) ; <nl> size_t commit_page_size = allocator - > CommitPageSize ( ) ; <nl> for ( auto region : freed_regions . regions ( ) ) { <nl> void WasmCodeAllocator : : FreeCode ( Vector < WasmCode * const > codes ) { <nl> } <nl> <nl> size_t WasmCodeAllocator : : GetNumCodeSpaces ( ) const { <nl> - base : : RecursiveMutexGuard lock ( & mutex_ ) ; <nl> + base : : MutexGuard lock ( & mutex_ ) ; <nl> return owned_code_space_ . size ( ) ; <nl> } <nl> <nl> - base : : AddressRegion WasmCodeAllocator : : GetSingleCodeRegion ( ) const { <nl> - base : : RecursiveMutexGuard lock ( & mutex_ ) ; <nl> - DCHECK_EQ ( 1 , owned_code_space_ . size ( ) ) ; <nl> - return owned_code_space_ [ 0 ] . region ( ) ; <nl> - } <nl> - <nl> NativeModule : : NativeModule ( WasmEngine * engine , const WasmFeatures & enabled , <nl> bool can_request_more , VirtualMemory code_space , <nl> std : : shared_ptr < const WasmModule > module , <nl> NativeModule : : NativeModule ( WasmEngine * engine , const WasmFeatures & enabled , <nl> code_table_ = <nl> std : : make_unique < WasmCode * [ ] > ( module_ - > num_declared_functions ) ; <nl> } <nl> - AddCodeSpace ( code_allocator_ . GetSingleCodeRegion ( ) ) ; <nl> + code_allocator_ . Init ( this ) ; <nl> } <nl> <nl> void NativeModule : : ReserveCodeTableForTesting ( uint32_t max_functions ) { <nl> void NativeModule : : ReserveCodeTableForTesting ( uint32_t max_functions ) { <nl> / / Re - allocate jump table . <nl> main_jump_table_ = CreateEmptyJumpTableInRegion ( <nl> JumpTableAssembler : : SizeForNumberOfSlots ( max_functions ) , <nl> - single_code_space_region ) ; <nl> + single_code_space_region , WasmCodeAllocator : : OptionalLock { } ) ; <nl> base : : MutexGuard guard ( & allocation_mutex_ ) ; <nl> code_space_data_ [ 0 ] . jump_table = main_jump_table_ ; <nl> } <nl> void NativeModule : : UseLazyStub ( uint32_t func_index ) { <nl> } <nl> lazy_compile_table_ = CreateEmptyJumpTableInRegion ( <nl> JumpTableAssembler : : SizeForNumberOfLazyFunctions ( num_slots ) , <nl> - single_code_space_region ) ; <nl> + single_code_space_region , WasmCodeAllocator : : OptionalLock { } ) ; <nl> JumpTableAssembler : : GenerateLazyCompileTable ( <nl> lazy_compile_table_ - > instruction_start ( ) , num_slots , <nl> module_ - > num_imported_functions , <nl> WasmModuleSourceMap * NativeModule : : GetWasmSourceMap ( ) const { <nl> } <nl> <nl> WasmCode * NativeModule : : CreateEmptyJumpTableInRegion ( <nl> - uint32_t jump_table_size , base : : AddressRegion region ) { <nl> + uint32_t jump_table_size , base : : AddressRegion region , <nl> + const WasmCodeAllocator : : OptionalLock & allocator_lock ) { <nl> / / Only call this if we really need a jump table . <nl> DCHECK_LT ( 0 , jump_table_size ) ; <nl> - Vector < uint8_t > code_space = <nl> - code_allocator_ . AllocateForCodeInRegion ( this , jump_table_size , region ) ; <nl> + Vector < uint8_t > code_space = code_allocator_ . AllocateForCodeInRegion ( <nl> + this , jump_table_size , region , allocator_lock ) ; <nl> DCHECK ( ! code_space . empty ( ) ) ; <nl> ZapCode ( reinterpret_cast < Address > ( code_space . begin ( ) ) , code_space . size ( ) ) ; <nl> std : : unique_ptr < WasmCode > code { new WasmCode { <nl> void NativeModule : : PatchJumpTableLocked ( const CodeSpaceData & code_space_data , <nl> target ) ; <nl> } <nl> <nl> - void NativeModule : : AddCodeSpace ( base : : AddressRegion region ) { <nl> + void NativeModule : : AddCodeSpace ( <nl> + base : : AddressRegion region , <nl> + const WasmCodeAllocator : : OptionalLock & allocator_lock ) { <nl> # ifndef V8_EMBEDDED_BUILTINS <nl> / / The far jump table contains far jumps to the embedded builtins . This <nl> / / requires a build with embedded builtins enabled . <nl> void NativeModule : : AddCodeSpace ( base : : AddressRegion region ) { <nl> - > CanRegisterUnwindInfoForNonABICompliantCodeRange ( ) ) { <nl> size_t size = Heap : : GetCodeRangeReservedAreaSize ( ) ; <nl> DCHECK_LT ( 0 , size ) ; <nl> - Vector < byte > padding = <nl> - code_allocator_ . AllocateForCodeInRegion ( this , size , region ) ; <nl> + Vector < byte > padding = code_allocator_ . AllocateForCodeInRegion ( <nl> + this , size , region , allocator_lock ) ; <nl> CHECK_EQ ( reinterpret_cast < Address > ( padding . begin ( ) ) , region . begin ( ) ) ; <nl> win64_unwindinfo : : RegisterNonABICompliantCodeRange ( <nl> reinterpret_cast < void * > ( region . begin ( ) ) , region . size ( ) ) ; <nl> void NativeModule : : AddCodeSpace ( base : : AddressRegion region ) { <nl> <nl> if ( needs_jump_table ) { <nl> jump_table = CreateEmptyJumpTableInRegion ( <nl> - JumpTableAssembler : : SizeForNumberOfSlots ( num_wasm_functions ) , region ) ; <nl> + JumpTableAssembler : : SizeForNumberOfSlots ( num_wasm_functions ) , region , <nl> + allocator_lock ) ; <nl> CHECK ( region . contains ( jump_table - > instruction_start ( ) ) ) ; <nl> } <nl> <nl> void NativeModule : : AddCodeSpace ( base : : AddressRegion region ) { <nl> far_jump_table = CreateEmptyJumpTableInRegion ( <nl> JumpTableAssembler : : SizeForNumberOfFarJumpSlots ( <nl> WasmCode : : kRuntimeStubCount , num_function_slots ) , <nl> - region ) ; <nl> + region , allocator_lock ) ; <nl> CHECK ( region . contains ( far_jump_table - > instruction_start ( ) ) ) ; <nl> EmbeddedData embedded_data = EmbeddedData : : FromBlob ( ) ; <nl> # define RUNTIME_STUB ( Name ) Builtins : : k # # Name , <nl> mmm a / src / wasm / wasm - code - manager . h <nl> ppp b / src / wasm / wasm - code - manager . h <nl> const char * GetWasmCodeKindAsString ( WasmCode : : Kind ) ; <nl> / / Manages the code reservations and allocations of a single { NativeModule } . <nl> class WasmCodeAllocator { <nl> public : <nl> + / / { OptionalLock } is passed between { WasmCodeAllocator } and { NativeModule } to <nl> + / / indicate that the lock on the { WasmCodeAllocator } is already taken . It ' s <nl> + / / optional to allow to also call methods without holding the lock . <nl> + class OptionalLock { <nl> + public : <nl> + / / External users can only instantiate a non - locked { OptionalLock } . <nl> + OptionalLock ( ) = default ; <nl> + ~ OptionalLock ( ) ; <nl> + bool is_locked ( ) const { return allocator_ ! = nullptr ; } <nl> + <nl> + private : <nl> + friend class WasmCodeAllocator ; <nl> + / / { Lock } is called from the { WasmCodeAllocator } if no locked { OptionalLock } <nl> + / / is passed . <nl> + void Lock ( WasmCodeAllocator * ) ; <nl> + <nl> + WasmCodeAllocator * allocator_ = nullptr ; <nl> + } ; <nl> + <nl> WasmCodeAllocator ( WasmCodeManager * , VirtualMemory code_space , <nl> bool can_request_more , <nl> std : : shared_ptr < Counters > async_counters ) ; <nl> ~ WasmCodeAllocator ( ) ; <nl> <nl> + / / Call before use , after the { NativeModule } is set up completely . <nl> + void Init ( NativeModule * ) ; <nl> + <nl> size_t committed_code_space ( ) const { <nl> return committed_code_space_ . load ( std : : memory_order_acquire ) ; <nl> } <nl> class WasmCodeAllocator { <nl> / / Allocate code space within a specific region . Returns a valid buffer or <nl> / / fails with OOM ( crash ) . <nl> Vector < byte > AllocateForCodeInRegion ( NativeModule * , size_t size , <nl> - base : : AddressRegion ) ; <nl> + base : : AddressRegion , <nl> + const WasmCodeAllocator : : OptionalLock & ) ; <nl> <nl> / / Sets permissions of all owned code space to executable , or read - write ( if <nl> / / { executable } is false ) . Returns true on success . <nl> class WasmCodeAllocator { <nl> / / Retrieve the number of separately reserved code spaces . <nl> size_t GetNumCodeSpaces ( ) const ; <nl> <nl> - / / Returns the region of the single code space managed by this code allocator . <nl> - / / Will fail if more than one code space has been created . <nl> - base : : AddressRegion GetSingleCodeRegion ( ) const ; <nl> - <nl> private : <nl> / / The engine - wide wasm code manager . <nl> WasmCodeManager * const code_manager_ ; <nl> <nl> - / / TODO ( clemensb ) : Try to make this non - recursive again . It ' s recursive <nl> - / / currently because { AllocateForCodeInRegion } might create a new code space , <nl> - / / which recursively calls { AllocateForCodeInRegion } for the jump table . <nl> - mutable base : : RecursiveMutex mutex_ ; <nl> + mutable base : : Mutex mutex_ ; <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / Protected by { mutex_ } : <nl> class V8_EXPORT_PRIVATE NativeModule final { <nl> ExecutionTier tier , Vector < uint8_t > code_space , <nl> const JumpTablesRef & jump_tables_ref ) ; <nl> <nl> - WasmCode * CreateEmptyJumpTableInRegion ( uint32_t jump_table_size , <nl> - base : : AddressRegion ) ; <nl> + WasmCode * CreateEmptyJumpTableInRegion ( <nl> + uint32_t jump_table_size , base : : AddressRegion , <nl> + const WasmCodeAllocator : : OptionalLock & ) ; <nl> <nl> / / Hold the { allocation_mutex_ } when calling one of these methods . <nl> / / { slot_index } is the index in the declared functions , i . e . function index <nl> class V8_EXPORT_PRIVATE NativeModule final { <nl> Address target ) ; <nl> <nl> / / Called by the { WasmCodeAllocator } to register a new code space . <nl> - void AddCodeSpace ( base : : AddressRegion ) ; <nl> + void AddCodeSpace ( base : : AddressRegion , <nl> + const WasmCodeAllocator : : OptionalLock & ) ; <nl> <nl> / / Hold the { allocation_mutex_ } when calling this method . <nl> bool has_interpreter_redirection ( uint32_t func_index ) { <nl>
|
[ wasm ] Replace RecursiveMutex by Mutex
|
v8/v8
|
eb7a36be4748e36cee456fb4bef8f11bdd245c98
|
2019-10-07T14:20:17Z
|
mmm a / xbmc / video / windows / GUIWindowVideoBase . cpp <nl> ppp b / xbmc / video / windows / GUIWindowVideoBase . cpp <nl> void CGUIWindowVideoBase : : GetResumeItemOffset ( const CFileItem * item , int64_t & st <nl> { <nl> if ( item - > GetCurrentResumeTimeAndPartNumber ( startoffset , partNumber ) ) <nl> { <nl> - startoffset * = 75 ; <nl> + startoffset = CUtil : : ConvertSecsToMilliSecs ( startoffset ) ; <nl> } <nl> else <nl> { <nl>
|
Merge pull request from ksooo / video - fix - getresumestring
|
xbmc/xbmc
|
33d85ac2f8a11b19d44c901c25722491e0fbf92a
|
2018-01-18T20:22:40Z
|
mmm a / src / rdb_protocol / datum_stream . cc <nl> ppp b / src / rdb_protocol / datum_stream . cc <nl> class pseudoshard_t { <nl> case range_state_t : : EXHAUSTED : break ; <nl> default : unreachable ( ) ; <nl> } <nl> - raw_stream_t new_cache ; <nl> - new_cache . reserve ( ( cached - > cache . size ( ) - cached_index ) <nl> - + ( fresh ? ( fresh - > stream . size ( ) - fresh_index ) : 0 ) ) ; <nl> - std : : move ( cached - > cache . begin ( ) + cached_index , <nl> - cached - > cache . end ( ) , <nl> - std : : back_inserter ( new_cache ) ) ; <nl> - if ( fresh ! = nullptr ) { <nl> - std : : move ( fresh - > stream . begin ( ) + fresh_index , <nl> - fresh - > stream . end ( ) , <nl> + if ( fresh | | cached_index > 0 ) { <nl> + raw_stream_t new_cache ; <nl> + new_cache . reserve ( ( cached - > cache . size ( ) - cached_index ) <nl> + + ( fresh ? ( fresh - > stream . size ( ) - fresh_index ) : 0 ) ) ; <nl> + std : : move ( cached - > cache . begin ( ) + cached_index , <nl> + cached - > cache . end ( ) , <nl> std : : back_inserter ( new_cache ) ) ; <nl> + if ( fresh ! = nullptr ) { <nl> + std : : move ( fresh - > stream . begin ( ) + fresh_index , <nl> + fresh - > stream . end ( ) , <nl> + std : : back_inserter ( new_cache ) ) ; <nl> + } <nl> + cached - > cache = std : : move ( new_cache ) ; <nl> } <nl> - cached - > cache = std : : move ( new_cache ) ; <nl> finished = true ; <nl> } <nl> <nl> raw_stream_t rget_response_reader_t : : unshard ( <nl> pseudoshards . reserve ( active_ranges - > ranges . size ( ) * CPU_SHARDING_FACTOR ) ; <nl> size_t n_active = 0 , n_fresh = 0 ; <nl> for ( auto & & pair : active_ranges - > ranges ) { <nl> + bool range_active = pair . second . state ( ) = = range_state_t : : ACTIVE ; <nl> for ( auto & & hash_pair : pair . second . hash_ranges ) { <nl> if ( hash_pair . second . totally_exhausted ( ) ) continue ; <nl> keyed_stream_t * fresh = nullptr ; <nl> / / Active shards need their bounds updated . <nl> - if ( hash_pair . second . state = = range_state_t : : ACTIVE ) { <nl> + if ( range_active ) { <nl> n_active + = 1 ; <nl> store_key_t * new_bound = nullptr ; <nl> auto it = stream . substreams . find ( <nl>
|
Fix unsharding problems that affected performance of small batches .
|
rethinkdb/rethinkdb
|
68532e4c80653f59f533f7ca4cd457084be97c6a
|
2015-11-11T09:24:42Z
|
mmm a / hphp / hhbbc / index . cpp <nl> ppp b / hphp / hhbbc / index . cpp <nl> void Index : : refine_return_info ( const FuncAnalysisResult & fa , <nl> <nl> if ( finfo - > effectFree ! = fa . effectFree ) { <nl> finfo - > effectFree = fa . effectFree ; <nl> - dep = Dep : : InlineDepthLimit ; <nl> + dep = Dep : : InlineDepthLimit | Dep : : ReturnTy ; <nl> } <nl> <nl> if ( dep ! = Dep { } ) find_deps ( * m_data , func , dep , deps ) ; <nl>
|
Fix some dependency issues
|
facebook/hhvm
|
c3af6c28bdd5e9050a7dd301c40c6b783ba61855
|
2019-04-27T14:02:25Z
|
mmm a / modules / photo / include / opencv2 / photo . hpp <nl> ppp b / modules / photo / include / opencv2 / photo . hpp <nl> class CV_EXPORTS_W Tonemap : public Algorithm <nl> public : <nl> / * * @ brief Tonemaps image <nl> <nl> - @ param src source image - 32 - bit 3 - channel Mat <nl> - @ param dst destination image - 32 - bit 3 - channel Mat with values in [ 0 , 1 ] range <nl> + @ param src source image - CV_32FC3 Mat ( float 32 bits 3 channels ) <nl> + @ param dst destination image - CV_32FC3 Mat with values in [ 0 , 1 ] range <nl> * / <nl> CV_WRAP virtual void process ( InputArray src , OutputArray dst ) = 0 ; <nl> <nl> mmm a / modules / photo / src / tonemap . cpp <nl> ppp b / modules / photo / src / tonemap . cpp <nl> class TonemapImpl CV_FINAL : public Tonemap <nl> <nl> Mat src = _src . getMat ( ) ; <nl> CV_Assert ( ! src . empty ( ) ) ; <nl> + CV_Assert ( _src . dims ( ) = = 2 & & _src . type ( ) = = CV_32FC3 ) ; <nl> _dst . create ( src . size ( ) , CV_32FC3 ) ; <nl> Mat dst = _dst . getMat ( ) ; <nl> <nl>
|
Solves bug 13853
|
opencv/opencv
|
9e94212eacac73d83372d2c3764d63e5af9454a7
|
2019-02-18T16:15:05Z
|
mmm a / lib / Sema / TypeCheckType . cpp <nl> ppp b / lib / Sema / TypeCheckType . cpp <nl> static bool checkObjCInExtensionContext ( TypeChecker & tc , <nl> return true ; <nl> } <nl> <nl> + / / Check if any classes in the inheritance hierarchy have generic <nl> + / / parameters . <nl> / / FIXME : This is a current limitation , not inherent . We don ' t have <nl> / / a concrete class to attach Objective - C category metadata to . <nl> - if ( ED - > getGenericParams ( ) ) { <nl> - if ( diagnose ) { <nl> - tc . diagnose ( value - > getLoc ( ) , diag : : objc_in_generic_extension ) ; <nl> + Type extendedTy = ED - > getDeclaredTypeInContext ( ) ; <nl> + while ( ! extendedTy . isNull ( ) ) { <nl> + const ClassDecl * CD = extendedTy - > getClassOrBoundGenericClass ( ) ; <nl> + if ( ! CD ) <nl> + break ; <nl> + <nl> + if ( CD - > getGenericParams ( ) ) { <nl> + if ( diagnose ) { <nl> + tc . diagnose ( value - > getLoc ( ) , diag : : objc_in_generic_extension ) ; <nl> + } <nl> + return true ; <nl> } <nl> - return true ; <nl> + <nl> + extendedTy = CD - > getSuperclass ( ) ; <nl> } <nl> } <nl> <nl> mmm a / test / attr / attr_objc . swift <nl> ppp b / test / attr / attr_objc . swift <nl> class GenericContext3 < T > { <nl> @ objc / / expected - error { { only classes that inherit from NSObject can be declared @ objc } } <nl> class ConcreteSubclassOfGeneric : GenericContext3 < Int > { } <nl> <nl> + extension ConcreteSubclassOfGeneric { <nl> + @ objc func foo ( ) { } / / expected - error { { @ objc is not supported within extensions of generic classes } } <nl> + } <nl> + <nl> @ objc / / expected - error { { generic subclasses of ' @ objc ' classes cannot have an explicit ' @ objc ' attribute } } <nl> class ConcreteSubclassOfGeneric2 : subject_genericClass2 < Int > { } <nl> <nl> + extension ConcreteSubclassOfGeneric2 { <nl> + @ objc func foo ( ) { } / / expected - error { { @ objc is not supported within extensions of generic classes } } <nl> + } <nl> + <nl> class subject_subscriptIndexed1 { <nl> @ objc <nl> subscript ( a : Int ) - > Int { / / no - error <nl>
|
Disallow @ objc in extensions of classes with inherited generics as well .
|
apple/swift
|
a0c07f12fa2c05f7e7659c3245e3bc8ec9251e90
|
2015-07-28T21:32:03Z
|
mmm a / docs / en / operations / monitoring . md <nl> ppp b / docs / en / operations / monitoring . md <nl> <nl> <nl> You can monitor : <nl> <nl> - - Hardware resources utilization . <nl> + - Utilization of hardware resources . <nl> - ClickHouse server metrics . <nl> <nl> - # # Resources Utilization <nl> + # # Resource Utilization <nl> <nl> ClickHouse does not monitor the state of hardware resources by itself . <nl> <nl> It is highly recommended to set up monitoring for : <nl> <nl> - - Processors load and temperature . <nl> + - Load and temperature on processors . <nl> <nl> You can use [ dmesg ] ( https : / / en . wikipedia . org / wiki / Dmesg ) , [ turbostat ] ( https : / / www . linux . org / docs / man8 / turbostat . html ) or other instruments . <nl> <nl> To track server events use server logs . See the [ logger ] ( # server_settings - logger <nl> ClickHouse collects : <nl> <nl> - Different metrics of how the server uses computational resources . <nl> - - Common statistics of queries processing . <nl> + - Common statistics on query processing . <nl> <nl> - You can find metrics in tables [ system . metrics ] ( # system_tables - metrics ) , [ system . events ] ( # system_tables - events ) и [ system . asynchronous_metrics ] ( # system_tables - asynchronous_metrics ) . <nl> + You can find metrics in the [ system . metrics ] ( # system_tables - metrics ) , [ system . events ] ( # system_tables - events ) , and [ system . asynchronous_metrics ] ( # system_tables - asynchronous_metrics ) tables . <nl> <nl> - You can configure ClickHouse to export metrics to [ Graphite ] ( https : / / github . com / graphite - project ) . See the [ Graphite section ] ( server_settings / settings . md # server_settings - graphite ) of ClickHouse server configuration file . Before configuring metrics export , you should set up Graphite by following their official guide https : / / graphite . readthedocs . io / en / latest / install . html . <nl> + You can configure ClickHouse to export metrics to [ Graphite ] ( https : / / github . com / graphite - project ) . See the [ Graphite section ] ( server_settings / settings . md # server_settings - graphite ) in the ClickHouse server configuration file . Before configuring export of metrics , you should set up Graphite by following their official guide https : / / graphite . readthedocs . io / en / latest / install . html . <nl> <nl> - Also , you can monitor server availability through the HTTP API . Send the ` HTTP GET ` request to ` / ` . If server available , it answers ` 200 OK ` . <nl> + Additionally , you can monitor server availability through the HTTP API . Send the ` HTTP GET ` request to ` / ` . If the server is available , it responds with ` 200 OK ` . <nl> <nl> - To monitor servers in a cluster configuration , you should set [ max_replica_delay_for_distributed_queries ] ( settings / settings . md # settings - max_replica_delay_for_distributed_queries ) parameter and use HTTP resource ` / replicas - delay ` . Request to ` / replicas - delay ` returns ` 200 OK ` if the replica is available and does not delay behind others . If replica delays , it returns the information about the gap . <nl> + To monitor servers in a cluster configuration , you should set the [ max_replica_delay_for_distributed_queries ] ( settings / settings . md # settings - max_replica_delay_for_distributed_queries ) parameter and use the HTTP resource ` / replicas - delay ` . A request to ` / replicas - delay ` returns ` 200 OK ` if the replica is available and is not delayed behind the other replicas . If a replica is delayed , it returns information about the gap . <nl> mmm a / docs / en / operations / requirements . md <nl> ppp b / docs / en / operations / requirements . md <nl> <nl> <nl> # # CPU <nl> <nl> - In case of installation from prebuilt deb - packages use CPU with x86_64 architecture and SSE 4 . 2 instructions support . To run ClickHouse with processors than does not support SSE 4 . 2 or has AArch64 or PowerPC64LE architecture , you should build ClickHouse from sources . <nl> + For installation from prebuilt deb packages , use a CPU with x86_64 architecture and support for SSE 4 . 2 instructions . To run ClickHouse with processors than do not support SSE 4 . 2 or have AArch64 or PowerPC64LE architecture , you should build ClickHouse from sources . <nl> <nl> - ClickHouse implements parallel data processing and uses all the hardware resources available . When choosing a processor , take into account that ClickHouse works more efficient at configurations with a large number of cores but lower clock rate than at configurations with fewer cores and a higher clock rate . For example , 16 cores with 2600 MHz is preferable than 8 cores with 3600 MHz . <nl> + ClickHouse implements parallel data processing and uses all the hardware resources available . When choosing a processor , take into account that ClickHouse works more efficiently at configurations with a large number of cores but a lower clock rate than at configurations with fewer cores and a higher clock rate . For example , 16 cores with 2600 MHz is preferable to 8 cores with 3600 MHz . <nl> <nl> Use of * * Turbo Boost * * and * * hyper - threading * * technologies is recommended . It significantly improves performance with a typical load . <nl> <nl> # # RAM <nl> <nl> - We recommend to use 4GB of RAM as minimum to be able to perform non - trivial queries . The ClickHouse server can run with a much smaller amount of RAM , but it requires memory for queries processing . <nl> + We recommend to use a minimum of 4GB of RAM in order to perform non - trivial queries . The ClickHouse server can run with a much smaller amount of RAM , but it requires memory for processing queries . <nl> <nl> The required volume of RAM depends on : <nl> <nl> - The complexity of queries . <nl> - - Amount of the data , that processed in queries . <nl> + - The amount of data that is processed in queries . <nl> <nl> To calculate the required volume of RAM , you should estimate the size of temporary data for [ GROUP BY ] ( . . / query_language / select . md # select - group - by - clause ) , [ DISTINCT ] ( . . / query_language / select . md # select - distinct ) , [ JOIN ] ( . . / query_language / select . md # select - join ) and other operations you use . <nl> <nl> You need to have 2GB of free disk space to install ClickHouse . <nl> <nl> The volume of storage required for your data should be calculated separately . Assessment should include : <nl> <nl> - - Estimation of a data volume . <nl> + - Estimation of the data volume . <nl> <nl> - You can take the sample of the data and get an average size of a row from it . Then multiply the value with a number of rows you plan to store . <nl> + You can take a sample of the data and get the average size of a row from it . Then multiply the value by the number of rows you plan to store . <nl> <nl> - - Data compression coefficient . <nl> + - The data compression coefficient . <nl> <nl> - To estimate the data compression coefficient , load some sample of your data into ClickHouse and compare the actual size of the data with the size of the table stored . For example , clickstream data are usually compressed by 6 - 10 times . <nl> + To estimate the data compression coefficient , load a sample of your data into ClickHouse and compare the actual size of the data with the size of the table stored . For example , clickstream data is usually compressed by 6 - 10 times . <nl> <nl> - To calculate the final volume of data to be stored , apply the compression coefficient to the estimated data volume . If you plan to store data in several replicas , then multiply estimated volume with the number of replicas . <nl> + To calculate the final volume of data to be stored , apply the compression coefficient to the estimated data volume . If you plan to store data in several replicas , then multiply the estimated volume by the number of replicas . <nl> <nl> # # Network <nl> <nl> - If possible , use networks of 10G of higher class . <nl> + If possible , use networks of 10G or higher class . <nl> <nl> - A bandwidth of the network is critical for processing of distributed queries with a large amount of intermediate data . Also , network speed affects replication processes . <nl> + The network bandwidth is critical for processing distributed queries with a large amount of intermediate data . In addition , network speed affects replication processes . <nl> <nl> # # Software <nl> <nl> - ClickHouse is developed for Linux family of operating systems . The recommended Linux distribution is Ubuntu . The ` tzdata ` package should be installed in the system . <nl> + ClickHouse is developed for the Linux family of operating systems . The recommended Linux distribution is Ubuntu . The ` tzdata ` package should be installed in the system . <nl> <nl> - ClickHouse also can work in other families of operating systems . See details in [ Getting started ] ( . . / getting_started / index . md ) section of the documentation . <nl> + ClickHouse can also work in other operating system families . See details in the [ Getting started ] ( . . / getting_started / index . md ) section of the documentation . <nl> mmm a / docs / en / operations / troubleshooting . md <nl> ppp b / docs / en / operations / troubleshooting . md <nl> <nl> <nl> - [ Installation ] ( # troubleshooting - installation - errors ) <nl> - [ Connecting to the server ] ( # troubleshooting - accepts - no - connections ) <nl> - - [ Queries processing ] ( # troubleshooting - does - not - process - queries ) <nl> - - [ Efficiency of queries processing ] ( # troubleshooting - too - slow ) <nl> + - [ Query processing ] ( # troubleshooting - does - not - process - queries ) <nl> + - [ Efficiency of query processing ] ( # troubleshooting - too - slow ) <nl> <nl> # # Installation { # troubleshooting - installation - errors } <nl> <nl> - # # # You Can Not Get Deb - packages from ClickHouse Repository With apt - get <nl> + # # # You Cannot Get Deb Packages from ClickHouse Repository With apt - get <nl> <nl> - Check firewall settings . <nl> - - If you can not access the repository by any reason , download packages as described in the [ Getting started ] ( . . / getting_started / index . md ) article and install them manually with ` sudo dpkg - i < packages > ` command . Also , you need ` tzdata ` package . <nl> + - If you cannot access the repository for any reason , download packages as described in the [ Getting started ] ( . . / getting_started / index . md ) article and install them manually using the ` sudo dpkg - i < packages > ` command . You will also need the ` tzdata ` package . <nl> <nl> <nl> # # Connecting to the Server { # troubleshooting - accepts - no - connections } <nl> sudo service clickhouse - server start <nl> <nl> The main log of ` clickhouse - server ` is in ` / var / log / clickhouse - server / clickhouse - server . log ` by default . <nl> <nl> - In case of successful start you should see the strings : <nl> + If the server started successfully , you should see the strings : <nl> <nl> - - ` < Information > Application : starting up . ` — Server started to run . <nl> - - ` < Information > Application : Ready for connections . ` — Server runs and ready for connections . <nl> + - ` < Information > Application : starting up . ` — Server started . <nl> + - ` < Information > Application : Ready for connections . ` — Server is running and ready for connections . <nl> <nl> - If ` clickhouse - server ` start failed by the configuration error you should see the ` < Error > ` string with an error description . For example : <nl> + If ` clickhouse - server ` start failed with a configuration error , you should see the ` < Error > ` string with an error description . For example : <nl> <nl> ` ` ` <nl> 2019 . 01 . 11 15 : 23 : 25 . 549505 [ 45 ] { } < Error > ExternalDictionaries : Failed reloading ' event2id ' external dictionary : Poco : : Exception . Code : 1000 , e . code ( ) = 111 , e . displayText ( ) = Connection refused , e . what ( ) = Connection refused <nl> ` ` ` <nl> <nl> - If you don ' t see an error at the end of file look through all the file from the string : <nl> + If you don ' t see an error at the end of the file , look through the entire file starting from the string : <nl> <nl> ` ` ` <nl> < Information > Application : starting up . <nl> ` ` ` <nl> <nl> - If you try to start the second instance of ` clickhouse - server ` at the server you see the following log : <nl> + If you try to start a second instance of ` clickhouse - server ` on the server , you see the following log : <nl> <nl> ` ` ` <nl> 2019 . 01 . 11 15 : 25 : 11 . 151730 [ 1 ] { } < Information > : Starting ClickHouse 19 . 1 . 0 with revision 54413 <nl> Revision : 54413 <nl> <nl> * * See system . d logs * * <nl> <nl> - If there is no any useful information in ` clickhouse - server ` logs or there is no any logs , you can see ` system . d ` logs by the command : <nl> + If you don ' t find any useful information in ` clickhouse - server ` logs or there aren ' t any logs , you can view ` system . d ` logs using the command : <nl> <nl> ` ` ` <nl> sudo journalctl - u clickhouse - server <nl> sudo journalctl - u clickhouse - server <nl> sudo - u clickhouse / usr / bin / clickhouse - server - - config - file / etc / clickhouse - server / config . xml <nl> ` ` ` <nl> <nl> - This command starts the server as an interactive app with standard parameters of autostart script . In this mode ` clickhouse - server ` prints all the event messages into the console . <nl> + This command starts the server as an interactive app with standard parameters of the autostart script . In this mode ` clickhouse - server ` prints all the event messages in the console . <nl> <nl> # # # Configuration Parameters <nl> <nl> Check : <nl> <nl> - Docker settings . <nl> <nl> - If you run ClickHouse in Docker in IPv6 network , make sure that ` network = host ` is set . <nl> + If you run ClickHouse in Docker in an IPv6 network , make sure that ` network = host ` is set . <nl> <nl> - Endpoint settings . <nl> <nl> Check : <nl> <nl> - HTTP protocol settings . <nl> <nl> - Check protocol settings for HTTP API . <nl> + Check protocol settings for the HTTP API . <nl> <nl> - Secure connection settings . <nl> <nl> Check : <nl> - The ` tcp_port_secure ` setting . <nl> - Settings for SSL sertificates . <nl> <nl> - Use proper parameters while connecting . For example , use parameter ` port_secure ` with ` clickhouse_client ` . <nl> + Use proper parameters while connecting . For example , use the ` port_secure ` parameter with ` clickhouse_client ` . <nl> <nl> - User settings . <nl> <nl> - You may use the wrong user name or password for it . <nl> + You might be using the wrong user name or password . <nl> <nl> - # # Queries Processing { # troubleshooting - does - not - process - queries } <nl> + # # Query Processing { # troubleshooting - does - not - process - queries } <nl> <nl> - If ClickHouse can not process the query , it sends the description of an error to the client . In the ` clickhouse - client ` you get a description of an error in console . If you use HTTP interface , ClickHouse sends error description in response body . For example , <nl> + If ClickHouse is not able to process the query , it sends an error description to the client . In the ` clickhouse - client ` you get a description of the error in the console . If you are using the HTTP interface , ClickHouse sends the error description in the response body . For example : <nl> <nl> ` ` ` bash <nl> $ curl ' http : / / localhost : 8123 / ' - - data - binary " SELECT a " <nl> Code : 47 , e . displayText ( ) = DB : : Exception : Unknown identifier : a . Note that there are no tables ( FROM clause ) in your query , context : required_names : ' a ' source_tables : table_aliases : private_aliases : column_aliases : public_columns : ' a ' masked_columns : array_join_columns : source_columns : , e . what ( ) = DB : : Exception <nl> ` ` ` <nl> <nl> - If you start ` clickhouse - client ` with ` stack - trace ` parameter , ClickHouse returns server stack trace with the description of an error . <nl> + If you start ` clickhouse - client ` with the ` stack - trace ` parameter , ClickHouse returns the server stack trace with the description of an error . <nl> <nl> - It is possible that you see the message of connection broken . In this case , you can repeat query . If connection brakes any time you perform the query you should check the server logs for errors . <nl> + You might see a message about a broken connection . In this case , you can repeat the query . If the connection breaks every time you perform the query , check the server logs for errors . <nl> <nl> - # # Efficiency of Queries Processing { # troubleshooting - too - slow } <nl> + # # Efficiency of Query Processing { # troubleshooting - too - slow } <nl> <nl> - If you see that ClickHouse works too slow , you need to profile the load of the server resources and network for your queries . <nl> + If you see that ClickHouse is working too slowly , you need to profile the load on the server resources and network for your queries . <nl> <nl> - You can use clickhouse - benchmark utility to profile queries . It shows the number of queries processed in a second , the number of rows processed in a second and percentiles of query processing times . <nl> + You can use the clickhouse - benchmark utility to profile queries . It shows the number of queries processed per second , the number of rows processed per second , and percentiles of query processing times . <nl> mmm a / docs / en / operations / update . md <nl> ppp b / docs / en / operations / update . md <nl> <nl> # ClickHouse Update <nl> <nl> - If ClickHouse is installed from deb - packages , execute the following commands on the server : <nl> + If ClickHouse was installed from deb packages , execute the following commands on the server : <nl> <nl> ` ` ` <nl> sudo apt - get update <nl> sudo apt - get install clickhouse - client clickhouse - server <nl> sudo service clickhouse - server restart <nl> ` ` ` <nl> <nl> - If you installed ClickHouse not from recommended deb - packages , use corresponding methods of update . <nl> + If you installed ClickHouse using something other than the recommended deb packages , use the appropriate update method . <nl> <nl> - ClickHouse does not support a distributed update . The operation should be performed consecutively at each separate server . Do not update all the servers on cluster at the same time , otherwise cluster became unavailable for some time . <nl> + ClickHouse does not support a distributed update . The operation should be performed consecutively on each separate server . Do not update all the servers on a cluster simultaneously , or the cluster will be unavailable for some time . <nl> mmm a / docs / ru / operations / table_engines / log . md <nl> ppp b / docs / ru / operations / table_engines / log . md <nl> <nl> Движок относится к семейству движков Log . Смотрите общие свойства и различия движков в статье [ Семейство Log ] ( log_family . md ) . <nl> <nl> Отличается от [ TinyLog ] ( tinylog . md ) тем , что вместе с файлами столбцов лежит небольшой файл " засечек " . Засечки пишутся на каждый блок данных и содержат смещение - с какого места нужно читать файл , чтобы пропустить заданное количество строк . Это позволяет читать данные из таблицы в несколько потоков . <nl> - При конкуррентном доступе к данным , чтения могут выполняться одновременно , а записи блокируют чтения и друг друга . <nl> + При конкурентном доступе к данным , чтения могут выполняться одновременно , а записи блокируют чтения и друг друга . <nl> Движок Log не поддерживает индексы . Также , если при записи в таблицу произошёл сбой , то таблица станет битой , и чтения из неё будут возвращать ошибку . Движок Log подходит для временных данных , write - once таблиц , а также для тестовых и демонстрационных целей . <nl> <nl> [ Оригинальная статья ] ( https : / / clickhouse . yandex / docs / ru / operations / table_engines / log / ) < ! - - hide - - > <nl> mmm a / docs / ru / operations / table_engines / log_family . md <nl> ppp b / docs / ru / operations / table_engines / log_family . md <nl> <nl> <nl> - Хранят данные на диске . <nl> <nl> - - Добавляют данных в конец файла при записи . <nl> + - Добавляют данные в конец файла при записи . <nl> <nl> - Не поддерживают операции [ мутации ] ( . . / . . / query_language / alter . md # alter - mutations ) . <nl> <nl>
|
DOCAPI - 4994 : EN review of Requirements , Monitoring , Troubleshooting and Update topics . ( )
|
ClickHouse/ClickHouse
|
b4f1cc6f474117c052bbc2be34748d9ae7cf9501
|
2019-02-11T14:48:37Z
|
mmm a / docs / api / app . md <nl> ppp b / docs / api / app . md <nl> returning ` false ` in the ` beforeunload ` event handler . <nl> <nl> # # # ` app . hide ( ) ` _OS X_ <nl> <nl> - Hides all application windows without minimising them . <nl> + Hides all application windows without minimizing them . <nl> <nl> # # # ` app . show ( ) ` _OS X_ <nl> <nl> mmm a / docs / api / browser - window . md <nl> ppp b / docs / api / browser - window . md <nl> It creates a new ` BrowserWindow ` with native properties as set by the ` options ` . <nl> * ` alwaysOnTop ` Boolean - Whether the window should always stay on top of <nl> other windows . Default is ` false ` . <nl> * ` fullscreen ` Boolean - Whether the window should show in fullscreen . When <nl> - explicity set to ` false ` the fullscreen button will be hidden or disabled <nl> + explicitly set to ` false ` the fullscreen button will be hidden or disabled <nl> on OS X , or the maximize button will be disabled on Windows . Default is <nl> ` false ` . <nl> * ` fullscreenable ` Boolean - Whether the maximize / zoom button on OS X should <nl> Returns the pathname of the file the window represents . <nl> * ` edited ` Boolean <nl> <nl> Specifies whether the window ’ s document has been edited , and the icon in title <nl> - bar will become grey when set to ` true ` . <nl> + bar will become gray when set to ` true ` . <nl> <nl> # # # ` win . isDocumentEdited ( ) ` _OS X_ <nl> <nl> mmm a / docs / api / web - view - tag . md <nl> ppp b / docs / api / web - view - tag . md <nl> Returns : <nl> * ` explicitSet ` Boolean <nl> <nl> Fired when page title is set during navigation . ` explicitSet ` is false when <nl> - title is synthesised from file url . <nl> + title is synthesized from file url . <nl> <nl> # # # Event : ' page - favicon - updated ' <nl> <nl>
|
Merge pull request from lukeapage / patch - 7
|
electron/electron
|
e47a815c38a51b2497e09c31870e1586d6fa3769
|
2016-02-16T12:22:31Z
|
mmm a / tensorflow / g3doc / how_tos / image_retraining / index . md <nl> ppp b / tensorflow / g3doc / how_tos / image_retraining / index . md <nl> to run since there ' s randomness in the training process . This number is based on <nl> how many of the images in the test set are given the correct label after the <nl> model is fully trained . <nl> <nl> + # # Using the Retrained Model <nl> + <nl> The script will write out a version of the Inception v3 network with a final <nl> layer retrained to your categories to / tmp / output_graph . pb , and a text file <nl> containing the labels to / tmp / output_labels . txt . These are both in a format that <nl> the [ C + + and Python image classification examples ] ( https : / / www . tensorflow . org / versions / master / tutorials / image_recognition / index . html ) <nl> can read in , so you can start using your new model immediately . Since you ' ve <nl> replaced the top layer , you will need to specify the new name in the script , for <nl> - example with the flag ` - - output_layer = final_output ` if you ' re using label_image . <nl> + example with the flag ` - - output_layer = final_result ` if you ' re using label_image . <nl> + <nl> + Here ' s an example of how to build and run the label_image example with your <nl> + retrained graphs : <nl> + <nl> + ` ` ` sh <nl> + bazel build tensorflow / examples / label_image : label_image & & \ <nl> + bazel - bin / tensorflow / examples / label_image / label_image \ <nl> + - - graph = / tmp / output_graph . pb - - labels = / tmp / output_labels . txt \ <nl> + - - output_layer = final_result \ <nl> + - - image = $ HOME / flower_photos / daisy / 21652746_cc379e0eea_m . jpg <nl> + ` ` ` <nl> + <nl> + You should see a list of flower labels , in most cases with daisy on top <nl> + ( though each retrained model may be slightly different ) . You can replace the <nl> + ` - - image ` parameter with your own images to try those out , and use the C + + code <nl> + as a template to integrate with your own applications . <nl> <nl> # # Training on Your Own Categories <nl> <nl>
|
Updated image retraining documentation with usage example
|
tensorflow/tensorflow
|
93866d1407f31011d307bf3868ad72516419fea0
|
2016-02-23T17:57:37Z
|
new file mode 100644 <nl> index 00000000000 . . 06c798bc323 <nl> mmm / dev / null <nl> ppp b / examples / char - lstm / . gitignore <nl> @ @ - 0 , 0 + 1 @ @ <nl> + input . txt <nl> new file mode 100644 <nl> index 00000000000 . . f429313dc72 <nl> mmm / dev / null <nl> ppp b / examples / char - lstm / lstm . jl <nl> <nl> + # An explicitly unrolled LSTM with fixed sequence length . <nl> + using MXNet <nl> + <nl> + immutable LSTMState <nl> + c : : mx . SymbolicNode <nl> + h : : mx . SymbolicNode <nl> + end <nl> + <nl> + immutable LSTMParam <nl> + i2h_W : : mx . SymbolicNode <nl> + h2h_W : : mx . SymbolicNode <nl> + i2h_b : : mx . SymbolicNode <nl> + h2h_b : : mx . SymbolicNode <nl> + end <nl> + <nl> + function ltsm_cell ( data : : mx . SymbolicNode , prev_state : : LSTMState , param : : LSTMParam ; <nl> + num_hidden : : Int = 512 , dropout : : Real = 0 , name : : Symbol = gensym ( ) ) <nl> + <nl> + if dropout > 0 <nl> + data = mx . Dropout ( data , p = dropout ) <nl> + end <nl> + <nl> + i2h = mx . FullyConnected ( data , weight = param . i2h_W , bias = param . i2h_b , <nl> + num_hidden = 4num_hidden , name = symbol ( name , " _i2h " ) ) <nl> + h2h = mx . FullyConnected ( prev_state . h , weight = param . h2h_W , bias = param . h2h_b , <nl> + num_hidden = 4num_hidden , name = symbol ( name , " _h2h " ) ) <nl> + <nl> + gates = mx . SliceChannel ( i2h + h2h , num_outputs = 4 , name = symbol ( name , " _gates " ) ) <nl> + <nl> + in_gate = mx . Activation ( gates [ 1 ] , act_type = : sigmoid ) <nl> + in_trans = mx . Activation ( gates [ 2 ] , act_type = : tanh ) <nl> + forget_gate = mx . Activation ( gates [ 3 ] , act_type = : sigmoid ) <nl> + out_gate = mx . Activation ( gates [ 4 ] , act_type = : sigmoid ) <nl> + <nl> + next_c = ( forget_gate . * prev_state . c ) + ( in_gate . * in_trans ) <nl> + next_h = out_gate . * mx . Activation ( next_c , act_type = : tanh ) <nl> + <nl> + return LTSMState ( next_c , next_h ) <nl> + end <nl> + <nl> + function LSTM ( n_layer : : Int , seq_len : : Int , dim_hidden : : Int , dim_embed : : Int , n_class : : Int ; <nl> + dropout : : Real = 0 , name : : Symbol = gensym ( ) ) <nl> + <nl> + # placeholder nodes for all parameters <nl> + embed_W = mx . Variable ( symbol ( name , " _embed_weight " ) ) <nl> + pred_W = mx . Variable ( symbol ( name , " _pred_weight " ) ) <nl> + pred_b = mx . Variable ( symbol ( name , " _pred_bias " ) ) <nl> + <nl> + layer_param_states = map ( 1 : n_layer ) do i <nl> + param = LSTMParam ( mx . Variable ( symbol ( name , " _l $ ( i ) _i2h_weight " ) ) , <nl> + mx . Variable ( symbol ( name , " _l $ ( i ) _h2h_weight " ) ) , <nl> + mx . Variable ( symbol ( name , " _l $ ( i ) _i2h_bias " ) ) , <nl> + mx . Variable ( symbol ( name , " _l $ ( i ) _h2h_bias " ) ) ) <nl> + state = LTSMState ( mx . Variable ( symbol ( name , " _l $ ( i ) _init_c " ) ) , <nl> + mx . Variable ( symbol ( name , " _l $ ( i ) _init_h " ) ) ) <nl> + ( param , state ) <nl> + end <nl> + <nl> + # now unroll over time <nl> + outputs = mx . SymbolicNode [ ] <nl> + for t = 1 : seq_len <nl> + data = mx . Variable ( symbol ( name , " _data_ $ t " ) ) <nl> + label = mx . Variable ( symbol ( name , " _label_ $ t " ) ) <nl> + hidden = mx . FullyConnected ( data , weight = embed_W , num_hidden = dim_embed , <nl> + no_bias = true , name = symbol ( name , " _embed_ $ t " ) ) <nl> + <nl> + <nl> + # stack LTSM cells <nl> + for i = 1 : n_layer <nl> + l_param , l_state = layer_param_states [ i ] <nl> + dp = i = = 1 ? 0 : dropout # don ' t do dropout for data <nl> + next_state = ltsm_cell ( hidden , l_state , l_param , num_hidden = dim_hidden , dropout = dp , <nl> + name = symbol ( name , " _lstm_ $ t " ) ) <nl> + hidden = next_state . h <nl> + layer_param_states [ i ] = ( l_param , next_state ) <nl> + end <nl> + <nl> + # prediction / decoder <nl> + if dropout > 0 <nl> + hidden = mx . Dropout ( hidden , p = dropout ) <nl> + end <nl> + pred = mx . FullyConnected ( hidden , weight = pred_W , bias = pred_b , num_hidden = n_class , <nl> + name = symbol ( name , " _pred_ $ t " ) ) <nl> + smax = mx . SoftmaxOutput ( pred , label , name = symbol ( name , " _softmax_ $ t " ) ) <nl> + push ! ( outputs , smax ) <nl> + end <nl> + <nl> + # append block - gradient nodes to the final states <nl> + for i = 1 : n_layer <nl> + l_param , l_state = layer_param_states [ i ] <nl> + final_state = LTSMState ( mx . BlockGrad ( l_state . c , name = symbol ( name , " _l $ ( i ) _last_c " ) ) , <nl> + mx . BlockGrad ( l_state . h , name = symbol ( name , " _l $ ( i ) _last_h " ) ) ) <nl> + layer_param_states [ i ] = ( l_param , final_state ) <nl> + end <nl> + <nl> + # now group all outputs together <nl> + return mx . Group ( outputs . . . ) <nl> + end <nl> new file mode 100644 <nl> index 00000000000 . . ea6c390581b <nl> mmm / dev / null <nl> ppp b / examples / char - lstm / seq - data . jl <nl> <nl> + # Simple data provider that load text <nl> + using MXNet <nl> + <nl> + const UNKNOWN_CHAR = Char ( 0 ) <nl> + <nl> + function build_vocabulary ( corpus_fn : : AbstractString , vocab_fn : : AbstractString ; max_vocab = 10000 ) <nl> + if isfile ( vocab_fn ) <nl> + info ( " Vocabulary already exists , reusing $ vocab_fn . . . " ) <nl> + vocab = open ( corpus_fn ) do io <nl> + Dict ( [ w [ 1 ] = > i for ( i , w ) in enumerate ( eachline ( io ) ) ] ) <nl> + end <nl> + else <nl> + # count symbol frequency <nl> + dict = Dict { Char , Int } ( ) <nl> + open ( corpus_fn ) do io <nl> + for line in eachline ( io ) <nl> + for c in line <nl> + dict [ c ] = get ( dict , c , 0 ) + 1 <nl> + end <nl> + end <nl> + end <nl> + <nl> + vocab = sort ( collect ( dict ) , by = x - > - x . second ) <nl> + vocab = vocab [ 1 : min ( max_vocab , length ( vocab ) ) ] <nl> + open ( vocab_fn , " w " ) do io <nl> + for x in vocab <nl> + println ( io , x . first ) <nl> + end <nl> + end <nl> + <nl> + vocab = Dict ( [ x . first = > i for ( i , x ) in enumerate ( vocab ) ] ) <nl> + end <nl> + vocab [ UNKNOWN_CHAR ] = 0 <nl> + return vocab <nl> + end <nl> + <nl> + build_vocabulary ( " input . txt " , " vocab . txt " ) <nl>
|
char - ltsm temp commit
|
apache/incubator-mxnet
|
645091c2a9a2a039f779cc55179745048241ee69
|
2015-11-12T21:26:20Z
|
deleted file mode 100644 <nl> index 3990d670026c . . 000000000000 <nl> mmm a / cmake / FindCUDA / FindCUDA . cmake <nl> ppp / dev / null <nl> <nl> - # . rst : <nl> - # FindCUDA <nl> - # mmmmmm - - <nl> - # <nl> - # Tools for building CUDA C files : libraries and build dependencies . <nl> - # <nl> - # This script locates the NVIDIA CUDA C tools . It should work on linux , <nl> - # windows , and mac and should be reasonably up to date with CUDA C <nl> - # releases . <nl> - # <nl> - # This script makes use of the standard find_package arguments of <nl> - # < VERSION > , REQUIRED and QUIET . CUDA_FOUND will report if an <nl> - # acceptable version of CUDA was found . <nl> - # <nl> - # The script will prompt the user to specify CUDA_TOOLKIT_ROOT_DIR if <nl> - # the prefix cannot be determined by the location of nvcc in the system <nl> - # path and REQUIRED is specified to find_package ( ) . To use a different <nl> - # installed version of the toolkit set the environment variable <nl> - # CUDA_BIN_PATH before running cmake ( e . g . <nl> - # CUDA_BIN_PATH = / usr / local / cuda1 . 0 instead of the default <nl> - # / usr / local / cuda ) or set CUDA_TOOLKIT_ROOT_DIR after configuring . If <nl> - # you change the value of CUDA_TOOLKIT_ROOT_DIR , various components that <nl> - # depend on the path will be relocated . <nl> - # <nl> - # It might be necessary to set CUDA_TOOLKIT_ROOT_DIR manually on certain <nl> - # platforms , or to use a cuda runtime not installed in the default <nl> - # location . In newer versions of the toolkit the cuda library is <nl> - # included with the graphics driver - be sure that the driver version <nl> - # matches what is needed by the cuda runtime version . <nl> - # <nl> - # The following variables affect the behavior of the macros in the <nl> - # script ( in alphebetical order ) . Note that any of these flags can be <nl> - # changed multiple times in the same directory before calling <nl> - # CUDA_ADD_EXECUTABLE , CUDA_ADD_LIBRARY , CUDA_COMPILE , CUDA_COMPILE_PTX , <nl> - # CUDA_COMPILE_FATBIN , CUDA_COMPILE_CUBIN or CUDA_WRAP_SRCS : : <nl> - # <nl> - # CUDA_64_BIT_DEVICE_CODE ( Default matches host bit size ) <nl> - # - - Set to ON to compile for 64 bit device code , OFF for 32 bit device code . <nl> - # Note that making this different from the host code when generating object <nl> - # or C files from CUDA code just won ' t work , because size_t gets defined by <nl> - # nvcc in the generated source . If you compile to PTX and then load the <nl> - # file yourself , you can mix bit sizes between device and host . <nl> - # <nl> - # CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE ( Default ON ) <nl> - # - - Set to ON if you want the custom build rule to be attached to the source <nl> - # file in Visual Studio . Turn OFF if you add the same cuda file to multiple <nl> - # targets . <nl> - # <nl> - # This allows the user to build the target from the CUDA file ; however , bad <nl> - # things can happen if the CUDA source file is added to multiple targets . <nl> - # When performing parallel builds it is possible for the custom build <nl> - # command to be run more than once and in parallel causing cryptic build <nl> - # errors . VS runs the rules for every source file in the target , and a <nl> - # source can have only one rule no matter how many projects it is added to . <nl> - # When the rule is run from multiple targets race conditions can occur on <nl> - # the generated file . Eventually everything will get built , but if the user <nl> - # is unaware of this behavior , there may be confusion . It would be nice if <nl> - # this script could detect the reuse of source files across multiple targets <nl> - # and turn the option off for the user , but no good solution could be found . <nl> - # <nl> - # CUDA_BUILD_CUBIN ( Default OFF ) <nl> - # - - Set to ON to enable and extra compilation pass with the - cubin option in <nl> - # Device mode . The output is parsed and register , shared memory usage is <nl> - # printed during build . <nl> - # <nl> - # CUDA_BUILD_EMULATION ( Default OFF for device mode ) <nl> - # - - Set to ON for Emulation mode . - D_DEVICEEMU is defined for CUDA C files <nl> - # when CUDA_BUILD_EMULATION is TRUE . <nl> - # <nl> - # CUDA_GENERATED_OUTPUT_DIR ( Default CMAKE_CURRENT_BINARY_DIR ) <nl> - # - - Set to the path you wish to have the generated files placed . If it is <nl> - # blank output files will be placed in CMAKE_CURRENT_BINARY_DIR . <nl> - # Intermediate files will always be placed in <nl> - # CMAKE_CURRENT_BINARY_DIR / CMakeFiles . <nl> - # <nl> - # CUDA_HOST_COMPILATION_CPP ( Default ON ) <nl> - # - - Set to OFF for C compilation of host code . <nl> - # <nl> - # CUDA_HOST_COMPILER ( Default CMAKE_C_COMPILER , $ ( VCInstallDir ) / bin for VS ) <nl> - # - - Set the host compiler to be used by nvcc . Ignored if - ccbin or <nl> - # - - compiler - bindir is already present in the CUDA_NVCC_FLAGS or <nl> - # CUDA_NVCC_FLAGS_ < CONFIG > variables . For Visual Studio targets <nl> - # $ ( VCInstallDir ) / bin is a special value that expands out to the path when <nl> - # the command is run from within VS . <nl> - # <nl> - # CUDA_NVCC_FLAGS <nl> - # CUDA_NVCC_FLAGS_ < CONFIG > <nl> - # - - Additional NVCC command line arguments . NOTE : multiple arguments must be <nl> - # semi - colon delimited ( e . g . - - compiler - options ; - Wall ) <nl> - # <nl> - # CUDA_PROPAGATE_HOST_FLAGS ( Default ON ) <nl> - # - - Set to ON to propagate CMAKE_ { C , CXX } _FLAGS and their configuration <nl> - # dependent counterparts ( e . g . CMAKE_C_FLAGS_DEBUG ) automatically to the <nl> - # host compiler through nvcc ' s - Xcompiler flag . This helps make the <nl> - # generated host code match the rest of the system better . Sometimes <nl> - # certain flags give nvcc problems , and this will help you turn the flag <nl> - # propagation off . This does not affect the flags supplied directly to nvcc <nl> - # via CUDA_NVCC_FLAGS or through the OPTION flags specified through <nl> - # CUDA_ADD_LIBRARY , CUDA_ADD_EXECUTABLE , or CUDA_WRAP_SRCS . Flags used for <nl> - # shared library compilation are not affected by this flag . <nl> - # <nl> - # CUDA_SEPARABLE_COMPILATION ( Default OFF ) <nl> - # - - If set this will enable separable compilation for all CUDA runtime object <nl> - # files . If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY <nl> - # ( e . g . calling CUDA_WRAP_SRCS directly ) , <nl> - # CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and <nl> - # CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called . <nl> - # <nl> - # CUDA_SOURCE_PROPERTY_FORMAT <nl> - # - - If this source file property is set , it can override the format specified <nl> - # to CUDA_WRAP_SRCS ( OBJ , PTX , CUBIN , or FATBIN ) . If an input source file <nl> - # is not a . cu file , setting this file will cause it to be treated as a . cu <nl> - # file . See documentation for set_source_files_properties on how to set <nl> - # this property . <nl> - # <nl> - # CUDA_USE_STATIC_CUDA_RUNTIME ( Default ON ) <nl> - # - - When enabled the static version of the CUDA runtime library will be used <nl> - # in CUDA_LIBRARIES . If the version of CUDA configured doesn ' t support <nl> - # this option , then it will be silently disabled . <nl> - # <nl> - # CUDA_VERBOSE_BUILD ( Default OFF ) <nl> - # - - Set to ON to see all the commands used when building the CUDA file . When <nl> - # using a Makefile generator the value defaults to VERBOSE ( run make <nl> - # VERBOSE = 1 to see output ) , although setting CUDA_VERBOSE_BUILD to ON will <nl> - # always print the output . <nl> - # <nl> - # The script creates the following macros ( in alphebetical order ) : : <nl> - # <nl> - # CUDA_ADD_CUFFT_TO_TARGET ( cuda_target ) <nl> - # - - Adds the cufft library to the target ( can be any target ) . Handles whether <nl> - # you are in emulation mode or not . <nl> - # <nl> - # CUDA_ADD_CUBLAS_TO_TARGET ( cuda_target ) <nl> - # - - Adds the cublas library to the target ( can be any target ) . Handles <nl> - # whether you are in emulation mode or not . <nl> - # <nl> - # CUDA_ADD_EXECUTABLE ( cuda_target file0 file1 . . . <nl> - # [ WIN32 ] [ MACOSX_BUNDLE ] [ EXCLUDE_FROM_ALL ] [ OPTIONS . . . ] ) <nl> - # - - Creates an executable " cuda_target " which is made up of the files <nl> - # specified . All of the non CUDA C files are compiled using the standard <nl> - # build rules specified by CMAKE and the cuda files are compiled to object <nl> - # files using nvcc and the host compiler . In addition CUDA_INCLUDE_DIRS is <nl> - # added automatically to include_directories ( ) . Some standard CMake target <nl> - # calls can be used on the target after calling this macro <nl> - # ( e . g . set_target_properties and target_link_libraries ) , but setting <nl> - # properties that adjust compilation flags will not affect code compiled by <nl> - # nvcc . Such flags should be modified before calling CUDA_ADD_EXECUTABLE , <nl> - # CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS . <nl> - # <nl> - # CUDA_ADD_LIBRARY ( cuda_target file0 file1 . . . <nl> - # [ STATIC | SHARED | MODULE ] [ EXCLUDE_FROM_ALL ] [ OPTIONS . . . ] ) <nl> - # - - Same as CUDA_ADD_EXECUTABLE except that a library is created . <nl> - # <nl> - # CUDA_BUILD_CLEAN_TARGET ( ) <nl> - # - - Creates a convience target that deletes all the dependency files <nl> - # generated . You should make clean after running this target to ensure the <nl> - # dependency files get regenerated . <nl> - # <nl> - # CUDA_COMPILE ( generated_files file0 file1 . . . [ STATIC | SHARED | MODULE ] <nl> - # [ OPTIONS . . . ] ) <nl> - # - - Returns a list of generated files from the input source files to be used <nl> - # with ADD_LIBRARY or ADD_EXECUTABLE . <nl> - # <nl> - # CUDA_COMPILE_PTX ( generated_files file0 file1 . . . [ OPTIONS . . . ] ) <nl> - # - - Returns a list of PTX files generated from the input source files . <nl> - # <nl> - # CUDA_COMPILE_FATBIN ( generated_files file0 file1 . . . [ OPTIONS . . . ] ) <nl> - # - - Returns a list of FATBIN files generated from the input source files . <nl> - # <nl> - # CUDA_COMPILE_CUBIN ( generated_files file0 file1 . . . [ OPTIONS . . . ] ) <nl> - # - - Returns a list of CUBIN files generated from the input source files . <nl> - # <nl> - # CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME ( output_file_var <nl> - # cuda_target <nl> - # object_files ) <nl> - # - - Compute the name of the intermediate link file used for separable <nl> - # compilation . This file name is typically passed into <nl> - # CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS . output_file_var is produced <nl> - # based on cuda_target the list of objects files that need separable <nl> - # compilation as specified by object_files . If the object_files list is <nl> - # empty , then output_file_var will be empty . This function is called <nl> - # automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE . Note that <nl> - # this is a function and not a macro . <nl> - # <nl> - # CUDA_INCLUDE_DIRECTORIES ( path0 path1 . . . ) <nl> - # - - Sets the directories that should be passed to nvcc <nl> - # ( e . g . nvcc - Ipath0 - Ipath1 . . . ) . These paths usually contain other . cu <nl> - # files . <nl> - # <nl> - # <nl> - # CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS ( output_file_var cuda_target <nl> - # nvcc_flags object_files ) <nl> - # - - Generates the link object required by separable compilation from the given <nl> - # object files . This is called automatically for CUDA_ADD_EXECUTABLE and <nl> - # CUDA_ADD_LIBRARY , but can be called manually when using CUDA_WRAP_SRCS <nl> - # directly . When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the <nl> - # nvcc_flags passed in are the same as the flags passed in via the OPTIONS <nl> - # argument . The only nvcc flag added automatically is the bitness flag as <nl> - # specified by CUDA_64_BIT_DEVICE_CODE . Note that this is a function <nl> - # instead of a macro . <nl> - # <nl> - # CUDA_SELECT_NVCC_ARCH_FLAGS ( out_variable [ target_CUDA_architectures ] ) <nl> - # - - Selects GPU arch flags for nvcc based on target_CUDA_architectures <nl> - # target_CUDA_architectures : Auto | Common | All | LIST ( ARCH_AND_PTX . . . ) <nl> - # - " Auto " detects local machine GPU compute arch at runtime . <nl> - # - " Common " and " All " cover common and entire subsets of architectures <nl> - # ARCH_AND_PTX : NAME | NUM . NUM | NUM . NUM ( NUM . NUM ) | NUM . NUM + PTX <nl> - # NAME : Fermi Kepler Maxwell Kepler + Tegra Kepler + Tesla Maxwell + Tegra Pascal <nl> - # NUM : Any number . Only those pairs are currently accepted by NVCC though : <nl> - # 2 . 0 2 . 1 3 . 0 3 . 2 3 . 5 3 . 7 5 . 0 5 . 2 5 . 3 6 . 0 6 . 2 <nl> - # Returns LIST of flags to be added to CUDA_NVCC_FLAGS in $ { out_variable } <nl> - # Additionally , sets $ { out_variable } _readable to the resulting numeric list <nl> - # Example : <nl> - # CUDA_SELECT_NVCC_ARCH_FLAGS ( ARCH_FLAGS 3 . 0 3 . 5 + PTX 5 . 2 ( 5 . 0 ) Maxwell ) <nl> - # LIST ( APPEND CUDA_NVCC_FLAGS $ { ARCH_FLAGS } ) <nl> - # <nl> - # More info on CUDA architectures : https : / / en . wikipedia . org / wiki / CUDA <nl> - # Note that this is a function instead of a macro . <nl> - # <nl> - # CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 . . . <nl> - # [ STATIC | SHARED | MODULE ] [ OPTIONS . . . ] ) <nl> - # - - This is where all the magic happens . CUDA_ADD_EXECUTABLE , <nl> - # CUDA_ADD_LIBRARY , CUDA_COMPILE , and CUDA_COMPILE_PTX all call this <nl> - # function under the hood . <nl> - # <nl> - # Given the list of files ( file0 file1 . . . fileN ) this macro generates <nl> - # custom commands that generate either PTX or linkable objects ( use " PTX " or <nl> - # " OBJ " for the format argument to switch ) . Files that don ' t end with . cu <nl> - # or have the HEADER_FILE_ONLY property are ignored . <nl> - # <nl> - # The arguments passed in after OPTIONS are extra command line options to <nl> - # give to nvcc . You can also specify per configuration options by <nl> - # specifying the name of the configuration followed by the options . General <nl> - # options must precede configuration specific options . Not all <nl> - # configurations need to be specified , only the ones provided will be used . <nl> - # <nl> - # OPTIONS - DFLAG = 2 " - DFLAG_OTHER = space in flag " <nl> - # DEBUG - g <nl> - # RELEASE - - use_fast_math <nl> - # RELWITHDEBINFO - - use_fast_math ; - g <nl> - # MINSIZEREL - - use_fast_math <nl> - # <nl> - # For certain configurations ( namely VS generating object files with <nl> - # CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON ) , no generated file will <nl> - # be produced for the given cuda file . This is because when you add the <nl> - # cuda file to Visual Studio it knows that this file produces an object file <nl> - # and will link in the resulting object file automatically . <nl> - # <nl> - # This script will also generate a separate cmake script that is used at <nl> - # build time to invoke nvcc . This is for several reasons . <nl> - # <nl> - # 1 . nvcc can return negative numbers as return values which confuses <nl> - # Visual Studio into thinking that the command succeeded . The script now <nl> - # checks the error codes and produces errors when there was a problem . <nl> - # <nl> - # 2 . nvcc has been known to not delete incomplete results when it <nl> - # encounters problems . This confuses build systems into thinking the <nl> - # target was generated when in fact an unusable file exists . The script <nl> - # now deletes the output files if there was an error . <nl> - # <nl> - # 3 . By putting all the options that affect the build into a file and then <nl> - # make the build rule dependent on the file , the output files will be <nl> - # regenerated when the options change . <nl> - # <nl> - # This script also looks at optional arguments STATIC , SHARED , or MODULE to <nl> - # determine when to target the object compilation for a shared library . <nl> - # BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS , but it is respected in <nl> - # CUDA_ADD_LIBRARY . On some systems special flags are added for building <nl> - # objects intended for shared libraries . A preprocessor macro , <nl> - # < target_name > _EXPORTS is defined when a shared library compilation is <nl> - # detected . <nl> - # <nl> - # Flags passed into add_definitions with - D or / D are passed along to nvcc . <nl> - # <nl> - # <nl> - # <nl> - # The script defines the following variables : : <nl> - # <nl> - # CUDA_VERSION_MAJOR - - The major version of cuda as reported by nvcc . <nl> - # CUDA_VERSION_MINOR - - The minor version . <nl> - # CUDA_VERSION <nl> - # CUDA_VERSION_STRING - - CUDA_VERSION_MAJOR . CUDA_VERSION_MINOR <nl> - # CUDA_HAS_FP16 - - Whether a short float ( float16 , fp16 ) is supported . <nl> - # <nl> - # CUDA_TOOLKIT_ROOT_DIR - - Path to the CUDA Toolkit ( defined if not set ) . <nl> - # CUDA_SDK_ROOT_DIR - - Path to the CUDA SDK . Use this to find files in the <nl> - # SDK . This script will not directly support finding <nl> - # specific libraries or headers , as that isn ' t <nl> - # supported by NVIDIA . If you want to change <nl> - # libraries when the path changes see the <nl> - # FindCUDA . cmake script for an example of how to clear <nl> - # these variables . There are also examples of how to <nl> - # use the CUDA_SDK_ROOT_DIR to locate headers or <nl> - # libraries , if you so choose ( at your own risk ) . <nl> - # CUDA_INCLUDE_DIRS - - Include directory for cuda headers . Added automatically <nl> - # for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY . <nl> - # CUDA_LIBRARIES - - Cuda RT library . <nl> - # CUDA_CUFFT_LIBRARIES - - Device or emulation library for the Cuda FFT <nl> - # implementation ( alternative to : <nl> - # CUDA_ADD_CUFFT_TO_TARGET macro ) <nl> - # CUDA_CUBLAS_LIBRARIES - - Device or emulation library for the Cuda BLAS <nl> - # implementation ( alterative to : <nl> - # CUDA_ADD_CUBLAS_TO_TARGET macro ) . <nl> - # CUDA_cudart_static_LIBRARY - - Statically linkable cuda runtime library . <nl> - # Only available for CUDA version 5 . 5 + <nl> - # CUDA_cupti_LIBRARY - - CUDA Profiling Tools Interface library . <nl> - # Only available for CUDA version 4 . 0 + . <nl> - # CUDA_curand_LIBRARY - - CUDA Random Number Generation library . <nl> - # Only available for CUDA version 3 . 2 + . <nl> - # CUDA_cusolver_LIBRARY - - CUDA Direct Solver library . <nl> - # Only available for CUDA version 7 . 0 + . <nl> - # CUDA_cusparse_LIBRARY - - CUDA Sparse Matrix library . <nl> - # Only available for CUDA version 3 . 2 + . <nl> - # CUDA_npp_LIBRARY - - NVIDIA Performance Primitives lib . <nl> - # Only available for CUDA version 4 . 0 + . <nl> - # CUDA_nppc_LIBRARY - - NVIDIA Performance Primitives lib ( core ) . <nl> - # Only available for CUDA version 5 . 5 + . <nl> - # CUDA_nppi_LIBRARY - - NVIDIA Performance Primitives lib ( image processing ) . <nl> - # Only available for CUDA version 5 . 5 + . <nl> - # CUDA_npps_LIBRARY - - NVIDIA Performance Primitives lib ( signal processing ) . <nl> - # Only available for CUDA version 5 . 5 + . <nl> - # CUDA_nvcuvenc_LIBRARY - - CUDA Video Encoder library . <nl> - # Only available for CUDA version 3 . 2 + . <nl> - # Windows only . <nl> - # CUDA_nvcuvid_LIBRARY - - CUDA Video Decoder library . <nl> - # Only available for CUDA version 3 . 2 + . <nl> - # Windows only . <nl> - # <nl> - <nl> - # James Bigler , NVIDIA Corp ( nvidia . com - jbigler ) <nl> - # Abe Stephens , SCI Institute - - http : / / www . sci . utah . edu / ~ abe / FindCuda . html <nl> - # <nl> - # Copyright ( c ) 2008 - 2009 NVIDIA Corporation . All rights reserved . <nl> - # <nl> - # Copyright ( c ) 2007 - 2009 <nl> - # Scientific Computing and Imaging Institute , University of Utah <nl> - # <nl> - # This code is licensed under the MIT License . See the FindCUDA . cmake script <nl> - # for the text of the license . <nl> - <nl> - # The MIT License <nl> - # <nl> - # License for the specific language governing rights and limitations under <nl> - # Permission is hereby granted , free of charge , to any person obtaining a <nl> - # copy of this software and associated documentation files ( the " Software " ) , <nl> - # to deal in the Software without restriction , including without limitation <nl> - # the rights to use , copy , modify , merge , publish , distribute , sublicense , <nl> - # and / or sell copies of the Software , and to permit persons to whom the <nl> - # Software is furnished to do so , subject to the following conditions : <nl> - # <nl> - # The above copyright notice and this permission notice shall be included <nl> - # in all copies or substantial portions of the Software . <nl> - # <nl> - # THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS <nl> - # OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , <nl> - # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL <nl> - # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER <nl> - # LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING <nl> - # FROM , OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER <nl> - # DEALINGS IN THE SOFTWARE . <nl> - # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - # FindCUDA . cmake <nl> - <nl> - # We need to have at least this version to support the VERSION_LESS argument to ' if ' ( 2 . 6 . 2 ) and unset ( 2 . 6 . 3 ) <nl> - cmake_policy ( PUSH ) <nl> - cmake_minimum_required ( VERSION 2 . 6 . 3 ) <nl> - cmake_policy ( POP ) <nl> - <nl> - # This macro helps us find the location of helper files we will need the full path to <nl> - macro ( CUDA_FIND_HELPER_FILE _name _extension ) <nl> - set ( _full_name " $ { _name } . $ { _extension } " ) <nl> - # CMAKE_CURRENT_LIST_FILE contains the full path to the file currently being <nl> - # processed . Using this variable , we can pull out the current path , and <nl> - # provide a way to get access to the other files we need local to here . <nl> - get_filename_component ( CMAKE_CURRENT_LIST_DIR " $ { CMAKE_CURRENT_LIST_FILE } " PATH ) <nl> - set ( CUDA_ $ { _name } " $ { CMAKE_CURRENT_LIST_DIR } / FindCUDA / $ { _full_name } " ) <nl> - if ( NOT EXISTS " $ { CUDA_ $ { _name } } " ) <nl> - set ( error_message " $ { _full_name } not found in $ { CMAKE_CURRENT_LIST_DIR } / FindCUDA " ) <nl> - if ( CUDA_FIND_REQUIRED ) <nl> - message ( FATAL_ERROR " $ { error_message } " ) <nl> - else ( ) <nl> - if ( NOT CUDA_FIND_QUIETLY ) <nl> - message ( STATUS " $ { error_message } " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - endif ( ) <nl> - # Set this variable as internal , so the user isn ' t bugged with it . <nl> - set ( CUDA_ $ { _name } $ { CUDA_ $ { _name } } CACHE INTERNAL " Location of $ { _full_name } " FORCE ) <nl> - endmacro ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # CUDA_INCLUDE_NVCC_DEPENDENCIES <nl> - # # <nl> - <nl> - # So we want to try and include the dependency file if it exists . If <nl> - # it doesn ' t exist then we need to create an empty one , so we can <nl> - # include it . <nl> - <nl> - # If it does exist , then we need to check to see if all the files it <nl> - # depends on exist . If they don ' t then we should clear the dependency <nl> - # file and regenerate it later . This covers the case where a header <nl> - # file has disappeared or moved . <nl> - <nl> - macro ( CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file ) <nl> - set ( CUDA_NVCC_DEPEND ) <nl> - set ( CUDA_NVCC_DEPEND_REGENERATE FALSE ) <nl> - <nl> - <nl> - # Include the dependency file . Create it first if it doesn ' t exist . The <nl> - # INCLUDE puts a dependency that will force CMake to rerun and bring in the <nl> - # new info when it changes . DO NOT REMOVE THIS ( as I did and spent a few <nl> - # hours figuring out why it didn ' t work . <nl> - if ( NOT EXISTS $ { dependency_file } ) <nl> - file ( WRITE $ { dependency_file } " # FindCUDA . cmake generated file . Do not edit . \ n " ) <nl> - endif ( ) <nl> - # Always include this file to force CMake to run again next <nl> - # invocation and rebuild the dependencies . <nl> - # message ( " including dependency_file = $ { dependency_file } " ) <nl> - include ( $ { dependency_file } ) <nl> - <nl> - # Now we need to verify the existence of all the included files <nl> - # here . If they aren ' t there we need to just blank this variable and <nl> - # make the file regenerate again . <nl> - # if ( DEFINED CUDA_NVCC_DEPEND ) <nl> - # message ( " CUDA_NVCC_DEPEND set " ) <nl> - # else ( ) <nl> - # message ( " CUDA_NVCC_DEPEND NOT set " ) <nl> - # endif ( ) <nl> - if ( CUDA_NVCC_DEPEND ) <nl> - # message ( " CUDA_NVCC_DEPEND found " ) <nl> - foreach ( f $ { CUDA_NVCC_DEPEND } ) <nl> - # message ( " searching for $ { f } " ) <nl> - if ( NOT EXISTS $ { f } ) <nl> - # message ( " file $ { f } not found " ) <nl> - set ( CUDA_NVCC_DEPEND_REGENERATE TRUE ) <nl> - endif ( ) <nl> - endforeach ( ) <nl> - else ( ) <nl> - # message ( " CUDA_NVCC_DEPEND false " ) <nl> - # No dependencies , so regenerate the file . <nl> - set ( CUDA_NVCC_DEPEND_REGENERATE TRUE ) <nl> - endif ( ) <nl> - <nl> - # message ( " CUDA_NVCC_DEPEND_REGENERATE = $ { CUDA_NVCC_DEPEND_REGENERATE } " ) <nl> - # No incoming dependencies , so we need to generate them . Make the <nl> - # output depend on the dependency file itself , which should cause the <nl> - # rule to re - run . <nl> - if ( CUDA_NVCC_DEPEND_REGENERATE ) <nl> - set ( CUDA_NVCC_DEPEND $ { dependency_file } ) <nl> - # message ( " Generating an empty dependency_file : $ { dependency_file } " ) <nl> - file ( WRITE $ { dependency_file } " # FindCUDA . cmake generated file . Do not edit . \ n " ) <nl> - endif ( ) <nl> - <nl> - endmacro ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Setup variables ' defaults <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - # Allow the user to specify if the device code is supposed to be 32 or 64 bit . <nl> - if ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) <nl> - set ( CUDA_64_BIT_DEVICE_CODE_DEFAULT ON ) <nl> - else ( ) <nl> - set ( CUDA_64_BIT_DEVICE_CODE_DEFAULT OFF ) <nl> - endif ( ) <nl> - option ( CUDA_64_BIT_DEVICE_CODE " Compile device code in 64 bit mode " $ { CUDA_64_BIT_DEVICE_CODE_DEFAULT } ) <nl> - <nl> - # Attach the build rule to the source file in VS . This option <nl> - option ( CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE " Attach the build rule to the CUDA source file . Enable only when the CUDA source file is added to at most one target . " ON ) <nl> - <nl> - # Prints out extra information about the cuda file during compilation <nl> - option ( CUDA_BUILD_CUBIN " Generate and parse . cubin files in Device mode . " OFF ) <nl> - <nl> - # Set whether we are using emulation or device mode . <nl> - option ( CUDA_BUILD_EMULATION " Build in Emulation mode " OFF ) <nl> - <nl> - # Where to put the generated output . <nl> - set ( CUDA_GENERATED_OUTPUT_DIR " " CACHE PATH " Directory to put all the output files . If blank it will default to the CMAKE_CURRENT_BINARY_DIR " ) <nl> - <nl> - # Parse HOST_COMPILATION mode . <nl> - option ( CUDA_HOST_COMPILATION_CPP " Generated file extension " ON ) <nl> - <nl> - # Extra user settable flags <nl> - set ( CUDA_NVCC_FLAGS " " CACHE STRING " Semi - colon delimit multiple arguments . " ) <nl> - <nl> - if ( MSVC AND NOT " $ { CMAKE_C_COMPILER } " MATCHES " / cl . exe " ) <nl> - find_program ( REAL_MSVC_COMPILER cl . exe ) <nl> - set ( CUDA_HOST_COMPILER " $ { REAL_MSVC_COMPILER } " CACHE FILEPATH " Host side compiler used by NVCC " ) <nl> - else ( ) <nl> - if ( APPLE <nl> - AND " $ { CMAKE_C_COMPILER_ID } " MATCHES " Clang " <nl> - AND " $ { CMAKE_C_COMPILER } " MATCHES " / cc $ " ) <nl> - # Using cc which is symlink to clang may let NVCC think it is GCC and issue <nl> - # unhandled - dumpspecs option to clang . Also in case neither <nl> - # CMAKE_C_COMPILER is defined ( project does not use C language ) nor <nl> - # CUDA_HOST_COMPILER is specified manually we should skip - ccbin and let <nl> - # nvcc use its own default C compiler . <nl> - # Only care about this on APPLE with clang to avoid <nl> - # following symlinks to things like ccache <nl> - if ( DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER ) <nl> - get_filename_component ( c_compiler_realpath " $ { CMAKE_C_COMPILER } " REALPATH ) <nl> - # if the real path does not end up being clang then <nl> - # go back to using CMAKE_C_COMPILER <nl> - if ( NOT " $ { c_compiler_realpath } " MATCHES " / clang $ " ) <nl> - set ( c_compiler_realpath " $ { CMAKE_C_COMPILER } " ) <nl> - endif ( ) <nl> - else ( ) <nl> - set ( c_compiler_realpath " " ) <nl> - endif ( ) <nl> - set ( CUDA_HOST_COMPILER " $ { c_compiler_realpath } " CACHE FILEPATH " Host side compiler used by NVCC " ) <nl> - else ( ) <nl> - set ( CUDA_HOST_COMPILER " $ { CMAKE_C_COMPILER } " <nl> - CACHE FILEPATH " Host side compiler used by NVCC " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - # Propagate the host flags to the host compiler via - Xcompiler <nl> - option ( CUDA_PROPAGATE_HOST_FLAGS " Propage C / CXX_FLAGS and friends to the host compiler via - Xcompile " ON ) <nl> - <nl> - # Enable CUDA_SEPARABLE_COMPILATION <nl> - option ( CUDA_SEPARABLE_COMPILATION " Compile CUDA objects with separable compilation enabled . Requires CUDA 5 . 0 + " OFF ) <nl> - <nl> - # Specifies whether the commands used when compiling the . cu file will be printed out . <nl> - option ( CUDA_VERBOSE_BUILD " Print out the commands run while compiling the CUDA source file . With the Makefile generator this defaults to VERBOSE variable specified on the command line , but can be forced on with this option . " OFF ) <nl> - <nl> - mark_as_advanced ( <nl> - CUDA_64_BIT_DEVICE_CODE <nl> - CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE <nl> - CUDA_GENERATED_OUTPUT_DIR <nl> - CUDA_HOST_COMPILATION_CPP <nl> - CUDA_NVCC_FLAGS <nl> - CUDA_PROPAGATE_HOST_FLAGS <nl> - CUDA_BUILD_CUBIN <nl> - CUDA_BUILD_EMULATION <nl> - CUDA_VERBOSE_BUILD <nl> - CUDA_SEPARABLE_COMPILATION <nl> - ) <nl> - <nl> - # Makefile and similar generators don ' t define CMAKE_CONFIGURATION_TYPES , so we <nl> - # need to add another entry for the CMAKE_BUILD_TYPE . We also need to add the <nl> - # standerd set of 4 build types ( Debug , MinSizeRel , Release , and RelWithDebInfo ) <nl> - # for completeness . We need run this loop in order to accomodate the addition <nl> - # of extra configuration types . Duplicate entries will be removed by <nl> - # REMOVE_DUPLICATES . <nl> - set ( CUDA_configuration_types $ { CMAKE_CONFIGURATION_TYPES } $ { CMAKE_BUILD_TYPE } Debug MinSizeRel Release RelWithDebInfo ) <nl> - list ( REMOVE_DUPLICATES CUDA_configuration_types ) <nl> - foreach ( config $ { CUDA_configuration_types } ) <nl> - string ( TOUPPER $ { config } config_upper ) <nl> - set ( CUDA_NVCC_FLAGS_ $ { config_upper } " " CACHE STRING " Semi - colon delimit multiple arguments . " ) <nl> - mark_as_advanced ( CUDA_NVCC_FLAGS_ $ { config_upper } ) <nl> - endforeach ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Locate CUDA , Set Build Type , etc . <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - macro ( cuda_unset_include_and_libraries ) <nl> - unset ( CUDA_TOOLKIT_INCLUDE CACHE ) <nl> - unset ( CUDA_CUDART_LIBRARY CACHE ) <nl> - unset ( CUDA_CUDA_LIBRARY CACHE ) <nl> - # Make sure you run this before you unset CUDA_VERSION . <nl> - if ( CUDA_VERSION VERSION_EQUAL " 3 . 0 " ) <nl> - # This only existed in the 3 . 0 version of the CUDA toolkit <nl> - unset ( CUDA_CUDARTEMU_LIBRARY CACHE ) <nl> - endif ( ) <nl> - unset ( CUDA_cudart_static_LIBRARY CACHE ) <nl> - unset ( CUDA_cublas_LIBRARY CACHE ) <nl> - unset ( CUDA_cublas_device_LIBRARY CACHE ) <nl> - unset ( CUDA_cublasemu_LIBRARY CACHE ) <nl> - unset ( CUDA_cufft_LIBRARY CACHE ) <nl> - unset ( CUDA_cufftemu_LIBRARY CACHE ) <nl> - unset ( CUDA_cupti_LIBRARY CACHE ) <nl> - unset ( CUDA_curand_LIBRARY CACHE ) <nl> - unset ( CUDA_cusolver_LIBRARY CACHE ) <nl> - unset ( CUDA_cusparse_LIBRARY CACHE ) <nl> - unset ( CUDA_npp_LIBRARY CACHE ) <nl> - unset ( CUDA_nppc_LIBRARY CACHE ) <nl> - unset ( CUDA_nppi_LIBRARY CACHE ) <nl> - unset ( CUDA_npps_LIBRARY CACHE ) <nl> - unset ( CUDA_nvcuvenc_LIBRARY CACHE ) <nl> - unset ( CUDA_nvcuvid_LIBRARY CACHE ) <nl> - unset ( CUDA_USE_STATIC_CUDA_RUNTIME CACHE ) <nl> - unset ( CUDA_GPU_DETECT_OUTPUT CACHE ) <nl> - endmacro ( ) <nl> - <nl> - # Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed , <nl> - # if they have then clear the cache variables , so that will be detected again . <nl> - if ( NOT " $ { CUDA_TOOLKIT_ROOT_DIR } " STREQUAL " $ { CUDA_TOOLKIT_ROOT_DIR_INTERNAL } " ) <nl> - unset ( CUDA_TOOLKIT_TARGET_DIR CACHE ) <nl> - unset ( CUDA_NVCC_EXECUTABLE CACHE ) <nl> - cuda_unset_include_and_libraries ( ) <nl> - unset ( CUDA_VERSION CACHE ) <nl> - endif ( ) <nl> - <nl> - if ( NOT " $ { CUDA_TOOLKIT_TARGET_DIR } " STREQUAL " $ { CUDA_TOOLKIT_TARGET_DIR_INTERNAL } " ) <nl> - cuda_unset_include_and_libraries ( ) <nl> - endif ( ) <nl> - <nl> - # <nl> - # End of unset ( ) <nl> - # <nl> - <nl> - # <nl> - # Start looking for things <nl> - # <nl> - <nl> - # Search for the cuda distribution . <nl> - if ( NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING ) <nl> - # Search in the CUDA_BIN_PATH first . <nl> - find_path ( CUDA_TOOLKIT_ROOT_DIR <nl> - NAMES nvcc nvcc . exe <nl> - PATHS <nl> - ENV CUDA_TOOLKIT_ROOT <nl> - ENV CUDA_PATH <nl> - ENV CUDA_BIN_PATH <nl> - PATH_SUFFIXES bin bin64 <nl> - DOC " Toolkit location . " <nl> - NO_DEFAULT_PATH <nl> - ) <nl> - <nl> - # Now search default paths <nl> - find_path ( CUDA_TOOLKIT_ROOT_DIR <nl> - NAMES nvcc nvcc . exe <nl> - PATHS / usr / local / bin <nl> - / usr / local / cuda / bin <nl> - DOC " Toolkit location . " <nl> - ) <nl> - <nl> - if ( CUDA_TOOLKIT_ROOT_DIR ) <nl> - string ( REGEX REPLACE " [ / \ \ \ \ ] ? bin [ 64 ] * [ / \ \ \ \ ] ? $ " " " CUDA_TOOLKIT_ROOT_DIR $ { CUDA_TOOLKIT_ROOT_DIR } ) <nl> - # We need to force this back into the cache . <nl> - set ( CUDA_TOOLKIT_ROOT_DIR $ { CUDA_TOOLKIT_ROOT_DIR } CACHE PATH " Toolkit location . " FORCE ) <nl> - set ( CUDA_TOOLKIT_TARGET_DIR $ { CUDA_TOOLKIT_ROOT_DIR } ) <nl> - endif ( ) <nl> - <nl> - if ( NOT EXISTS $ { CUDA_TOOLKIT_ROOT_DIR } ) <nl> - if ( CUDA_FIND_REQUIRED ) <nl> - message ( FATAL_ERROR " Specify CUDA_TOOLKIT_ROOT_DIR " ) <nl> - elseif ( NOT CUDA_FIND_QUIETLY ) <nl> - message ( " CUDA_TOOLKIT_ROOT_DIR not found or specified " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - if ( CMAKE_CROSSCOMPILING ) <nl> - SET ( CUDA_TOOLKIT_ROOT $ ENV { CUDA_TOOLKIT_ROOT } ) <nl> - if ( CMAKE_SYSTEM_PROCESSOR STREQUAL " armv7 - a " ) <nl> - # Support for NVPACK <nl> - set ( CUDA_TOOLKIT_TARGET_NAME " armv7 - linux - androideabi " ) <nl> - elseif ( CMAKE_SYSTEM_PROCESSOR MATCHES " arm " ) <nl> - # Support for arm cross compilation <nl> - set ( CUDA_TOOLKIT_TARGET_NAME " armv7 - linux - gnueabihf " ) <nl> - elseif ( CMAKE_SYSTEM_PROCESSOR MATCHES " aarch64 " ) <nl> - # Support for aarch64 cross compilation <nl> - if ( ANDROID_ARCH_NAME STREQUAL " arm64 " ) <nl> - set ( CUDA_TOOLKIT_TARGET_NAME " aarch64 - linux - androideabi " ) <nl> - else ( ) <nl> - set ( CUDA_TOOLKIT_TARGET_NAME " aarch64 - linux " ) <nl> - endif ( ANDROID_ARCH_NAME STREQUAL " arm64 " ) <nl> - endif ( ) <nl> - <nl> - if ( EXISTS " $ { CUDA_TOOLKIT_ROOT } / targets / $ { CUDA_TOOLKIT_TARGET_NAME } " ) <nl> - set ( CUDA_TOOLKIT_TARGET_DIR " $ { CUDA_TOOLKIT_ROOT } / targets / $ { CUDA_TOOLKIT_TARGET_NAME } " CACHE PATH " CUDA Toolkit target location . " ) <nl> - SET ( CUDA_TOOLKIT_ROOT_DIR $ { CUDA_TOOLKIT_ROOT } ) <nl> - mark_as_advanced ( CUDA_TOOLKIT_TARGET_DIR ) <nl> - endif ( ) <nl> - <nl> - # add known CUDA targetr root path to the set of directories we search for programs , libraries and headers <nl> - set ( CMAKE_FIND_ROOT_PATH " $ { CUDA_TOOLKIT_TARGET_DIR } ; $ { CMAKE_FIND_ROOT_PATH } " ) <nl> - macro ( cuda_find_host_program ) <nl> - find_host_program ( $ { ARGN } ) <nl> - endmacro ( ) <nl> - else ( ) <nl> - # for non - cross - compile , find_host_program = = find_program and CUDA_TOOLKIT_TARGET_DIR = = CUDA_TOOLKIT_ROOT_DIR <nl> - macro ( cuda_find_host_program ) <nl> - find_program ( $ { ARGN } ) <nl> - endmacro ( ) <nl> - SET ( CUDA_TOOLKIT_TARGET_DIR $ { CUDA_TOOLKIT_ROOT_DIR } ) <nl> - endif ( ) <nl> - <nl> - <nl> - # CUDA_NVCC_EXECUTABLE <nl> - if ( DEFINED ENV { CUDA_NVCC_EXECUTABLE } ) <nl> - SET ( CUDA_NVCC_EXECUTABLE " $ ENV { CUDA_NVCC_EXECUTABLE } " ) <nl> - else ( DEFINED ENV { CUDA_NVCC_EXECUTABLE } ) <nl> - cuda_find_host_program ( CUDA_NVCC_EXECUTABLE <nl> - NAMES nvcc <nl> - PATHS " $ { CUDA_TOOLKIT_ROOT_DIR } " <nl> - ENV CUDA_PATH <nl> - ENV CUDA_BIN_PATH <nl> - PATH_SUFFIXES bin bin64 <nl> - NO_DEFAULT_PATH <nl> - ) <nl> - # Search default search paths , after we search our own set of paths . <nl> - cuda_find_host_program ( CUDA_NVCC_EXECUTABLE nvcc ) <nl> - mark_as_advanced ( CUDA_NVCC_EXECUTABLE ) <nl> - endif ( DEFINED ENV { CUDA_NVCC_EXECUTABLE } ) <nl> - <nl> - if ( CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION ) <nl> - # Compute the version . <nl> - execute_process ( COMMAND $ { CUDA_NVCC_EXECUTABLE } " - - version " OUTPUT_VARIABLE NVCC_OUT ) <nl> - string ( REGEX REPLACE " . * release ( [ 0 - 9 ] + ) \ \ . ( [ 0 - 9 ] + ) . * " " \ \ 1 " CUDA_VERSION_MAJOR $ { NVCC_OUT } ) <nl> - string ( REGEX REPLACE " . * release ( [ 0 - 9 ] + ) \ \ . ( [ 0 - 9 ] + ) . * " " \ \ 2 " CUDA_VERSION_MINOR $ { NVCC_OUT } ) <nl> - set ( CUDA_VERSION " $ { CUDA_VERSION_MAJOR } . $ { CUDA_VERSION_MINOR } " CACHE STRING " Version of CUDA as computed from nvcc . " ) <nl> - mark_as_advanced ( CUDA_VERSION ) <nl> - else ( ) <nl> - # Need to set these based off of the cached value <nl> - string ( REGEX REPLACE " ( [ 0 - 9 ] + ) \ \ . ( [ 0 - 9 ] + ) . * " " \ \ 1 " CUDA_VERSION_MAJOR " $ { CUDA_VERSION } " ) <nl> - string ( REGEX REPLACE " ( [ 0 - 9 ] + ) \ \ . ( [ 0 - 9 ] + ) . * " " \ \ 2 " CUDA_VERSION_MINOR " $ { CUDA_VERSION } " ) <nl> - endif ( ) <nl> - <nl> - <nl> - # Always set this convenience variable <nl> - set ( CUDA_VERSION_STRING " $ { CUDA_VERSION } " ) <nl> - <nl> - # CUDA_TOOLKIT_INCLUDE <nl> - find_path ( CUDA_TOOLKIT_INCLUDE <nl> - device_functions . h # Header included in toolkit <nl> - PATHS $ { CUDA_TOOLKIT_TARGET_DIR } <nl> - ENV CUDA_PATH <nl> - ENV CUDA_INC_PATH <nl> - PATH_SUFFIXES include <nl> - NO_DEFAULT_PATH <nl> - ) <nl> - # Search default search paths , after we search our own set of paths . <nl> - find_path ( CUDA_TOOLKIT_INCLUDE device_functions . h ) <nl> - mark_as_advanced ( CUDA_TOOLKIT_INCLUDE ) <nl> - <nl> - if ( CUDA_VERSION VERSION_GREATER " 7 . 0 " OR EXISTS " $ { CUDA_TOOLKIT_INCLUDE } / cuda_fp16 . h " ) <nl> - set ( CUDA_HAS_FP16 TRUE ) <nl> - else ( ) <nl> - set ( CUDA_HAS_FP16 FALSE ) <nl> - endif ( ) <nl> - <nl> - # Set the user list of include dir to nothing to initialize it . <nl> - set ( CUDA_NVCC_INCLUDE_ARGS_USER " " ) <nl> - set ( CUDA_INCLUDE_DIRS $ { CUDA_TOOLKIT_INCLUDE } ) <nl> - <nl> - macro ( cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext ) <nl> - if ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) <nl> - # CUDA 3 . 2 + on Windows moved the library directories , so we need the new <nl> - # and old paths . <nl> - set ( _cuda_64bit_lib_dir " $ { _path_ext } lib / x64 " " $ { _path_ext } lib64 " " $ { _path_ext } libx64 " ) <nl> - endif ( ) <nl> - # CUDA 3 . 2 + on Windows moved the library directories , so we need to new <nl> - # ( lib / Win32 ) and the old path ( lib ) . <nl> - find_library ( $ { _var } <nl> - NAMES $ { _names } <nl> - PATHS " $ { CUDA_TOOLKIT_TARGET_DIR } " <nl> - ENV CUDA_PATH <nl> - ENV CUDA_LIB_PATH <nl> - PATH_SUFFIXES $ { _cuda_64bit_lib_dir } " $ { _path_ext } lib / Win32 " " $ { _path_ext } lib " " $ { _path_ext } libWin32 " <nl> - DOC $ { _doc } <nl> - NO_DEFAULT_PATH <nl> - ) <nl> - if ( NOT CMAKE_CROSSCOMPILING ) <nl> - # Search default search paths , after we search our own set of paths . <nl> - find_library ( $ { _var } <nl> - NAMES $ { _names } <nl> - PATHS " / usr / lib / nvidia - current " <nl> - DOC $ { _doc } <nl> - ) <nl> - endif ( ) <nl> - endmacro ( ) <nl> - <nl> - macro ( cuda_find_library_local_first _var _names _doc ) <nl> - cuda_find_library_local_first_with_path_ext ( " $ { _var } " " $ { _names } " " $ { _doc } " " " ) <nl> - endmacro ( ) <nl> - <nl> - macro ( find_library_local_first _var _names _doc ) <nl> - cuda_find_library_local_first ( " $ { _var } " " $ { _names } " " $ { _doc } " " " ) <nl> - endmacro ( ) <nl> - <nl> - <nl> - # CUDA_LIBRARIES <nl> - cuda_find_library_local_first ( CUDA_CUDART_LIBRARY cudart " \ " cudart \ " library " ) <nl> - if ( CUDA_VERSION VERSION_EQUAL " 3 . 0 " ) <nl> - # The cudartemu library only existed for the 3 . 0 version of CUDA . <nl> - cuda_find_library_local_first ( CUDA_CUDARTEMU_LIBRARY cudartemu " \ " cudartemu \ " library " ) <nl> - mark_as_advanced ( <nl> - CUDA_CUDARTEMU_LIBRARY <nl> - ) <nl> - endif ( ) <nl> - <nl> - if ( CUDA_USE_STATIC_CUDA_RUNTIME AND NOT CUDA_VERSION VERSION_LESS " 5 . 5 " ) <nl> - cuda_find_library_local_first ( CUDA_cudart_static_LIBRARY cudart_static " static CUDA runtime library " ) <nl> - mark_as_advanced ( CUDA_cudart_static_LIBRARY ) <nl> - endif ( ) <nl> - <nl> - <nl> - if ( CUDA_cudart_static_LIBRARY ) <nl> - # Set whether to use the static cuda runtime . <nl> - option ( CUDA_USE_STATIC_CUDA_RUNTIME " Use the static version of the CUDA runtime library if available " ON ) <nl> - set ( CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY ) <nl> - else ( ) <nl> - option ( CUDA_USE_STATIC_CUDA_RUNTIME " Use the static version of the CUDA runtime library if available " OFF ) <nl> - set ( CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY ) <nl> - endif ( ) <nl> - <nl> - if ( CUDA_USE_STATIC_CUDA_RUNTIME ) <nl> - if ( UNIX ) <nl> - # Check for the dependent libraries . Here we look for pthreads . <nl> - if ( DEFINED CMAKE_THREAD_PREFER_PTHREAD ) <nl> - set ( _cuda_cmake_thread_prefer_pthread $ { CMAKE_THREAD_PREFER_PTHREAD } ) <nl> - endif ( ) <nl> - set ( CMAKE_THREAD_PREFER_PTHREAD 1 ) <nl> - <nl> - # Many of the FindXYZ CMake comes with makes use of try_compile with int main ( ) { return 0 ; } <nl> - # as the source file . Unfortunately this causes a warning with - Wstrict - prototypes and <nl> - # - Werror causes the try_compile to fail . We will just temporarily disable other flags <nl> - # when doing the find_package command here . <nl> - set ( _cuda_cmake_c_flags $ { CMAKE_C_FLAGS } ) <nl> - set ( CMAKE_C_FLAGS " - fPIC " ) <nl> - find_package ( Threads REQUIRED ) <nl> - set ( CMAKE_C_FLAGS $ { _cuda_cmake_c_flags } ) <nl> - <nl> - if ( DEFINED _cuda_cmake_thread_prefer_pthread ) <nl> - set ( CMAKE_THREAD_PREFER_PTHREAD $ { _cuda_cmake_thread_prefer_pthread } ) <nl> - unset ( _cuda_cmake_thread_prefer_pthread ) <nl> - else ( ) <nl> - unset ( CMAKE_THREAD_PREFER_PTHREAD ) <nl> - endif ( ) <nl> - endif ( ) <nl> - if ( NOT APPLE AND CUDA_VERSION VERSION_LESS " 7 . 0 " ) <nl> - # Before CUDA 7 . 0 , there was librt that has things such as , clock_gettime , shm_open , and shm_unlink . <nl> - find_library ( CUDA_rt_LIBRARY rt ) <nl> - if ( NOT CUDA_rt_LIBRARY ) <nl> - message ( WARNING " Expecting to find librt for libcudart_static , but didn ' t find it . " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - # CUPTI library showed up in cuda toolkit 4 . 0 <nl> - if ( NOT CUDA_VERSION VERSION_LESS " 4 . 0 " ) <nl> - cuda_find_library_local_first_with_path_ext ( CUDA_cupti_LIBRARY cupti " \ " cupti \ " library " " extras / CUPTI / " ) <nl> - mark_as_advanced ( CUDA_cupti_LIBRARY ) <nl> - endif ( ) <nl> - <nl> - # Set the CUDA_LIBRARIES variable . This is the set of stuff to link against if you are <nl> - # using the CUDA runtime . For the dynamic version of the runtime , most of the <nl> - # dependencies are brough in , but for the static version there are additional libraries <nl> - # and linker commands needed . <nl> - # Initialize to empty <nl> - set ( CUDA_LIBRARIES ) <nl> - <nl> - # If we are using emulation mode and we found the cudartemu library then use <nl> - # that one instead of cudart . <nl> - if ( CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY ) <nl> - list ( APPEND CUDA_LIBRARIES $ { CUDA_CUDARTEMU_LIBRARY } ) <nl> - elseif ( CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY ) <nl> - list ( APPEND CUDA_LIBRARIES $ { CUDA_cudart_static_LIBRARY } $ { CMAKE_THREAD_LIBS_INIT } $ { CMAKE_DL_LIBS } ) <nl> - if ( CUDA_rt_LIBRARY ) <nl> - list ( APPEND CUDA_LIBRARIES $ { CUDA_rt_LIBRARY } ) <nl> - endif ( ) <nl> - if ( APPLE ) <nl> - # We need to add the default path to the driver ( libcuda . dylib ) as an rpath , so that <nl> - # the static cuda runtime can find it at runtime . <nl> - list ( APPEND CUDA_LIBRARIES - Wl , - rpath , / usr / local / cuda / lib ) <nl> - endif ( ) <nl> - else ( ) <nl> - list ( APPEND CUDA_LIBRARIES $ { CUDA_CUDART_LIBRARY } ) <nl> - endif ( ) <nl> - <nl> - # 1 . 1 toolkit on linux doesn ' t appear to have a separate library on <nl> - # some platforms . <nl> - cuda_find_library_local_first ( CUDA_CUDA_LIBRARY cuda " \ " cuda \ " library ( older versions only ) . " ) <nl> - <nl> - mark_as_advanced ( <nl> - CUDA_CUDA_LIBRARY <nl> - CUDA_CUDART_LIBRARY <nl> - ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Look for some of the toolkit helper libraries <nl> - macro ( FIND_CUDA_HELPER_LIBS _name ) <nl> - cuda_find_library_local_first ( CUDA_ $ { _name } _LIBRARY $ { _name } " \ " $ { _name } \ " library " ) <nl> - mark_as_advanced ( CUDA_ $ { _name } _LIBRARY ) <nl> - endmacro ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Disable emulation for v3 . 1 onward <nl> - if ( CUDA_VERSION VERSION_GREATER " 3 . 0 " ) <nl> - if ( CUDA_BUILD_EMULATION ) <nl> - message ( FATAL_ERROR " CUDA_BUILD_EMULATION is not supported in version 3 . 1 and onwards . You must disable it to proceed . You have version $ { CUDA_VERSION } . " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - # Search for additional CUDA toolkit libraries . <nl> - if ( CUDA_VERSION VERSION_LESS " 3 . 1 " ) <nl> - # Emulation libraries aren ' t available in version 3 . 1 onward . <nl> - find_cuda_helper_libs ( cufftemu ) <nl> - find_cuda_helper_libs ( cublasemu ) <nl> - endif ( ) <nl> - find_cuda_helper_libs ( cufft ) <nl> - find_cuda_helper_libs ( cublas ) <nl> - if ( NOT CUDA_VERSION VERSION_LESS " 3 . 2 " ) <nl> - # cusparse showed up in version 3 . 2 <nl> - find_cuda_helper_libs ( cusparse ) <nl> - find_cuda_helper_libs ( curand ) <nl> - if ( WIN32 ) <nl> - find_cuda_helper_libs ( nvcuvenc ) <nl> - find_cuda_helper_libs ( nvcuvid ) <nl> - endif ( ) <nl> - endif ( ) <nl> - if ( CUDA_VERSION VERSION_GREATER " 5 . 0 " ) <nl> - find_cuda_helper_libs ( cublas_device ) <nl> - # In CUDA 5 . 5 NPP was splitted onto 3 separate libraries . <nl> - find_cuda_helper_libs ( nppc ) <nl> - find_cuda_helper_libs ( nppi ) <nl> - find_cuda_helper_libs ( npps ) <nl> - set ( CUDA_npp_LIBRARY " $ { CUDA_nppc_LIBRARY } ; $ { CUDA_nppi_LIBRARY } ; $ { CUDA_npps_LIBRARY } " ) <nl> - elseif ( NOT CUDA_VERSION VERSION_LESS " 4 . 0 " ) <nl> - find_cuda_helper_libs ( npp ) <nl> - endif ( ) <nl> - if ( NOT CUDA_VERSION VERSION_LESS " 7 . 0 " ) <nl> - # cusolver showed up in version 7 . 0 <nl> - find_cuda_helper_libs ( cusolver ) <nl> - endif ( ) <nl> - <nl> - if ( CUDA_BUILD_EMULATION ) <nl> - set ( CUDA_CUFFT_LIBRARIES $ { CUDA_cufftemu_LIBRARY } ) <nl> - set ( CUDA_CUBLAS_LIBRARIES $ { CUDA_cublasemu_LIBRARY } ) <nl> - else ( ) <nl> - set ( CUDA_CUFFT_LIBRARIES $ { CUDA_cufft_LIBRARY } ) <nl> - set ( CUDA_CUBLAS_LIBRARIES $ { CUDA_cublas_LIBRARY } $ { CUDA_cublas_device_LIBRARY } ) <nl> - endif ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Look for the SDK stuff . As of CUDA 3 . 0 NVSDKCUDA_ROOT has been replaced with <nl> - # NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory <nl> - find_path ( CUDA_SDK_ROOT_DIR common / inc / cutil . h <nl> - HINTS <nl> - " $ ENV { NVSDKCOMPUTE_ROOT } / C " <nl> - ENV NVSDKCUDA_ROOT <nl> - " [ HKEY_LOCAL_MACHINE \ \ SOFTWARE \ \ NVIDIA Corporation \ \ Installed Products \ \ NVIDIA SDK 10 \ \ Compute ; InstallDir ] " <nl> - PATHS <nl> - " / Developer / GPU \ Computing / C " <nl> - ) <nl> - <nl> - # Keep the CUDA_SDK_ROOT_DIR first in order to be able to override the <nl> - # environment variables . <nl> - set ( CUDA_SDK_SEARCH_PATH <nl> - " $ { CUDA_SDK_ROOT_DIR } " <nl> - " $ { CUDA_TOOLKIT_ROOT_DIR } / local / NVSDK0 . 2 " <nl> - " $ { CUDA_TOOLKIT_ROOT_DIR } / NVSDK0 . 2 " <nl> - " $ { CUDA_TOOLKIT_ROOT_DIR } / NV_CUDA_SDK " <nl> - " $ ENV { HOME } / NVIDIA_CUDA_SDK " <nl> - " $ ENV { HOME } / NVIDIA_CUDA_SDK_MACOSX " <nl> - " / Developer / CUDA " <nl> - ) <nl> - <nl> - # Example of how to find an include file from the CUDA_SDK_ROOT_DIR <nl> - <nl> - # find_path ( CUDA_CUT_INCLUDE_DIR <nl> - # cutil . h <nl> - # PATHS $ { CUDA_SDK_SEARCH_PATH } <nl> - # PATH_SUFFIXES " common / inc " <nl> - # DOC " Location of cutil . h " <nl> - # NO_DEFAULT_PATH <nl> - # ) <nl> - # # Now search system paths <nl> - # find_path ( CUDA_CUT_INCLUDE_DIR cutil . h DOC " Location of cutil . h " ) <nl> - <nl> - # mark_as_advanced ( CUDA_CUT_INCLUDE_DIR ) <nl> - <nl> - <nl> - # Example of how to find a library in the CUDA_SDK_ROOT_DIR <nl> - <nl> - # # cutil library is called cutil64 for 64 bit builds on windows . We don ' t want <nl> - # # to get these confused , so we are setting the name based on the word size of <nl> - # # the build . <nl> - <nl> - # if ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) <nl> - # set ( cuda_cutil_name cutil64 ) <nl> - # else ( ) <nl> - # set ( cuda_cutil_name cutil32 ) <nl> - # endif ( ) <nl> - <nl> - # find_library ( CUDA_CUT_LIBRARY <nl> - # NAMES cutil $ { cuda_cutil_name } <nl> - # PATHS $ { CUDA_SDK_SEARCH_PATH } <nl> - # # The new version of the sdk shows up in common / lib , but the old one is in lib <nl> - # PATH_SUFFIXES " common / lib " " lib " <nl> - # DOC " Location of cutil library " <nl> - # NO_DEFAULT_PATH <nl> - # ) <nl> - # # Now search system paths <nl> - # find_library ( CUDA_CUT_LIBRARY NAMES cutil $ { cuda_cutil_name } DOC " Location of cutil library " ) <nl> - # mark_as_advanced ( CUDA_CUT_LIBRARY ) <nl> - # set ( CUDA_CUT_LIBRARIES $ { CUDA_CUT_LIBRARY } ) <nl> - <nl> - <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Check for required components <nl> - set ( CUDA_FOUND TRUE ) <nl> - <nl> - set ( CUDA_TOOLKIT_ROOT_DIR_INTERNAL " $ { CUDA_TOOLKIT_ROOT_DIR } " CACHE INTERNAL <nl> - " This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully . " FORCE ) <nl> - set ( CUDA_TOOLKIT_TARGET_DIR_INTERNAL " $ { CUDA_TOOLKIT_TARGET_DIR } " CACHE INTERNAL <nl> - " This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully . " FORCE ) <nl> - set ( CUDA_SDK_ROOT_DIR_INTERNAL " $ { CUDA_SDK_ROOT_DIR } " CACHE INTERNAL <nl> - " This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully . " FORCE ) <nl> - <nl> - # include ( $ { CMAKE_CURRENT_LIST_DIR } / FindPackageHandleStandardArgs . cmake ) <nl> - include ( $ { CMAKE_ROOT } / Modules / FindPackageHandleStandardArgs . cmake ) <nl> - <nl> - find_package_handle_standard_args ( CUDA <nl> - REQUIRED_VARS <nl> - CUDA_TOOLKIT_ROOT_DIR <nl> - CUDA_NVCC_EXECUTABLE <nl> - CUDA_INCLUDE_DIRS <nl> - $ { CUDA_CUDART_LIBRARY_VAR } <nl> - VERSION_VAR <nl> - CUDA_VERSION <nl> - ) <nl> - <nl> - <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Macros <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Add include directories to pass to the nvcc command . <nl> - macro ( CUDA_INCLUDE_DIRECTORIES ) <nl> - foreach ( dir $ { ARGN } ) <nl> - list ( APPEND CUDA_NVCC_INCLUDE_ARGS_USER - I $ { dir } ) <nl> - endforeach ( ) <nl> - endmacro ( ) <nl> - <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - cuda_find_helper_file ( parse_cubin cmake ) <nl> - cuda_find_helper_file ( make2cmake cmake ) <nl> - cuda_find_helper_file ( run_nvcc cmake ) <nl> - include ( " $ { CMAKE_CURRENT_LIST_DIR } / FindCUDA / select_compute_arch . cmake " ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Separate the OPTIONS out from the sources <nl> - # <nl> - macro ( CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options ) <nl> - set ( $ { _sources } ) <nl> - set ( $ { _cmake_options } ) <nl> - set ( $ { _options } ) <nl> - set ( _found_options FALSE ) <nl> - foreach ( arg $ { ARGN } ) <nl> - if ( " x $ { arg } " STREQUAL " xOPTIONS " ) <nl> - set ( _found_options TRUE ) <nl> - elseif ( <nl> - " x $ { arg } " STREQUAL " xWIN32 " OR <nl> - " x $ { arg } " STREQUAL " xMACOSX_BUNDLE " OR <nl> - " x $ { arg } " STREQUAL " xEXCLUDE_FROM_ALL " OR <nl> - " x $ { arg } " STREQUAL " xSTATIC " OR <nl> - " x $ { arg } " STREQUAL " xSHARED " OR <nl> - " x $ { arg } " STREQUAL " xMODULE " <nl> - ) <nl> - list ( APPEND $ { _cmake_options } $ { arg } ) <nl> - else ( ) <nl> - if ( _found_options ) <nl> - list ( APPEND $ { _options } $ { arg } ) <nl> - else ( ) <nl> - # Assume this is a file <nl> - list ( APPEND $ { _sources } $ { arg } ) <nl> - endif ( ) <nl> - endif ( ) <nl> - endforeach ( ) <nl> - endmacro ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Parse the OPTIONS from ARGN and set the variables prefixed by _option_prefix <nl> - # <nl> - macro ( CUDA_PARSE_NVCC_OPTIONS _option_prefix ) <nl> - set ( _found_config ) <nl> - foreach ( arg $ { ARGN } ) <nl> - # Determine if we are dealing with a perconfiguration flag <nl> - foreach ( config $ { CUDA_configuration_types } ) <nl> - string ( TOUPPER $ { config } config_upper ) <nl> - if ( arg STREQUAL " $ { config_upper } " ) <nl> - set ( _found_config _ $ { arg } ) <nl> - # Set arg to nothing to keep it from being processed further <nl> - set ( arg ) <nl> - endif ( ) <nl> - endforeach ( ) <nl> - <nl> - if ( arg ) <nl> - list ( APPEND $ { _option_prefix } $ { _found_config } " $ { arg } " ) <nl> - endif ( ) <nl> - endforeach ( ) <nl> - endmacro ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Helper to add the include directory for CUDA only once <nl> - function ( CUDA_ADD_CUDA_INCLUDE_ONCE ) <nl> - get_directory_property ( _include_directories INCLUDE_DIRECTORIES ) <nl> - set ( _add TRUE ) <nl> - if ( _include_directories ) <nl> - foreach ( dir $ { _include_directories } ) <nl> - if ( " $ { dir } " STREQUAL " $ { CUDA_INCLUDE_DIRS } " ) <nl> - set ( _add FALSE ) <nl> - endif ( ) <nl> - endforeach ( ) <nl> - endif ( ) <nl> - if ( _add ) <nl> - include_directories ( $ { CUDA_INCLUDE_DIRS } ) <nl> - endif ( ) <nl> - endfunction ( ) <nl> - <nl> - function ( CUDA_BUILD_SHARED_LIBRARY shared_flag ) <nl> - set ( cmake_args $ { ARGN } ) <nl> - # If SHARED , MODULE , or STATIC aren ' t already in the list of arguments , then <nl> - # add SHARED or STATIC based on the value of BUILD_SHARED_LIBS . <nl> - list ( FIND cmake_args SHARED _cuda_found_SHARED ) <nl> - list ( FIND cmake_args MODULE _cuda_found_MODULE ) <nl> - list ( FIND cmake_args STATIC _cuda_found_STATIC ) <nl> - if ( _cuda_found_SHARED GREATER - 1 OR <nl> - _cuda_found_MODULE GREATER - 1 OR <nl> - _cuda_found_STATIC GREATER - 1 ) <nl> - set ( _cuda_build_shared_libs ) <nl> - else ( ) <nl> - if ( BUILD_SHARED_LIBS ) <nl> - set ( _cuda_build_shared_libs SHARED ) <nl> - else ( ) <nl> - set ( _cuda_build_shared_libs STATIC ) <nl> - endif ( ) <nl> - endif ( ) <nl> - set ( $ { shared_flag } $ { _cuda_build_shared_libs } PARENT_SCOPE ) <nl> - endfunction ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Helper to avoid clashes of files with the same basename but different paths . <nl> - # This doesn ' t attempt to do exactly what CMake internals do , which is to only <nl> - # add this path when there is a conflict , since by the time a second collision <nl> - # in names is detected it ' s already too late to fix the first one . For <nl> - # consistency sake the relative path will be added to all files . <nl> - function ( CUDA_COMPUTE_BUILD_PATH path build_path ) <nl> - # message ( " CUDA_COMPUTE_BUILD_PATH ( [ $ { path } ] $ { build_path } ) " ) <nl> - # Only deal with CMake style paths from here on out <nl> - file ( TO_CMAKE_PATH " $ { path } " bpath ) <nl> - if ( IS_ABSOLUTE " $ { bpath } " ) <nl> - # Absolute paths are generally unnessary , especially if something like <nl> - # file ( GLOB_RECURSE ) is used to pick up the files . <nl> - <nl> - string ( FIND " $ { bpath } " " $ { CMAKE_CURRENT_BINARY_DIR } " _binary_dir_pos ) <nl> - if ( _binary_dir_pos EQUAL 0 ) <nl> - file ( RELATIVE_PATH bpath " $ { CMAKE_CURRENT_BINARY_DIR } " " $ { bpath } " ) <nl> - else ( ) <nl> - file ( RELATIVE_PATH bpath " $ { CMAKE_CURRENT_SOURCE_DIR } " " $ { bpath } " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - # This recipe is from cmLocalGenerator : : CreateSafeUniqueObjectFileName in the <nl> - # CMake source . <nl> - <nl> - # Remove leading / <nl> - string ( REGEX REPLACE " ^ [ / ] + " " " bpath " $ { bpath } " ) <nl> - # Avoid absolute paths by removing ' : ' <nl> - string ( REPLACE " : " " _ " bpath " $ { bpath } " ) <nl> - # Avoid relative paths that go up the tree <nl> - string ( REPLACE " . . / " " __ / " bpath " $ { bpath } " ) <nl> - # Avoid spaces <nl> - string ( REPLACE " " " _ " bpath " $ { bpath } " ) <nl> - <nl> - # Strip off the filename . I wait until here to do it , since removin the <nl> - # basename can make a path that looked like path / . . / basename turn into <nl> - # path / . . ( notice the trailing slash ) . <nl> - get_filename_component ( bpath " $ { bpath } " PATH ) <nl> - <nl> - set ( $ { build_path } " $ { bpath } " PARENT_SCOPE ) <nl> - # message ( " $ { build_path } = $ { bpath } " ) <nl> - endfunction ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # This helper macro populates the following variables and setups up custom <nl> - # commands and targets to invoke the nvcc compiler to generate C or PTX source <nl> - # dependent upon the format parameter . The compiler is invoked once with - M <nl> - # to generate a dependency file and a second time with - cuda or - ptx to generate <nl> - # a . cpp or . ptx file . <nl> - # INPUT : <nl> - # cuda_target - Target name <nl> - # format - PTX , CUBIN , FATBIN or OBJ <nl> - # FILE1 . . FILEN - The remaining arguments are the sources to be wrapped . <nl> - # OPTIONS - Extra options to NVCC <nl> - # OUTPUT : <nl> - # generated_files - List of generated files <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - macro ( CUDA_WRAP_SRCS cuda_target format generated_files ) <nl> - <nl> - # If CMake doesn ' t support separable compilation , complain <nl> - if ( CUDA_SEPARABLE_COMPILATION AND CMAKE_VERSION VERSION_LESS " 2 . 8 . 10 . 1 " ) <nl> - message ( SEND_ERROR " CUDA_SEPARABLE_COMPILATION isn ' t supported for CMake versions less than 2 . 8 . 10 . 1 " ) <nl> - endif ( ) <nl> - <nl> - # Set up all the command line flags here , so that they can be overridden on a per target basis . <nl> - <nl> - set ( nvcc_flags " " ) <nl> - <nl> - # Emulation if the card isn ' t present . <nl> - if ( CUDA_BUILD_EMULATION ) <nl> - # Emulation . <nl> - set ( nvcc_flags $ { nvcc_flags } - - device - emulation - D_DEVICEEMU - g ) <nl> - else ( ) <nl> - # Device mode . No flags necessary . <nl> - endif ( ) <nl> - <nl> - if ( CUDA_HOST_COMPILATION_CPP ) <nl> - set ( CUDA_C_OR_CXX CXX ) <nl> - else ( ) <nl> - if ( CUDA_VERSION VERSION_LESS " 3 . 0 " ) <nl> - set ( nvcc_flags $ { nvcc_flags } - - host - compilation C ) <nl> - else ( ) <nl> - message ( WARNING " - - host - compilation flag is deprecated in CUDA version > = 3 . 0 . Removing - - host - compilation C flag " ) <nl> - endif ( ) <nl> - set ( CUDA_C_OR_CXX C ) <nl> - endif ( ) <nl> - <nl> - set ( generated_extension $ { CMAKE_ $ { CUDA_C_OR_CXX } _OUTPUT_EXTENSION } ) <nl> - <nl> - if ( CUDA_64_BIT_DEVICE_CODE ) <nl> - set ( nvcc_flags $ { nvcc_flags } - m64 ) <nl> - else ( ) <nl> - set ( nvcc_flags $ { nvcc_flags } - m32 ) <nl> - endif ( ) <nl> - <nl> - if ( CUDA_TARGET_CPU_ARCH ) <nl> - set ( nvcc_flags $ { nvcc_flags } " - - target - cpu - architecture = $ { CUDA_TARGET_CPU_ARCH } " ) <nl> - endif ( ) <nl> - <nl> - # This needs to be passed in at this stage , because VS needs to fill out the <nl> - # value of VCInstallDir from within VS . Note that CCBIN is only used if <nl> - # - ccbin or - - compiler - bindir isn ' t used and CUDA_HOST_COMPILER matches <nl> - # $ ( VCInstallDir ) / bin . <nl> - if ( CMAKE_GENERATOR MATCHES " Visual Studio " ) <nl> - set ( ccbin_flags - D " \ " CCBIN : PATH = $ ( VCInstallDir ) bin \ " " ) <nl> - else ( ) <nl> - set ( ccbin_flags ) <nl> - endif ( ) <nl> - <nl> - # Figure out which configure we will use and pass that in as an argument to <nl> - # the script . We need to defer the decision until compilation time , because <nl> - # for VS projects we won ' t know if we are making a debug or release build <nl> - # until build time . <nl> - if ( CMAKE_GENERATOR MATCHES " Visual Studio " ) <nl> - set ( CUDA_build_configuration " $ ( ConfigurationName ) " ) <nl> - else ( ) <nl> - set ( CUDA_build_configuration " $ { CMAKE_BUILD_TYPE } " ) <nl> - endif ( ) <nl> - <nl> - # Initialize our list of includes with the user ones followed by the CUDA system ones . <nl> - set ( CUDA_NVCC_INCLUDE_ARGS $ { CUDA_NVCC_INCLUDE_ARGS_USER } " - I $ { CUDA_INCLUDE_DIRS } " ) <nl> - # Get the include directories for this directory and use them for our nvcc command . <nl> - # Remove duplicate entries which may be present since include_directories <nl> - # in CMake > = 2 . 8 . 8 does not remove them . <nl> - get_directory_property ( CUDA_NVCC_INCLUDE_DIRECTORIES INCLUDE_DIRECTORIES ) <nl> - list ( REMOVE_DUPLICATES CUDA_NVCC_INCLUDE_DIRECTORIES ) <nl> - if ( CUDA_NVCC_INCLUDE_DIRECTORIES ) <nl> - foreach ( dir $ { CUDA_NVCC_INCLUDE_DIRECTORIES } ) <nl> - list ( APPEND CUDA_NVCC_INCLUDE_ARGS - I $ { dir } ) <nl> - endforeach ( ) <nl> - endif ( ) <nl> - <nl> - # Reset these variables <nl> - set ( CUDA_WRAP_OPTION_NVCC_FLAGS ) <nl> - foreach ( config $ { CUDA_configuration_types } ) <nl> - string ( TOUPPER $ { config } config_upper ) <nl> - set ( CUDA_WRAP_OPTION_NVCC_FLAGS_ $ { config_upper } ) <nl> - endforeach ( ) <nl> - <nl> - CUDA_GET_SOURCES_AND_OPTIONS ( _cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options $ { ARGN } ) <nl> - CUDA_PARSE_NVCC_OPTIONS ( CUDA_WRAP_OPTION_NVCC_FLAGS $ { _cuda_wrap_options } ) <nl> - <nl> - # Figure out if we are building a shared library . BUILD_SHARED_LIBS is <nl> - # respected in CUDA_ADD_LIBRARY . <nl> - set ( _cuda_build_shared_libs FALSE ) <nl> - # SHARED , MODULE <nl> - list ( FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED ) <nl> - list ( FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE ) <nl> - if ( _cuda_found_SHARED GREATER - 1 OR _cuda_found_MODULE GREATER - 1 ) <nl> - set ( _cuda_build_shared_libs TRUE ) <nl> - endif ( ) <nl> - # STATIC <nl> - list ( FIND _cuda_wrap_cmake_options STATIC _cuda_found_STATIC ) <nl> - if ( _cuda_found_STATIC GREATER - 1 ) <nl> - set ( _cuda_build_shared_libs FALSE ) <nl> - endif ( ) <nl> - <nl> - # CUDA_HOST_FLAGS <nl> - if ( _cuda_build_shared_libs ) <nl> - # If we are setting up code for a shared library , then we need to add extra flags for <nl> - # compiling objects for shared libraries . <nl> - set ( CUDA_HOST_SHARED_FLAGS $ { CMAKE_SHARED_LIBRARY_ $ { CUDA_C_OR_CXX } _FLAGS } ) <nl> - else ( ) <nl> - set ( CUDA_HOST_SHARED_FLAGS ) <nl> - endif ( ) <nl> - # Only add the CMAKE_ { C , CXX } _FLAGS if we are propagating host flags . We <nl> - # always need to set the SHARED_FLAGS , though . <nl> - if ( CUDA_PROPAGATE_HOST_FLAGS ) <nl> - set ( _cuda_host_flags " set ( CMAKE_HOST_FLAGS $ { CMAKE_ $ { CUDA_C_OR_CXX } _FLAGS } $ { CUDA_HOST_SHARED_FLAGS } ) " ) <nl> - else ( ) <nl> - set ( _cuda_host_flags " set ( CMAKE_HOST_FLAGS $ { CUDA_HOST_SHARED_FLAGS } ) " ) <nl> - endif ( ) <nl> - <nl> - set ( _cuda_nvcc_flags_config " # Build specific configuration flags " ) <nl> - # Loop over all the configuration types to generate appropriate flags for run_nvcc . cmake <nl> - foreach ( config $ { CUDA_configuration_types } ) <nl> - string ( TOUPPER $ { config } config_upper ) <nl> - # CMAKE_FLAGS are strings and not lists . By not putting quotes around CMAKE_FLAGS <nl> - # we convert the strings to lists ( like we want ) . <nl> - <nl> - if ( CUDA_PROPAGATE_HOST_FLAGS ) <nl> - # nvcc chokes on - g3 in versions previous to 3 . 0 , so replace it with - g <nl> - set ( _cuda_fix_g3 FALSE ) <nl> - <nl> - if ( CMAKE_COMPILER_IS_GNUCC ) <nl> - if ( CUDA_VERSION VERSION_LESS " 3 . 0 " OR <nl> - CUDA_VERSION VERSION_EQUAL " 4 . 1 " OR <nl> - CUDA_VERSION VERSION_EQUAL " 4 . 2 " <nl> - ) <nl> - set ( _cuda_fix_g3 TRUE ) <nl> - endif ( ) <nl> - endif ( ) <nl> - if ( _cuda_fix_g3 ) <nl> - string ( REPLACE " - g3 " " - g " _cuda_C_FLAGS " $ { CMAKE_ $ { CUDA_C_OR_CXX } _FLAGS_ $ { config_upper } } " ) <nl> - else ( ) <nl> - set ( _cuda_C_FLAGS " $ { CMAKE_ $ { CUDA_C_OR_CXX } _FLAGS_ $ { config_upper } } " ) <nl> - endif ( ) <nl> - <nl> - set ( _cuda_host_flags " $ { _cuda_host_flags } \ nset ( CMAKE_HOST_FLAGS_ $ { config_upper } $ { _cuda_C_FLAGS } ) " ) <nl> - endif ( ) <nl> - <nl> - # Note that if we ever want CUDA_NVCC_FLAGS_ < CONFIG > to be string ( instead of a list <nl> - # like it is currently ) , we can remove the quotes around the <nl> - # $ { CUDA_NVCC_FLAGS_ $ { config_upper } } variable like the CMAKE_HOST_FLAGS_ < CONFIG > variable . <nl> - set ( _cuda_nvcc_flags_config " $ { _cuda_nvcc_flags_config } \ nset ( CUDA_NVCC_FLAGS_ $ { config_upper } $ { CUDA_NVCC_FLAGS_ $ { config_upper } } ; ; $ { CUDA_WRAP_OPTION_NVCC_FLAGS_ $ { config_upper } } ) " ) <nl> - endforeach ( ) <nl> - <nl> - # Process the C + + 11 flag . If the host sets the flag , we need to add it to nvcc and <nl> - # remove it from the host . This is because - Xcompile - std = c + + will choke nvcc ( it uses <nl> - # the C preprocessor ) . In order to get this to work correctly , we need to use nvcc ' s <nl> - # specific c + + 11 flag . <nl> - if ( " $ { _cuda_host_flags } " MATCHES " - std = c \ \ + \ \ + 11 " ) <nl> - # Add the c + + 11 flag to nvcc if it isn ' t already present . Note that we only look at <nl> - # the main flag instead of the configuration specific flags . <nl> - if ( NOT " $ { CUDA_NVCC_FLAGS } " MATCHES " - std ; c \ \ + \ \ + 11 " ) <nl> - list ( APPEND nvcc_flags - - std c + + 11 ) <nl> - endif ( ) <nl> - string ( REGEX REPLACE " [ - ] + std = c \ \ + \ \ + 11 " " " _cuda_host_flags " $ { _cuda_host_flags } " ) <nl> - endif ( ) <nl> - <nl> - # Get the list of definitions from the directory property <nl> - get_directory_property ( CUDA_NVCC_DEFINITIONS COMPILE_DEFINITIONS ) <nl> - if ( CUDA_NVCC_DEFINITIONS ) <nl> - foreach ( _definition $ { CUDA_NVCC_DEFINITIONS } ) <nl> - list ( APPEND nvcc_flags " - D $ { _definition } " ) <nl> - endforeach ( ) <nl> - endif ( ) <nl> - <nl> - if ( _cuda_build_shared_libs ) <nl> - list ( APPEND nvcc_flags " - D $ { cuda_target } _EXPORTS " ) <nl> - endif ( ) <nl> - <nl> - # Reset the output variable <nl> - set ( _cuda_wrap_generated_files " " ) <nl> - <nl> - # Iterate over the macro arguments and create custom <nl> - # commands for all the . cu files . <nl> - foreach ( file $ { ARGN } ) <nl> - # Ignore any file marked as a HEADER_FILE_ONLY <nl> - get_source_file_property ( _is_header $ { file } HEADER_FILE_ONLY ) <nl> - # Allow per source file overrides of the format . Also allows compiling non - . cu files . <nl> - get_source_file_property ( _cuda_source_format $ { file } CUDA_SOURCE_PROPERTY_FORMAT ) <nl> - if ( ( $ { file } MATCHES " \ \ . cu $ " OR _cuda_source_format ) AND NOT _is_header ) <nl> - <nl> - if ( NOT _cuda_source_format ) <nl> - set ( _cuda_source_format $ { format } ) <nl> - endif ( ) <nl> - # If file isn ' t a . cu file , we need to tell nvcc to treat it as such . <nl> - if ( NOT $ { file } MATCHES " \ \ . cu $ " ) <nl> - set ( cuda_language_flag - x = cu ) <nl> - else ( ) <nl> - set ( cuda_language_flag ) <nl> - endif ( ) <nl> - <nl> - if ( $ { _cuda_source_format } MATCHES " OBJ " ) <nl> - set ( cuda_compile_to_external_module OFF ) <nl> - else ( ) <nl> - set ( cuda_compile_to_external_module ON ) <nl> - if ( $ { _cuda_source_format } MATCHES " PTX " ) <nl> - set ( cuda_compile_to_external_module_type " ptx " ) <nl> - elseif ( $ { _cuda_source_format } MATCHES " CUBIN " ) <nl> - set ( cuda_compile_to_external_module_type " cubin " ) <nl> - elseif ( $ { _cuda_source_format } MATCHES " FATBIN " ) <nl> - set ( cuda_compile_to_external_module_type " fatbin " ) <nl> - else ( ) <nl> - message ( FATAL_ERROR " Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file ' $ { file } ' : ' $ { _cuda_source_format } ' . Use OBJ , PTX , CUBIN or FATBIN . " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - if ( cuda_compile_to_external_module ) <nl> - # Don ' t use any of the host compilation flags for PTX targets . <nl> - set ( CUDA_HOST_FLAGS ) <nl> - set ( CUDA_NVCC_FLAGS_CONFIG ) <nl> - else ( ) <nl> - set ( CUDA_HOST_FLAGS $ { _cuda_host_flags } ) <nl> - set ( CUDA_NVCC_FLAGS_CONFIG $ { _cuda_nvcc_flags_config } ) <nl> - endif ( ) <nl> - <nl> - # Determine output directory <nl> - cuda_compute_build_path ( " $ { file } " cuda_build_path ) <nl> - set ( cuda_compile_intermediate_directory " $ { CMAKE_CURRENT_BINARY_DIR } / CMakeFiles / $ { cuda_target } . dir / $ { cuda_build_path } " ) <nl> - if ( CUDA_GENERATED_OUTPUT_DIR ) <nl> - set ( cuda_compile_output_dir " $ { CUDA_GENERATED_OUTPUT_DIR } " ) <nl> - else ( ) <nl> - if ( cuda_compile_to_external_module ) <nl> - set ( cuda_compile_output_dir " $ { CMAKE_CURRENT_BINARY_DIR } " ) <nl> - else ( ) <nl> - set ( cuda_compile_output_dir " $ { cuda_compile_intermediate_directory } " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - # Add a custom target to generate a c or ptx file . # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - get_filename_component ( basename $ { file } NAME ) <nl> - if ( cuda_compile_to_external_module ) <nl> - set ( generated_file_path " $ { cuda_compile_output_dir } " ) <nl> - set ( generated_file_basename " $ { cuda_target } _generated_ $ { basename } . $ { cuda_compile_to_external_module_type } " ) <nl> - set ( format_flag " - $ { cuda_compile_to_external_module_type } " ) <nl> - file ( MAKE_DIRECTORY " $ { cuda_compile_output_dir } " ) <nl> - else ( ) <nl> - set ( generated_file_path " $ { cuda_compile_output_dir } / $ { CMAKE_CFG_INTDIR } " ) <nl> - set ( generated_file_basename " $ { cuda_target } _generated_ $ { basename } $ { generated_extension } " ) <nl> - if ( CUDA_SEPARABLE_COMPILATION ) <nl> - set ( format_flag " - dc " ) <nl> - else ( ) <nl> - set ( format_flag " - c " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - # Set all of our file names . Make sure that whatever filenames that have <nl> - # generated_file_path in them get passed in through as a command line <nl> - # argument , so that the $ { CMAKE_CFG_INTDIR } gets expanded at run time <nl> - # instead of configure time . <nl> - set ( generated_file " $ { generated_file_path } / $ { generated_file_basename } " ) <nl> - set ( cmake_dependency_file " $ { cuda_compile_intermediate_directory } / $ { generated_file_basename } . depend " ) <nl> - set ( NVCC_generated_dependency_file " $ { cuda_compile_intermediate_directory } / $ { generated_file_basename } . NVCC - depend " ) <nl> - set ( generated_cubin_file " $ { generated_file_path } / $ { generated_file_basename } . cubin . txt " ) <nl> - set ( custom_target_script " $ { cuda_compile_intermediate_directory } / $ { generated_file_basename } . cmake " ) <nl> - <nl> - # Setup properties for obj files : <nl> - if ( NOT cuda_compile_to_external_module ) <nl> - set_source_files_properties ( " $ { generated_file } " <nl> - PROPERTIES <nl> - EXTERNAL_OBJECT true # This is an object file not to be compiled , but only be linked . <nl> - ) <nl> - endif ( ) <nl> - <nl> - # Don ' t add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path . <nl> - get_filename_component ( file_path " $ { file } " PATH ) <nl> - if ( IS_ABSOLUTE " $ { file_path } " ) <nl> - set ( source_file " $ { file } " ) <nl> - else ( ) <nl> - set ( source_file " $ { CMAKE_CURRENT_SOURCE_DIR } / $ { file } " ) <nl> - endif ( ) <nl> - <nl> - if ( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION ) <nl> - list ( APPEND $ { cuda_target } _SEPARABLE_COMPILATION_OBJECTS " $ { generated_file } " ) <nl> - endif ( ) <nl> - <nl> - # Bring in the dependencies . Creates a variable CUDA_NVCC_DEPEND # # # # # # # <nl> - cuda_include_nvcc_dependencies ( $ { cmake_dependency_file } ) <nl> - <nl> - # Convience string for output # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - if ( CUDA_BUILD_EMULATION ) <nl> - set ( cuda_build_type " Emulation " ) <nl> - else ( ) <nl> - set ( cuda_build_type " Device " ) <nl> - endif ( ) <nl> - <nl> - # Build the NVCC made dependency file # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - set ( build_cubin OFF ) <nl> - if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) <nl> - if ( NOT cuda_compile_to_external_module ) <nl> - set ( build_cubin ON ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - # Configure the build script <nl> - configure_file ( " $ { CUDA_run_nvcc } " " $ { custom_target_script } " @ ONLY ) <nl> - <nl> - <nl> - # So if a user specifies the same cuda file as input more than once , you <nl> - # can have bad things happen with dependencies . Here we check an option <nl> - # to see if this is the behavior they want . <nl> - if ( CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE ) <nl> - set ( main_dep MAIN_DEPENDENCY $ { source_file } ) <nl> - else ( ) <nl> - set ( main_dep DEPENDS $ { source_file } ) <nl> - endif ( ) <nl> - <nl> - if ( CUDA_VERBOSE_BUILD ) <nl> - set ( verbose_output ON ) <nl> - elseif ( CMAKE_GENERATOR MATCHES " Makefiles " ) <nl> - set ( verbose_output " $ ( VERBOSE ) " ) <nl> - else ( ) <nl> - set ( verbose_output OFF ) <nl> - endif ( ) <nl> - <nl> - # Create up the comment string <nl> - file ( RELATIVE_PATH generated_file_relative_path " $ { CMAKE_BINARY_DIR } " " $ { generated_file } " ) <nl> - if ( cuda_compile_to_external_module ) <nl> - set ( cuda_build_comment_string " Building NVCC $ { cuda_compile_to_external_module_type } file $ { generated_file_relative_path } " ) <nl> - else ( ) <nl> - set ( cuda_build_comment_string " Building NVCC ( $ { cuda_build_type } ) object $ { generated_file_relative_path } " ) <nl> - endif ( ) <nl> - <nl> - set ( _verbatim VERBATIM ) <nl> - if ( ccbin_flags MATCHES " \ \ $ \ \ ( VCInstallDir \ \ ) " ) <nl> - set ( _verbatim " " ) <nl> - endif ( ) <nl> - <nl> - # Build the generated file and dependency file # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - add_custom_command ( <nl> - OUTPUT $ { generated_file } <nl> - # These output files depend on the source_file and the contents of cmake_dependency_file <nl> - $ { main_dep } <nl> - DEPENDS $ { CUDA_NVCC_DEPEND } <nl> - DEPENDS $ { custom_target_script } <nl> - # Make sure the output directory exists before trying to write to it . <nl> - COMMAND $ { CMAKE_COMMAND } - E make_directory " $ { generated_file_path } " <nl> - COMMAND $ { CMAKE_COMMAND } ARGS <nl> - - D verbose : BOOL = $ { verbose_output } <nl> - $ { ccbin_flags } <nl> - - D build_configuration : STRING = $ { CUDA_build_configuration } <nl> - - D " generated_file : STRING = $ { generated_file } " <nl> - - D " generated_cubin_file : STRING = $ { generated_cubin_file } " <nl> - - P " $ { custom_target_script } " <nl> - WORKING_DIRECTORY " $ { cuda_compile_intermediate_directory } " <nl> - COMMENT " $ { cuda_build_comment_string } " <nl> - $ { _verbatim } <nl> - ) <nl> - <nl> - # Make sure the build system knows the file is generated . <nl> - set_source_files_properties ( $ { generated_file } PROPERTIES GENERATED TRUE ) <nl> - <nl> - list ( APPEND _cuda_wrap_generated_files $ { generated_file } ) <nl> - <nl> - # Add the other files that we want cmake to clean on a cleanup # # # # # # # # # # <nl> - list ( APPEND CUDA_ADDITIONAL_CLEAN_FILES " $ { cmake_dependency_file } " ) <nl> - list ( REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES ) <nl> - set ( CUDA_ADDITIONAL_CLEAN_FILES $ { CUDA_ADDITIONAL_CLEAN_FILES } CACHE INTERNAL " List of intermediate files that are part of the cuda dependency scanning . " ) <nl> - <nl> - endif ( ) <nl> - endforeach ( ) <nl> - <nl> - # Set the return parameter <nl> - set ( $ { generated_files } $ { _cuda_wrap_generated_files } ) <nl> - endmacro ( ) <nl> - <nl> - function ( _cuda_get_important_host_flags important_flags flag_string ) <nl> - if ( CMAKE_GENERATOR MATCHES " Visual Studio " ) <nl> - string ( REGEX MATCHALL " / M [ DT ] [ d ] ? " flags " $ { flag_string } " ) <nl> - list ( APPEND $ { important_flags } $ { flags } ) <nl> - else ( ) <nl> - string ( REGEX MATCHALL " - fPIC " flags " $ { flag_string } " ) <nl> - list ( APPEND $ { important_flags } $ { flags } ) <nl> - endif ( ) <nl> - set ( $ { important_flags } $ { $ { important_flags } } PARENT_SCOPE ) <nl> - endfunction ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Separable Compilation Link <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - # Compute the filename to be used by CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS <nl> - function ( CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME output_file_var cuda_target object_files ) <nl> - if ( object_files ) <nl> - set ( generated_extension $ { CMAKE_ $ { CUDA_C_OR_CXX } _OUTPUT_EXTENSION } ) <nl> - set ( output_file " $ { CMAKE_CURRENT_BINARY_DIR } / CMakeFiles / $ { cuda_target } . dir / $ { CMAKE_CFG_INTDIR } / $ { cuda_target } _intermediate_link $ { generated_extension } " ) <nl> - else ( ) <nl> - set ( output_file ) <nl> - endif ( ) <nl> - <nl> - set ( $ { output_file_var } " $ { output_file } " PARENT_SCOPE ) <nl> - endfunction ( ) <nl> - <nl> - # Setup the build rule for the separable compilation intermediate link file . <nl> - function ( CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files ) <nl> - if ( object_files ) <nl> - <nl> - set_source_files_properties ( " $ { output_file } " <nl> - PROPERTIES <nl> - EXTERNAL_OBJECT TRUE # This is an object file not to be compiled , but only <nl> - # be linked . <nl> - GENERATED TRUE # This file is generated during the build <nl> - ) <nl> - <nl> - # For now we are ignoring all the configuration specific flags . <nl> - set ( nvcc_flags ) <nl> - CUDA_PARSE_NVCC_OPTIONS ( nvcc_flags $ { options } ) <nl> - if ( CUDA_64_BIT_DEVICE_CODE ) <nl> - list ( APPEND nvcc_flags - m64 ) <nl> - else ( ) <nl> - list ( APPEND nvcc_flags - m32 ) <nl> - endif ( ) <nl> - # If - ccbin , - - compiler - bindir has been specified , don ' t do anything . Otherwise add it here . <nl> - list ( FIND nvcc_flags " - ccbin " ccbin_found0 ) <nl> - list ( FIND nvcc_flags " - - compiler - bindir " ccbin_found1 ) <nl> - if ( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) <nl> - # Match VERBATIM check below . <nl> - if ( CUDA_HOST_COMPILER MATCHES " \ \ $ \ \ ( VCInstallDir \ \ ) " ) <nl> - list ( APPEND nvcc_flags - ccbin " \ " $ { CUDA_HOST_COMPILER } \ " " ) <nl> - else ( ) <nl> - list ( APPEND nvcc_flags - ccbin " $ { CUDA_HOST_COMPILER } " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - # Create a list of flags specified by CUDA_NVCC_FLAGS_ $ { CONFIG } and CMAKE_ $ { CUDA_C_OR_CXX } _FLAGS * <nl> - set ( config_specific_flags ) <nl> - set ( flags ) <nl> - foreach ( config $ { CUDA_configuration_types } ) <nl> - string ( TOUPPER $ { config } config_upper ) <nl> - # Add config specific flags <nl> - foreach ( f $ { CUDA_NVCC_FLAGS_ $ { config_upper } } ) <nl> - list ( APPEND config_specific_flags $ < $ < CONFIG : $ { config } > : $ { f } > ) <nl> - endforeach ( ) <nl> - set ( important_host_flags ) <nl> - _cuda_get_important_host_flags ( important_host_flags " $ { CMAKE_ $ { CUDA_C_OR_CXX } _FLAGS_ $ { config_upper } } " ) <nl> - foreach ( f $ { important_host_flags } ) <nl> - list ( APPEND flags $ < $ < CONFIG : $ { config } > : - Xcompiler > $ < $ < CONFIG : $ { config } > : $ { f } > ) <nl> - endforeach ( ) <nl> - endforeach ( ) <nl> - # Add CMAKE_ $ { CUDA_C_OR_CXX } _FLAGS <nl> - set ( important_host_flags ) <nl> - _cuda_get_important_host_flags ( important_host_flags " $ { CMAKE_ $ { CUDA_C_OR_CXX } _FLAGS } " ) <nl> - foreach ( f $ { important_host_flags } ) <nl> - list ( APPEND flags - Xcompiler $ { f } ) <nl> - endforeach ( ) <nl> - <nl> - # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags <nl> - set ( nvcc_flags $ { CUDA_NVCC_FLAGS } $ { config_specific_flags } $ { nvcc_flags } ) <nl> - <nl> - file ( RELATIVE_PATH output_file_relative_path " $ { CMAKE_BINARY_DIR } " " $ { output_file } " ) <nl> - <nl> - # Some generators don ' t handle the multiple levels of custom command <nl> - # dependencies correctly ( obj1 depends on file1 , obj2 depends on obj1 ) , so <nl> - # we work around that issue by compiling the intermediate link object as a <nl> - # pre - link custom command in that situation . <nl> - set ( do_obj_build_rule TRUE ) <nl> - if ( MSVC_VERSION GREATER 1599 AND MSVC_VERSION LESS 1800 ) <nl> - # VS 2010 and 2012 have this problem . <nl> - set ( do_obj_build_rule FALSE ) <nl> - endif ( ) <nl> - <nl> - set ( _verbatim VERBATIM ) <nl> - if ( nvcc_flags MATCHES " \ \ $ \ \ ( VCInstallDir \ \ ) " ) <nl> - set ( _verbatim " " ) <nl> - endif ( ) <nl> - <nl> - if ( do_obj_build_rule ) <nl> - add_custom_command ( <nl> - OUTPUT $ { output_file } <nl> - DEPENDS $ { object_files } <nl> - COMMAND $ { CUDA_NVCC_EXECUTABLE } $ { nvcc_flags } - dlink $ { object_files } - o $ { output_file } <nl> - $ { flags } <nl> - COMMENT " Building NVCC intermediate link file $ { output_file_relative_path } " <nl> - $ { _verbatim } <nl> - ) <nl> - else ( ) <nl> - get_filename_component ( output_file_dir " $ { output_file } " DIRECTORY ) <nl> - add_custom_command ( <nl> - TARGET $ { cuda_target } <nl> - PRE_LINK <nl> - COMMAND $ { CMAKE_COMMAND } - E echo " Building NVCC intermediate link file $ { output_file_relative_path } " <nl> - COMMAND $ { CMAKE_COMMAND } - E make_directory " $ { output_file_dir } " <nl> - COMMAND $ { CUDA_NVCC_EXECUTABLE } $ { nvcc_flags } $ { flags } - dlink $ { object_files } - o " $ { output_file } " <nl> - $ { _verbatim } <nl> - ) <nl> - endif ( ) <nl> - endif ( ) <nl> - endfunction ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # ADD LIBRARY <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - macro ( CUDA_ADD_LIBRARY cuda_target ) <nl> - <nl> - CUDA_ADD_CUDA_INCLUDE_ONCE ( ) <nl> - <nl> - # Separate the sources from the options <nl> - CUDA_GET_SOURCES_AND_OPTIONS ( _sources _cmake_options _options $ { ARGN } ) <nl> - CUDA_BUILD_SHARED_LIBRARY ( _cuda_shared_flag $ { ARGN } ) <nl> - # Create custom commands and targets for each file . <nl> - CUDA_WRAP_SRCS ( $ { cuda_target } OBJ _generated_files $ { _sources } <nl> - $ { _cmake_options } $ { _cuda_shared_flag } <nl> - OPTIONS $ { _options } ) <nl> - <nl> - # Compute the file name of the intermedate link file used for separable <nl> - # compilation . <nl> - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME ( link_file $ { cuda_target } " $ { $ { cuda_target } _SEPARABLE_COMPILATION_OBJECTS } " ) <nl> - <nl> - # Add the library . <nl> - add_library ( $ { cuda_target } $ { _cmake_options } <nl> - $ { _generated_files } <nl> - $ { _sources } <nl> - $ { link_file } <nl> - ) <nl> - <nl> - # Add a link phase for the separable compilation if it has been enabled . If <nl> - # it has been enabled then the $ { cuda_target } _SEPARABLE_COMPILATION_OBJECTS <nl> - # variable will have been defined . <nl> - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS ( " $ { link_file } " $ { cuda_target } " $ { _options } " " $ { $ { cuda_target } _SEPARABLE_COMPILATION_OBJECTS } " ) <nl> - <nl> - target_link_libraries ( $ { cuda_target } <nl> - $ { CUDA_LIBRARIES } <nl> - ) <nl> - <nl> - # We need to set the linker language based on what the expected generated file <nl> - # would be . CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP . <nl> - set_target_properties ( $ { cuda_target } <nl> - PROPERTIES <nl> - LINKER_LANGUAGE $ { CUDA_C_OR_CXX } <nl> - ) <nl> - <nl> - endmacro ( ) <nl> - <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # ADD EXECUTABLE <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - macro ( CUDA_ADD_EXECUTABLE cuda_target ) <nl> - <nl> - CUDA_ADD_CUDA_INCLUDE_ONCE ( ) <nl> - <nl> - # Separate the sources from the options <nl> - CUDA_GET_SOURCES_AND_OPTIONS ( _sources _cmake_options _options $ { ARGN } ) <nl> - # Create custom commands and targets for each file . <nl> - CUDA_WRAP_SRCS ( $ { cuda_target } OBJ _generated_files $ { _sources } OPTIONS $ { _options } ) <nl> - <nl> - # Compute the file name of the intermedate link file used for separable <nl> - # compilation . <nl> - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME ( link_file $ { cuda_target } " $ { $ { cuda_target } _SEPARABLE_COMPILATION_OBJECTS } " ) <nl> - <nl> - # Add the library . <nl> - add_executable ( $ { cuda_target } $ { _cmake_options } <nl> - $ { _generated_files } <nl> - $ { _sources } <nl> - $ { link_file } <nl> - ) <nl> - <nl> - # Add a link phase for the separable compilation if it has been enabled . If <nl> - # it has been enabled then the $ { cuda_target } _SEPARABLE_COMPILATION_OBJECTS <nl> - # variable will have been defined . <nl> - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS ( " $ { link_file } " $ { cuda_target } " $ { _options } " " $ { $ { cuda_target } _SEPARABLE_COMPILATION_OBJECTS } " ) <nl> - <nl> - target_link_libraries ( $ { cuda_target } <nl> - $ { CUDA_LIBRARIES } <nl> - ) <nl> - <nl> - # We need to set the linker language based on what the expected generated file <nl> - # would be . CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP . <nl> - set_target_properties ( $ { cuda_target } <nl> - PROPERTIES <nl> - LINKER_LANGUAGE $ { CUDA_C_OR_CXX } <nl> - ) <nl> - <nl> - endmacro ( ) <nl> - <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # ( Internal ) helper for manually added cuda source files with specific targets <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - macro ( cuda_compile_base cuda_target format generated_files ) <nl> - <nl> - # Separate the sources from the options <nl> - CUDA_GET_SOURCES_AND_OPTIONS ( _sources _cmake_options _options $ { ARGN } ) <nl> - # Create custom commands and targets for each file . <nl> - CUDA_WRAP_SRCS ( $ { cuda_target } $ { format } _generated_files $ { _sources } $ { _cmake_options } <nl> - OPTIONS $ { _options } ) <nl> - <nl> - set ( $ { generated_files } $ { _generated_files } ) <nl> - <nl> - endmacro ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # CUDA COMPILE <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - macro ( CUDA_COMPILE generated_files ) <nl> - cuda_compile_base ( cuda_compile OBJ $ { generated_files } $ { ARGN } ) <nl> - endmacro ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # CUDA COMPILE PTX <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - macro ( CUDA_COMPILE_PTX generated_files ) <nl> - cuda_compile_base ( cuda_compile_ptx PTX $ { generated_files } $ { ARGN } ) <nl> - endmacro ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # CUDA COMPILE FATBIN <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - macro ( CUDA_COMPILE_FATBIN generated_files ) <nl> - cuda_compile_base ( cuda_compile_fatbin FATBIN $ { generated_files } $ { ARGN } ) <nl> - endmacro ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # CUDA COMPILE CUBIN <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - macro ( CUDA_COMPILE_CUBIN generated_files ) <nl> - cuda_compile_base ( cuda_compile_cubin CUBIN $ { generated_files } $ { ARGN } ) <nl> - endmacro ( ) <nl> - <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # CUDA ADD CUFFT TO TARGET <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - macro ( CUDA_ADD_CUFFT_TO_TARGET target ) <nl> - if ( CUDA_BUILD_EMULATION ) <nl> - target_link_libraries ( $ { target } $ { CUDA_cufftemu_LIBRARY } ) <nl> - else ( ) <nl> - target_link_libraries ( $ { target } $ { CUDA_cufft_LIBRARY } ) <nl> - endif ( ) <nl> - endmacro ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # CUDA ADD CUBLAS TO TARGET <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - macro ( CUDA_ADD_CUBLAS_TO_TARGET target ) <nl> - if ( CUDA_BUILD_EMULATION ) <nl> - target_link_libraries ( $ { target } $ { CUDA_cublasemu_LIBRARY } ) <nl> - else ( ) <nl> - target_link_libraries ( $ { target } $ { CUDA_cublas_LIBRARY } $ { CUDA_cublas_device_LIBRARY } ) <nl> - endif ( ) <nl> - endmacro ( ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # CUDA BUILD CLEAN TARGET <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - macro ( CUDA_BUILD_CLEAN_TARGET ) <nl> - # Call this after you add all your CUDA targets , and you will get a convience <nl> - # target . You should also make clean after running this target to get the <nl> - # build system to generate all the code again . <nl> - <nl> - set ( cuda_clean_target_name clean_cuda_depends ) <nl> - if ( CMAKE_GENERATOR MATCHES " Visual Studio " ) <nl> - string ( TOUPPER $ { cuda_clean_target_name } cuda_clean_target_name ) <nl> - endif ( ) <nl> - add_custom_target ( $ { cuda_clean_target_name } <nl> - COMMAND $ { CMAKE_COMMAND } - E remove $ { CUDA_ADDITIONAL_CLEAN_FILES } ) <nl> - <nl> - # Clear out the variable , so the next time we configure it will be empty . <nl> - # This is useful so that the files won ' t persist in the list after targets <nl> - # have been removed . <nl> - set ( CUDA_ADDITIONAL_CLEAN_FILES " " CACHE INTERNAL " List of intermediate files that are part of the cuda dependency scanning . " ) <nl> - endmacro ( ) <nl> deleted file mode 100644 <nl> index 802f93aceb09 . . 000000000000 <nl> mmm a / cmake / FindCUDA / FindCUDA / make2cmake . cmake <nl> ppp / dev / null <nl> <nl> - # James Bigler , NVIDIA Corp ( nvidia . com - jbigler ) <nl> - # Abe Stephens , SCI Institute - - http : / / www . sci . utah . edu / ~ abe / FindCuda . html <nl> - # <nl> - # Copyright ( c ) 2008 - 2009 NVIDIA Corporation . All rights reserved . <nl> - # <nl> - # Copyright ( c ) 2007 - 2009 <nl> - # Scientific Computing and Imaging Institute , University of Utah <nl> - # <nl> - # This code is licensed under the MIT License . See the FindCUDA . cmake script <nl> - # for the text of the license . <nl> - <nl> - # The MIT License <nl> - # <nl> - # License for the specific language governing rights and limitations under <nl> - # Permission is hereby granted , free of charge , to any person obtaining a <nl> - # copy of this software and associated documentation files ( the " Software " ) , <nl> - # to deal in the Software without restriction , including without limitation <nl> - # the rights to use , copy , modify , merge , publish , distribute , sublicense , <nl> - # and / or sell copies of the Software , and to permit persons to whom the <nl> - # Software is furnished to do so , subject to the following conditions : <nl> - # <nl> - # The above copyright notice and this permission notice shall be included <nl> - # in all copies or substantial portions of the Software . <nl> - # <nl> - # THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS <nl> - # OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , <nl> - # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL <nl> - # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER <nl> - # LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING <nl> - # FROM , OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER <nl> - # DEALINGS IN THE SOFTWARE . <nl> - # <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # This converts a file written in makefile syntax into one that can be included <nl> - # by CMake . <nl> - <nl> - # Input variables <nl> - # <nl> - # verbose : BOOL = < > OFF : Be as quiet as possible ( default ) <nl> - # ON : Extra output <nl> - # <nl> - # input_file : FILEPATH = < > Path to dependecy file in makefile format <nl> - # <nl> - # output_file : FILEPATH = < > Path to file with dependencies in CMake readable variable <nl> - # <nl> - <nl> - file ( READ $ { input_file } depend_text ) <nl> - <nl> - if ( NOT " $ { depend_text } " STREQUAL " " ) <nl> - <nl> - # message ( " FOUND DEPENDS " ) <nl> - <nl> - string ( REPLACE " \ \ " " " depend_text $ { depend_text } ) <nl> - <nl> - # This works for the nvcc - M generated dependency files . <nl> - string ( REGEX REPLACE " ^ . * : " " " depend_text $ { depend_text } ) <nl> - string ( REGEX REPLACE " [ \ \ \ \ ] * \ n " " ; " depend_text $ { depend_text } ) <nl> - <nl> - set ( dependency_list " " ) <nl> - <nl> - foreach ( file $ { depend_text } ) <nl> - <nl> - string ( REGEX REPLACE " ^ + " " " file $ { file } ) <nl> - <nl> - # OK , now if we had a UNC path , nvcc has a tendency to only output the first ' / ' <nl> - # instead of ' / / ' . Here we will test to see if the file exists , if it doesn ' t then <nl> - # try to prepend another ' / ' to the path and test again . If it still fails remove the <nl> - # path . <nl> - <nl> - if ( NOT EXISTS " $ { file } " ) <nl> - if ( EXISTS " / $ { file } " ) <nl> - set ( file " / $ { file } " ) <nl> - else ( ) <nl> - if ( verbose ) <nl> - message ( WARNING " Removing non - existent dependency file : $ { file } " ) <nl> - endif ( ) <nl> - set ( file " " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - # Make sure we check to see if we have a file , before asking if it is not a directory . <nl> - # if ( NOT IS_DIRECTORY " " ) will return TRUE . <nl> - if ( file AND NOT IS_DIRECTORY " $ { file } " ) <nl> - # If softlinks start to matter , we should change this to REALPATH . For now we need <nl> - # to flatten paths , because nvcc can generate stuff like / bin / . . / include instead of <nl> - # just / include . <nl> - get_filename_component ( file_absolute " $ { file } " ABSOLUTE ) <nl> - list ( APPEND dependency_list " $ { file_absolute } " ) <nl> - endif ( ) <nl> - <nl> - endforeach ( ) <nl> - <nl> - else ( ) <nl> - # message ( " FOUND NO DEPENDS " ) <nl> - endif ( ) <nl> - <nl> - # Remove the duplicate entries and sort them . <nl> - list ( REMOVE_DUPLICATES dependency_list ) <nl> - list ( SORT dependency_list ) <nl> - <nl> - foreach ( file $ { dependency_list } ) <nl> - set ( cuda_nvcc_depend " $ { cuda_nvcc_depend } \ " $ { file } \ " \ n " ) <nl> - endforeach ( ) <nl> - <nl> - file ( WRITE $ { output_file } " # Generated by : make2cmake . cmake \ nSET ( CUDA_NVCC_DEPEND \ n $ { cuda_nvcc_depend } ) \ n \ n " ) <nl> deleted file mode 100644 <nl> index 626c8a2e47d3 . . 000000000000 <nl> mmm a / cmake / FindCUDA / FindCUDA / parse_cubin . cmake <nl> ppp / dev / null <nl> <nl> - # James Bigler , NVIDIA Corp ( nvidia . com - jbigler ) <nl> - # Abe Stephens , SCI Institute - - http : / / www . sci . utah . edu / ~ abe / FindCuda . html <nl> - # <nl> - # Copyright ( c ) 2008 - 2009 NVIDIA Corporation . All rights reserved . <nl> - # <nl> - # Copyright ( c ) 2007 - 2009 <nl> - # Scientific Computing and Imaging Institute , University of Utah <nl> - # <nl> - # This code is licensed under the MIT License . See the FindCUDA . cmake script <nl> - # for the text of the license . <nl> - <nl> - # The MIT License <nl> - # <nl> - # License for the specific language governing rights and limitations under <nl> - # Permission is hereby granted , free of charge , to any person obtaining a <nl> - # copy of this software and associated documentation files ( the " Software " ) , <nl> - # to deal in the Software without restriction , including without limitation <nl> - # the rights to use , copy , modify , merge , publish , distribute , sublicense , <nl> - # and / or sell copies of the Software , and to permit persons to whom the <nl> - # Software is furnished to do so , subject to the following conditions : <nl> - # <nl> - # The above copyright notice and this permission notice shall be included <nl> - # in all copies or substantial portions of the Software . <nl> - # <nl> - # THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS <nl> - # OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , <nl> - # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL <nl> - # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER <nl> - # LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING <nl> - # FROM , OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER <nl> - # DEALINGS IN THE SOFTWARE . <nl> - # <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Parses a . cubin file produced by nvcc and reports statistics about the file . <nl> - <nl> - <nl> - file ( READ $ { input_file } file_text ) <nl> - <nl> - if ( NOT " $ { file_text } " STREQUAL " " ) <nl> - <nl> - string ( REPLACE " ; " " \ \ ; " file_text $ { file_text } ) <nl> - string ( REPLACE " \ ncode " " ; code " file_text $ { file_text } ) <nl> - <nl> - list ( LENGTH file_text len ) <nl> - <nl> - foreach ( line $ { file_text } ) <nl> - <nl> - # Only look at " code { } " blocks . <nl> - if ( line MATCHES " ^ code " ) <nl> - <nl> - # Break into individual lines . <nl> - string ( REGEX REPLACE " \ n " " ; " line $ { line } ) <nl> - <nl> - foreach ( entry $ { line } ) <nl> - <nl> - # Extract kernel names . <nl> - if ( $ { entry } MATCHES " [ ^ g ] name = ( [ ^ ] + ) " ) <nl> - set ( entry " $ { CMAKE_MATCH_1 } " ) <nl> - <nl> - # Check to see if the kernel name starts with " _ " <nl> - set ( skip FALSE ) <nl> - # if ( $ { entry } MATCHES " ^ _ " ) <nl> - # Skip the rest of this block . <nl> - # message ( " Skipping $ { entry } " ) <nl> - # set ( skip TRUE ) <nl> - # else ( ) <nl> - message ( " Kernel : $ { entry } " ) <nl> - # endif ( ) <nl> - <nl> - endif ( ) <nl> - <nl> - # Skip the rest of the block if necessary <nl> - if ( NOT skip ) <nl> - <nl> - # Registers <nl> - if ( $ { entry } MATCHES " reg ( [ ] + ) = ( [ ] + ) ( [ ^ ] + ) " ) <nl> - set ( entry " $ { CMAKE_MATCH_3 } " ) <nl> - message ( " Registers : $ { entry } " ) <nl> - endif ( ) <nl> - <nl> - # Local memory <nl> - if ( $ { entry } MATCHES " lmem ( [ ] + ) = ( [ ] + ) ( [ ^ ] + ) " ) <nl> - set ( entry " $ { CMAKE_MATCH_3 } " ) <nl> - message ( " Local : $ { entry } " ) <nl> - endif ( ) <nl> - <nl> - # Shared memory <nl> - if ( $ { entry } MATCHES " smem ( [ ] + ) = ( [ ] + ) ( [ ^ ] + ) " ) <nl> - set ( entry " $ { CMAKE_MATCH_3 } " ) <nl> - message ( " Shared : $ { entry } " ) <nl> - endif ( ) <nl> - <nl> - if ( $ { entry } MATCHES " ^ } " ) <nl> - message ( " " ) <nl> - endif ( ) <nl> - <nl> - endif ( ) <nl> - <nl> - <nl> - endforeach ( ) <nl> - <nl> - endif ( ) <nl> - <nl> - endforeach ( ) <nl> - <nl> - else ( ) <nl> - # message ( " FOUND NO DEPENDS " ) <nl> - endif ( ) <nl> - <nl> - <nl> deleted file mode 100644 <nl> index 12b83e0d2b7f . . 000000000000 <nl> mmm a / cmake / FindCUDA / FindCUDA / run_nvcc . cmake <nl> ppp / dev / null <nl> <nl> - # James Bigler , NVIDIA Corp ( nvidia . com - jbigler ) <nl> - # <nl> - # Copyright ( c ) 2008 - 2009 NVIDIA Corporation . All rights reserved . <nl> - # <nl> - # This code is licensed under the MIT License . See the FindCUDA . cmake script <nl> - # for the text of the license . <nl> - <nl> - # The MIT License <nl> - # <nl> - # License for the specific language governing rights and limitations under <nl> - # Permission is hereby granted , free of charge , to any person obtaining a <nl> - # copy of this software and associated documentation files ( the " Software " ) , <nl> - # to deal in the Software without restriction , including without limitation <nl> - # the rights to use , copy , modify , merge , publish , distribute , sublicense , <nl> - # and / or sell copies of the Software , and to permit persons to whom the <nl> - # Software is furnished to do so , subject to the following conditions : <nl> - # <nl> - # The above copyright notice and this permission notice shall be included <nl> - # in all copies or substantial portions of the Software . <nl> - # <nl> - # THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS <nl> - # OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , <nl> - # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL <nl> - # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER <nl> - # LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING <nl> - # FROM , OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER <nl> - # DEALINGS IN THE SOFTWARE . <nl> - <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # This file runs the nvcc commands to produce the desired output file along with <nl> - # the dependency file needed by CMake to compute dependencies . In addition the <nl> - # file checks the output of each command and if the command fails it deletes the <nl> - # output files . <nl> - <nl> - # Input variables <nl> - # <nl> - # verbose : BOOL = < > OFF : Be as quiet as possible ( default ) <nl> - # ON : Describe each step <nl> - # <nl> - # build_configuration : STRING = < > Typically one of Debug , MinSizeRel , Release , or <nl> - # RelWithDebInfo , but it should match one of the <nl> - # entries in CUDA_HOST_FLAGS . This is the build <nl> - # configuration used when compiling the code . If <nl> - # blank or unspecified Debug is assumed as this is <nl> - # what CMake does . <nl> - # <nl> - # generated_file : STRING = < > File to generate . This argument must be passed in . <nl> - # <nl> - # generated_cubin_file : STRING = < > File to generate . This argument must be passed <nl> - # in if build_cubin is true . <nl> - <nl> - if ( NOT generated_file ) <nl> - message ( FATAL_ERROR " You must specify generated_file on the command line " ) <nl> - endif ( ) <nl> - <nl> - # Set these up as variables to make reading the generated file easier <nl> - set ( CMAKE_COMMAND " @ CMAKE_COMMAND @ " ) # path <nl> - set ( source_file " @ source_file @ " ) # path <nl> - set ( NVCC_generated_dependency_file " @ NVCC_generated_dependency_file @ " ) # path <nl> - set ( cmake_dependency_file " @ cmake_dependency_file @ " ) # path <nl> - set ( CUDA_make2cmake " @ CUDA_make2cmake @ " ) # path <nl> - set ( CUDA_parse_cubin " @ CUDA_parse_cubin @ " ) # path <nl> - set ( build_cubin @ build_cubin @ ) # bool <nl> - set ( CUDA_HOST_COMPILER " @ CUDA_HOST_COMPILER @ " ) # path <nl> - # We won ' t actually use these variables for now , but we need to set this , in <nl> - # order to force this file to be run again if it changes . <nl> - set ( generated_file_path " @ generated_file_path @ " ) # path <nl> - set ( generated_file_internal " @ generated_file @ " ) # path <nl> - set ( generated_cubin_file_internal " @ generated_cubin_file @ " ) # path <nl> - <nl> - set ( CUDA_NVCC_EXECUTABLE " @ CUDA_NVCC_EXECUTABLE @ " ) # path <nl> - set ( CUDA_NVCC_FLAGS @ CUDA_NVCC_FLAGS @ ; ; @ CUDA_WRAP_OPTION_NVCC_FLAGS @ ) # list <nl> - @ CUDA_NVCC_FLAGS_CONFIG @ <nl> - set ( nvcc_flags @ nvcc_flags @ ) # list <nl> - set ( CUDA_NVCC_INCLUDE_ARGS " @ CUDA_NVCC_INCLUDE_ARGS @ " ) # list ( needs to be in quotes to handle spaces properly ) . <nl> - set ( format_flag " @ format_flag @ " ) # string <nl> - set ( cuda_language_flag @ cuda_language_flag @ ) # list <nl> - <nl> - if ( build_cubin AND NOT generated_cubin_file ) <nl> - message ( FATAL_ERROR " You must specify generated_cubin_file on the command line " ) <nl> - endif ( ) <nl> - <nl> - # This is the list of host compilation flags . It C or CXX should already have <nl> - # been chosen by FindCUDA . cmake . <nl> - @ CUDA_HOST_FLAGS @ <nl> - <nl> - # Take the compiler flags and package them up to be sent to the compiler via - Xcompiler <nl> - set ( nvcc_host_compiler_flags " " ) <nl> - # If we weren ' t given a build_configuration , use Debug . <nl> - if ( NOT build_configuration ) <nl> - set ( build_configuration Debug ) <nl> - endif ( ) <nl> - string ( TOUPPER " $ { build_configuration } " build_configuration ) <nl> - # message ( " CUDA_NVCC_HOST_COMPILER_FLAGS = $ { CUDA_NVCC_HOST_COMPILER_FLAGS } " ) <nl> - foreach ( flag $ { CMAKE_HOST_FLAGS } $ { CMAKE_HOST_FLAGS_ $ { build_configuration } } ) <nl> - # Extra quotes are added around each flag to help nvcc parse out flags with spaces . <nl> - set ( nvcc_host_compiler_flags " $ { nvcc_host_compiler_flags } , \ " $ { flag } \ " " ) <nl> - endforeach ( ) <nl> - if ( nvcc_host_compiler_flags ) <nl> - set ( nvcc_host_compiler_flags " - Xcompiler " $ { nvcc_host_compiler_flags } ) <nl> - endif ( ) <nl> - # message ( " nvcc_host_compiler_flags = \ " $ { nvcc_host_compiler_flags } \ " " ) <nl> - # Add the build specific configuration flags <nl> - list ( APPEND CUDA_NVCC_FLAGS $ { CUDA_NVCC_FLAGS_ $ { build_configuration } } ) <nl> - <nl> - # Any - ccbin existing in CUDA_NVCC_FLAGS gets highest priority <nl> - list ( FIND CUDA_NVCC_FLAGS " - ccbin " ccbin_found0 ) <nl> - list ( FIND CUDA_NVCC_FLAGS " - - compiler - bindir " ccbin_found1 ) <nl> - if ( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) <nl> - if ( CUDA_HOST_COMPILER STREQUAL " $ ( VCInstallDir ) bin " AND DEFINED CCBIN ) <nl> - set ( CCBIN - ccbin " $ { CCBIN } " ) <nl> - else ( ) <nl> - set ( CCBIN - ccbin " $ { CUDA_HOST_COMPILER } " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - # cuda_execute_process - Executes a command with optional command echo and status message . <nl> - # <nl> - # status - Status message to print if verbose is true <nl> - # command - COMMAND argument from the usual execute_process argument structure <nl> - # ARGN - Remaining arguments are the command with arguments <nl> - # <nl> - # CUDA_result - return value from running the command <nl> - # <nl> - # Make this a macro instead of a function , so that things like RESULT_VARIABLE <nl> - # and other return variables are present after executing the process . <nl> - macro ( cuda_execute_process status command ) <nl> - set ( _command $ { command } ) <nl> - if ( NOT " x $ { _command } " STREQUAL " xCOMMAND " ) <nl> - message ( FATAL_ERROR " Malformed call to cuda_execute_process . Missing COMMAND as second argument . ( command = $ { command } ) " ) <nl> - endif ( ) <nl> - if ( verbose ) <nl> - execute_process ( COMMAND " $ { CMAKE_COMMAND } " - E echo - - $ { status } ) <nl> - # Now we need to build up our command string . We are accounting for quotes <nl> - # and spaces , anything else is left up to the user to fix if they want to <nl> - # copy and paste a runnable command line . <nl> - set ( cuda_execute_process_string ) <nl> - foreach ( arg $ { ARGN } ) <nl> - # If there are quotes , excape them , so they come through . <nl> - string ( REPLACE " \ " " " \ \ \ " " arg $ { arg } ) <nl> - # Args with spaces need quotes around them to get them to be parsed as a single argument . <nl> - if ( arg MATCHES " " ) <nl> - list ( APPEND cuda_execute_process_string " \ " $ { arg } \ " " ) <nl> - else ( ) <nl> - list ( APPEND cuda_execute_process_string $ { arg } ) <nl> - endif ( ) <nl> - endforeach ( ) <nl> - # Echo the command <nl> - execute_process ( COMMAND $ { CMAKE_COMMAND } - E echo $ { cuda_execute_process_string } ) <nl> - endif ( ) <nl> - # Run the command <nl> - execute_process ( COMMAND $ { ARGN } RESULT_VARIABLE CUDA_result ) <nl> - endmacro ( ) <nl> - <nl> - # Delete the target file <nl> - cuda_execute_process ( <nl> - " Removing $ { generated_file } " <nl> - COMMAND " $ { CMAKE_COMMAND } " - E remove " $ { generated_file } " <nl> - ) <nl> - <nl> - # For CUDA 2 . 3 and below , - G - M doesn ' t work , so remove the - G flag <nl> - # for dependency generation and hope for the best . <nl> - set ( depends_CUDA_NVCC_FLAGS " $ { CUDA_NVCC_FLAGS } " ) <nl> - set ( CUDA_VERSION @ CUDA_VERSION @ ) <nl> - if ( CUDA_VERSION VERSION_LESS " 3 . 0 " ) <nl> - cmake_policy ( PUSH ) <nl> - # CMake policy 0007 NEW states that empty list elements are not <nl> - # ignored . I ' m just setting it to avoid the warning that ' s printed . <nl> - cmake_policy ( SET CMP0007 NEW ) <nl> - # Note that this will remove all occurances of - G . <nl> - list ( REMOVE_ITEM depends_CUDA_NVCC_FLAGS " - G " ) <nl> - cmake_policy ( POP ) <nl> - endif ( ) <nl> - <nl> - # nvcc doesn ' t define __CUDACC__ for some reason when generating dependency files . This <nl> - # can cause incorrect dependencies when # including files based on this macro which is <nl> - # defined in the generating passes of nvcc invokation . We will go ahead and manually <nl> - # define this for now until a future version fixes this bug . <nl> - set ( CUDACC_DEFINE - D__CUDACC__ ) <nl> - <nl> - # Generate the dependency file <nl> - cuda_execute_process ( <nl> - " Generating dependency file : $ { NVCC_generated_dependency_file } " <nl> - COMMAND " $ { CUDA_NVCC_EXECUTABLE } " <nl> - - M <nl> - $ { CUDACC_DEFINE } <nl> - " $ { source_file } " <nl> - - o " $ { NVCC_generated_dependency_file } " <nl> - $ { CCBIN } <nl> - $ { nvcc_flags } <nl> - $ { nvcc_host_compiler_flags } <nl> - $ { depends_CUDA_NVCC_FLAGS } <nl> - - DNVCC <nl> - $ { CUDA_NVCC_INCLUDE_ARGS } <nl> - ) <nl> - <nl> - if ( CUDA_result ) <nl> - message ( FATAL_ERROR " Error generating $ { generated_file } " ) <nl> - endif ( ) <nl> - <nl> - # Generate the cmake readable dependency file to a temp file . Don ' t put the <nl> - # quotes just around the filenames for the input_file and output_file variables . <nl> - # CMake will pass the quotes through and not be able to find the file . <nl> - cuda_execute_process ( <nl> - " Generating temporary cmake readable file : $ { cmake_dependency_file } . tmp " <nl> - COMMAND " $ { CMAKE_COMMAND } " <nl> - - D " input_file : FILEPATH = $ { NVCC_generated_dependency_file } " <nl> - - D " output_file : FILEPATH = $ { cmake_dependency_file } . tmp " <nl> - - D " verbose = $ { verbose } " <nl> - - P " $ { CUDA_make2cmake } " <nl> - ) <nl> - <nl> - if ( CUDA_result ) <nl> - message ( FATAL_ERROR " Error generating $ { generated_file } " ) <nl> - endif ( ) <nl> - <nl> - # Copy the file if it is different <nl> - cuda_execute_process ( <nl> - " Copy if different $ { cmake_dependency_file } . tmp to $ { cmake_dependency_file } " <nl> - COMMAND " $ { CMAKE_COMMAND } " - E copy_if_different " $ { cmake_dependency_file } . tmp " " $ { cmake_dependency_file } " <nl> - ) <nl> - <nl> - if ( CUDA_result ) <nl> - message ( FATAL_ERROR " Error generating $ { generated_file } " ) <nl> - endif ( ) <nl> - <nl> - # Delete the temporary file <nl> - cuda_execute_process ( <nl> - " Removing $ { cmake_dependency_file } . tmp and $ { NVCC_generated_dependency_file } " <nl> - COMMAND " $ { CMAKE_COMMAND } " - E remove " $ { cmake_dependency_file } . tmp " " $ { NVCC_generated_dependency_file } " <nl> - ) <nl> - <nl> - if ( CUDA_result ) <nl> - message ( FATAL_ERROR " Error generating $ { generated_file } " ) <nl> - endif ( ) <nl> - <nl> - # Generate the code <nl> - cuda_execute_process ( <nl> - " Generating $ { generated_file } " <nl> - COMMAND " $ { CUDA_NVCC_EXECUTABLE } " <nl> - " $ { source_file } " <nl> - $ { cuda_language_flag } <nl> - $ { format_flag } - o " $ { generated_file } " <nl> - $ { CCBIN } <nl> - $ { nvcc_flags } <nl> - $ { nvcc_host_compiler_flags } <nl> - $ { CUDA_NVCC_FLAGS } <nl> - - DNVCC <nl> - $ { CUDA_NVCC_INCLUDE_ARGS } <nl> - ) <nl> - <nl> - if ( CUDA_result ) <nl> - # Since nvcc can sometimes leave half done files make sure that we delete the output file . <nl> - cuda_execute_process ( <nl> - " Removing $ { generated_file } " <nl> - COMMAND " $ { CMAKE_COMMAND } " - E remove " $ { generated_file } " <nl> - ) <nl> - message ( FATAL_ERROR " Error generating file $ { generated_file } " ) <nl> - else ( ) <nl> - if ( verbose ) <nl> - message ( " Generated $ { generated_file } successfully . " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - # Cubin resource report commands . <nl> - if ( build_cubin ) <nl> - # Run with - cubin to produce resource usage report . <nl> - cuda_execute_process ( <nl> - " Generating $ { generated_cubin_file } " <nl> - COMMAND " $ { CUDA_NVCC_EXECUTABLE } " <nl> - " $ { source_file } " <nl> - $ { CUDA_NVCC_FLAGS } <nl> - $ { nvcc_flags } <nl> - $ { CCBIN } <nl> - $ { nvcc_host_compiler_flags } <nl> - - DNVCC <nl> - - cubin <nl> - - o " $ { generated_cubin_file } " <nl> - $ { CUDA_NVCC_INCLUDE_ARGS } <nl> - ) <nl> - <nl> - # Execute the parser script . <nl> - cuda_execute_process ( <nl> - " Executing the parser script " <nl> - COMMAND " $ { CMAKE_COMMAND } " <nl> - - D " input_file : STRING = $ { generated_cubin_file } " <nl> - - P " $ { CUDA_parse_cubin } " <nl> - ) <nl> - <nl> - endif ( ) <nl> deleted file mode 100644 <nl> index 5e79cdb144f9 . . 000000000000 <nl> mmm a / cmake / FindCUDA / FindCUDA / select_compute_arch . cmake <nl> ppp / dev / null <nl> <nl> - # Synopsis : <nl> - # CUDA_SELECT_NVCC_ARCH_FLAGS ( out_variable [ target_CUDA_architectures ] ) <nl> - # - - Selects GPU arch flags for nvcc based on target_CUDA_architectures <nl> - # target_CUDA_architectures : Auto | Common | All | LIST ( ARCH_AND_PTX . . . ) <nl> - # - " Auto " detects local machine GPU compute arch at runtime . <nl> - # - " Common " and " All " cover common and entire subsets of architectures <nl> - # ARCH_AND_PTX : NAME | NUM . NUM | NUM . NUM ( NUM . NUM ) | NUM . NUM + PTX <nl> - # NAME : Fermi Kepler Maxwell Kepler + Tegra Kepler + Tesla Maxwell + Tegra Pascal <nl> - # NUM : Any number . Only those pairs are currently accepted by NVCC though : <nl> - # 2 . 0 2 . 1 3 . 0 3 . 2 3 . 5 3 . 7 5 . 0 5 . 2 5 . 3 6 . 0 6 . 2 <nl> - # Returns LIST of flags to be added to CUDA_NVCC_FLAGS in $ { out_variable } <nl> - # Additionally , sets $ { out_variable } _readable to the resulting numeric list <nl> - # Example : <nl> - # CUDA_SELECT_NVCC_ARCH_FLAGS ( ARCH_FLAGS 3 . 0 3 . 5 + PTX 5 . 2 ( 5 . 0 ) Maxwell ) <nl> - # LIST ( APPEND CUDA_NVCC_FLAGS $ { ARCH_FLAGS } ) <nl> - # <nl> - # More info on CUDA architectures : https : / / en . wikipedia . org / wiki / CUDA <nl> - # <nl> - <nl> - # This list will be used for CUDA_ARCH_NAME = All option <nl> - set ( CUDA_KNOWN_GPU_ARCHITECTURES " Fermi " " Kepler " " Maxwell " ) <nl> - <nl> - # This list will be used for CUDA_ARCH_NAME = Common option ( enabled by default ) <nl> - set ( CUDA_COMMON_GPU_ARCHITECTURES " 3 . 0 " " 3 . 5 " " 5 . 0 " ) <nl> - <nl> - if ( CUDA_VERSION VERSION_GREATER " 6 . 5 " ) <nl> - list ( APPEND CUDA_KNOWN_GPU_ARCHITECTURES " Kepler + Tegra " " Kepler + Tesla " " Maxwell + Tegra " ) <nl> - list ( APPEND CUDA_COMMON_GPU_ARCHITECTURES " 5 . 2 " ) <nl> - endif ( ) <nl> - <nl> - if ( CUDA_VERSION VERSION_GREATER " 7 . 5 " ) <nl> - list ( APPEND CUDA_KNOWN_GPU_ARCHITECTURES " Pascal " ) <nl> - list ( APPEND CUDA_COMMON_GPU_ARCHITECTURES " 6 . 0 " " 6 . 1 " " 6 . 1 + PTX " ) <nl> - else ( ) <nl> - list ( APPEND CUDA_COMMON_GPU_ARCHITECTURES " 5 . 2 + PTX " ) <nl> - endif ( ) <nl> - <nl> - <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # A function for automatic detection of GPUs installed ( if autodetection is enabled ) <nl> - # Usage : <nl> - # CUDA_DETECT_INSTALLED_GPUS ( OUT_VARIABLE ) <nl> - # <nl> - function ( CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE ) <nl> - if ( NOT CUDA_GPU_DETECT_OUTPUT ) <nl> - set ( cufile $ { PROJECT_BINARY_DIR } / detect_cuda_archs . cu ) <nl> - <nl> - file ( WRITE $ { cufile } " " <nl> - " # include < cstdio > \ n " <nl> - " int main ( ) \ n " <nl> - " { \ n " <nl> - " int count = 0 ; \ n " <nl> - " if ( cudaSuccess ! = cudaGetDeviceCount ( & count ) ) return - 1 ; \ n " <nl> - " if ( count = = 0 ) return - 1 ; \ n " <nl> - " for ( int device = 0 ; device < count ; + + device ) \ n " <nl> - " { \ n " <nl> - " cudaDeviceProp prop ; \ n " <nl> - " if ( cudaSuccess = = cudaGetDeviceProperties ( & prop , device ) ) \ n " <nl> - " std : : printf ( \ " % d . % d \ " , prop . major , prop . minor ) ; \ n " <nl> - " } \ n " <nl> - " return 0 ; \ n " <nl> - " } \ n " ) <nl> - <nl> - if ( MSVC AND NOT " $ { CMAKE_C_COMPILER } " MATCHES " / cl . exe " ) <nl> - find_program ( REAL_MSVC_COMPILER cl . exe ) <nl> - set ( CCBIN " $ { REAL_MSVC_COMPILER } " ) <nl> - else ( ) <nl> - set ( CCBIN " $ { CMAKE_C_COMPILER } " ) <nl> - endif ( ) <nl> - <nl> - execute_process ( COMMAND " $ { CUDA_NVCC_EXECUTABLE } " " - - run " " $ { cufile } " <nl> - " - ccbin " $ { CCBIN } <nl> - WORKING_DIRECTORY " $ { PROJECT_BINARY_DIR } / CMakeFiles / " <nl> - RESULT_VARIABLE nvcc_res OUTPUT_VARIABLE nvcc_out <nl> - ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ) <nl> - <nl> - if ( nvcc_res EQUAL 0 ) <nl> - # only keep the last line of nvcc_out <nl> - STRING ( REGEX REPLACE " ; " " \ \ \ \ ; " nvcc_out " $ { nvcc_out } " ) <nl> - STRING ( REGEX REPLACE " \ n " " ; " nvcc_out " $ { nvcc_out } " ) <nl> - list ( GET nvcc_out - 1 nvcc_out ) <nl> - string ( REPLACE " 2 . 1 " " 2 . 1 ( 2 . 0 ) " nvcc_out " $ { nvcc_out } " ) <nl> - set ( CUDA_GPU_DETECT_OUTPUT $ { nvcc_out } CACHE INTERNAL " Returned GPU architetures from detect_gpus tool " FORCE ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - if ( NOT CUDA_GPU_DETECT_OUTPUT ) <nl> - message ( STATUS " Automatic GPU detection failed . Building for common architectures . " ) <nl> - set ( $ { OUT_VARIABLE } $ { CUDA_COMMON_GPU_ARCHITECTURES } PARENT_SCOPE ) <nl> - else ( ) <nl> - set ( $ { OUT_VARIABLE } $ { CUDA_GPU_DETECT_OUTPUT } PARENT_SCOPE ) <nl> - endif ( ) <nl> - endfunction ( ) <nl> - <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Function for selecting GPU arch flags for nvcc based on CUDA architectures from parameter list <nl> - # Usage : <nl> - # SELECT_NVCC_ARCH_FLAGS ( out_variable [ list of CUDA compute archs ] ) <nl> - function ( CUDA_SELECT_NVCC_ARCH_FLAGS out_variable ) <nl> - set ( CUDA_ARCH_LIST " $ { ARGN } " ) <nl> - <nl> - if ( " X $ { CUDA_ARCH_LIST } " STREQUAL " X " ) <nl> - set ( CUDA_ARCH_LIST " Auto " ) <nl> - endif ( ) <nl> - <nl> - set ( cuda_arch_bin ) <nl> - set ( cuda_arch_ptx ) <nl> - <nl> - if ( " $ { CUDA_ARCH_LIST } " STREQUAL " All " ) <nl> - set ( CUDA_ARCH_LIST $ { CUDA_KNOWN_GPU_ARCHITECTURES } ) <nl> - elseif ( " $ { CUDA_ARCH_LIST } " STREQUAL " Common " ) <nl> - set ( CUDA_ARCH_LIST $ { CUDA_COMMON_GPU_ARCHITECTURES } ) <nl> - elseif ( " $ { CUDA_ARCH_LIST } " STREQUAL " Auto " ) <nl> - CUDA_DETECT_INSTALLED_GPUS ( CUDA_ARCH_LIST ) <nl> - message ( STATUS " Autodetected CUDA architecture ( s ) : $ { CUDA_ARCH_LIST } " ) <nl> - endif ( ) <nl> - <nl> - # Now process the list and look for names <nl> - string ( REGEX REPLACE " [ \ t ] + " " ; " CUDA_ARCH_LIST " $ { CUDA_ARCH_LIST } " ) <nl> - list ( REMOVE_DUPLICATES CUDA_ARCH_LIST ) <nl> - foreach ( arch_name $ { CUDA_ARCH_LIST } ) <nl> - set ( arch_bin ) <nl> - set ( add_ptx FALSE ) <nl> - # Check to see if we are compiling PTX <nl> - if ( arch_name MATCHES " ( . * ) \ \ + PTX $ " ) <nl> - set ( add_ptx TRUE ) <nl> - set ( arch_name $ { CMAKE_MATCH_1 } ) <nl> - endif ( ) <nl> - if ( arch_name MATCHES " ( ^ [ 0 - 9 ] \ \ . [ 0 - 9 ] ( \ \ ( [ 0 - 9 ] \ \ . [ 0 - 9 ] \ \ ) ) ? ) $ " ) <nl> - set ( arch_bin $ { CMAKE_MATCH_1 } ) <nl> - set ( arch_ptx $ { arch_bin } ) <nl> - else ( ) <nl> - # Look for it in our list of known architectures <nl> - if ( $ { arch_name } STREQUAL " Fermi " ) <nl> - set ( arch_bin " 2 . 0 2 . 1 ( 2 . 0 ) " ) <nl> - elseif ( $ { arch_name } STREQUAL " Kepler + Tegra " ) <nl> - set ( arch_bin 3 . 2 ) <nl> - elseif ( $ { arch_name } STREQUAL " Kepler + Tesla " ) <nl> - set ( arch_bin 3 . 7 ) <nl> - elseif ( $ { arch_name } STREQUAL " Kepler " ) <nl> - set ( arch_bin 3 . 0 3 . 5 ) <nl> - set ( arch_ptx 3 . 5 ) <nl> - elseif ( $ { arch_name } STREQUAL " Maxwell + Tegra " ) <nl> - set ( arch_bin 5 . 3 ) <nl> - elseif ( $ { arch_name } STREQUAL " Maxwell " ) <nl> - set ( arch_bin 5 . 0 5 . 2 ) <nl> - set ( arch_ptx 5 . 2 ) <nl> - elseif ( $ { arch_name } STREQUAL " Pascal " ) <nl> - set ( arch_bin 6 . 0 6 . 1 ) <nl> - set ( arch_ptx 6 . 1 ) <nl> - else ( ) <nl> - message ( SEND_ERROR " Unknown CUDA Architecture Name $ { arch_name } in CUDA_SELECT_NVCC_ARCH_FLAGS " ) <nl> - endif ( ) <nl> - endif ( ) <nl> - if ( NOT arch_bin ) <nl> - message ( SEND_ERROR " arch_bin wasn ' t set for some reason " ) <nl> - endif ( ) <nl> - list ( APPEND cuda_arch_bin $ { arch_bin } ) <nl> - if ( add_ptx ) <nl> - if ( NOT arch_ptx ) <nl> - set ( arch_ptx $ { arch_bin } ) <nl> - endif ( ) <nl> - list ( APPEND cuda_arch_ptx $ { arch_ptx } ) <nl> - endif ( ) <nl> - endforeach ( ) <nl> - <nl> - # remove dots and convert to lists <nl> - string ( REGEX REPLACE " \ \ . " " " cuda_arch_bin " $ { cuda_arch_bin } " ) <nl> - string ( REGEX REPLACE " \ \ . " " " cuda_arch_ptx " $ { cuda_arch_ptx } " ) <nl> - string ( REGEX MATCHALL " [ 0 - 9 ( ) ] + " cuda_arch_bin " $ { cuda_arch_bin } " ) <nl> - string ( REGEX MATCHALL " [ 0 - 9 ] + " cuda_arch_ptx " $ { cuda_arch_ptx } " ) <nl> - <nl> - if ( cuda_arch_bin ) <nl> - list ( REMOVE_DUPLICATES cuda_arch_bin ) <nl> - endif ( ) <nl> - if ( cuda_arch_ptx ) <nl> - list ( REMOVE_DUPLICATES cuda_arch_ptx ) <nl> - endif ( ) <nl> - <nl> - set ( nvcc_flags " " ) <nl> - set ( nvcc_archs_readable " " ) <nl> - <nl> - # Tell NVCC to add binaries for the specified GPUs <nl> - foreach ( arch $ { cuda_arch_bin } ) <nl> - if ( arch MATCHES " ( [ 0 - 9 ] + ) \ \ ( ( [ 0 - 9 ] + ) \ \ ) " ) <nl> - # User explicitly specified ARCH for the concrete CODE <nl> - list ( APPEND nvcc_flags - gencode arch = compute_ $ { CMAKE_MATCH_2 } , code = sm_ $ { CMAKE_MATCH_1 } ) <nl> - list ( APPEND nvcc_archs_readable sm_ $ { CMAKE_MATCH_1 } ) <nl> - else ( ) <nl> - # User didn ' t explicitly specify ARCH for the concrete CODE , we assume ARCH = CODE <nl> - list ( APPEND nvcc_flags - gencode arch = compute_ $ { arch } , code = sm_ $ { arch } ) <nl> - list ( APPEND nvcc_archs_readable sm_ $ { arch } ) <nl> - endif ( ) <nl> - endforeach ( ) <nl> - <nl> - # Tell NVCC to add PTX intermediate code for the specified architectures <nl> - foreach ( arch $ { cuda_arch_ptx } ) <nl> - list ( APPEND nvcc_flags - gencode arch = compute_ $ { arch } , code = compute_ $ { arch } ) <nl> - list ( APPEND nvcc_archs_readable compute_ $ { arch } ) <nl> - endforeach ( ) <nl> - <nl> - string ( REPLACE " ; " " " nvcc_archs_readable " $ { nvcc_archs_readable } " ) <nl> - set ( $ { out_variable } $ { nvcc_flags } PARENT_SCOPE ) <nl> - set ( $ { out_variable } _readable $ { nvcc_archs_readable } PARENT_SCOPE ) <nl> - endfunction ( ) <nl>
|
Remove top - level cmake directory . ( )
|
pytorch/pytorch
|
16b0adb27494a69508bcd472f06df70e145de2e1
|
2018-03-29T15:51:09Z
|
mmm a / drivers / gles3 / shader_compiler_gles3 . cpp <nl> ppp b / drivers / gles3 / shader_compiler_gles3 . cpp <nl> ShaderCompilerGLES3 : : ShaderCompilerGLES3 ( ) { <nl> actions [ VS : : SHADER_CANVAS_ITEM ] . renames [ " PROJECTION_MATRIX " ] = " projection_matrix " ; <nl> actions [ VS : : SHADER_CANVAS_ITEM ] . renames [ " EXTRA_MATRIX " ] = = " extra_matrix " ; <nl> actions [ VS : : SHADER_CANVAS_ITEM ] . renames [ " TIME " ] = " time " ; <nl> + actions [ VS : : SHADER_CANVAS_ITEM ] . renames [ " AT_LIGHT_PASS " ] = " at_light_pass " ; <nl> <nl> actions [ VS : : SHADER_CANVAS_ITEM ] . renames [ " COLOR " ] = " color " ; <nl> actions [ VS : : SHADER_CANVAS_ITEM ] . renames [ " NORMAL " ] = " normal " ; <nl> mmm a / drivers / gles3 / shaders / canvas . glsl <nl> ppp b / drivers / gles3 / shaders / canvas . glsl <nl> out vec4 local_rot ; <nl> out highp vec2 pos ; <nl> # endif <nl> <nl> + const bool at_light_pass = true ; <nl> + # else <nl> + const bool at_light_pass = false ; <nl> # endif <nl> <nl> <nl> in highp vec2 pos ; <nl> <nl> # endif <nl> <nl> + const bool at_light_pass = true ; <nl> + # else <nl> + const bool at_light_pass = false ; <nl> # endif <nl> <nl> uniform mediump vec4 final_modulate ; <nl> mmm a / servers / visual / shader_types . cpp <nl> ppp b / servers / visual / shader_types . cpp <nl> ShaderTypes : : ShaderTypes ( ) { <nl> shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " vertex " ] [ " EXTRA_MATRIX " ] = ShaderLanguage : : TYPE_MAT4 ; <nl> shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " vertex " ] [ " TIME " ] = ShaderLanguage : : TYPE_FLOAT ; <nl> shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " vertex " ] [ " PARTICLE_CUSTOM " ] = ShaderLanguage : : TYPE_VEC4 ; <nl> + shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " vertex " ] [ " AT_LIGHT_PASS " ] = ShaderLanguage : : TYPE_BOOL ; <nl> <nl> shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " fragment " ] [ " SRC_COLOR " ] = ShaderLanguage : : TYPE_VEC4 ; <nl> shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " fragment " ] [ " POSITION " ] = ShaderLanguage : : TYPE_VEC2 ; <nl> ShaderTypes : : ShaderTypes ( ) { <nl> shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " fragment " ] [ " SCREEN_UV " ] = ShaderLanguage : : TYPE_VEC2 ; <nl> shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " fragment " ] [ " POINT_COORD " ] = ShaderLanguage : : TYPE_VEC2 ; <nl> shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " fragment " ] [ " TIME " ] = ShaderLanguage : : TYPE_FLOAT ; <nl> + shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " fragment " ] [ " AT_LIGHT_PASS " ] = ShaderLanguage : : TYPE_BOOL ; <nl> <nl> shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " light " ] [ " POSITION " ] = ShaderLanguage : : TYPE_VEC2 ; <nl> shader_modes [ VS : : SHADER_CANVAS_ITEM ] . functions [ " light " ] [ " NORMAL " ] = ShaderLanguage : : TYPE_VEC3 ; <nl>
|
Add AT_LIGHT_PASS builtin to canvas shaders
|
godotengine/godot
|
93ffd9023f0f685c7e0910397efa0a9b59326a81
|
2017-06-15T00:03:15Z
|
mmm a / lib / browser / rpc - server . js <nl> ppp b / lib / browser / rpc - server . js <nl> ipcMain . on ( ' ELECTRON_BROWSER_DEREFERENCE ' , function ( event , id ) { <nl> objectsRegistry . remove ( event . sender . getId ( ) , id ) <nl> } ) <nl> <nl> + ipcMain . on ( ' ELECTRON_BROWSER_CONTEXT_RELEASE ' , ( e ) = > { <nl> + objectsRegistry . clear ( e . sender . getId ( ) ) <nl> + e . returnValue = null <nl> + } ) <nl> + <nl> ipcMain . on ( ' ELECTRON_BROWSER_GUEST_WEB_CONTENTS ' , function ( event , guestInstanceId ) { <nl> try { <nl> let guestViewManager = require ( ' . / guest - view - manager ' ) <nl> mmm a / lib / renderer / api / remote . js <nl> ppp b / lib / renderer / api / remote . js <nl> ipcRenderer . on ( ' ELECTRON_RENDERER_RELEASE_CALLBACK ' , function ( event , id ) { <nl> callbacksRegistry . remove ( id ) <nl> } ) <nl> <nl> + process . on ( ' exit ' , ( ) = > { <nl> + ipcRenderer . sendSync ( ' ELECTRON_BROWSER_CONTEXT_RELEASE ' ) <nl> + } ) <nl> + <nl> / / Get remote module . <nl> exports . require = function ( module ) { <nl> return metaToValue ( ipcRenderer . sendSync ( ' ELECTRON_BROWSER_REQUIRE ' , module ) ) <nl>
|
Fix how rpc - server releases references after page reload
|
electron/electron
|
6b5bd3b6ceb9457b091171bbde40700be71c66dd
|
2017-05-16T12:05:52Z
|
mmm a / src / test / net_tests . cpp <nl> ppp b / src / test / net_tests . cpp <nl> class CAddrManSerializationMock : public CAddrMan <nl> { <nl> public : <nl> virtual void Serialize ( CDataStream & s , int nType , int nVersionDummy ) const = 0 ; <nl> + <nl> + / / ! Ensure that bucket placement is always the same for testing purposes . <nl> + void MakeDeterministic ( ) <nl> + { <nl> + nKey . SetNull ( ) ; <nl> + seed_insecure_rand ( true ) ; <nl> + } <nl> } ; <nl> <nl> class CAddrManUncorrupted : public CAddrManSerializationMock <nl> BOOST_FIXTURE_TEST_SUITE ( net_tests , BasicTestingSetup ) <nl> BOOST_AUTO_TEST_CASE ( caddrdb_read ) <nl> { <nl> CAddrManUncorrupted addrmanUncorrupted ; <nl> + addrmanUncorrupted . MakeDeterministic ( ) ; <nl> <nl> CService addr1 = CService ( " 250 . 7 . 1 . 1 " , 8333 ) ; <nl> CService addr2 = CService ( " 250 . 7 . 2 . 2 " , 9999 ) ; <nl> BOOST_AUTO_TEST_CASE ( caddrdb_read ) <nl> BOOST_AUTO_TEST_CASE ( caddrdb_read_corrupted ) <nl> { <nl> CAddrManCorrupted addrmanCorrupted ; <nl> + addrmanCorrupted . MakeDeterministic ( ) ; <nl> <nl> / / Test that the de - serialization of corrupted addrman throws an exception . <nl> CDataStream ssPeers1 = AddrmanToStream ( addrmanCorrupted ) ; <nl>
|
Remove non - determinism which is breaking net_tests
|
bitcoin/bitcoin
|
f4119c6c988ea24a5218aa6bc67e57e47e051547
|
2016-05-18T16:26:41Z
|
mmm a / docs / development / build - instructions - gn . md <nl> ppp b / docs / development / build - instructions - gn . md <nl> $ gn gen out / Debug - x86 - - args = ' . . . target_cpu = " x86 " ' <nl> ` ` ` <nl> <nl> Not all combinations of source and target CPU / OS are supported by Chromium . <nl> - Only cross - compiling Windows 32 - bit from Windows 64 - bit and Linux 32 - bit from <nl> - Linux 64 - bit have been tested in Electron . If you test other combinations and <nl> - find them to work , please update this document : ) <nl> + <nl> + < table > <nl> + < tr > < th > Host < / th > < th > Target < / th > < th > Status < / th > < / tr > <nl> + < tr > < td > Windows x64 < / td > < td > Windows arm64 < / td > < td > Experimental < / td > <nl> + < tr > < td > Windows x64 < / td > < td > Windows x86 < / td > < td > Automatically tested < / td > < / tr > <nl> + < tr > < td > Linux x64 < / td > < td > Linux x86 < / td > < td > Automatically tested < / td > < / tr > <nl> + < / table > <nl> + <nl> + If you test other combinations and find them to work , please update this document : ) <nl> <nl> See the GN reference for allowable values of [ ` target_os ` ] [ target_os values ] <nl> - and [ ` target_cpu ` ] [ target_cpu values ] <nl> + and [ ` target_cpu ` ] [ target_cpu values ] . <nl> <nl> [ target_os values ] : https : / / gn . googlesource . com / gn / + / master / docs / reference . md # built_in - predefined - variables - target_os_the - desired - operating - system - for - the - build - possible - values <nl> [ target_cpu values ] : https : / / gn . googlesource . com / gn / + / master / docs / reference . md # built_in - predefined - variables - target_cpu_the - desired - cpu - architecture - for - the - build - possible - values <nl> <nl> + # # # # Windows on Arm ( experimental ) <nl> + To cross - compile for Windows on Arm , [ follow Chromium ' s guide ] ( https : / / chromium . googlesource . com / chromium / src / + / refs / heads / master / docs / windows_build_instructions . md # Visual - Studio ) to get the necessary dependencies , SDK and libraries , then build with ` ELECTRON_BUILDING_WOA = 1 ` in your environment before running ` gclient sync ` . <nl> + <nl> + ` ` ` bat <nl> + set ELECTRON_BUILDING_WOA = 1 <nl> + gclient sync - f - - with_branch_heads - - with_tags <nl> + ` ` ` <nl> + <nl> + Or ( if using PowerShell ) : <nl> + ` ` ` powershell <nl> + $ env : ELECTRON_BUILDING_WOA = 1 <nl> + gclient sync - f - - with_branch_heads - - with_tags <nl> + ` ` ` <nl> + <nl> + Next , run ` gn gen ` as above with ` target_cpu = " arm64 " ` . <nl> + <nl> + <nl> # # Tests <nl> <nl> To run the tests , you ' ll first need to build the test modules against the <nl> mmm a / patches / common / chromium / . patches <nl> ppp b / patches / common / chromium / . patches <nl> worker_context_will_destroy . patch <nl> fix_breakpad_symbol_generation_on_linux_arm . patch <nl> cross_site_document_resource_handler . patch <nl> frame_host_manager . patch <nl> + woa_compiler_workaround . patch <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 000000000000 . . 3e1c11aeb358 <nl> mmm / dev / null <nl> ppp b / patches / common / chromium / woa_compiler_workaround . patch <nl> <nl> + From b3414d055399d0a21f6166a536467ea752b2aa8a Mon Sep 17 00 : 00 : 00 2001 <nl> + From : Richard Townsend < richard . townsend @ arm . com > <nl> + Date : Mon , 3 Jun 2019 09 : 52 : 49 + 0100 <nl> + Subject : build : pull in a fixed compiler for Windows on Arm <nl> + <nl> + Due to a code - generation defect in the version of Clang used for the M76 <nl> + branch related to virtual method thunks , it ' s necessary to build M76 <nl> + with a later version of Clang . This change pulls in a corrected version <nl> + by setting ELECTRON_BUILDING_WOA = 1 or similar in the environment . <nl> + <nl> + This PR is only intended to be a temporary workaround and will be <nl> + removed when Electron ' s Chromium updates to a compiler unaffected by <nl> + this issue . <nl> + mmm <nl> + tools / clang / scripts / update . py | 6 pppppp <nl> + 1 file changed , 6 insertions ( + ) <nl> + <nl> pppmmm a / tools / clang / scripts / update . py <nl> ppp + b / tools / clang / scripts / update . py <nl> + CLANG_REVISION = ' 67510fac36d27b2e22c7cd955fc167136b737b93 ' <nl> + CLANG_SVN_REVISION = ' 361212 ' <nl> + CLANG_SUB_REVISION = 2 <nl> + <nl> + + if os . getenv ( ' ELECTRON_BUILDING_WOA ' ) : <nl> + + CLANG_REVISION = ' 56bee1a90a71876cb5067b108bf5715fa1c4e843 ' <nl> + + CLANG_SVN_REVISION = ' 361657 ' <nl> + + CLANG_SUB_REVISION = 1 <nl> + + <nl> + + <nl> + PACKAGE_VERSION = ' % s - % s - % s ' % ( CLANG_SVN_REVISION , CLANG_REVISION [ : 8 ] , <nl> + CLANG_SUB_REVISION ) <nl> + RELEASE_VERSION = ' 9 . 0 . 0 ' <nl> + - - <nl> + 2 . 19 . 1 . windows . 1 <nl> + <nl>
|
build : bring in a later compiler for Windows on Arm ( )
|
electron/electron
|
3c8acf368737b36baaa81e5fe9c27c1a7d12345b
|
2019-06-03T21:29:25Z
|
mmm a / include / swift / Reflection / Records . h <nl> ppp b / include / swift / Reflection / Records . h <nl> class FieldDescriptor { <nl> Kind = = FieldDescriptorKind : : ObjCProtocol ) ; <nl> } <nl> <nl> + bool isStruct ( ) const { <nl> + return Kind = = FieldDescriptorKind : : Struct ; <nl> + } <nl> + <nl> const_iterator begin ( ) const { <nl> auto Begin = getFieldRecordBuffer ( ) ; <nl> auto End = Begin + NumFields ; <nl> mmm a / lib / IRGen / GenMeta . cpp <nl> ppp b / lib / IRGen / GenMeta . cpp <nl> IRGenModule : : getAddrOfForeignTypeMetadataCandidate ( CanType type ) { <nl> } else if ( auto structType = dyn_cast < StructType > ( type ) ) { <nl> auto structDecl = structType - > getDecl ( ) ; <nl> assert ( isa < ClangModuleUnit > ( structDecl - > getModuleScopeContext ( ) ) ) ; <nl> - <nl> + <nl> + ImportedStructs . insert ( structDecl ) ; <nl> + <nl> ForeignStructMetadataBuilder builder ( * this , structDecl , init ) ; <nl> builder . layout ( ) ; <nl> addressPoint = builder . getOffsetOfAddressPoint ( ) ; <nl> mmm a / lib / IRGen / GenReflection . cpp <nl> ppp b / lib / IRGen / GenReflection . cpp <nl> class FieldTypeMetadataBuilder : public ReflectionMetadataBuilder { <nl> B . addInt16 ( fieldRecordSize ) ; <nl> <nl> / / Imported classes don ' t need field descriptors <nl> - if ( NTD - > hasClangNode ( ) ) { <nl> - assert ( isa < ClassDecl > ( NTD ) ) ; <nl> + if ( NTD - > hasClangNode ( ) & & isa < ClassDecl > ( NTD ) ) { <nl> B . addInt32 ( 0 ) ; <nl> return ; <nl> } <nl> <nl> + assert ( ! NTD - > hasClangNode ( ) | | isa < StructDecl > ( NTD ) ) ; <nl> + <nl> auto properties = NTD - > getStoredProperties ( ) ; <nl> B . addInt32 ( std : : distance ( properties . begin ( ) , properties . end ( ) ) ) ; <nl> for ( auto property : properties ) <nl> class FieldTypeMetadataBuilder : public ReflectionMetadataBuilder { <nl> void layout ( ) override { <nl> if ( NTD - > hasClangNode ( ) & & <nl> ! isa < ClassDecl > ( NTD ) & & <nl> + ! isa < StructDecl > ( NTD ) & & <nl> ! isa < ProtocolDecl > ( NTD ) ) <nl> return ; <nl> <nl> void IRGenModule : : emitBuiltinReflectionMetadata ( ) { <nl> for ( auto PD : ImportedProtocols ) <nl> emitFieldMetadataRecord ( PD ) ; <nl> <nl> + for ( auto SD : ImportedStructs ) <nl> + emitFieldMetadataRecord ( SD ) ; <nl> + <nl> for ( auto builtinType : BuiltinTypes ) <nl> emitBuiltinTypeMetadataRecord ( builtinType ) ; <nl> <nl> mmm a / lib / IRGen / IRGenModule . h <nl> ppp b / lib / IRGen / IRGenModule . h <nl> class IRGenModule { <nl> / / / Imported protocols referenced by types in this module when emitting <nl> / / / reflection metadata . <nl> llvm : : SetVector < const ProtocolDecl * > ImportedProtocols ; <nl> + / / / Imported structs referenced by types in this module when emitting <nl> + / / / reflection metadata . <nl> + llvm : : SetVector < const StructDecl * > ImportedStructs ; <nl> <nl> llvm : : Constant * getAddrOfStringForTypeRef ( StringRef Str ) ; <nl> llvm : : Constant * getAddrOfFieldName ( StringRef Name ) ; <nl> mmm a / stdlib / public / Reflection / TypeLowering . cpp <nl> ppp b / stdlib / public / Reflection / TypeLowering . cpp <nl> class LowerType <nl> <nl> const TypeInfo * visitAnyNominalTypeRef ( const TypeRef * TR ) { <nl> const auto & FD = TC . getBuilder ( ) . getFieldTypeInfo ( TR ) ; <nl> - if ( FD . first = = nullptr ) { <nl> + if ( FD . first = = nullptr | | FD . first - > isStruct ( ) ) { <nl> / / Maybe this type is opaque - - look for a builtin <nl> / / descriptor to see if we at least know its size <nl> / / and alignment . <nl> class LowerType <nl> return TC . makeTypeInfo < BuiltinTypeInfo > ( ImportedTypeDescriptor ) ; <nl> <nl> / / Otherwise , we ' re out of luck . <nl> - DEBUG ( std : : cerr < < " No TypeInfo for nominal type : " ; TR - > dump ( ) ) ; <nl> - return nullptr ; <nl> + if ( FD . first = = nullptr ) { <nl> + DEBUG ( std : : cerr < < " No TypeInfo for nominal type : " ; TR - > dump ( ) ) ; <nl> + return nullptr ; <nl> + } <nl> } <nl> <nl> switch ( FD . first - > Kind ) { <nl> mmm a / test / Reflection / typeref_decoding_imported . swift <nl> ppp b / test / Reflection / typeref_decoding_imported . swift <nl> <nl> / / CHECK - 32 : mce : __C . MyCEnum <nl> / / CHECK - 32 : ( struct __C . MyCEnum ) <nl> <nl> + / / CHECK - 32 : __C . MyCStruct <nl> + / / CHECK - 32 : mmmmmmmmmmmm - <nl> + / / CHECK - 32 : i : Swift . Int32 <nl> + / / CHECK - 32 : ( struct Swift . Int32 ) <nl> + <nl> + / / CHECK - 32 : ip : Swift . Optional < Swift . UnsafeMutablePointer < Swift . Int32 > > <nl> + / / CHECK - 32 : ( bound_generic_enum Swift . Optional <nl> + / / CHECK - 32 : ( bound_generic_struct Swift . UnsafeMutablePointer <nl> + / / CHECK - 32 : ( struct Swift . Int32 ) ) ) <nl> + <nl> + / / CHECK - 32 : c : Swift . Int8 <nl> + / / CHECK - 32 : ( struct Swift . Int8 ) <nl> + <nl> / / CHECK - 32 : TypesToReflect . AlsoHasCTypes <nl> / / CHECK - 32 : mmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> <nl> / / CHECK - 64 : mcu : __C . MyCUnion <nl> / / CHECK - 64 : ( struct __C . MyCUnion ) <nl> <nl> + / / CHECK - 64 : __C . MyCStruct <nl> + / / CHECK - 64 : mmmmmmmmmmmm - <nl> + / / CHECK - 64 : i : Swift . Int32 <nl> + / / CHECK - 64 : ( struct Swift . Int32 ) <nl> + <nl> + / / CHECK - 64 : ip : Swift . Optional < Swift . UnsafeMutablePointer < Swift . Int32 > > <nl> + / / CHECK - 64 : ( bound_generic_enum Swift . Optional <nl> + / / CHECK - 64 : ( bound_generic_struct Swift . UnsafeMutablePointer <nl> + / / CHECK - 64 : ( struct Swift . Int32 ) ) ) <nl> + <nl> + / / CHECK - 64 : c : Swift . Int8 <nl> + / / CHECK - 64 : ( struct Swift . Int8 ) <nl> + <nl> / / CHECK - 64 : TypesToReflect . AlsoHasCTypes <nl> / / CHECK - 64 : mmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl>
|
Merge remote - tracking branch ' origin / master ' into master - llvm - swift5 - transition
|
apple/swift
|
4024bdf1019673f6808fba05c93fc69d6429a035
|
2018-02-07T09:58:16Z
|
mmm a / src / torque / utils . h <nl> ppp b / src / torque / utils . h <nl> void EraseIf ( Container * container , F f ) { <nl> <nl> class NullStreambuf : public std : : streambuf { <nl> public : <nl> - virtual int overflow ( int c ) { <nl> + int overflow ( int c ) override { <nl> setp ( buffer_ , buffer_ + sizeof ( buffer_ ) ) ; <nl> return ( c = = traits_type : : eof ( ) ) ? ' \ 0 ' : c ; <nl> } <nl>
|
[ clang - tidy ] Add override and remove virtual
|
v8/v8
|
d64bcab36986e54fa5fbc9254dd9597fd7ddb2ec
|
2020-05-07T08:28:24Z
|
mmm a / doc / options . compiled <nl> ppp b / doc / options . compiled <nl> How long to wait for dangling server to respond . <nl> <nl> To further control idle connections , set <nl> ConnectionTimeoutSeconds = < some value > <nl> - This parameter controls how long libevent will timeout a connection after <nl> + This parameter controls how long libevent will timeout a connection after <nl> idle on read or write . It takes effect when EnableKeepAlive is enabled . <nl> <nl> - EnableEarlyFlush , ForceChunkedEncoding <nl> next requests . <nl> Memcache = false <nl> MemcacheKey = false <nl> SQL = false <nl> + SQLTable = false <nl> <nl> XSL = xsl filename <nl> XSLProxy = url to get the xsl file <nl> mmm a / src / runtime / base / runtime_option . cpp <nl> ppp b / src / runtime / base / runtime_option . cpp <nl> bool RuntimeOption : : EnableAPCKeyStats = false ; <nl> bool RuntimeOption : : EnableMemcacheStats = false ; <nl> bool RuntimeOption : : EnableMemcacheKeyStats = false ; <nl> bool RuntimeOption : : EnableSQLStats = false ; <nl> + bool RuntimeOption : : EnableSQLTableStats = false ; <nl> std : : string RuntimeOption : : StatsXSL ; <nl> std : : string RuntimeOption : : StatsXSLProxy ; <nl> int RuntimeOption : : StatsSlotDuration = 10 * 60 ; / / 10 minutes <nl> void RuntimeOption : : Load ( Hdf & config ) { <nl> EnableMemcacheStats = stats [ " Memcache " ] . getBool ( ) ; <nl> EnableMemcacheKeyStats = stats [ " MemcacheKey " ] . getBool ( ) ; <nl> EnableSQLStats = stats [ " SQL " ] . getBool ( ) ; <nl> + EnableSQLTableStats = stats [ " SQLTable " ] . getBool ( ) ; <nl> <nl> if ( EnableStats & & EnableMallocStats ) { <nl> LeakDetectable : : EnableMallocStats ( true ) ; <nl> mmm a / src / runtime / base / runtime_option . h <nl> ppp b / src / runtime / base / runtime_option . h <nl> class RuntimeOption { <nl> static bool EnableMemcacheStats ; <nl> static bool EnableMemcacheKeyStats ; <nl> static bool EnableSQLStats ; <nl> + static bool EnableSQLTableStats ; <nl> static std : : string StatsXSL ; <nl> static std : : string StatsXSLProxy ; <nl> static int StatsSlotDuration ; <nl> mmm a / src / runtime / base / server / admin_request_handler . cpp <nl> ppp b / src / runtime / base / server / admin_request_handler . cpp <nl> <nl> # include < runtime / base / program_functions . h > <nl> # include < runtime / base / shared / shared_store . h > <nl> # include < runtime / base / memory / leak_detectable . h > <nl> + # include < runtime / ext / mysql_stats . h > <nl> <nl> # ifdef GOOGLE_CPU_PROFILER <nl> # include < google / profiler . h > <nl> void AdminRequestHandler : : handleRequest ( Transport * transport ) { <nl> " / check - load : how many threads are actively handling requests \ n " <nl> " / check - mem : report memory quick statistics in log file \ n " <nl> " / check - apc : report APC quick statistics \ n " <nl> + " / check - sql : report SQL table statistics \ n " <nl> <nl> " / status . xml : show server status in XML \ n " <nl> " / status . json : show server status in JSON \ n " <nl> bool AdminRequestHandler : : handleCheckRequest ( const std : : string & cmd , <nl> transport - > sendString ( stats ) ; <nl> return true ; <nl> } <nl> + if ( cmd = = " check - sql " ) { <nl> + string stats = " < ? xml version = \ " 1 . 0 \ " encoding = \ " utf - 8 \ " ? > \ n " ; <nl> + stats + = " < SQL > \ n " ; <nl> + stats + = MySqlStats : : ReportStats ( ) ; <nl> + stats + = " < / SQL > \ n " ; <nl> + transport - > sendString ( stats ) ; <nl> + return true ; <nl> + } <nl> return false ; <nl> } <nl> <nl> mmm a / src / runtime / ext / ext_mysql . cpp <nl> ppp b / src / runtime / ext / ext_mysql . cpp <nl> <nl> # include < runtime / ext / ext_mysql . h > <nl> # include < runtime / ext / ext_preg . h > <nl> # include < runtime / ext / ext_network . h > <nl> + # include < runtime / ext / mysql_stats . h > <nl> # include < runtime / base / runtime_option . h > <nl> # include < runtime / base / server / server_stats . h > <nl> # include < runtime / base / util / request_local . h > <nl> static MYSQL * create_new_conn ( ) { <nl> <nl> MySQL : : MySQL ( const char * host , int port , const char * username , <nl> const char * password ) <nl> - : m_port ( port ) , m_last_error_set ( false ) , m_last_errno ( 0 ) { <nl> + : m_port ( port ) , m_last_error_set ( false ) , m_last_errno ( 0 ) , <nl> + m_in_transaction ( false ) { <nl> if ( host ) m_host = host ; <nl> if ( username ) m_username = username ; <nl> if ( password ) m_password = password ; <nl> void MySQL : : close ( ) { <nl> if ( m_conn ) { <nl> m_last_error_set = false ; <nl> m_last_errno = 0 ; <nl> + m_in_transaction = false ; <nl> m_last_error . clear ( ) ; <nl> mysql_close ( m_conn ) ; <nl> m_conn = NULL ; <nl> bool MySQL : : connect ( CStrRef host , int port , CStrRef socket , CStrRef username , <nl> ServerStats : : Log ( " sql . conn " , 1 ) ; <nl> } <nl> IOStatusHelper io ( " mysql : : connect " , host . data ( ) , port ) ; <nl> + m_in_transaction = false ; <nl> return mysql_real_connect ( m_conn , host . data ( ) , username . data ( ) , <nl> password . data ( ) , NULL , port , <nl> socket . empty ( ) ? NULL : socket . data ( ) , <nl> bool MySQL : : reconnect ( CStrRef host , int port , CStrRef socket , CStrRef username , <nl> ServerStats : : Log ( " sql . reconn_old " , 1 ) ; <nl> } <nl> IOStatusHelper io ( " mysql : : connect " , host . data ( ) , port ) ; <nl> + m_in_transaction = false ; <nl> return mysql_real_connect ( m_conn , host . data ( ) , username . data ( ) , <nl> password . data ( ) , NULL , port , socket . data ( ) , <nl> client_flags ) ; <nl> static Variant php_mysql_do_query_general ( CStrRef query , CVarRef link_id , <nl> table = table . substr ( 1 , table . length ( ) - 2 ) ; <nl> } <nl> ServerStats : : Log ( string ( " sql . query . " ) + table + " . " + verb , 1 ) ; <nl> + if ( RuntimeOption : : EnableStats & & RuntimeOption : : EnableSQLTableStats ) { <nl> + MySqlStats : : Record ( verb , rconn - > m_in_transaction , table ) ; <nl> + } <nl> } else { <nl> f_preg_match ( " / ^ ( ? : ( ? : \ \ / \ \ * . * ? \ \ * \ \ / ) | \ \ ( | \ \ s ) * " <nl> " ( begin | commit | rollback ) / is " , <nl> static Variant php_mysql_do_query_general ( CStrRef query , CVarRef link_id , <nl> size = matches . toArray ( ) . size ( ) ; <nl> if ( size = = 2 ) { <nl> string verb = Util : : toLower ( matches [ 1 ] . toString ( ) . data ( ) ) ; <nl> + rconn - > m_in_transaction = ( verb = = " begin " ) ; <nl> ServerStats : : Log ( string ( " sql . query . " ) + verb , 1 ) ; <nl> + if ( RuntimeOption : : EnableStats & & RuntimeOption : : EnableSQLTableStats ) { <nl> + MySqlStats : : Record ( verb ) ; <nl> + } <nl> } else { <nl> raise_warning ( " Unable to record MySQL stats with : % s " , query . data ( ) ) ; <nl> ServerStats : : Log ( " sql . query . unknown " , 1 ) ; <nl> mmm a / src / runtime / ext / ext_mysql . h <nl> ppp b / src / runtime / ext / ext_mysql . h <nl> class MySQL : public SweepableResourceData { <nl> bool m_last_error_set ; <nl> int m_last_errno ; <nl> std : : string m_last_error ; <nl> + bool m_in_transaction ; <nl> } ; <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> new file mode 100644 <nl> index 00000000000 . . 6e8455a1369 <nl> mmm / dev / null <nl> ppp b / src / runtime / ext / mysql_stats . cpp <nl> <nl> + / * <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + | HipHop for PHP | <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + | This source file is subject to version 3 . 01 of the PHP license , | <nl> + | that is bundled with this package in the file LICENSE , and is | <nl> + | available through the world - wide - web at the following url : | <nl> + | http : / / www . php . net / license / 3_01 . txt | <nl> + | If you did not receive a copy of the PHP license and are unable to | <nl> + | obtain it through the world - wide - web , please send a note to | <nl> + | license @ php . net so we can mail you a copy immediately . | <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + * / <nl> + <nl> + # include < runtime / ext / mysql_stats . h > <nl> + # include < util / util . h > <nl> + <nl> + using namespace std ; <nl> + <nl> + namespace HPHP { <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + bool MySqlStats : : s_inited = false ; <nl> + hphp_string_map < MySqlStats : : Verb > MySqlStats : : s_verbs ; <nl> + const char * MySqlStats : : s_verb_names [ VERB_COUNT ] ; <nl> + Mutex MySqlStats : : s_mutex ; <nl> + MySqlStats : : StatsMap MySqlStats : : s_stats ; <nl> + <nl> + void MySqlStats : : Init ( ) { <nl> + ASSERT ( ! s_inited ) ; <nl> + s_verbs [ " t_begin " ] = T_BEGIN ; <nl> + s_verbs [ " t_commit " ] = T_COMMIT ; <nl> + s_verbs [ " t_rollback " ] = T_ROLLBACK ; <nl> + s_verbs [ " t_insert " ] = T_INSERT ; <nl> + s_verbs [ " t_update " ] = T_UPDATE ; <nl> + s_verbs [ " t_delete " ] = T_DELETE ; <nl> + s_verbs [ " t_replace " ] = T_REPLACE ; <nl> + s_verbs [ " t_select " ] = T_SELECT ; <nl> + s_verbs [ " n_insert " ] = N_INSERT ; <nl> + s_verbs [ " n_update " ] = N_UPDATE ; <nl> + s_verbs [ " n_delete " ] = N_DELETE ; <nl> + s_verbs [ " n_replace " ] = N_REPLACE ; <nl> + s_verbs [ " n_select " ] = N_SELECT ; <nl> + <nl> + s_verb_names [ UNKNOWN ] = " unknown " ; <nl> + s_verb_names [ T_BEGIN ] = " begin " ; <nl> + s_verb_names [ T_COMMIT ] = " commit " ; <nl> + s_verb_names [ T_ROLLBACK ] = " rollback " ; <nl> + s_verb_names [ T_INSERT ] = " t_insert " ; <nl> + s_verb_names [ T_UPDATE ] = " t_update " ; <nl> + s_verb_names [ T_DELETE ] = " t_delete " ; <nl> + s_verb_names [ T_REPLACE ] = " t_replace " ; <nl> + s_verb_names [ T_SELECT ] = " t_select " ; <nl> + s_verb_names [ N_INSERT ] = " n_insert " ; <nl> + s_verb_names [ N_UPDATE ] = " n_update " ; <nl> + s_verb_names [ N_DELETE ] = " n_delete " ; <nl> + s_verb_names [ N_REPLACE ] = " n_replace " ; <nl> + s_verb_names [ N_SELECT ] = " n_select " ; <nl> + } <nl> + <nl> + MySqlStats : : Verb MySqlStats : : Translate ( const std : : string & verb , <nl> + bool inTransaction ) { <nl> + if ( ! s_inited ) Init ( ) ; <nl> + string composed = inTransaction ? " t_ " : " n_ " ; <nl> + composed + = Util : : toLower ( verb ) ; <nl> + hphp_string_map < Verb > : : const_iterator iter = s_verbs . find ( composed ) ; <nl> + if ( iter ! = s_verbs . end ( ) ) { <nl> + return iter - > second ; <nl> + } <nl> + return UNKNOWN ; <nl> + } <nl> + <nl> + const char * MySqlStats : : Translate ( Verb verb ) { <nl> + if ( ! s_inited ) Init ( ) ; <nl> + if ( verb > = 0 & & verb < VERB_COUNT ) { <nl> + return s_verb_names [ verb ] ; <nl> + } <nl> + return NULL ; <nl> + } <nl> + <nl> + void MySqlStats : : Record ( const std : : string & verb , <nl> + bool inTransaction / * = false * / , <nl> + const std : : string & table / * = " " * / ) { <nl> + Verb v = Translate ( verb , inTransaction ) ; <nl> + string ltable = Util : : toLower ( table ) ; <nl> + <nl> + Lock lock ( s_mutex ) ; <nl> + StatsMap : : iterator iter = s_stats . find ( ltable ) ; <nl> + if ( iter = = s_stats . end ( ) ) { <nl> + StatsPtr stats ( new Stats ( ) ) ; <nl> + memset ( stats . get ( ) , 0 , sizeof ( Stats ) ) ; <nl> + stats - > actions [ v ] = 1 ; <nl> + s_stats [ ltable ] = stats ; <nl> + } else { <nl> + Stats & stats = * iter - > second ; <nl> + + + stats . actions [ v ] ; <nl> + } <nl> + } <nl> + <nl> + std : : string MySqlStats : : ReportStats ( ) { <nl> + ostringstream out ; <nl> + <nl> + Lock lock ( s_mutex ) ; <nl> + for ( StatsMap : : const_iterator iter = s_stats . begin ( ) ; iter ! = s_stats . end ( ) ; <nl> + + + iter ) { <nl> + string table = iter - > first ; <nl> + if ( table . empty ( ) ) { <nl> + table = " x " ; <nl> + } <nl> + out < < " < " < < table < < " > \ n " ; <nl> + Stats & stats = * iter - > second ; <nl> + for ( int i = 0 ; i < VERB_COUNT ; i + + ) { <nl> + const char * name = Translate ( ( Verb ) i ) ; <nl> + out < < " < " < < name < < " > " ; <nl> + out < < stats . actions [ i ] ; <nl> + out < < " < / " < < name < < " > \ n " ; <nl> + } <nl> + out < < " < / " < < table < < " > \ n " ; <nl> + } <nl> + <nl> + return out . str ( ) ; <nl> + } <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 9e07cf85dcc <nl> mmm / dev / null <nl> ppp b / src / runtime / ext / mysql_stats . h <nl> <nl> + / * <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + | HipHop for PHP | <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + | This source file is subject to version 3 . 01 of the PHP license , | <nl> + | that is bundled with this package in the file LICENSE , and is | <nl> + | available through the world - wide - web at the following url : | <nl> + | http : / / www . php . net / license / 3_01 . txt | <nl> + | If you did not receive a copy of the PHP license and are unable to | <nl> + | obtain it through the world - wide - web , please send a note to | <nl> + | license @ php . net so we can mail you a copy immediately . | <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + * / <nl> + <nl> + # ifndef __HPHP_MYSQL_STATS_H__ <nl> + # define __HPHP_MYSQL_STATS_H__ <nl> + <nl> + # include < util / base . h > <nl> + # include < util / lock . h > <nl> + <nl> + namespace HPHP { <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + class MySqlStats { <nl> + public : <nl> + enum Verb { <nl> + UNKNOWN , <nl> + <nl> + T_BEGIN , <nl> + T_COMMIT , <nl> + T_ROLLBACK , <nl> + <nl> + / / transactional : statements inside begin / commit <nl> + T_INSERT , <nl> + T_UPDATE , <nl> + T_DELETE , <nl> + T_REPLACE , <nl> + T_SELECT , <nl> + <nl> + / / non - transactional <nl> + N_INSERT , <nl> + N_UPDATE , <nl> + N_DELETE , <nl> + N_REPLACE , <nl> + N_SELECT , <nl> + <nl> + VERB_COUNT <nl> + } ; <nl> + <nl> + public : <nl> + static void Record ( const std : : string & verb , bool inTransaction = false , <nl> + const std : : string & table = " " ) ; <nl> + static std : : string ReportStats ( ) ; <nl> + <nl> + private : <nl> + DECLARE_BOOST_TYPES ( Stats ) ; <nl> + struct Stats { <nl> + int actions [ VERB_COUNT ] ; <nl> + } ; <nl> + typedef hphp_string_map < StatsPtr > StatsMap ; <nl> + <nl> + static bool s_inited ; <nl> + static hphp_string_map < Verb > s_verbs ; <nl> + static const char * s_verb_names [ ] ; <nl> + <nl> + static Mutex s_mutex ; <nl> + static StatsMap s_stats ; <nl> + <nl> + static void Init ( ) ; <nl> + static Verb Translate ( const std : : string & verb , bool inTransaction ) ; <nl> + static const char * Translate ( Verb verb ) ; <nl> + } ; <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + } <nl> + <nl> + # endif / / __HPHP_MYSQL_STATS_H__ <nl>
|
adding MySQL table stats
|
facebook/hhvm
|
ebc528f61acc39815f23014a8eb9aa393963fa41
|
2010-05-25T00:02:53Z
|
mmm a / include / swift / IDE / DigesterEnums . def <nl> ppp b / include / swift / IDE / DigesterEnums . def <nl> NODE_ANNOTATION_CHANGE_KIND ( ArrayMemberUpdate ) <nl> NODE_ANNOTATION_CHANGE_KIND ( OptionalArrayMemberUpdate ) <nl> NODE_ANNOTATION_CHANGE_KIND ( SimpleStringRepresentableUpdate ) <nl> NODE_ANNOTATION_CHANGE_KIND ( SimpleOptionalStringRepresentableUpdate ) <nl> + NODE_ANNOTATION_CHANGE_KIND ( TypeAliasDeclToRawRepresentable ) <nl> <nl> NODE_ANNOTATION_CHANGE_KIND ( RevertDictionaryKeyUpdate ) <nl> NODE_ANNOTATION_CHANGE_KIND ( RevertOptionalDictionaryKeyUpdate ) <nl> mmm a / lib / IRGen / GenExistential . cpp <nl> ppp b / lib / IRGen / GenExistential . cpp <nl> class OpaqueExistentialTypeInfo final : <nl> llvm : : Type * ty , Size size , Alignment align ) <nl> : super ( protocols , ty , size , <nl> SpareBitVector : : getConstant ( size . getValueInBits ( ) , false ) , align , <nl> - IsNotPOD , IsNotBitwiseTakable , IsFixedSize ) { } <nl> + IsNotPOD , IsBitwiseTakable , IsFixedSize ) { } <nl> <nl> public : <nl> OpaqueExistentialLayout getLayout ( ) const { <nl> mmm a / stdlib / public / runtime / ExistentialMetadataImpl . h <nl> ppp b / stdlib / public / runtime / ExistentialMetadataImpl . h <nl> struct LLVM_LIBRARY_VISIBILITY OpaqueExistentialBox <nl> static constexpr size_t alignment = alignof ( Container ) ; <nl> static constexpr size_t stride = sizeof ( Container ) ; <nl> static constexpr size_t isPOD = false ; <nl> - static constexpr bool isBitwiseTakable = false ; <nl> + static constexpr bool isBitwiseTakable = true ; <nl> static constexpr unsigned numExtraInhabitants = 0 ; <nl> } ; <nl> <nl> mmm a / stdlib / public / runtime / Metadata . cpp <nl> ppp b / stdlib / public / runtime / Metadata . cpp <nl> OpaqueExistentialValueWitnessTableCacheEntry ( unsigned numWitnessTables ) { <nl> Data . flags = ValueWitnessFlags ( ) <nl> . withAlignment ( Box : : Container : : getAlignment ( numWitnessTables ) ) <nl> . withPOD ( false ) <nl> - . withBitwiseTakable ( false ) <nl> + . withBitwiseTakable ( true ) <nl> . withInlineStorage ( false ) <nl> . withExtraInhabitants ( false ) ; <nl> Data . stride = Box : : Container : : getStride ( numWitnessTables ) ; <nl> mmm a / test / IRGen / existentials . sil <nl> ppp b / test / IRGen / existentials . sil <nl> <nl> sil_stage canonical <nl> <nl> import Swift <nl> + protocol P { } <nl> + <nl> + / / NonBitwiseTakableBit = 0x00100000 . This struct is bitwise takable because <nl> + / / 0x30007 = 196615 . <nl> + / / CHECK : @ " $ S12existentials14BitwiseTakableVWV " = internal constant [ 11 x i8 * ] { { . * } } i8 * inttoptr ( i64 196615 to i8 * ) <nl> + struct BitwiseTakable { <nl> + var p : P <nl> + } <nl> <nl> protocol CP : class { } <nl> <nl> mmm a / test / api - digester / Inputs / APINotesLeft / APINotesTest . h <nl> ppp b / test / api - digester / Inputs / APINotesLeft / APINotesTest . h <nl> extern int ANTGlobalValue ; <nl> @ end <nl> <nl> extern NSString * globalAttributeName ; <nl> + <nl> + typedef NSString * CatAttributeName ; <nl> \ No newline at end of file <nl> mmm a / test / api - digester / Inputs / APINotesRight / APINotesTest . h <nl> ppp b / test / api - digester / Inputs / APINotesRight / APINotesTest . h <nl> typedef NSString * AnimalAttributeName NS_STRING_ENUM ; <nl> @ end <nl> <nl> extern AnimalAttributeName globalAttributeName ; <nl> + <nl> + typedef NSString * CatAttributeName NS_STRING_ENUM ; <nl> mmm a / test / api - digester / Outputs / apinotes - diags . txt <nl> ppp b / test / api - digester / Outputs / apinotes - diags . txt <nl> <nl> <nl> / * RawRepresentable Changes * / <nl> + APINotesTest ( APINotesTest . h ) : TypeAlias CatAttributeName ( NSString ) is now String representable <nl> <nl> / * Removed Decls * / <nl> APINotesTest ( APINotesTest . h ) : Func ObjcProt . protMemberFunc2 ( ) has been removed <nl> mmm a / test / api - digester / Outputs / apinotes - migrator - gen . json <nl> ppp b / test / api - digester / Outputs / apinotes - migrator - gen . json <nl> <nl> " RightComment " : " AnimalAttributeName " , <nl> " ModuleName " : " APINotesTest " <nl> } , <nl> + { <nl> + " DiffItemKind " : " CommonDiffItem " , <nl> + " NodeKind " : " TypeAlias " , <nl> + " NodeAnnotation " : " TypeAliasDeclToRawRepresentable " , <nl> + " ChildIndex " : " 0 " , <nl> + " LeftUsr " : " c : APINotesTest . h @ T @ CatAttributeName " , <nl> + " LeftComment " : " NSString " , <nl> + " RightUsr " : " " , <nl> + " RightComment " : " String " , <nl> + " ModuleName " : " APINotesTest " <nl> + } , <nl> { <nl> " DiffItemKind " : " CommonDiffItem " , <nl> " NodeKind " : " Function " , <nl> mmm a / tools / swift - api - digester / swift - api - digester . cpp <nl> ppp b / tools / swift - api - digester / swift - api - digester . cpp <nl> static int compareSDKs ( StringRef LeftPath , StringRef RightPath , <nl> RefinementPass . pass ( LeftModule , RightModule ) ; <nl> DiffVector AllItems ; <nl> DiffItemEmitter : : collectDiffItems ( LeftModule , AllItems ) ; <nl> + <nl> + auto & AliasMap = Ctx . getTypeAliasUpdateMap ( ) ; <nl> + / / Find type alias change first . <nl> + TypeAliasDiffFinder ( LeftModule , RightModule , AliasMap ) . search ( ) ; <nl> + <nl> + for ( auto Pair : AliasMap ) { <nl> + auto Left = Pair . first - > getAs < SDKNodeDeclTypeAlias > ( ) - > getUnderlyingType ( ) - > <nl> + getPrintedName ( ) ; <nl> + auto Right = AliasMap [ ( SDKNode * ) Pair . first ] - > getAs < SDKNodeDeclType > ( ) - > <nl> + getRawValueType ( ) - > getPrintedName ( ) ; <nl> + auto * D = Pair . first - > getAs < SDKNodeDecl > ( ) ; <nl> + AllItems . emplace_back ( SDKNodeKind : : DeclTypeAlias , <nl> + NodeAnnotation : : TypeAliasDeclToRawRepresentable , " 0 " , <nl> + D - > getUsr ( ) , " " , Left , Right , D - > getModuleName ( ) ) ; <nl> + } <nl> + <nl> AllItems . erase ( std : : remove_if ( AllItems . begin ( ) , AllItems . end ( ) , <nl> [ & ] ( CommonDiffItem & Item ) { <nl> return Item . DiffKind = = NodeAnnotation : : RemovedDecl & & <nl> mmm a / unittests / runtime / Metadata . cpp <nl> ppp b / unittests / runtime / Metadata . cpp <nl> TEST ( MetadataTest , getExistentialTypeMetadata_opaque ) { <nl> EXPECT_EQ ( 5 * sizeof ( void * ) , ex1 - > getValueWitnesses ( ) - > getSize ( ) ) ; <nl> EXPECT_EQ ( alignof ( void * ) , ex1 - > getValueWitnesses ( ) - > getAlignment ( ) ) ; <nl> EXPECT_FALSE ( ex1 - > getValueWitnesses ( ) - > isPOD ( ) ) ; <nl> - EXPECT_FALSE ( ex1 - > getValueWitnesses ( ) - > isBitwiseTakable ( ) ) ; <nl> + EXPECT_TRUE ( ex1 - > getValueWitnesses ( ) - > isBitwiseTakable ( ) ) ; <nl> EXPECT_EQ ( nullptr , <nl> ex1 - > getSuperclassConstraint ( ) ) ; <nl> return ex1 ; <nl> TEST ( MetadataTest , getExistentialTypeMetadata_opaque ) { <nl> EXPECT_EQ ( 6 * sizeof ( void * ) , ex2 - > getValueWitnesses ( ) - > getSize ( ) ) ; <nl> EXPECT_EQ ( alignof ( void * ) , ex2 - > getValueWitnesses ( ) - > getAlignment ( ) ) ; <nl> EXPECT_FALSE ( ex2 - > getValueWitnesses ( ) - > isPOD ( ) ) ; <nl> - EXPECT_FALSE ( ex2 - > getValueWitnesses ( ) - > isBitwiseTakable ( ) ) ; <nl> + EXPECT_TRUE ( ex2 - > getValueWitnesses ( ) - > isBitwiseTakable ( ) ) ; <nl> EXPECT_EQ ( nullptr , <nl> ex2 - > getSuperclassConstraint ( ) ) ; <nl> return ex2 ; <nl> TEST ( MetadataTest , getExistentialTypeMetadata_opaque ) { <nl> EXPECT_EQ ( 7 * sizeof ( void * ) , ex3 - > getValueWitnesses ( ) - > getSize ( ) ) ; <nl> EXPECT_EQ ( alignof ( void * ) , ex3 - > getValueWitnesses ( ) - > getAlignment ( ) ) ; <nl> EXPECT_FALSE ( ex3 - > getValueWitnesses ( ) - > isPOD ( ) ) ; <nl> - EXPECT_FALSE ( ex3 - > getValueWitnesses ( ) - > isBitwiseTakable ( ) ) ; <nl> + EXPECT_TRUE ( ex3 - > getValueWitnesses ( ) - > isBitwiseTakable ( ) ) ; <nl> EXPECT_EQ ( nullptr , <nl> ex3 - > getSuperclassConstraint ( ) ) ; <nl> return ex3 ; <nl>
|
Merge remote - tracking branch ' origin / master ' into master - next
|
apple/swift
|
469fb047c1f74878d552490b04ae284e420ccb05
|
2018-05-23T20:29:12Z
|
mmm a / tensorflow / g3doc / api_docs / python / contrib . learn . md <nl> ppp b / tensorflow / g3doc / api_docs / python / contrib . learn . md <nl> Estimator class is the basic TensorFlow model trainer / evaluator . <nl> <nl> # # # # ` tf . contrib . learn . Estimator . __init__ ( model_fn = None , model_dir = None , config = None , params = None , feature_engineering_fn = None ) ` { # Estimator . __init__ } <nl> <nl> - Constructs an Estimator instance . <nl> + Constructs an ` Estimator ` instance . <nl> <nl> # # # # # Args : <nl> <nl> <nl> - * < b > ` model_fn ` < / b > : Model function , takes features and labels tensors or dicts of <nl> - tensors and returns tuple of : <nl> + * < b > ` model_fn ` < / b > : Model function . Follows the signature : <nl> + * Args : <nl> + * ` features ` are single ` Tensor ` or ` dict ` of ` Tensor ` s <nl> + ( depending on data passed to ` fit ` ) , <nl> + * ` labels ` are ` Tensor ` or ` dict ` of ` Tensor ` s ( for multi - head <nl> + models ) . If mode is ` ModeKeys . INFER ` , ` labels = None ` will be <nl> + passed . If the ` model_fn ` ' s signature does not accept <nl> + ` mode ` , the ` model_fn ` must still be able to handle <nl> + ` labels = None ` . <nl> + * ` mode ` specifies if this training , evaluation or <nl> + prediction . See ` ModeKeys ` . <nl> + * ` params ` is a ` dict ` of hyperparameters . Will receive what <nl> + is passed to Estimator in ` params ` parameter . This allows <nl> + to configure Estimators from hyper parameter tuning . <nl> + <nl> + * Returns : <nl> + ` ModelFnOps ` <nl> + <nl> + Also supports a legacy signature which returns tuple of : <nl> <nl> * predictions : ` Tensor ` , ` SparseTensor ` or dictionary of same . <nl> Can also be any type that is convertible to a ` Tensor ` or <nl> Constructs an Estimator instance . <nl> * loss : Scalar loss ` Tensor ` . <nl> * train_op : Training update ` Tensor ` or ` Operation ` . <nl> <nl> - Supports next three signatures for the function : <nl> + Supports next three signatures for the function : <nl> <nl> * ` ( features , labels ) - > ( predictions , loss , train_op ) ` <nl> * ` ( features , labels , mode ) - > ( predictions , loss , train_op ) ` <nl> * ` ( features , labels , mode , params ) - > ( predictions , loss , train_op ) ` <nl> <nl> - Where <nl> - <nl> - * ` features ` are single ` Tensor ` or ` dict ` of ` Tensor ` s <nl> - ( depending on data passed to ` fit ` ) , <nl> - * ` labels ` are ` Tensor ` or ` dict ` of ` Tensor ` s ( for multi - head <nl> - models ) . If mode is ` ModeKeys . INFER ` , ` labels = None ` will be <nl> - passed . If the ` model_fn ` ' s signature does not accept <nl> - ` mode ` , the ` model_fn ` must still be able to handle <nl> - ` labels = None ` . <nl> - * ` mode ` represents if this training , evaluation or <nl> - prediction . See ` ModeKeys ` . <nl> - * ` params ` is a ` dict ` of hyperparameters . Will receive what <nl> - is passed to Estimator in ` params ` parameter . This allows <nl> - to configure Estimators from hyper parameter tunning . <nl> - <nl> <nl> * < b > ` model_dir ` < / b > : Directory to save model parameters , graph and etc . This can <nl> also be used to load checkpoints from the directory into a estimator to <nl> available in the SKCompat class , Estimator will only accept input_fn . <nl> <nl> - - - <nl> <nl> - # # # # ` tf . contrib . learn . DNNRegressor . export ( * args , * * kwargs ) ` { # DNNRegressor . export } <nl> + # # # # ` tf . contrib . learn . DNNRegressor . export ( export_dir , input_fn = None , input_feature_key = None , use_deprecated_input_fn = True , signature_fn = None , default_batch_size = None , exports_to_keep = None ) ` { # DNNRegressor . export } <nl> <nl> - Exports inference graph into given dir . ( deprecated arguments ) <nl> <nl> - SOME ARGUMENTS ARE DEPRECATED . They will be removed after 2016 - 09 - 23 . <nl> - Instructions for updating : <nl> - The signature of the input_fn accepted by export is changing to be consistent with what ' s used by tf . Learn Estimator ' s train / evaluate . input_fn ( and in most cases , input_feature_key ) will become required args , and use_deprecated_input_fn will default to False and be removed altogether . <nl> - <nl> - Args : <nl> - export_dir : A string containing a directory to write the exported graph <nl> - and checkpoints . <nl> - input_fn : If ` use_deprecated_input_fn ` is true , then a function that given <nl> - ` Tensor ` of ` Example ` strings , parses it into features that are then <nl> - passed to the model . Otherwise , a function that takes no argument and <nl> - returns a tuple of ( features , labels ) , where features is a dict of <nl> - string key to ` Tensor ` and labels is a ` Tensor ` that ' s currently not <nl> - used ( and so can be ` None ` ) . <nl> - input_feature_key : Only used if ` use_deprecated_input_fn ` is false . String <nl> - key into the features dict returned by ` input_fn ` that corresponds to a <nl> - the raw ` Example ` strings ` Tensor ` that the exported model will take as <nl> - input . Can only be ` None ` if you ' re using a custom ` signature_fn ` that <nl> - does not use the first arg ( examples ) . <nl> - use_deprecated_input_fn : Determines the signature format of ` input_fn ` . <nl> - signature_fn : Function that returns a default signature and a named <nl> - signature map , given ` Tensor ` of ` Example ` strings , ` dict ` of ` Tensor ` s <nl> - for features and ` Tensor ` or ` dict ` of ` Tensor ` s for predictions . <nl> - prediction_key : The key for a tensor in the ` predictions ` dict ( output <nl> - from the ` model_fn ` ) to use as the ` predictions ` input to the <nl> - ` signature_fn ` . Optional . If ` None ` , predictions will pass to <nl> - ` signature_fn ` without filtering . <nl> - default_batch_size : Default batch size of the ` Example ` placeholder . <nl> - exports_to_keep : Number of exports to keep . <nl> - <nl> - Returns : <nl> - The string path to the exported directory . NB : this functionality was <nl> - added ca . 2016 / 09 / 25 ; clients that depend on the return value may need <nl> - to handle the case where this function returns None because subclasses <nl> - are not returning a value . <nl> <nl> <nl> - - - <nl> available in the SKCompat class , Estimator will only accept input_fn . <nl> <nl> # # # # ` tf . contrib . learn . DNNRegressor . predict ( * args , * * kwargs ) ` { # DNNRegressor . predict } <nl> <nl> - Returns predictions for given features . ( deprecated arguments ) <nl> + Runs inference to determine the predicted class . ( deprecated arguments ) <nl> <nl> - SOME ARGUMENTS ARE DEPRECATED . They will be removed after 2016 - 12 - 01 . <nl> + SOME ARGUMENTS ARE DEPRECATED . They will be removed after 2016 - 09 - 15 . <nl> Instructions for updating : <nl> - Estimator is decoupled from Scikit Learn interface by moving into <nl> - separate class SKCompat . Arguments x , y and batch_size are only <nl> - available in the SKCompat class , Estimator will only accept input_fn . <nl> - <nl> - # # # # # Example conversion : <nl> - <nl> - est = Estimator ( . . . ) - > est = SKCompat ( Estimator ( . . . ) ) <nl> - <nl> - <nl> - * < b > ` Args ` < / b > : <nl> - * < b > ` x ` < / b > : Matrix of shape [ n_samples , n_features . . . ] . Can be iterator that <nl> - returns arrays of features . The training input samples for fitting the <nl> - model . If set , ` input_fn ` must be ` None ` . <nl> - * < b > ` input_fn ` < / b > : Input function . If set , ` x ` and ' batch_size ' must be ` None ` . <nl> - * < b > ` batch_size ` < / b > : Override default batch size . If set , ' input_fn ' must be <nl> - ' None ' . <nl> - * < b > ` outputs ` < / b > : list of ` str ` , name of the output to predict . <nl> - If ` None ` , returns all . <nl> - * < b > ` as_iterable ` < / b > : If True , return an iterable which keeps yielding predictions <nl> - for each example until inputs are exhausted . Note : The inputs must <nl> - terminate if you want the iterable to terminate ( e . g . be sure to pass <nl> - num_epochs = 1 if you are using something like read_batch_features ) . <nl> - <nl> - <nl> - * < b > ` Returns ` < / b > : <nl> - A numpy array of predicted classes or regression values if the <nl> - constructor ' s ` model_fn ` returns a ` Tensor ` for ` predictions ` or a ` dict ` <nl> - of numpy arrays if ` model_fn ` returns a ` dict ` . Returns an iterable of <nl> - predictions if as_iterable is True . <nl> - <nl> - <nl> - * < b > ` Raises ` < / b > : <nl> - * < b > ` ValueError ` < / b > : If x and input_fn are both provided or both ` None ` . <nl> + The default behavior of predict ( ) is changing . The default value for <nl> + as_iterable will change to True , and then the flag will be removed <nl> + altogether . The behavior of this flag is described below . <nl> <nl> <nl> - - - <nl> mmm a / tensorflow / g3doc / api_docs / python / functions_and_classes / shard3 / tf . contrib . learn . Estimator . md <nl> ppp b / tensorflow / g3doc / api_docs / python / functions_and_classes / shard3 / tf . contrib . learn . Estimator . md <nl> Estimator class is the basic TensorFlow model trainer / evaluator . <nl> <nl> # # # # ` tf . contrib . learn . Estimator . __init__ ( model_fn = None , model_dir = None , config = None , params = None , feature_engineering_fn = None ) ` { # Estimator . __init__ } <nl> <nl> - Constructs an Estimator instance . <nl> + Constructs an ` Estimator ` instance . <nl> <nl> # # # # # Args : <nl> <nl> <nl> - * < b > ` model_fn ` < / b > : Model function , takes features and labels tensors or dicts of <nl> - tensors and returns tuple of : <nl> + * < b > ` model_fn ` < / b > : Model function . Follows the signature : <nl> + * Args : <nl> + * ` features ` are single ` Tensor ` or ` dict ` of ` Tensor ` s <nl> + ( depending on data passed to ` fit ` ) , <nl> + * ` labels ` are ` Tensor ` or ` dict ` of ` Tensor ` s ( for multi - head <nl> + models ) . If mode is ` ModeKeys . INFER ` , ` labels = None ` will be <nl> + passed . If the ` model_fn ` ' s signature does not accept <nl> + ` mode ` , the ` model_fn ` must still be able to handle <nl> + ` labels = None ` . <nl> + * ` mode ` specifies if this training , evaluation or <nl> + prediction . See ` ModeKeys ` . <nl> + * ` params ` is a ` dict ` of hyperparameters . Will receive what <nl> + is passed to Estimator in ` params ` parameter . This allows <nl> + to configure Estimators from hyper parameter tuning . <nl> + <nl> + * Returns : <nl> + ` ModelFnOps ` <nl> + <nl> + Also supports a legacy signature which returns tuple of : <nl> <nl> * predictions : ` Tensor ` , ` SparseTensor ` or dictionary of same . <nl> Can also be any type that is convertible to a ` Tensor ` or <nl> Constructs an Estimator instance . <nl> * loss : Scalar loss ` Tensor ` . <nl> * train_op : Training update ` Tensor ` or ` Operation ` . <nl> <nl> - Supports next three signatures for the function : <nl> + Supports next three signatures for the function : <nl> <nl> * ` ( features , labels ) - > ( predictions , loss , train_op ) ` <nl> * ` ( features , labels , mode ) - > ( predictions , loss , train_op ) ` <nl> * ` ( features , labels , mode , params ) - > ( predictions , loss , train_op ) ` <nl> <nl> - Where <nl> - <nl> - * ` features ` are single ` Tensor ` or ` dict ` of ` Tensor ` s <nl> - ( depending on data passed to ` fit ` ) , <nl> - * ` labels ` are ` Tensor ` or ` dict ` of ` Tensor ` s ( for multi - head <nl> - models ) . If mode is ` ModeKeys . INFER ` , ` labels = None ` will be <nl> - passed . If the ` model_fn ` ' s signature does not accept <nl> - ` mode ` , the ` model_fn ` must still be able to handle <nl> - ` labels = None ` . <nl> - * ` mode ` represents if this training , evaluation or <nl> - prediction . See ` ModeKeys ` . <nl> - * ` params ` is a ` dict ` of hyperparameters . Will receive what <nl> - is passed to Estimator in ` params ` parameter . This allows <nl> - to configure Estimators from hyper parameter tunning . <nl> - <nl> <nl> * < b > ` model_dir ` < / b > : Directory to save model parameters , graph and etc . This can <nl> also be used to load checkpoints from the directory into a estimator to <nl> mmm a / tensorflow / g3doc / api_docs / python / functions_and_classes / shard9 / tf . contrib . learn . DNNRegressor . md <nl> ppp b / tensorflow / g3doc / api_docs / python / functions_and_classes / shard9 / tf . contrib . learn . DNNRegressor . md <nl> available in the SKCompat class , Estimator will only accept input_fn . <nl> <nl> - - - <nl> <nl> - # # # # ` tf . contrib . learn . DNNRegressor . export ( * args , * * kwargs ) ` { # DNNRegressor . export } <nl> + # # # # ` tf . contrib . learn . DNNRegressor . export ( export_dir , input_fn = None , input_feature_key = None , use_deprecated_input_fn = True , signature_fn = None , default_batch_size = None , exports_to_keep = None ) ` { # DNNRegressor . export } <nl> <nl> - Exports inference graph into given dir . ( deprecated arguments ) <nl> <nl> - SOME ARGUMENTS ARE DEPRECATED . They will be removed after 2016 - 09 - 23 . <nl> - Instructions for updating : <nl> - The signature of the input_fn accepted by export is changing to be consistent with what ' s used by tf . Learn Estimator ' s train / evaluate . input_fn ( and in most cases , input_feature_key ) will become required args , and use_deprecated_input_fn will default to False and be removed altogether . <nl> - <nl> - Args : <nl> - export_dir : A string containing a directory to write the exported graph <nl> - and checkpoints . <nl> - input_fn : If ` use_deprecated_input_fn ` is true , then a function that given <nl> - ` Tensor ` of ` Example ` strings , parses it into features that are then <nl> - passed to the model . Otherwise , a function that takes no argument and <nl> - returns a tuple of ( features , labels ) , where features is a dict of <nl> - string key to ` Tensor ` and labels is a ` Tensor ` that ' s currently not <nl> - used ( and so can be ` None ` ) . <nl> - input_feature_key : Only used if ` use_deprecated_input_fn ` is false . String <nl> - key into the features dict returned by ` input_fn ` that corresponds to a <nl> - the raw ` Example ` strings ` Tensor ` that the exported model will take as <nl> - input . Can only be ` None ` if you ' re using a custom ` signature_fn ` that <nl> - does not use the first arg ( examples ) . <nl> - use_deprecated_input_fn : Determines the signature format of ` input_fn ` . <nl> - signature_fn : Function that returns a default signature and a named <nl> - signature map , given ` Tensor ` of ` Example ` strings , ` dict ` of ` Tensor ` s <nl> - for features and ` Tensor ` or ` dict ` of ` Tensor ` s for predictions . <nl> - prediction_key : The key for a tensor in the ` predictions ` dict ( output <nl> - from the ` model_fn ` ) to use as the ` predictions ` input to the <nl> - ` signature_fn ` . Optional . If ` None ` , predictions will pass to <nl> - ` signature_fn ` without filtering . <nl> - default_batch_size : Default batch size of the ` Example ` placeholder . <nl> - exports_to_keep : Number of exports to keep . <nl> - <nl> - Returns : <nl> - The string path to the exported directory . NB : this functionality was <nl> - added ca . 2016 / 09 / 25 ; clients that depend on the return value may need <nl> - to handle the case where this function returns None because subclasses <nl> - are not returning a value . <nl> <nl> <nl> - - - <nl> available in the SKCompat class , Estimator will only accept input_fn . <nl> <nl> # # # # ` tf . contrib . learn . DNNRegressor . predict ( * args , * * kwargs ) ` { # DNNRegressor . predict } <nl> <nl> - Returns predictions for given features . ( deprecated arguments ) <nl> + Runs inference to determine the predicted class . ( deprecated arguments ) <nl> <nl> - SOME ARGUMENTS ARE DEPRECATED . They will be removed after 2016 - 12 - 01 . <nl> + SOME ARGUMENTS ARE DEPRECATED . They will be removed after 2016 - 09 - 15 . <nl> Instructions for updating : <nl> - Estimator is decoupled from Scikit Learn interface by moving into <nl> - separate class SKCompat . Arguments x , y and batch_size are only <nl> - available in the SKCompat class , Estimator will only accept input_fn . <nl> - <nl> - # # # # # Example conversion : <nl> - <nl> - est = Estimator ( . . . ) - > est = SKCompat ( Estimator ( . . . ) ) <nl> - <nl> - <nl> - * < b > ` Args ` < / b > : <nl> - * < b > ` x ` < / b > : Matrix of shape [ n_samples , n_features . . . ] . Can be iterator that <nl> - returns arrays of features . The training input samples for fitting the <nl> - model . If set , ` input_fn ` must be ` None ` . <nl> - * < b > ` input_fn ` < / b > : Input function . If set , ` x ` and ' batch_size ' must be ` None ` . <nl> - * < b > ` batch_size ` < / b > : Override default batch size . If set , ' input_fn ' must be <nl> - ' None ' . <nl> - * < b > ` outputs ` < / b > : list of ` str ` , name of the output to predict . <nl> - If ` None ` , returns all . <nl> - * < b > ` as_iterable ` < / b > : If True , return an iterable which keeps yielding predictions <nl> - for each example until inputs are exhausted . Note : The inputs must <nl> - terminate if you want the iterable to terminate ( e . g . be sure to pass <nl> - num_epochs = 1 if you are using something like read_batch_features ) . <nl> - <nl> - <nl> - * < b > ` Returns ` < / b > : <nl> - A numpy array of predicted classes or regression values if the <nl> - constructor ' s ` model_fn ` returns a ` Tensor ` for ` predictions ` or a ` dict ` <nl> - of numpy arrays if ` model_fn ` returns a ` dict ` . Returns an iterable of <nl> - predictions if as_iterable is True . <nl> - <nl> - <nl> - * < b > ` Raises ` < / b > : <nl> - * < b > ` ValueError ` < / b > : If x and input_fn are both provided or both ` None ` . <nl> + The default behavior of predict ( ) is changing . The default value for <nl> + as_iterable will change to True , and then the flag will be removed <nl> + altogether . The behavior of this flag is described below . <nl> <nl> <nl> - - - <nl>
|
Update generated Python Op docs .
|
tensorflow/tensorflow
|
3dbe1e3d1f730c568c0a6a6644d4ac0adc22ad90
|
2016-11-14T20:29:33Z
|
mmm a / test / core / client_channel / resolvers / sockaddr_resolver_test . cc <nl> ppp b / test / core / client_channel / resolvers / sockaddr_resolver_test . cc <nl> static void test_succeeds ( grpc_resolver_factory * factory , const char * string ) { <nl> grpc_resolver_next_locked ( resolver , & on_res_arg . resolver_result , <nl> on_resolution ) ; <nl> GRPC_RESOLVER_UNREF ( resolver , " test_succeeds " ) ; <nl> - <nl> grpc_uri_destroy ( uri ) ; <nl> + / * Flush ExecCtx to avoid stack - use - after - scope on on_res_arg which is <nl> + * accessed in the closure on_resolution_cb * / <nl> + grpc_core : : ExecCtx : : Get ( ) - > Flush ( ) ; <nl> } <nl> <nl> static void test_fails ( grpc_resolver_factory * factory , const char * string ) { <nl>
|
Merge pull request from yashykt / asan_sockaddr
|
grpc/grpc
|
98f22c7a95936b0560feffe07efbfb1921542e1b
|
2018-01-19T01:13:57Z
|
mmm a / src / mongo / db / repl / SConscript <nl> ppp b / src / mongo / db / repl / SConscript <nl> env . Library ( <nl> source = [ <nl> ' repl_client_info . cpp ' , <nl> ' replication_coordinator . cpp ' , <nl> + ' replication_coordinator_noop . cpp ' , <nl> ] , <nl> LIBDEPS = [ <nl> ' optime ' , <nl> new file mode 100644 <nl> index 000000000000 . . 77efa6b0cf73 <nl> mmm / dev / null <nl> ppp b / src / mongo / db / repl / replication_coordinator_noop . cpp <nl> <nl> + / * * <nl> + * Copyright ( C ) 2019 MongoDB , Inc . <nl> + * <nl> + * This program is free software : you can redistribute it and / or modify <nl> + * it under the terms of the Server Side Public License , version 1 , <nl> + * as published by MongoDB , Inc . <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> + * Server Side Public License for more details . <nl> + * <nl> + * You should have received a copy of the Server Side Public License <nl> + * along with this program . If not , see <nl> + * < http : / / www . mongodb . com / licensing / server - side - public - license > . <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 Server Side 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 " replication_coordinator_noop . h " <nl> + <nl> + namespace mongo { <nl> + namespace repl { <nl> + <nl> + ReplicationCoordinatorNoOp : : ReplicationCoordinatorNoOp ( ServiceContext * service ) <nl> + : _service ( service ) { } <nl> + <nl> + void ReplicationCoordinatorNoOp : : startup ( OperationContext * opCtx ) { } <nl> + <nl> + void ReplicationCoordinatorNoOp : : enterTerminalShutdown ( ) { } <nl> + <nl> + void ReplicationCoordinatorNoOp : : shutdown ( OperationContext * opCtx ) { } <nl> + <nl> + ReplicationCoordinator : : Mode ReplicationCoordinatorNoOp : : getReplicationMode ( ) const { <nl> + return modeReplSet ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : isReplEnabled ( ) const { <nl> + return getReplicationMode ( ) = = modeReplSet ; <nl> + } <nl> + <nl> + MemberState ReplicationCoordinatorNoOp : : getMemberState ( ) const { <nl> + return MemberState : : RS_PRIMARY ; <nl> + } <nl> + <nl> + OpTime ReplicationCoordinatorNoOp : : getMyLastAppliedOpTime ( ) const { <nl> + return OpTime { } ; <nl> + } <nl> + <nl> + const ReplSettings & ReplicationCoordinatorNoOp : : getSettings ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : isMasterForReportingPurposes ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : canAcceptWritesForDatabase ( OperationContext * opCtx , <nl> + StringData dbName ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : canAcceptWritesForDatabase_UNSAFE ( OperationContext * opCtx , <nl> + StringData dbName ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : canAcceptWritesFor_UNSAFE ( OperationContext * opCtx , <nl> + const NamespaceString & ns ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : canAcceptWritesFor ( OperationContext * opCtx , <nl> + const NamespaceString & ns ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : checkCanServeReadsFor_UNSAFE ( OperationContext * opCtx , <nl> + const NamespaceString & ns , <nl> + bool slaveOk ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : checkCanServeReadsFor ( OperationContext * opCtx , <nl> + const NamespaceString & ns , <nl> + bool slaveOk ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : isInPrimaryOrSecondaryState_UNSAFE ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : isInPrimaryOrSecondaryState ( OperationContext * opCtx ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : shouldRelaxIndexConstraints ( OperationContext * opCtx , <nl> + const NamespaceString & ns ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : getMaintenanceMode ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + WriteConcernOptions ReplicationCoordinatorNoOp : : getGetLastErrorDefault ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : buildsIndexes ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + OpTimeAndWallTime ReplicationCoordinatorNoOp : : getMyLastAppliedOpTimeAndWallTime ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + WriteConcernOptions ReplicationCoordinatorNoOp : : populateUnsetWriteConcernOptionsSyncMode ( <nl> + WriteConcernOptions wc ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + OpTime ReplicationCoordinatorNoOp : : getCurrentCommittedSnapshotOpTime ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + OpTimeAndWallTime ReplicationCoordinatorNoOp : : getCurrentCommittedSnapshotOpTimeAndWallTime ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + void ReplicationCoordinatorNoOp : : appendDiagnosticBSON ( mongo : : BSONObjBuilder * ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : appendConnectionStats ( executor : : ConnectionPoolStats * stats ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + std : : vector < repl : : MemberData > ReplicationCoordinatorNoOp : : getMemberData ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : canAcceptNonLocalWrites ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : waitForMemberState ( MemberState , Milliseconds ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Seconds ReplicationCoordinatorNoOp : : getSlaveDelaySecs ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : clearSyncSourceBlacklist ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : setFollowerMode ( const MemberState & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : setFollowerModeStrict ( OperationContext * opCtx , <nl> + const MemberState & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + ReplicationCoordinator : : ApplierState ReplicationCoordinatorNoOp : : getApplierState ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : signalDrainComplete ( OperationContext * , long long ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : waitForDrainFinish ( Milliseconds ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : signalUpstreamUpdater ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : setMyHeartbeatMessage ( const std : : string & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : setMyLastAppliedOpTimeAndWallTimeForward ( const OpTimeAndWallTime & , <nl> + DataConsistency ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : setMyLastDurableOpTimeAndWallTimeForward ( <nl> + const OpTimeAndWallTime & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : setMyLastAppliedOpTimeAndWallTime ( const OpTimeAndWallTime & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : setMyLastDurableOpTimeAndWallTime ( const OpTimeAndWallTime & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : resetMyLastOpTimes ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + OpTimeAndWallTime ReplicationCoordinatorNoOp : : getMyLastDurableOpTimeAndWallTime ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + OpTime ReplicationCoordinatorNoOp : : getMyLastDurableOpTime ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : waitUntilOpTimeForRead ( OperationContext * , <nl> + const ReadConcernArgs & readConcern ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : waitUntilOpTimeForReadUntil ( OperationContext * , <nl> + const ReadConcernArgs & , <nl> + boost : : optional < Date_t > ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : awaitTimestampCommitted ( OperationContext * opCtx , Timestamp ts ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + ReplicationCoordinator : : StatusAndDuration ReplicationCoordinatorNoOp : : awaitReplication ( <nl> + OperationContext * , const OpTime & , const WriteConcernOptions & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : stepDown ( OperationContext * , <nl> + const bool , <nl> + const Milliseconds & , <nl> + const Milliseconds & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + OID ReplicationCoordinatorNoOp : : getElectionId ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + int ReplicationCoordinatorNoOp : : getMyId ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + HostAndPort ReplicationCoordinatorNoOp : : getMyHostAndPort ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : resyncData ( OperationContext * , bool ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + StatusWith < BSONObj > ReplicationCoordinatorNoOp : : prepareReplSetUpdatePositionCommand ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : processReplSetGetStatus ( BSONObjBuilder * , <nl> + ReplSetGetStatusResponseStyle ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : fillIsMasterForReplSet ( IsMasterResponse * , <nl> + const SplitHorizon : : Parameters & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : appendSlaveInfoData ( BSONObjBuilder * ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + ReplSetConfig ReplicationCoordinatorNoOp : : getConfig ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : processReplSetGetConfig ( BSONObjBuilder * ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : processReplSetMetadata ( const rpc : : ReplSetMetadata & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : cancelAndRescheduleElectionTimeout ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : setMaintenanceMode ( bool ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : processReplSetSyncFrom ( OperationContext * , <nl> + const HostAndPort & , <nl> + BSONObjBuilder * ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : processReplSetFreeze ( int , BSONObjBuilder * ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : processReplSetReconfig ( OperationContext * , <nl> + const ReplSetReconfigArgs & , <nl> + BSONObjBuilder * ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : processReplSetInitiate ( OperationContext * , <nl> + const BSONObj & , <nl> + BSONObjBuilder * ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : abortCatchupIfNeeded ( PrimaryCatchUpConclusionReason reason ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : incrementNumCatchUpOpsIfCatchingUp ( int numOps ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : processReplSetUpdatePosition ( const UpdatePositionArgs & , <nl> + long long * ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + std : : vector < HostAndPort > ReplicationCoordinatorNoOp : : getHostsWrittenTo ( const OpTime & , bool ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + std : : vector < HostAndPort > ReplicationCoordinatorNoOp : : getOtherNodesInReplSet ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : checkIfWriteConcernCanBeSatisfied ( <nl> + const WriteConcernOptions & ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : checkIfCommitQuorumCanBeSatisfied ( <nl> + const CommitQuorumOptions & commitQuorum ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + StatusWith < bool > ReplicationCoordinatorNoOp : : checkIfCommitQuorumIsSatisfied ( <nl> + const CommitQuorumOptions & commitQuorum , <nl> + const std : : vector < HostAndPort > & commitReadyMembers ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : checkReplEnabledForCommand ( BSONObjBuilder * ) { <nl> + return Status ( ErrorCodes : : NoReplicationEnabled , " no replication on embedded " ) ; <nl> + } <nl> + <nl> + HostAndPort ReplicationCoordinatorNoOp : : chooseNewSyncSource ( const OpTime & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : blacklistSyncSource ( const HostAndPort & , Date_t ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : resetLastOpTimesFromOplog ( OperationContext * , DataConsistency ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : shouldChangeSyncSource ( const HostAndPort & , <nl> + const rpc : : ReplSetMetadata & , <nl> + boost : : optional < rpc : : OplogQueryMetadata > ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : advanceCommitPoint ( const OpTimeAndWallTime & , bool fromSyncSource ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + OpTime ReplicationCoordinatorNoOp : : getLastCommittedOpTime ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + OpTimeAndWallTime ReplicationCoordinatorNoOp : : getLastCommittedOpTimeAndWallTime ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : processReplSetRequestVotes ( OperationContext * , <nl> + const ReplSetRequestVotesArgs & , <nl> + ReplSetRequestVotesResponse * ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : prepareReplMetadata ( const BSONObj & , <nl> + const OpTime & , <nl> + BSONObjBuilder * ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : getWriteConcernMajorityShouldJournal ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : processHeartbeatV1 ( const ReplSetHeartbeatArgsV1 & , <nl> + ReplSetHeartbeatResponse * ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + long long ReplicationCoordinatorNoOp : : getTerm ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : updateTerm ( OperationContext * , long long ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : waitUntilSnapshotCommitted ( OperationContext * , const Timestamp & ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + size_t ReplicationCoordinatorNoOp : : getNumUncommittedSnapshots ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : createWMajorityWriteAvailabilityDateWaiter ( OpTime opTime ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : dropAllSnapshots ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + Status ReplicationCoordinatorNoOp : : stepUpIfEligible ( bool skipDryRun ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : signalDropPendingCollectionsRemovedFromStorage ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + boost : : optional < Timestamp > ReplicationCoordinatorNoOp : : getRecoveryTimestamp ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + bool ReplicationCoordinatorNoOp : : setContainsArbiter ( ) const { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : attemptToAdvanceStableTimestamp ( ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + void ReplicationCoordinatorNoOp : : finishRecoveryIfEligible ( OperationContext * opCtx ) { <nl> + MONGO_UNREACHABLE ; <nl> + } <nl> + <nl> + } / / namespace repl <nl> + } / / namespace mongo <nl> new file mode 100644 <nl> index 000000000000 . . 821ed68617e2 <nl> mmm / dev / null <nl> ppp b / src / mongo / db / repl / replication_coordinator_noop . h <nl> <nl> + / * * <nl> + * Copyright ( C ) 2019 MongoDB , Inc . <nl> + * <nl> + * This program is free software : you can redistribute it and / or modify <nl> + * it under the terms of the Server Side Public License , version 1 , <nl> + * as published by MongoDB , Inc . <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> + * Server Side Public License for more details . <nl> + * <nl> + * You should have received a copy of the Server Side Public License <nl> + * along with this program . If not , see <nl> + * < http : / / www . mongodb . com / licensing / server - side - public - license > . <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 Server Side 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 / db / repl / replication_coordinator . h " <nl> + <nl> + namespace mongo { <nl> + namespace repl { <nl> + <nl> + / * * <nl> + * Stub implementation for tests , or programs like mongocryptd , that want a non - null <nl> + * ReplicationCoordinator but don ' t need any replication logic . <nl> + * / <nl> + class ReplicationCoordinatorNoOp final : public ReplicationCoordinator { <nl> + <nl> + public : <nl> + ReplicationCoordinatorNoOp ( ServiceContext * serviceContext ) ; <nl> + ~ ReplicationCoordinatorNoOp ( ) = default ; <nl> + <nl> + ReplicationCoordinatorNoOp ( ReplicationCoordinatorNoOp & ) = delete ; <nl> + ReplicationCoordinatorNoOp & operator = ( ReplicationCoordinatorNoOp & ) = delete ; <nl> + <nl> + void startup ( OperationContext * opCtx ) final ; <nl> + <nl> + void enterTerminalShutdown ( ) final ; <nl> + <nl> + void shutdown ( OperationContext * opCtx ) final ; <nl> + <nl> + ServiceContext * getServiceContext ( ) final { <nl> + return _service ; <nl> + } <nl> + <nl> + const ReplSettings & getSettings ( ) const final ; <nl> + <nl> + Mode getReplicationMode ( ) const final ; <nl> + bool getMaintenanceMode ( ) final ; <nl> + <nl> + bool isReplEnabled ( ) const final ; <nl> + bool isMasterForReportingPurposes ( ) final ; <nl> + bool isInPrimaryOrSecondaryState ( OperationContext * opCtx ) const final ; <nl> + bool isInPrimaryOrSecondaryState_UNSAFE ( ) const final ; <nl> + <nl> + bool canAcceptWritesForDatabase ( OperationContext * opCtx , StringData dbName ) final ; <nl> + bool canAcceptWritesForDatabase_UNSAFE ( OperationContext * opCtx , StringData dbName ) final ; <nl> + <nl> + bool canAcceptWritesFor ( OperationContext * opCtx , const NamespaceString & ns ) final ; <nl> + bool canAcceptWritesFor_UNSAFE ( OperationContext * opCtx , const NamespaceString & ns ) final ; <nl> + <nl> + Status checkCanServeReadsFor ( OperationContext * opCtx , <nl> + const NamespaceString & ns , <nl> + bool slaveOk ) final ; <nl> + Status checkCanServeReadsFor_UNSAFE ( OperationContext * opCtx , <nl> + const NamespaceString & ns , <nl> + bool slaveOk ) final ; <nl> + <nl> + bool shouldRelaxIndexConstraints ( OperationContext * opCtx , const NamespaceString & ns ) final ; <nl> + <nl> + WriteConcernOptions getGetLastErrorDefault ( ) final ; <nl> + <nl> + WriteConcernOptions populateUnsetWriteConcernOptionsSyncMode ( WriteConcernOptions wc ) final ; <nl> + <nl> + bool buildsIndexes ( ) final ; <nl> + <nl> + MemberState getMemberState ( ) const final ; <nl> + <nl> + bool canAcceptNonLocalWrites ( ) const final ; <nl> + <nl> + std : : vector < MemberData > getMemberData ( ) const final ; <nl> + <nl> + Status waitForMemberState ( MemberState , Milliseconds ) final ; <nl> + <nl> + Seconds getSlaveDelaySecs ( ) const final ; <nl> + <nl> + void clearSyncSourceBlacklist ( ) final ; <nl> + <nl> + ReplicationCoordinator : : StatusAndDuration awaitReplication ( OperationContext * , <nl> + const OpTime & , <nl> + const WriteConcernOptions & ) final ; <nl> + <nl> + void stepDown ( OperationContext * , bool , const Milliseconds & , const Milliseconds & ) final ; <nl> + <nl> + Status checkIfWriteConcernCanBeSatisfied ( const WriteConcernOptions & ) const final ; <nl> + <nl> + Status checkIfCommitQuorumCanBeSatisfied ( const CommitQuorumOptions & commitQuorum ) const final ; <nl> + <nl> + StatusWith < bool > checkIfCommitQuorumIsSatisfied ( <nl> + const CommitQuorumOptions & commitQuorum , <nl> + const std : : vector < HostAndPort > & commitReadyMembers ) const final ; <nl> + <nl> + void setMyLastAppliedOpTimeAndWallTime ( const OpTimeAndWallTime & opTimeAndWallTime ) final ; <nl> + void setMyLastDurableOpTimeAndWallTime ( const OpTimeAndWallTime & opTimeAndWallTime ) final ; <nl> + void setMyLastAppliedOpTimeAndWallTimeForward ( const OpTimeAndWallTime & opTimeAndWallTime , <nl> + DataConsistency consistency ) final ; <nl> + void setMyLastDurableOpTimeAndWallTimeForward ( const OpTimeAndWallTime & opTimeAndWallTime ) final ; <nl> + <nl> + void resetMyLastOpTimes ( ) final ; <nl> + <nl> + void setMyHeartbeatMessage ( const std : : string & ) final ; <nl> + <nl> + OpTime getMyLastAppliedOpTime ( ) const final ; <nl> + OpTimeAndWallTime getMyLastAppliedOpTimeAndWallTime ( ) const final ; <nl> + <nl> + OpTime getMyLastDurableOpTime ( ) const final ; <nl> + OpTimeAndWallTime getMyLastDurableOpTimeAndWallTime ( ) const final ; <nl> + <nl> + Status waitUntilOpTimeForReadUntil ( OperationContext * , <nl> + const ReadConcernArgs & , <nl> + boost : : optional < Date_t > ) final ; <nl> + <nl> + Status waitUntilOpTimeForRead ( OperationContext * , const ReadConcernArgs & ) final ; <nl> + Status awaitTimestampCommitted ( OperationContext * opCtx , Timestamp ts ) final ; <nl> + <nl> + OID getElectionId ( ) final ; <nl> + <nl> + int getMyId ( ) const final ; <nl> + <nl> + HostAndPort getMyHostAndPort ( ) const final ; <nl> + <nl> + Status setFollowerMode ( const MemberState & ) final ; <nl> + <nl> + Status setFollowerModeStrict ( OperationContext * opCtx , const MemberState & ) final ; <nl> + <nl> + ApplierState getApplierState ( ) final ; <nl> + <nl> + void signalDrainComplete ( OperationContext * , long long ) final ; <nl> + <nl> + Status waitForDrainFinish ( Milliseconds ) final ; <nl> + <nl> + void signalUpstreamUpdater ( ) final ; <nl> + <nl> + Status resyncData ( OperationContext * , bool ) final ; <nl> + <nl> + StatusWith < BSONObj > prepareReplSetUpdatePositionCommand ( ) const final ; <nl> + <nl> + Status processReplSetGetStatus ( BSONObjBuilder * , ReplSetGetStatusResponseStyle ) final ; <nl> + <nl> + void fillIsMasterForReplSet ( IsMasterResponse * , const SplitHorizon : : Parameters & horizon ) final ; <nl> + <nl> + void appendSlaveInfoData ( BSONObjBuilder * ) final ; <nl> + <nl> + ReplSetConfig getConfig ( ) const final ; <nl> + <nl> + void processReplSetGetConfig ( BSONObjBuilder * ) final ; <nl> + <nl> + void processReplSetMetadata ( const rpc : : ReplSetMetadata & ) final ; <nl> + <nl> + void advanceCommitPoint ( const OpTimeAndWallTime & committedOpTimeAndWallTime , <nl> + bool fromSyncSource ) final ; <nl> + <nl> + void cancelAndRescheduleElectionTimeout ( ) final ; <nl> + <nl> + Status setMaintenanceMode ( bool ) final ; <nl> + <nl> + Status processReplSetSyncFrom ( OperationContext * , const HostAndPort & , BSONObjBuilder * ) final ; <nl> + <nl> + Status processReplSetFreeze ( int , BSONObjBuilder * ) final ; <nl> + <nl> + Status processReplSetReconfig ( OperationContext * , <nl> + const ReplSetReconfigArgs & , <nl> + BSONObjBuilder * ) final ; <nl> + <nl> + Status processReplSetInitiate ( OperationContext * , const BSONObj & , BSONObjBuilder * ) final ; <nl> + <nl> + Status processReplSetUpdatePosition ( const UpdatePositionArgs & , long long * ) final ; <nl> + <nl> + std : : vector < HostAndPort > getHostsWrittenTo ( const OpTime & , bool ) final ; <nl> + <nl> + std : : vector < HostAndPort > getOtherNodesInReplSet ( ) const final ; <nl> + <nl> + Status checkReplEnabledForCommand ( BSONObjBuilder * ) final ; <nl> + <nl> + <nl> + HostAndPort chooseNewSyncSource ( const OpTime & ) final ; <nl> + <nl> + void blacklistSyncSource ( const HostAndPort & , Date_t ) final ; <nl> + <nl> + void resetLastOpTimesFromOplog ( OperationContext * , DataConsistency ) final ; <nl> + <nl> + bool shouldChangeSyncSource ( const HostAndPort & , <nl> + const rpc : : ReplSetMetadata & , <nl> + boost : : optional < rpc : : OplogQueryMetadata > ) final ; <nl> + <nl> + OpTime getLastCommittedOpTime ( ) const final ; <nl> + <nl> + OpTimeAndWallTime getLastCommittedOpTimeAndWallTime ( ) const final ; <nl> + <nl> + Status processReplSetRequestVotes ( OperationContext * , <nl> + const ReplSetRequestVotesArgs & , <nl> + ReplSetRequestVotesResponse * ) final ; <nl> + <nl> + void prepareReplMetadata ( const BSONObj & , const OpTime & , BSONObjBuilder * ) const final ; <nl> + <nl> + Status processHeartbeatV1 ( const ReplSetHeartbeatArgsV1 & , ReplSetHeartbeatResponse * ) final ; <nl> + <nl> + bool getWriteConcernMajorityShouldJournal ( ) final ; <nl> + <nl> + void dropAllSnapshots ( ) final ; <nl> + <nl> + long long getTerm ( ) final ; <nl> + <nl> + Status updateTerm ( OperationContext * , long long ) final ; <nl> + <nl> + OpTime getCurrentCommittedSnapshotOpTime ( ) const final ; <nl> + <nl> + OpTimeAndWallTime getCurrentCommittedSnapshotOpTimeAndWallTime ( ) const final ; <nl> + <nl> + void waitUntilSnapshotCommitted ( OperationContext * , const Timestamp & ) final ; <nl> + <nl> + void appendDiagnosticBSON ( BSONObjBuilder * ) final ; <nl> + <nl> + void appendConnectionStats ( executor : : ConnectionPoolStats * stats ) const final ; <nl> + <nl> + size_t getNumUncommittedSnapshots ( ) final ; <nl> + <nl> + virtual void createWMajorityWriteAvailabilityDateWaiter ( OpTime opTime ) final ; <nl> + <nl> + Status stepUpIfEligible ( bool skipDryRun ) final ; <nl> + <nl> + Status abortCatchupIfNeeded ( PrimaryCatchUpConclusionReason reason ) final ; <nl> + <nl> + void incrementNumCatchUpOpsIfCatchingUp ( int numOps ) final ; <nl> + <nl> + void signalDropPendingCollectionsRemovedFromStorage ( ) final ; <nl> + <nl> + boost : : optional < Timestamp > getRecoveryTimestamp ( ) final ; <nl> + <nl> + bool setContainsArbiter ( ) const final ; <nl> + <nl> + void attemptToAdvanceStableTimestamp ( ) final ; <nl> + <nl> + void finishRecoveryIfEligible ( OperationContext * opCtx ) final ; <nl> + <nl> + private : <nl> + ServiceContext * const _service ; <nl> + } ; <nl> + <nl> + } / / namespace repl <nl> + } / / namespace mongo <nl>
|
SERVER - 43372 Add ReplicationCoordinatorNoOp
|
mongodb/mongo
|
e2c85ad312f7071cb748ae0633c64245da8bd53c
|
2019-09-23T12:24:46Z
|
mmm a / samples / Cpp / HelloCpp / CMakeLists . txt <nl> ppp b / samples / Cpp / HelloCpp / CMakeLists . txt <nl> add_executable ( $ { APP_NAME } <nl> $ { SAMPLE_SRC } <nl> ) <nl> <nl> - # get our resources <nl> - add_custom_command ( TARGET $ { APP_NAME } PRE_BUILD <nl> - COMMAND $ { CMAKE_COMMAND } - E copy_directory <nl> - $ { CMAKE_CURRENT_SOURCE_DIR } / Resources $ { CMAKE_CURRENT_BINARY_DIR } ) <nl> - <nl> if ( WIN32 AND MSVC ) <nl> - <nl> + # get our resources <nl> + add_custom_command ( TARGET $ { APP_NAME } PRE_BUILD <nl> + COMMAND $ { CMAKE_COMMAND } - E copy_directory <nl> + $ { CMAKE_CURRENT_SOURCE_DIR } / Resources $ { CMAKE_CURRENT_BINARY_DIR } ) <nl> # get our dlls <nl> add_custom_command ( TARGET $ { APP_NAME } PRE_BUILD <nl> COMMAND $ { CMAKE_COMMAND } - E copy <nl> if ( WIN32 AND MSVC ) <nl> # Visual Studio Defaults to wrong type <nl> set_target_properties ( $ { APP_NAME } PROPERTIES LINK_FLAGS_DEBUG " / SUBSYSTEM : WINDOWS " ) <nl> set_target_properties ( $ { APP_NAME } PROPERTIES LINK_FLAGS_RELEASE " / SUBSYSTEM : WINDOWS " ) <nl> + else ( ) <nl> + set ( APP_BIN_DIR " $ { CMAKE_SOURCE_DIR } / bin / $ { APP_NAME } " ) <nl> + <nl> + set_target_properties ( $ { APP_NAME } PROPERTIES <nl> + RUNTIME_OUTPUT_DIRECTORY " $ { APP_BIN_DIR } " ) <nl> + <nl> + pre_build ( $ { APP_NAME } <nl> + COMMAND $ { CMAKE_COMMAND } - E remove_directory $ { APP_BIN_DIR } / Resources <nl> + COMMAND $ { CMAKE_COMMAND } - E copy_directory $ { CMAKE_CURRENT_SOURCE_DIR } / Resources $ { APP_BIN_DIR } / Resources <nl> + ) <nl> endif ( ) <nl> <nl> target_link_libraries ( $ { APP_NAME } audio cocos2d ) <nl>
|
Generates execute file in cocos root_dir / bin folder for HelloCpp .
|
cocos2d/cocos2d-x
|
902490c79a88475b82e60f05813f26bb8d8d6598
|
2013-12-26T12:09:03Z
|
mmm a / userguide / image_classifier / how - it - works . md <nl> ppp b / userguide / image_classifier / how - it - works . md <nl> Only available on macOS 10 . 14 and higher . This model is included in the <nl> operating system , so the exported model size is very small . <nl> <nl> * Core ML exported models are about 40KB <nl> - <nl> - <nl> - # # Performance <nl> - <nl> - It ’ s always important to make sure any machine learning technique is <nl> - consistent in its usefulness , and that its success is not a fluke . In <nl> - order to do that , we ' ve tested it on several datasets . For each dataset , <nl> - the experiment was identical . We trained a model on a dataset of just a <nl> - small number of images , and then evaluated the accuracy on a completely <nl> - different dataset of roughly 1800 images per category . <nl> - <nl> - Here is a short summary of results : <nl> - <nl> - # # # # Resnet <nl> - <nl> - Performance on 50 datasets with 5 categories , 25 training examples <nl> - per category <nl> - - Median accuracy : 0 . 994667 <nl> - - Max accuracy : 1 . 000000 <nl> - - Min accuracy : 0 . 978667 <nl> - <nl> - Performance on 50 datasets with 5 categories , 50 training examples <nl> - per category <nl> - - Median accuracy : 0 . 996000 <nl> - - Max accuracy : 1 . 000000 <nl> - - Min accuracy : 0 . 980000 <nl> - <nl> - # # # # Squeezenet <nl> - <nl> - Performance on 50 datasets with 5 categories , 25 training examples <nl> - per category <nl> - - Median accuracy : 0 . 961333 <nl> - - Max accuracy : 0 . 981333 <nl> - - Min accuracy : 0 . 912000 <nl> - <nl> - Performance on 50 datasets with 5 categories , 50 training examples per <nl> - category <nl> - - Median accuracy : 0 . 970000 <nl> - - Max accuracy : 0 . 988000 <nl> - - Min accuracy : 0 . 876000 <nl> - <nl> - # # # # VisionFeaturePrint_Screen <nl> - <nl> - Performance on 50 datasets with 5 categories , 25 training examples <nl> - per category <nl> - - Median accuracy : 0 . 970309 <nl> - - Max accuracy : 0 . 992788 <nl> - - Min accuracy : 0 . 846873 <nl> - <nl> - Performance on 50 datasets with 5 categories , 50 training examples per <nl> - category <nl> - - Median accuracy : 0 . 976342 <nl> - - Max accuracy : 0 . 988342 <nl> - - Min accuracy : 0 . 944571 <nl> - <nl> - To give you some perspective , a [ user <nl> - study ] ( https : / / arxiv . org / abs / 1409 . 0575 ) was made on a dataset with 1000 <nl> - classes and measured human performance is about 94 % . <nl> - <nl>
|
Update how - it - works . md
|
apple/turicreate
|
86c65447504be4e4bdd3378d88957c6f1b0d4d63
|
2019-01-10T15:35:28Z
|
mmm a / include / spdlog / details / log_msg_buffer . h <nl> ppp b / include / spdlog / details / log_msg_buffer . h <nl> <nl> # pragma once <nl> <nl> # include " spdlog / details / log_msg . h " <nl> - # include " spdlog / fmt / bundled / core . h " <nl> + # include " spdlog / fmt / fmt . h " <nl> <nl> namespace spdlog { <nl> namespace details { <nl> class log_msg_buffer : public log_msg <nl> } ; <nl> <nl> } / / namespace details <nl> - } / / namespace spdlog <nl> \ No newline at end of file <nl> + } / / namespace spdlog <nl>
|
Fixed { fmt } include if using the non - bundled version
|
gabime/spdlog
|
9c5869ce5aa9a5cefda1db14f4bae91db2ed507f
|
2019-08-31T19:30:36Z
|
mmm a / src / compiler / analysis / alias_manager . cpp <nl> ppp b / src / compiler / analysis / alias_manager . cpp <nl> ExpressionPtr AliasManager : : canonicalizeRecur ( ExpressionPtr e ) { <nl> case Expression : : KindOfSimpleFunctionCall : <nl> delayVars = false ; <nl> / / fall through <nl> - <nl> + <nl> case Expression : : KindOfNewObjectExpression : <nl> pushStack = m_accessList . size ( ) > 0 ; <nl> break ; <nl> int AliasManager : : collectAliasInfoRecur ( ConstructPtr cs , bool unused ) { <nl> m_scope - > getContainingFunction ( ) - > setNextLSB ( true ) ; <nl> } <nl> } <nl> + } else if ( unused & & b - > isShortCircuitOperator ( ) ) { <nl> + b - > getExp2 ( ) - > setUnused ( true ) ; <nl> } <nl> break ; <nl> } <nl> <nl> + case Expression : : KindOfQOpExpression : <nl> + if ( unused ) { <nl> + if ( ExpressionPtr t1 = e - > getNthExpr ( 1 ) ) t1 - > setUnused ( true ) ; <nl> + e - > getNthExpr ( 2 ) - > setUnused ( true ) ; <nl> + } <nl> + break ; <nl> + <nl> default : <nl> break ; <nl> } <nl> mmm a / src / compiler / expression / binary_op_expression . cpp <nl> ppp b / src / compiler / expression / binary_op_expression . cpp <nl> ExpressionPtr BinaryOpExpression : : preOptimize ( AnalysisResultConstPtr ar ) { <nl> } catch ( Exception & e ) { <nl> / / runtime / base threw an exception , perhaps bad operands <nl> } <nl> - if ( ! optExp ) { <nl> - if ( isShortCircuitOperator ( ) ) optExp = simplifyLogical ( ar ) ; <nl> - } <nl> if ( optExp ) optExp = replaceValue ( optExp ) ; <nl> return optExp ; <nl> } <nl> bool BinaryOpExpression : : preOutputCPP ( CodeGenerator & cg , AnalysisResultPtr ar , <nl> m_op = = T_LOGICAL_OR | | m_op = = T_BOOLEAN_OR ? " ! " : " " , <nl> tmp . c_str ( ) ) ; <nl> m_exp2 - > preOutputCPP ( cg , ar , 0 ) ; <nl> - cg_printf ( " % s = ( " , tmp . c_str ( ) ) ; <nl> + if ( ! isUnused ( ) ) cg_printf ( " % s = ( " , tmp . c_str ( ) ) ; <nl> m_exp2 - > outputCPP ( cg , ar ) ; <nl> - cg_printf ( " ) ; \ n " ) ; <nl> + if ( ! isUnused ( ) ) cg_printf ( " ) " ) ; <nl> + cg_printf ( " ; \ n " ) ; <nl> cg_indentEnd ( " } \ n " ) ; <nl> m_cppTemp = tmp ; <nl> } else if ( state & FixOrder ) { <nl> mmm a / src / compiler / expression / expression . cpp <nl> ppp b / src / compiler / expression / expression . cpp <nl> Expression : : ExprClass Expression : : getExprClass ( ) const { <nl> return cls ; <nl> } <nl> <nl> + bool Expression : : getEffectiveScalar ( Variant & v ) { <nl> + if ( is ( KindOfExpressionList ) ) { <nl> + ExpressionRawPtr sub = static_cast < ExpressionList * > ( this ) - > listValue ( ) ; <nl> + if ( ! sub ) return false ; <nl> + return sub - > getEffectiveScalar ( v ) ; <nl> + } <nl> + return getScalarValue ( v ) ; <nl> + } <nl> + <nl> void Expression : : addElement ( ExpressionPtr exp ) { <nl> ASSERT ( false ) ; <nl> } <nl> mmm a / src / compiler / expression / expression . h <nl> ppp b / src / compiler / expression / expression . h <nl> class Expression : public Construct { <nl> virtual bool isScalar ( ) const { return false ; } <nl> virtual bool isRefable ( bool checkError = false ) const { return false ; } <nl> virtual bool getScalarValue ( Variant & value ) { return false ; } <nl> + bool getEffectiveScalar ( Variant & value ) ; <nl> virtual ExpressionPtr clone ( ) { <nl> ASSERT ( false ) ; <nl> return ExpressionPtr ( ) ; <nl> mmm a / src / compiler / expression / function_call . cpp <nl> ppp b / src / compiler / expression / function_call . cpp <nl> FunctionCall : : FunctionCall <nl> StaticClassName ( classExp ) , m_nameExp ( nameExp ) , <nl> m_ciTemp ( - 1 ) , m_params ( params ) , m_valid ( false ) , <nl> m_extraArg ( 0 ) , m_variableArgument ( false ) , m_voidReturn ( false ) , <nl> - m_voidWrapper ( false ) , m_allowVoidReturn ( false ) , m_redeclared ( false ) , <nl> + m_voidWrapper ( false ) , m_redeclared ( false ) , <nl> m_noStatic ( false ) , m_noInline ( false ) , m_invokeFewArgsDecision ( true ) , <nl> m_arrayParams ( false ) , <nl> m_argArrayId ( - 1 ) , m_argArrayHash ( - 1 ) , m_argArrayIndex ( - 1 ) { <nl> TypePtr FunctionCall : : checkParamsAndReturn ( AnalysisResultPtr ar , <nl> if ( ! frt ) { <nl> m_voidReturn = true ; <nl> setActualType ( TypePtr ( ) ) ; <nl> - if ( ! type - > is ( Type : : KindOfAny ) ) { <nl> - if ( ! m_allowVoidReturn & & ! func - > isFirstPass ( ) & & ! func - > isAbstract ( ) ) { <nl> + if ( ! isUnused ( ) & & ! type - > is ( Type : : KindOfAny ) ) { <nl> + if ( ! hasContext ( ReturnContext ) & & <nl> + ! func - > isFirstPass ( ) & & ! func - > isAbstract ( ) ) { <nl> Compiler : : Error ( Compiler : : UseVoidReturn , self ) ; <nl> } <nl> m_voidWrapper = true ; <nl> mmm a / src / compiler / expression / function_call . h <nl> ppp b / src / compiler / expression / function_call . h <nl> class FunctionCall : public Expression , public StaticClassName { <nl> ExpressionPtr getNameExp ( ) const { return m_nameExp ; } <nl> ExpressionListPtr getParams ( ) const { return m_params ; } <nl> void setNoInline ( ) { m_noInline = true ; } <nl> - void setAllowVoidReturn ( ) { m_allowVoidReturn = true ; } <nl> void setFunctionAndClassScope ( FunctionScopePtr fsp , ClassScopePtr csp ) ; <nl> bool preOutputCPP ( CodeGenerator & cg , AnalysisResultPtr ar , <nl> int state ) ; <nl> class FunctionCall : public Expression , public StaticClassName { <nl> unsigned m_variableArgument : 1 ; <nl> unsigned m_voidReturn : 1 ; / / no return type <nl> unsigned m_voidWrapper : 1 ; / / void wrapper is needed <nl> - unsigned m_allowVoidReturn : 1 ; <nl> unsigned m_redeclared : 1 ; <nl> unsigned m_noStatic : 1 ; <nl> unsigned m_noInline : 1 ; <nl> mmm a / src / compiler / expression / qop_expression . cpp <nl> ppp b / src / compiler / expression / qop_expression . cpp <nl> bool QOpExpression : : preOutputCPP ( CodeGenerator & cg , AnalysisResultPtr ar , <nl> <nl> if ( fix_yes | | fix_no ) { <nl> cg . wrapExpressionBegin ( ) ; <nl> - std : : string tmp = genCPPTemp ( cg , ar ) ; <nl> - <nl> - if ( m_expYes ) { <nl> - TypePtr typeYes = m_expYes - > getActualType ( ) ; <nl> - TypePtr typeNo = m_expNo - > getActualType ( ) ; <nl> - TypePtr type = <nl> - typeYes & & typeNo & & Type : : SameType ( typeYes , typeNo ) & & <nl> - ! typeYes - > is ( Type : : KindOfVariant ) & & <nl> - m_expYes - > isLiteralString ( ) = = m_expNo - > isLiteralString ( ) ? <nl> - typeYes : Type : : Variant ; <nl> - <nl> - type - > outputCPPDecl ( cg , ar , getScope ( ) ) ; <nl> - cg_printf ( " % s ; \ n " , tmp . c_str ( ) ) ; <nl> + if ( isUnused ( ) ) { <nl> cg_printf ( " if ( " ) ; <nl> m_condition - > outputCPP ( cg , ar ) ; <nl> cg_indentBegin ( " ) { \ n " ) ; <nl> - m_expYes - > preOutputCPP ( cg , ar , 0 ) ; <nl> - cg_printf ( " % s = ( " , tmp . c_str ( ) ) ; <nl> - m_expYes - > outputCPP ( cg , ar ) ; <nl> - cg_indentEnd ( " ) ; \ n " ) ; <nl> + if ( m_expYes ) { <nl> + m_expYes - > preOutputCPP ( cg , ar , 0 ) ; <nl> + if ( m_expYes - > outputCPPUnneeded ( cg , ar ) ) cg_printf ( " ; \ n " ) ; <nl> + } <nl> + cg_indentEnd ( " \ n " ) ; <nl> + cg_indentBegin ( " } else { \ n " ) ; <nl> + m_expNo - > preOutputCPP ( cg , ar , 0 ) ; <nl> + if ( m_expNo - > outputCPPUnneeded ( cg , ar ) ) cg_printf ( " ; \ n " ) ; <nl> + cg_indentEnd ( " } \ n " ) ; <nl> + m_cppValue = " null_variant " ; <nl> } else { <nl> - TypePtr typeYes = m_condition - > getActualType ( ) ; <nl> - TypePtr typeNo = m_expNo - > getActualType ( ) ; <nl> - TypePtr type = <nl> - typeYes & & typeNo & & Type : : SameType ( typeYes , typeNo ) & & <nl> - ! typeYes - > is ( Type : : KindOfVariant ) & & <nl> - m_condition - > isLiteralString ( ) = = m_expNo - > isLiteralString ( ) ? <nl> - typeYes : Type : : Variant ; <nl> - <nl> - type - > outputCPPDecl ( cg , ar , getScope ( ) ) ; <nl> - cg_printf ( " % s = " , tmp . c_str ( ) ) ; <nl> - m_condition - > outputCPP ( cg , ar ) ; <nl> - cg_printf ( " ; \ n " ) ; <nl> - cg_printf ( " if ( toBoolean ( % s ) ) { \ n " , tmp . c_str ( ) ) ; <nl> - } <nl> + std : : string tmp = genCPPTemp ( cg , ar ) ; <nl> <nl> - cg_indentBegin ( " } else { \ n " ) ; <nl> - m_expNo - > preOutputCPP ( cg , ar , 0 ) ; <nl> - cg_printf ( " % s = ( " , tmp . c_str ( ) ) ; <nl> - m_expNo - > outputCPP ( cg , ar ) ; <nl> - cg_printf ( " ) ; \ n " ) ; <nl> - cg_indentEnd ( " } \ n " ) ; <nl> - m_cppValue = tmp ; <nl> + if ( m_expYes ) { <nl> + TypePtr typeYes = m_expYes - > getActualType ( ) ; <nl> + TypePtr typeNo = m_expNo - > getActualType ( ) ; <nl> + TypePtr type = <nl> + typeYes & & typeNo & & Type : : SameType ( typeYes , typeNo ) & & <nl> + ! typeYes - > is ( Type : : KindOfVariant ) & & <nl> + m_expYes - > isLiteralString ( ) = = m_expNo - > isLiteralString ( ) ? <nl> + typeYes : Type : : Variant ; <nl> + <nl> + type - > outputCPPDecl ( cg , ar , getScope ( ) ) ; <nl> + cg_printf ( " % s ; \ n " , tmp . c_str ( ) ) ; <nl> + cg_printf ( " if ( " ) ; <nl> + m_condition - > outputCPP ( cg , ar ) ; <nl> + cg_indentBegin ( " ) { \ n " ) ; <nl> + m_expYes - > preOutputCPP ( cg , ar , 0 ) ; <nl> + cg_printf ( " % s = ( " , tmp . c_str ( ) ) ; <nl> + m_expYes - > outputCPP ( cg , ar ) ; <nl> + cg_indentEnd ( " ) ; \ n " ) ; <nl> + } else { <nl> + TypePtr typeYes = m_condition - > getActualType ( ) ; <nl> + TypePtr typeNo = m_expNo - > getActualType ( ) ; <nl> + TypePtr type = <nl> + typeYes & & typeNo & & Type : : SameType ( typeYes , typeNo ) & & <nl> + ! typeYes - > is ( Type : : KindOfVariant ) & & <nl> + m_condition - > isLiteralString ( ) = = m_expNo - > isLiteralString ( ) ? <nl> + typeYes : Type : : Variant ; <nl> + <nl> + type - > outputCPPDecl ( cg , ar , getScope ( ) ) ; <nl> + cg_printf ( " % s = " , tmp . c_str ( ) ) ; <nl> + m_condition - > outputCPP ( cg , ar ) ; <nl> + cg_printf ( " ; \ n " ) ; <nl> + cg_printf ( " if ( toBoolean ( % s ) ) { \ n " , tmp . c_str ( ) ) ; <nl> + } <nl> <nl> + cg_indentBegin ( " } else { \ n " ) ; <nl> + m_expNo - > preOutputCPP ( cg , ar , 0 ) ; <nl> + cg_printf ( " % s = ( " , tmp . c_str ( ) ) ; <nl> + m_expNo - > outputCPP ( cg , ar ) ; <nl> + cg_printf ( " ) ; \ n " ) ; <nl> + cg_indentEnd ( " } \ n " ) ; <nl> + m_cppValue = tmp ; <nl> + } <nl> } else if ( state & FixOrder ) { <nl> preOutputStash ( cg , ar , state ) ; <nl> return true ; <nl> mmm a / src / compiler / expression / simple_function_call . cpp <nl> ppp b / src / compiler / expression / simple_function_call . cpp <nl> void SimpleFunctionCall : : analyzeProgram ( AnalysisResultPtr ar ) { <nl> if ( m_params ) { <nl> markRefParams ( m_funcScope , m_name , canInvokeFewArgs ( ) ) ; <nl> } <nl> + } else if ( ar - > getPhase ( ) = = AnalysisResult : : AnalyzeFinal ) { <nl> + if ( ! m_class & & ! m_redeclared & & ! m_dynamicInvoke & & ! m_funcScope & & <nl> + ( m_className . empty ( ) | | <nl> + ( m_classScope & & <nl> + ! m_classScope - > derivesFromRedeclaring ( ) & & <nl> + ! m_classScope - > getAttribute ( <nl> + ClassScope : : HasUnknownStaticMethodHandler ) & & <nl> + ! m_classScope - > getAttribute ( <nl> + ClassScope : : InheritsUnknownStaticMethodHandler ) ) ) ) { <nl> + Compiler : : Error ( Compiler : : UnknownFunction , shared_from_this ( ) ) ; <nl> + } <nl> } <nl> } <nl> <nl> TypePtr SimpleFunctionCall : : inferAndCheck ( AnalysisResultPtr ar , TypePtr type , <nl> m_redeclared = true ; <nl> getScope ( ) - > getVariables ( ) - > <nl> setAttribute ( VariableTable : : NeedGlobalPointer ) ; <nl> - } else if ( ! m_dynamicInvoke & & <nl> - ( ! m_classScope | | <nl> - ( ! m_classScope - > derivesFromRedeclaring ( ) & & <nl> - ! m_classScope - > getAttribute ( <nl> - ClassScope : : HasUnknownStaticMethodHandler ) & & <nl> - ! m_classScope - > getAttribute ( <nl> - ClassScope : : InheritsUnknownStaticMethodHandler ) ) ) & & <nl> - getScope ( ) - > isFirstPass ( ) ) { <nl> - Compiler : : Error ( Compiler : : UnknownFunction , self ) ; <nl> } <nl> if ( m_params ) { <nl> if ( func ) { <nl> mmm a / src / compiler / statement / exp_statement . cpp <nl> ppp b / src / compiler / statement / exp_statement . cpp <nl> void ExpStatement : : onParse ( AnalysisResultConstPtr ar , FileScopePtr scope ) { <nl> m_exp = include ; <nl> } <nl> <nl> - void ExpStatement : : analyzeShortCircuit ( AnalysisResultPtr ar ) { <nl> - if ( ! m_exp - > is ( Expression : : KindOfBinaryOpExpression ) ) return ; <nl> - <nl> - BinaryOpExpressionPtr exp = dynamic_pointer_cast < BinaryOpExpression > ( m_exp ) ; <nl> - if ( exp - > isShortCircuitOperator ( ) ) { <nl> - FunctionCallPtr call = dynamic_pointer_cast < FunctionCall > ( exp - > getExp2 ( ) ) ; <nl> - if ( call ) { <nl> - call - > setAllowVoidReturn ( ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / static analysis functions <nl> <nl> mmm a / src / compiler / statement / exp_statement . h <nl> ppp b / src / compiler / statement / exp_statement . h <nl> class ExpStatement : public Statement , public IParseHandler { <nl> <nl> void onParse ( AnalysisResultConstPtr ar , FileScopePtr scope ) ; <nl> <nl> - / * * <nl> - * Allow 2nd expression to use void returns . <nl> - * / <nl> - void analyzeShortCircuit ( AnalysisResultPtr ar ) ; <nl> - <nl> virtual bool kidUnused ( int i ) const { return i = = 0 ; } <nl> private : <nl> ExpressionPtr m_exp ; <nl> mmm a / src / compiler / statement / if_branch_statement . h <nl> ppp b / src / compiler / statement / if_branch_statement . h <nl> class IfBranchStatement : public Statement { <nl> } <nl> ExpressionPtr getCondition ( ) { return m_condition ; } <nl> StatementPtr getStmt ( ) { return m_stmt ; } <nl> + void clearStmt ( ) { m_stmt . reset ( ) ; } <nl> <nl> int outputCPPIfBranch ( CodeGenerator & cg , AnalysisResultPtr ar ) ; <nl> private : <nl> mmm a / src / compiler / statement / if_statement . cpp <nl> ppp b / src / compiler / statement / if_statement . cpp <nl> StatementPtr IfStatement : : preOptimize ( AnalysisResultConstPtr ar ) { <nl> } <nl> } <nl> break ; <nl> - } else if ( condition - > isScalar ( ) & & <nl> - condition - > getScalarValue ( value ) ) { <nl> + } else if ( condition - > getEffectiveScalar ( value ) ) { <nl> if ( value . toBoolean ( ) ) { <nl> hoist = ! i & & <nl> ( ( getFunctionScope ( ) & & ! getFunctionScope ( ) - > inPseudoMain ( ) ) | | <nl> ! branch - > hasDecl ( ) ) ; <nl> break ; <nl> - } else { <nl> + } else if ( ! condition - > hasEffect ( ) ) { <nl> m_stmts - > removeElement ( i - - ) ; <nl> changed = true ; <nl> + } else if ( branch - > getStmt ( ) ) { <nl> + branch - > clearStmt ( ) ; <nl> + changed = true ; <nl> } <nl> } <nl> } <nl> mmm a / src / compiler / statement / statement_list . cpp <nl> ppp b / src / compiler / statement / statement_list . cpp <nl> void StatementList : : analyzeProgramImpl ( AnalysisResultPtr ar ) { <nl> ! stmt - > is ( Statement : : KindOfStatementList ) ) { <nl> Compiler : : Error ( Compiler : : StatementHasNoEffect , stmt ) ; <nl> } <nl> - <nl> - if ( stmt - > is ( Statement : : KindOfExpStatement ) ) { <nl> - static_pointer_cast < ExpStatement > ( stmt ) - > analyzeShortCircuit ( ar ) ; <nl> - } <nl> } <nl> <nl> bool scopeStmt = stmt - > is ( Statement : : KindOfFunctionStatement ) | | <nl>
|
[ Nemo / Perf ] Improve code gen , and error reporting
|
facebook/hhvm
|
7175b0d8a62e0969d0ba52c8f1e9fca372ba051c
|
2011-06-07T17:41:43Z
|
mmm a / src / src . pro <nl> ppp b / src / src . pro <nl> TARGET = qbittorrent <nl> CONFIG + = qt thread x11 network <nl> <nl> # Update this VERSION for each release <nl> - DEFINES + = VERSION = \ \ \ " v1 . 2 . 0beta7 \ \ \ " <nl> + DEFINES + = VERSION = \ \ \ " v1 . 2 . 0beta8 \ \ \ " <nl> DEFINES + = VERSION_MAJOR = 1 <nl> DEFINES + = VERSION_MINOR = 2 <nl> DEFINES + = VERSION_BUGFIX = 0 <nl>
|
- bump to beta8
|
qbittorrent/qBittorrent
|
037c46b58789ab44176b6b63baacd5fb61f91b74
|
2008-09-28T11:33:21Z
|
mmm a / tests / pthread / test_pthread_sbrk . cpp <nl> ppp b / tests / pthread / test_pthread_sbrk . cpp <nl> <nl> # define ALLOCATION_SIZE 2560 / / Malloc doesn ' t abort , allocate a bit more memory to test graceful allocation failures <nl> # endif <nl> <nl> + # define RESULT_OK 0 <nl> + # define RESULT_EXPECTED_FAILS 1 <nl> + # define RESULT_BAD_FAIL 2 <nl> + <nl> / / Use barriers to make each thread synchronize their execution points , to maximize the possibility of seeing race conditions <nl> / / if those might occur . <nl> static pthread_barrier_t barrierWaitToAlloc ; <nl> static pthread_barrier_t barrierWaitToVerify ; <nl> static pthread_barrier_t barrierWaitToFree ; <nl> <nl> + / / Use a mutex for logging . <nl> + static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER ; <nl> + <nl> static void * thread_start ( void * arg ) <nl> { <nl> + # if DEBUG <nl> + pthread_mutex_lock ( & mutex ) ; <nl> + printf ( " thread started , will try % d allocations of size % d \ n " , NUM_ALLOCATIONS , ALLOCATION_SIZE ) ; <nl> + pthread_mutex_unlock ( & mutex ) ; <nl> + # endif <nl> + <nl> int id = ( int ) ( arg ) + 1 ; <nl> - int return_code = 0 ; <nl> + int return_code = RESULT_OK ; <nl> <nl> uint8_t * allocated_buffers [ NUM_ALLOCATIONS ] = { } ; <nl> <nl> int some_allocations_failed = 0 ; <nl> + size_t allocated = 0 ; <nl> <nl> pthread_barrier_wait ( & barrierWaitToAlloc ) ; / / Halt until all threads reach here , then proceed synchronously . <nl> for ( int i = 0 ; i < NUM_ALLOCATIONS ; + + i ) <nl> { <nl> allocated_buffers [ i ] = ( uint8_t * ) malloc ( ALLOCATION_SIZE ) ; <nl> - if ( allocated_buffers [ i ] ) <nl> + if ( allocated_buffers [ i ] ) { <nl> memset ( allocated_buffers [ i ] , id , ALLOCATION_SIZE ) ; <nl> - else <nl> + allocated + = ALLOCATION_SIZE ; <nl> + } else <nl> some_allocations_failed = 1 ; <nl> } <nl> - <nl> + # if DEBUG <nl> + pthread_mutex_lock ( & mutex ) ; <nl> + printf ( " total allocations : % u ( % d of size % d tried ) , some failed ? % d \ n " , allocated , NUM_ALLOCATIONS , ALLOCATION_SIZE , some_allocations_failed ) ; <nl> + pthread_mutex_unlock ( & mutex ) ; <nl> + # endif <nl> pthread_barrier_wait ( & barrierWaitToVerify ) ; / / Halt until all threads reach here , then proceed synchronously . <nl> int reported_once = 0 ; <nl> for ( int i = 0 ; i < NUM_ALLOCATIONS ; + + i ) <nl> static void * thread_start ( void * arg ) <nl> <nl> # if ABORTING_MALLOC <nl> if ( some_allocations_failed ) <nl> - return_code = 12345678 ; / / We expect allocations not to fail ( if they did , shouldn ' t reach here , but we should have aborted ) <nl> + return_code = RESULT_BAD_FAIL ; / / We expect allocations not to fail ( if they did , shouldn ' t reach here , but we should have aborted ) <nl> # else <nl> - if ( ! some_allocations_failed ) <nl> - return_code = 12345678 ; / / We expect to be allocating so much memory that some of the allocations fail . <nl> + if ( some_allocations_failed ) <nl> + return_code = RESULT_EXPECTED_FAILS ; / / We expect to be allocating so much memory that some of the allocations fail . <nl> + / / Otherwise , the fails might happen in another thread , that ' s cool . <nl> + # endif <nl> + # if DEBUG <nl> + pthread_mutex_lock ( & mutex ) ; <nl> + printf ( " the pthread return code : % d \ n " , return_code ) ; <nl> + pthread_mutex_unlock ( & mutex ) ; <nl> # endif <nl> pthread_exit ( ( void * ) return_code ) ; <nl> } <nl> int main ( ) <nl> return 0 ; <nl> } <nl> <nl> + printf ( " starting test , aborting ? % d \ n " , ABORTING_MALLOC ) ; <nl> + <nl> int ret = pthread_barrier_init ( & barrierWaitToAlloc , NULL , NUM_THREADS ) ; <nl> assert ( ret = = 0 ) ; <nl> ret = pthread_barrier_init ( & barrierWaitToVerify , NULL , NUM_THREADS ) ; <nl> int main ( ) <nl> assert ( ret = = 0 ) ; <nl> } <nl> <nl> + int seen_expected_fails = 0 ; <nl> + <nl> for ( int i = 0 ; i < NUM_THREADS ; + + i ) { <nl> int res = 0 ; <nl> ret = pthread_join ( thr [ i ] , ( void * * ) & res ) ; <nl> assert ( ret = = 0 ) ; <nl> - result + = res ; <nl> + if ( res = = RESULT_OK ) { <nl> + } else if ( res = = RESULT_EXPECTED_FAILS ) { <nl> + seen_expected_fails = 1 ; <nl> + } else if ( res = = RESULT_BAD_FAIL ) { <nl> + result = 1 ; <nl> + } <nl> if ( res ) printf ( " Thread % d failed with return code % d . \ n " , i , res ) ; <nl> } <nl> + # if ! ABORTING_MALLOC <nl> + if ( ! seen_expected_fails ) { <nl> + printf ( " Expected to see fails , but saw none : ( \ n " ) ; <nl> + result = 2 ; <nl> + } <nl> + # endif <nl> + <nl> printf ( " Test finished with result % d \ n " , result ) ; <nl> <nl> # ifdef REPORT_RESULT <nl> mmm a / tests / test_browser . py <nl> ppp b / tests / test_browser . py <nl> def test_pthread_proxying_in_futex_wait ( self ) : <nl> self . btest ( path_from_root ( ' tests ' , ' pthread ' , ' test_pthread_proxying_in_futex_wait . cpp ' ) , expected = ' 0 ' , args = [ ' - O3 ' , ' - s ' , ' USE_PTHREADS = 1 ' , ' - s ' , ' PTHREAD_POOL_SIZE = 1 ' ] ) <nl> <nl> # Test that sbrk ( ) operates properly in multithreaded conditions <nl> - @ flaky <nl> @ requires_threads <nl> def test_pthread_sbrk ( self ) : <nl> for aborting_malloc in [ 0 , 1 ] : <nl>
|
fix browser . test_pthread_sbrk - the test assumed each thread must see some allocation failures , but it is possible one or two will be lucky to run early enough so that their allocations all succeed ( )
|
emscripten-core/emscripten
|
264c00695789ef86d0ffd80c3f3fcd2086905671
|
2018-11-01T22:48:29Z
|
mmm a / js / apps / system / _admin / aardvark / APP / frontend / js / views / queryView . js <nl> ppp b / js / apps / system / _admin / aardvark / APP / frontend / js / views / queryView . js <nl> <nl> data . batchSize = parseInt ( sizeBox . val ( ) , 10 ) ; <nl> } <nl> <nl> + var bindVars = { } ; <nl> if ( Object . keys ( this . bindParamTableObj ) . length > 0 ) { <nl> + _ . each ( this . bindParamTableObj , function ( val , key ) { <nl> + if ( data . query . indexOf ( key ) > - 1 ) { <nl> + bindVars [ key ] = val ; <nl> + } <nl> + } ) ; <nl> data . bindVars = this . bindParamTableObj ; <nl> } <nl> + if ( Object . keys ( data . bindVars ) . length > 0 ) { <nl> + data . bindVars = bindVars ; <nl> + } <nl> <nl> / / add profile flag for query execution <nl> if ( forExecute ) { <nl>
|
query bind parameter bugfix
|
arangodb/arangodb
|
8cc6a5194af438b09f84c18686f37624fa7430ad
|
2016-10-04T16:04:07Z
|
mmm a / tools / eliminator / eliminator - test - output . js <nl> ppp b / tools / eliminator / eliminator - test - output . js <nl> var anon = ( function ( x ) { <nl> var $ 8 = $ 4 + 12 ; <nl> HEAP [ $ 8 ] = $ 7 ; <nl> } ) ; <nl> + function r ( $ 0 ) { <nl> + HEAP [ $ 0 + 7 ] = 107 ; <nl> + } <nl> mmm a / tools / eliminator / eliminator - test . js <nl> ppp b / tools / eliminator / eliminator - test . js <nl> var anon = function ( x ) { <nl> var $ 8 = $ 4 + 12 ; <nl> HEAP [ $ 8 ] = $ 7 ; <nl> } <nl> - / / EMSCRIPTEN_GENERATED_FUNCTIONS : [ " f " , " g " , " h " , " py " ] <nl> + function r ( $ 0 ) { <nl> + HEAP [ $ 0 + 5 + 2 ] = 99 + 5 + 2 + 1 ; <nl> + } <nl> + / / EMSCRIPTEN_GENERATED_FUNCTIONS : [ " f " , " g " , " h " , " py " , " r " ] <nl> <nl> mmm a / tools / eliminator / eliminator . coffee <nl> ppp b / tools / eliminator / eliminator . coffee <nl> fs = require ' fs ' <nl> # Functions which have been generated by Emscripten . We optimize only those . <nl> generatedFunctions = [ ] <nl> GENERATED_FUNCTIONS_MARKER = ' / / EMSCRIPTEN_GENERATED_FUNCTIONS : ' <nl> + isGenerated = ( ident ) - > <nl> + ident in generatedFunctions <nl> <nl> # Maximum number of uses to consider a variable not worth eliminating . <nl> MAX_USES = 3 <nl> traverse = ( node , callback ) - > <nl> # function / defun node and call run ( ) to apply the optimization ( in - place ) . <nl> class Eliminator <nl> constructor : ( func ) - > <nl> - @ ident = func [ 1 ] <nl> - <nl> # The statements of the function to analyze . <nl> @ body = func [ 3 ] <nl> <nl> class Eliminator <nl> # Runs the eliminator on a given function body updating the AST in - place . <nl> # @ returns : The number of variables eliminated , or undefined if skipped . <nl> run : - > <nl> - # Our optimization does not account for closures . <nl> - if not @ isGenerated ( ) then return undefined <nl> - <nl> @ calculateBasicVarStats ( ) <nl> @ analyzeInitialValues ( ) <nl> @ calculateTransitiveDependencies ( ) <nl> class Eliminator <nl> <nl> return eliminated <nl> <nl> - # Determines if a function is Emscripten - generated . <nl> - isGenerated : - > <nl> - return @ ident in generatedFunctions <nl> - <nl> # Runs the basic variable scan pass . Fills the following member variables : <nl> # isLocal <nl> # isSingleDef <nl> class Eliminator <nl> return undefined <nl> <nl> <nl> + # A class for optimizing expressions . We know that it is legitimate to collapse <nl> + # 5 + 7 in the generated code , as it will always be numerical , for example . <nl> + class ExpressionOptimizer <nl> + constructor : ( node ) - > <nl> + @ node = node <nl> + <nl> + run : - > <nl> + traverse @ node , ( node , type ) - > <nl> + if type is ' binary ' and node [ 1 ] = = ' + ' <nl> + names = [ ] <nl> + num = 0 <nl> + has_num = false <nl> + fail = false <nl> + traverse node , ( subNode , subType ) - > <nl> + if subType is ' binary ' <nl> + if subNode [ 1 ] isnt ' + ' <nl> + fail = true <nl> + return false <nl> + return undefined <nl> + else if subType is ' name ' <nl> + names . push subNode [ 1 ] <nl> + return undefined <nl> + else if subType is ' num ' <nl> + num + = subNode [ 1 ] <nl> + has_num = true <nl> + return undefined <nl> + else <nl> + fail = true <nl> + return false <nl> + if not fail and has_num <nl> + ret = [ ' num ' , num ] <nl> + for name in names <nl> + ret = [ ' binary ' , ' + ' , [ ' name ' , name ] , ret ] <nl> + return ret <nl> + return undefined <nl> + <nl> + return undefined <nl> + <nl> # The main entry point . Reads JavaScript from stdin , runs the eliminator on each <nl> # function , then writes the optimized result to stdout . <nl> main = - > <nl> main = - > <nl> <nl> ast = uglify . parser . parse src <nl> <nl> - # Run the eliminator on all functions . <nl> + # Run on all functions . <nl> traverse ast , ( node , type ) - > <nl> - if type in [ ' defun ' , ' function ' ] <nl> + if type in [ ' defun ' , ' function ' ] and isGenerated node [ 1 ] <nl> + <nl> + # Run the eliminator <nl> process . stderr . write ( node [ 1 ] | | ' ( anonymous ) ' ) + ' \ n ' <nl> eliminated = new Eliminator ( node ) . run ( ) <nl> if eliminated ? <nl> process . stderr . write " Eliminated # { eliminated } vars . \ n " <nl> + <nl> + # Run the expression optimizer <nl> + new ExpressionOptimizer ( node [ 3 ] ) . run ( ) <nl> else <nl> process . stderr . write ' Skipped . \ n ' <nl> + <nl> return undefined <nl> <nl> # Write out the optimized code . <nl>
|
expression optimizer in eliminator
|
emscripten-core/emscripten
|
bcccdc948dc02db5a5b17ef722ddf3f688a8cc9e
|
2011-11-08T02:24:19Z
|
mmm a / cyber / tools / cyber_recorder / info . cc <nl> ppp b / cyber / tools / cyber_recorder / info . cc <nl> bool Info : : Display ( const std : : string & file ) { <nl> return false ; <nl> } <nl> <nl> - Index idx = file_reader . GetIndex ( ) ; <nl> / / channel info <nl> + std : : cout < < std : : setw ( w ) < < " channel_info : " ; <nl> + Index idx = file_reader . GetIndex ( ) ; <nl> for ( int i = 0 ; i < idx . indexes_size ( ) ; + + i ) { <nl> ChannelCache * cache = idx . mutable_indexes ( i ) - > mutable_channel_cache ( ) ; <nl> if ( idx . mutable_indexes ( i ) - > type ( ) = = SectionType : : SECTION_CHANNEL ) { <nl> - if ( i = = 0 ) { <nl> - std : : cout < < std : : setw ( w ) < < " channel_info : " ; <nl> - } else { <nl> - std : : cout < < std : : setw ( w ) < < " " ; <nl> - } <nl> + std : : cout < < std : : setw ( w ) < < " " ; <nl> std : : cout < < resetiosflags ( std : : ios : : right ) ; <nl> std : : cout < < std : : setw ( 50 ) < < cache - > name ( ) ; <nl> std : : cout < < setiosflags ( std : : ios : : right ) ; <nl>
|
cyber : avoid checking - up index each time for getting channel info inside loop
|
ApolloAuto/apollo
|
03cf1f674c663aaaf5c912aaf9417a330c5563c4
|
2019-03-31T18:31:02Z
|
mmm a / drivers / javascript / package . json <nl> ppp b / drivers / javascript / package . json <nl> <nl> { " name " : " rethinkdb " <nl> - , " version " : " 1 . 9 . 0 - 0 " <nl> + , " version " : " 1 . 9 . 0 - 1 " <nl> , " main " : " rethinkdb " <nl> , " description " : " This package provides the JavaScript driver library for the RethinkDB database server for use either from node or your web - browser . " <nl> , " keywords " : [ " database " , " NoSQL " , " reql " , " query language " ] <nl>
|
JavaScript driver version 1 . 9 . 0 - 1
|
rethinkdb/rethinkdb
|
df0f1e4241af9b7d3a4353031d1bebb91a1b3fdd
|
2013-09-13T06:53:20Z
|
mmm a / src / heap / heap . cc <nl> ppp b / src / heap / heap . cc <nl> bool Heap : : RootCanBeTreatedAsConstant ( RootListIndex root_index ) { <nl> } <nl> <nl> <nl> - Object * RegExpResultsCache : : Lookup ( Heap * heap , String * key_string , <nl> - Object * key_pattern , ResultsCacheType type ) { <nl> - FixedArray * cache ; <nl> - if ( ! key_string - > IsInternalizedString ( ) ) return Smi : : FromInt ( 0 ) ; <nl> - if ( type = = STRING_SPLIT_SUBSTRINGS ) { <nl> - DCHECK ( key_pattern - > IsString ( ) ) ; <nl> - if ( ! key_pattern - > IsInternalizedString ( ) ) return Smi : : FromInt ( 0 ) ; <nl> - cache = heap - > string_split_cache ( ) ; <nl> - } else { <nl> - DCHECK ( type = = REGEXP_MULTIPLE_INDICES ) ; <nl> - DCHECK ( key_pattern - > IsFixedArray ( ) ) ; <nl> - cache = heap - > regexp_multiple_cache ( ) ; <nl> - } <nl> - <nl> - uint32_t hash = key_string - > Hash ( ) ; <nl> - uint32_t index = ( ( hash & ( kRegExpResultsCacheSize - 1 ) ) & <nl> - ~ ( kArrayEntriesPerCacheEntry - 1 ) ) ; <nl> - if ( cache - > get ( index + kStringOffset ) = = key_string & & <nl> - cache - > get ( index + kPatternOffset ) = = key_pattern ) { <nl> - return cache - > get ( index + kArrayOffset ) ; <nl> - } <nl> - index = <nl> - ( ( index + kArrayEntriesPerCacheEntry ) & ( kRegExpResultsCacheSize - 1 ) ) ; <nl> - if ( cache - > get ( index + kStringOffset ) = = key_string & & <nl> - cache - > get ( index + kPatternOffset ) = = key_pattern ) { <nl> - return cache - > get ( index + kArrayOffset ) ; <nl> - } <nl> - return Smi : : FromInt ( 0 ) ; <nl> - } <nl> - <nl> - <nl> - void RegExpResultsCache : : Enter ( Isolate * isolate , Handle < String > key_string , <nl> - Handle < Object > key_pattern , <nl> - Handle < FixedArray > value_array , <nl> - ResultsCacheType type ) { <nl> - Factory * factory = isolate - > factory ( ) ; <nl> - Handle < FixedArray > cache ; <nl> - if ( ! key_string - > IsInternalizedString ( ) ) return ; <nl> - if ( type = = STRING_SPLIT_SUBSTRINGS ) { <nl> - DCHECK ( key_pattern - > IsString ( ) ) ; <nl> - if ( ! key_pattern - > IsInternalizedString ( ) ) return ; <nl> - cache = factory - > string_split_cache ( ) ; <nl> - } else { <nl> - DCHECK ( type = = REGEXP_MULTIPLE_INDICES ) ; <nl> - DCHECK ( key_pattern - > IsFixedArray ( ) ) ; <nl> - cache = factory - > regexp_multiple_cache ( ) ; <nl> - } <nl> - <nl> - uint32_t hash = key_string - > Hash ( ) ; <nl> - uint32_t index = ( ( hash & ( kRegExpResultsCacheSize - 1 ) ) & <nl> - ~ ( kArrayEntriesPerCacheEntry - 1 ) ) ; <nl> - if ( cache - > get ( index + kStringOffset ) = = Smi : : FromInt ( 0 ) ) { <nl> - cache - > set ( index + kStringOffset , * key_string ) ; <nl> - cache - > set ( index + kPatternOffset , * key_pattern ) ; <nl> - cache - > set ( index + kArrayOffset , * value_array ) ; <nl> - } else { <nl> - uint32_t index2 = <nl> - ( ( index + kArrayEntriesPerCacheEntry ) & ( kRegExpResultsCacheSize - 1 ) ) ; <nl> - if ( cache - > get ( index2 + kStringOffset ) = = Smi : : FromInt ( 0 ) ) { <nl> - cache - > set ( index2 + kStringOffset , * key_string ) ; <nl> - cache - > set ( index2 + kPatternOffset , * key_pattern ) ; <nl> - cache - > set ( index2 + kArrayOffset , * value_array ) ; <nl> - } else { <nl> - cache - > set ( index2 + kStringOffset , Smi : : FromInt ( 0 ) ) ; <nl> - cache - > set ( index2 + kPatternOffset , Smi : : FromInt ( 0 ) ) ; <nl> - cache - > set ( index2 + kArrayOffset , Smi : : FromInt ( 0 ) ) ; <nl> - cache - > set ( index + kStringOffset , * key_string ) ; <nl> - cache - > set ( index + kPatternOffset , * key_pattern ) ; <nl> - cache - > set ( index + kArrayOffset , * value_array ) ; <nl> - } <nl> - } <nl> - / / If the array is a reasonably short list of substrings , convert it into a <nl> - / / list of internalized strings . <nl> - if ( type = = STRING_SPLIT_SUBSTRINGS & & value_array - > length ( ) < 100 ) { <nl> - for ( int i = 0 ; i < value_array - > length ( ) ; i + + ) { <nl> - Handle < String > str ( String : : cast ( value_array - > get ( i ) ) , isolate ) ; <nl> - Handle < String > internalized_str = factory - > InternalizeString ( str ) ; <nl> - value_array - > set ( i , * internalized_str ) ; <nl> - } <nl> - } <nl> - / / Convert backing store to a copy - on - write array . <nl> - value_array - > set_map_no_write_barrier ( * factory - > fixed_cow_array_map ( ) ) ; <nl> - } <nl> - <nl> - <nl> - void RegExpResultsCache : : Clear ( FixedArray * cache ) { <nl> - for ( int i = 0 ; i < kRegExpResultsCacheSize ; i + + ) { <nl> - cache - > set ( i , Smi : : FromInt ( 0 ) ) ; <nl> - } <nl> - } <nl> - <nl> - <nl> int Heap : : FullSizeNumberStringCacheLength ( ) { <nl> / / Compute the size of the number string cache based on the max newspace size . <nl> / / The number string cache has a minimum size based on twice the initial cache <nl> mmm a / src / heap / heap . h <nl> ppp b / src / heap / heap . h <nl> class DescriptorLookupCache { <nl> } ; <nl> <nl> <nl> - class RegExpResultsCache { <nl> - public : <nl> - enum ResultsCacheType { REGEXP_MULTIPLE_INDICES , STRING_SPLIT_SUBSTRINGS } ; <nl> - <nl> - / / Attempt to retrieve a cached result . On failure , 0 is returned as a Smi . <nl> - / / On success , the returned result is guaranteed to be a COW - array . <nl> - static Object * Lookup ( Heap * heap , String * key_string , Object * key_pattern , <nl> - ResultsCacheType type ) ; <nl> - / / Attempt to add value_array to the cache specified by type . On success , <nl> - / / value_array is turned into a COW - array . <nl> - static void Enter ( Isolate * isolate , Handle < String > key_string , <nl> - Handle < Object > key_pattern , Handle < FixedArray > value_array , <nl> - ResultsCacheType type ) ; <nl> - static void Clear ( FixedArray * cache ) ; <nl> - static const int kRegExpResultsCacheSize = 0x100 ; <nl> - <nl> - private : <nl> - static const int kArrayEntriesPerCacheEntry = 4 ; <nl> - static const int kStringOffset = 0 ; <nl> - static const int kPatternOffset = 1 ; <nl> - static const int kArrayOffset = 2 ; <nl> - } ; <nl> - <nl> - <nl> / / Abstract base class for checking whether a weak object should be retained . <nl> class WeakObjectRetainer { <nl> public : <nl> mmm a / src / regexp / jsregexp . cc <nl> ppp b / src / regexp / jsregexp . cc <nl> bool RegExpEngine : : TooMuchRegExpCode ( Handle < String > pattern ) { <nl> } <nl> return too_much ; <nl> } <nl> + <nl> + <nl> + Object * RegExpResultsCache : : Lookup ( Heap * heap , String * key_string , <nl> + Object * key_pattern , ResultsCacheType type ) { <nl> + FixedArray * cache ; <nl> + if ( ! key_string - > IsInternalizedString ( ) ) return Smi : : FromInt ( 0 ) ; <nl> + if ( type = = STRING_SPLIT_SUBSTRINGS ) { <nl> + DCHECK ( key_pattern - > IsString ( ) ) ; <nl> + if ( ! key_pattern - > IsInternalizedString ( ) ) return Smi : : FromInt ( 0 ) ; <nl> + cache = heap - > string_split_cache ( ) ; <nl> + } else { <nl> + DCHECK ( type = = REGEXP_MULTIPLE_INDICES ) ; <nl> + DCHECK ( key_pattern - > IsFixedArray ( ) ) ; <nl> + cache = heap - > regexp_multiple_cache ( ) ; <nl> + } <nl> + <nl> + uint32_t hash = key_string - > Hash ( ) ; <nl> + uint32_t index = ( ( hash & ( kRegExpResultsCacheSize - 1 ) ) & <nl> + ~ ( kArrayEntriesPerCacheEntry - 1 ) ) ; <nl> + if ( cache - > get ( index + kStringOffset ) = = key_string & & <nl> + cache - > get ( index + kPatternOffset ) = = key_pattern ) { <nl> + return cache - > get ( index + kArrayOffset ) ; <nl> + } <nl> + index = <nl> + ( ( index + kArrayEntriesPerCacheEntry ) & ( kRegExpResultsCacheSize - 1 ) ) ; <nl> + if ( cache - > get ( index + kStringOffset ) = = key_string & & <nl> + cache - > get ( index + kPatternOffset ) = = key_pattern ) { <nl> + return cache - > get ( index + kArrayOffset ) ; <nl> + } <nl> + return Smi : : FromInt ( 0 ) ; <nl> + } <nl> + <nl> + <nl> + void RegExpResultsCache : : Enter ( Isolate * isolate , Handle < String > key_string , <nl> + Handle < Object > key_pattern , <nl> + Handle < FixedArray > value_array , <nl> + ResultsCacheType type ) { <nl> + Factory * factory = isolate - > factory ( ) ; <nl> + Handle < FixedArray > cache ; <nl> + if ( ! key_string - > IsInternalizedString ( ) ) return ; <nl> + if ( type = = STRING_SPLIT_SUBSTRINGS ) { <nl> + DCHECK ( key_pattern - > IsString ( ) ) ; <nl> + if ( ! key_pattern - > IsInternalizedString ( ) ) return ; <nl> + cache = factory - > string_split_cache ( ) ; <nl> + } else { <nl> + DCHECK ( type = = REGEXP_MULTIPLE_INDICES ) ; <nl> + DCHECK ( key_pattern - > IsFixedArray ( ) ) ; <nl> + cache = factory - > regexp_multiple_cache ( ) ; <nl> + } <nl> + <nl> + uint32_t hash = key_string - > Hash ( ) ; <nl> + uint32_t index = ( ( hash & ( kRegExpResultsCacheSize - 1 ) ) & <nl> + ~ ( kArrayEntriesPerCacheEntry - 1 ) ) ; <nl> + if ( cache - > get ( index + kStringOffset ) = = Smi : : FromInt ( 0 ) ) { <nl> + cache - > set ( index + kStringOffset , * key_string ) ; <nl> + cache - > set ( index + kPatternOffset , * key_pattern ) ; <nl> + cache - > set ( index + kArrayOffset , * value_array ) ; <nl> + } else { <nl> + uint32_t index2 = <nl> + ( ( index + kArrayEntriesPerCacheEntry ) & ( kRegExpResultsCacheSize - 1 ) ) ; <nl> + if ( cache - > get ( index2 + kStringOffset ) = = Smi : : FromInt ( 0 ) ) { <nl> + cache - > set ( index2 + kStringOffset , * key_string ) ; <nl> + cache - > set ( index2 + kPatternOffset , * key_pattern ) ; <nl> + cache - > set ( index2 + kArrayOffset , * value_array ) ; <nl> + } else { <nl> + cache - > set ( index2 + kStringOffset , Smi : : FromInt ( 0 ) ) ; <nl> + cache - > set ( index2 + kPatternOffset , Smi : : FromInt ( 0 ) ) ; <nl> + cache - > set ( index2 + kArrayOffset , Smi : : FromInt ( 0 ) ) ; <nl> + cache - > set ( index + kStringOffset , * key_string ) ; <nl> + cache - > set ( index + kPatternOffset , * key_pattern ) ; <nl> + cache - > set ( index + kArrayOffset , * value_array ) ; <nl> + } <nl> + } <nl> + / / If the array is a reasonably short list of substrings , convert it into a <nl> + / / list of internalized strings . <nl> + if ( type = = STRING_SPLIT_SUBSTRINGS & & value_array - > length ( ) < 100 ) { <nl> + for ( int i = 0 ; i < value_array - > length ( ) ; i + + ) { <nl> + Handle < String > str ( String : : cast ( value_array - > get ( i ) ) , isolate ) ; <nl> + Handle < String > internalized_str = factory - > InternalizeString ( str ) ; <nl> + value_array - > set ( i , * internalized_str ) ; <nl> + } <nl> + } <nl> + / / Convert backing store to a copy - on - write array . <nl> + value_array - > set_map_no_write_barrier ( * factory - > fixed_cow_array_map ( ) ) ; <nl> + } <nl> + <nl> + <nl> + void RegExpResultsCache : : Clear ( FixedArray * cache ) { <nl> + for ( int i = 0 ; i < kRegExpResultsCacheSize ; i + + ) { <nl> + cache - > set ( i , Smi : : FromInt ( 0 ) ) ; <nl> + } <nl> + } <nl> + <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / regexp / jsregexp . h <nl> ppp b / src / regexp / jsregexp . h <nl> class RegExpEngine : public AllStatic { <nl> } ; <nl> <nl> <nl> - } } / / namespace v8 : : internal <nl> + class RegExpResultsCache : public AllStatic { <nl> + public : <nl> + enum ResultsCacheType { REGEXP_MULTIPLE_INDICES , STRING_SPLIT_SUBSTRINGS } ; <nl> + <nl> + / / Attempt to retrieve a cached result . On failure , 0 is returned as a Smi . <nl> + / / On success , the returned result is guaranteed to be a COW - array . <nl> + static Object * Lookup ( Heap * heap , String * key_string , Object * key_pattern , <nl> + ResultsCacheType type ) ; <nl> + / / Attempt to add value_array to the cache specified by type . On success , <nl> + / / value_array is turned into a COW - array . <nl> + static void Enter ( Isolate * isolate , Handle < String > key_string , <nl> + Handle < Object > key_pattern , Handle < FixedArray > value_array , <nl> + ResultsCacheType type ) ; <nl> + static void Clear ( FixedArray * cache ) ; <nl> + static const int kRegExpResultsCacheSize = 0x100 ; <nl> + <nl> + private : <nl> + static const int kArrayEntriesPerCacheEntry = 4 ; <nl> + static const int kStringOffset = 0 ; <nl> + static const int kPatternOffset = 1 ; <nl> + static const int kArrayOffset = 2 ; <nl> + } ; <nl> + <nl> + } / / namespace internal <nl> + } / / namespace v8 <nl> <nl> # endif / / V8_REGEXP_JSREGEXP_H_ <nl>
|
[ heap ] Move RegExpResultCache out of the heap .
|
v8/v8
|
24ef80dc93deba21256e9c270683f47036c9b32d
|
2015-08-21T12:34:30Z
|
mmm a / tensorflow / tools / ci_build / windows / gpu / pip / build_tf_windows . sh <nl> ppp b / tensorflow / tools / ci_build / windows / gpu / pip / build_tf_windows . sh <nl> if [ [ " $ TF_NIGHTLY " = = 1 ] ] ; then <nl> if [ - z $ { PROJECT_NAME } ] ; then <nl> EXTRA_PIP_FLAGS = " - - nightly_flag " <nl> else <nl> - EXTRA_PIP_FLAGS = " - - project_name = $ { PROJECT_NAME } - - nightly_flag " <nl> + EXTRA_PIP_FLAGS = " - - project_name $ { PROJECT_NAME } - - nightly_flag " <nl> fi <nl> fi <nl> <nl>
|
Internal change .
|
tensorflow/tensorflow
|
0848c480c0613257fdff9f5a2a6e2b77d8d0f942
|
2018-12-18T23:01:45Z
|
mmm a / src / compiler . cc <nl> ppp b / src / compiler . cc <nl> static bool MakeCrankshaftCode ( CompilationInfo * info ) { <nl> FLAG_deopt_every_n_times = = 0 ? Compiler : : kDefaultMaxOptCount : 1000 ; <nl> if ( info - > shared_info ( ) - > opt_count ( ) > kMaxOptCount ) { <nl> info - > AbortOptimization ( ) ; <nl> - Handle < JSFunction > closure = info - > closure ( ) ; <nl> info - > shared_info ( ) - > DisableOptimization ( ) ; <nl> / / True indicates the compilation pipeline is still going , not <nl> / / necessarily that we optimized the code . <nl> static bool MakeCrankshaftCode ( CompilationInfo * info ) { <nl> ( info - > osr_ast_id ( ) ! = AstNode : : kNoNumber & & <nl> scope - > num_parameters ( ) + 1 + scope - > num_stack_slots ( ) > locals_limit ) ) { <nl> info - > AbortOptimization ( ) ; <nl> - Handle < JSFunction > closure = info - > closure ( ) ; <nl> info - > shared_info ( ) - > DisableOptimization ( ) ; <nl> / / True indicates the compilation pipeline is still going , not <nl> / / necessarily that we optimized the code . <nl> static bool MakeCrankshaftCode ( CompilationInfo * info ) { <nl> if ( ! builder . inline_bailout ( ) ) { <nl> / / Mark the shared code as unoptimizable unless it was an inlined <nl> / / function that bailed out . <nl> - Handle < JSFunction > closure = info - > closure ( ) ; <nl> info - > shared_info ( ) - > DisableOptimization ( ) ; <nl> } <nl> / / True indicates the compilation pipeline is still going , not necessarily <nl>
|
Fix GCC - 4 . 7 warnings
|
v8/v8
|
1cd5f2c7baa51d9fdc77227348ea3b630f639fbf
|
2012-02-16T08:38:11Z
|
mmm a / jvm - packages / xgboost4j / src / main / java / ml / dmlc / xgboost4j / java / NativeLibLoader . java <nl> ppp b / jvm - packages / xgboost4j / src / main / java / ml / dmlc / xgboost4j / java / NativeLibLoader . java <nl> <nl> private static final Log logger = LogFactory . getLog ( NativeLibLoader . class ) ; <nl> <nl> private static boolean initialized = false ; <nl> - private static final String nativePath = " . . / . . / lib / " ; <nl> private static final String nativeResourcePath = " / lib / " ; <nl> private static final String [ ] libNames = new String [ ] { " xgboost4j " } ; <nl> <nl> static synchronized void initXGBoost ( ) throws IOException { <nl> if ( ! initialized ) { <nl> for ( String libName : libNames ) { <nl> - smartLoad ( libName ) ; <nl> + try { <nl> + String libraryFromJar = nativeResourcePath + System . mapLibraryName ( libName ) ; <nl> + loadLibraryFromJar ( libraryFromJar ) ; <nl> + } catch ( IOException ioe ) { <nl> + logger . error ( " failed to load " + libName + " library from jar " ) ; <nl> + throw ioe ; <nl> + } <nl> } <nl> initialized = true ; <nl> } <nl> static String createTempFileFromResource ( String path ) throws <nl> return temp . getAbsolutePath ( ) ; <nl> } <nl> <nl> - / * * <nl> - * load native library , this method will first try to load library from java . library . path , then <nl> - * try to load library in jar package . <nl> - * <nl> - * @ param libName library path <nl> - * @ throws IOException exception <nl> - * / <nl> - private static void smartLoad ( String libName ) throws IOException { <nl> - addNativeDir ( nativePath ) ; <nl> - try { <nl> - System . loadLibrary ( libName ) ; <nl> - } catch ( UnsatisfiedLinkError e ) { <nl> - try { <nl> - String libraryFromJar = nativeResourcePath + System . mapLibraryName ( libName ) ; <nl> - loadLibraryFromJar ( libraryFromJar ) ; <nl> - } catch ( IOException ioe ) { <nl> - logger . error ( " failed to load library from both native path and jar " ) ; <nl> - throw ioe ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - / * * <nl> - * Add libPath to java . library . path , then native library in libPath would be load properly <nl> - * <nl> - * @ param libPath library path <nl> - * @ throws IOException exception <nl> - * / <nl> - private static void addNativeDir ( String libPath ) throws IOException { <nl> - try { <nl> - Field field = ClassLoader . class . getDeclaredField ( " usr_paths " ) ; <nl> - field . setAccessible ( true ) ; <nl> - String [ ] paths = ( String [ ] ) field . get ( null ) ; <nl> - for ( String path : paths ) { <nl> - if ( libPath . equals ( path ) ) { <nl> - return ; <nl> - } <nl> - } <nl> - String [ ] tmp = new String [ paths . length + 1 ] ; <nl> - System . arraycopy ( paths , 0 , tmp , 0 , paths . length ) ; <nl> - tmp [ paths . length ] = libPath ; <nl> - field . set ( null , tmp ) ; <nl> - } catch ( IllegalAccessException e ) { <nl> - logger . error ( e . getMessage ( ) ) ; <nl> - throw new IOException ( " Failed to get permissions to set library path " ) ; <nl> - } catch ( NoSuchFieldException e ) { <nl> - logger . error ( e . getMessage ( ) ) ; <nl> - throw new IOException ( " Failed to get field handle to set library path " ) ; <nl> - } <nl> - } <nl> } <nl>
|
[ jvm - packages ] Fixing the NativeLibLoader on Java 9 + ( )
|
dmlc/xgboost
|
a448a8320cdaf4f1ecf73cfdbd6478eb4a37bc44
|
2019-04-10T19:41:44Z
|
mmm a / fdbclient / SystemData . cpp <nl> ppp b / fdbclient / SystemData . cpp <nl> const Key restoreStatusKeyFor ( StringRef statusType ) { <nl> <nl> const Value restoreStatusValue ( double const & val ) { <nl> BinaryWriter wr ( IncludeVersion ( ) ) ; <nl> - wr < < ( long ) val ; <nl> + wr < < StringRef ( std : : to_string ( val ) ) ; <nl> return wr . toValue ( ) ; <nl> } <nl> const KeyRef healthyZoneKey = LiteralStringRef ( " \ xff \ x02 / healthyZone " ) ; <nl> mmm a / fdbserver / Restore . actor . cpp <nl> ppp b / fdbserver / Restore . actor . cpp <nl> ACTOR static Future < Void > sampleWorkload ( Reference < RestoreData > rd , RestoreReque <nl> rd - > cmdID = checkpointCMDUID ; <nl> curFileIndex = checkpointCurFileIndex ; <nl> curFileOffset = checkpointCurFileOffset ; <nl> + allLoadReqsSent = false ; <nl> printf ( " [ Sampling ] [ Waring ] Retry at CMDID : % s curFileIndex : % ld \ n " , rd - > cmdID . toString ( ) . c_str ( ) , curFileIndex ) ; <nl> } <nl> } <nl> ACTOR Future < Void > workerCore ( Reference < RestoreData > rd , RestoreInterface ri , Da <nl> / / TODO : Wait until all workers have registered their interface . <nl> wait ( setWorkerInterface ( req , rd , ri , cx ) ) ; <nl> } <nl> - <nl> - <nl> - <nl> } <nl> <nl> } catch ( Error & e ) { <nl> mmm a / fdbserver / RestoreInterface . h <nl> ppp b / fdbserver / RestoreInterface . h <nl> class CMDUID { <nl> <nl> std : : string toString ( ) const ; <nl> <nl> - bool operator = = ( const CMDUID & r ) const { return batch = = r . batch & & phase = = r . phase ; cmdID = = r . cmdID ; } <nl> + bool operator = = ( const CMDUID & r ) const { return batch = = r . batch & & phase = = r . phase & & cmdID = = r . cmdID ; } <nl> bool operator ! = ( const CMDUID & r ) const { return batch ! = r . batch | | phase ! = r . phase | | cmdID ! = r . cmdID ; } <nl> bool operator < ( const CMDUID & r ) const { return batch < r . batch | | ( batch = = r . batch & & phase < r . phase ) | | ( batch = = r . batch & & phase = = r . phase & & cmdID < r . cmdID ) ; } <nl> <nl> struct RestoreNodeStatus { <nl> } else if ( newRole = = RestoreRole : : Applier ) { <nl> applierState = ApplierState : : Ready ; <nl> } else if ( newRole = = RestoreRole : : Master ) { <nl> - masterState = = MasterState : : Ready ; <nl> + masterState = MasterState : : Ready ; <nl> } <nl> lastStart = 0 ; <nl> totalExecTime = 0 ; <nl>
|
FastRestore : Fix MacOS compilation
|
apple/foundationdb
|
092a890da5ce733368c765b00877390ef352cfc9
|
2019-04-10T05:37:24Z
|
mmm a / src / mongo / db / auth / authorization_manager_impl . cpp <nl> ppp b / src / mongo / db / auth / authorization_manager_impl . cpp <nl> <nl> # include " mongo / base / shim . h " <nl> # include " mongo / base / status . h " <nl> # include " mongo / bson / util / bson_extract . h " <nl> + # include " mongo / config . h " <nl> # include " mongo / crypto / mechanism_scram . h " <nl> # include " mongo / db / auth / address_restriction . h " <nl> + # include " mongo / db / auth / authorization_manager_global_parameters_gen . h " <nl> # include " mongo / db / auth / authorization_manager_impl_parameters_gen . h " <nl> # include " mongo / db / auth / authorization_session_impl . h " <nl> # include " mongo / db / auth / authz_manager_external_state . h " <nl> <nl> # include " mongo / db / mongod_options . h " <nl> # include " mongo / logv2 / log . h " <nl> # include " mongo / util / assert_util . h " <nl> + # include " mongo / util / net / ssl_types . h " <nl> # include " mongo / util / str . h " <nl> <nl> namespace mongo { <nl> Status initializeUserFromPrivilegeDocument ( User * user , const BSONObj & privDoc ) { <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> + / * * <nl> + * Returns true if roles for this user were provided by the client , and can be obtained from <nl> + * the connection . <nl> + * / <nl> + bool shouldUseRolesFromConnection ( OperationContext * opCtx , const UserName & userName ) { <nl> + # ifdef MONGO_CONFIG_SSL <nl> + if ( ! opCtx | | ! opCtx - > getClient ( ) | | ! opCtx - > getClient ( ) - > session ( ) ) { <nl> + return false ; <nl> + } <nl> + <nl> + if ( ! allowRolesFromX509Certificates ) { <nl> + return false ; <nl> + } <nl> + <nl> + auto & sslPeerInfo = SSLPeerInfo : : forSession ( opCtx - > getClient ( ) - > session ( ) ) ; <nl> + return sslPeerInfo . subjectName . toString ( ) = = userName . getUser ( ) & & <nl> + userName . getDB ( ) = = " $ external " _sd & & ! sslPeerInfo . roles . empty ( ) ; <nl> + # else <nl> + return false ; <nl> + # endif <nl> + } <nl> + <nl> + <nl> std : : unique_ptr < AuthorizationManager > authorizationManagerCreateImpl ( <nl> ServiceContext * serviceContext ) { <nl> return std : : make_unique < AuthorizationManagerImpl > ( serviceContext , <nl> bool AuthorizationManagerImpl : : hasAnyPrivilegeDocuments ( OperationContext * opCtx ) <nl> Status AuthorizationManagerImpl : : getUserDescription ( OperationContext * opCtx , <nl> const UserName & userName , <nl> BSONObj * result ) { <nl> - return _externalState - > getUserDescription ( opCtx , userName , result ) ; <nl> + return _externalState - > getUserDescription ( opCtx , UserRequest ( userName , boost : : none ) , result ) ; <nl> } <nl> <nl> Status AuthorizationManagerImpl : : getRoleDescription ( OperationContext * opCtx , <nl> StatusWith < UserHandle > AuthorizationManagerImpl : : acquireUser ( OperationContext * o <nl> return internalSecurity . user ; <nl> } <nl> <nl> - auto cachedUser = _userCache . acquire ( opCtx , userName ) ; <nl> + UserRequest request ( userName , boost : : none ) ; <nl> + <nl> + / / Clients connected via TLS may present an X . 509 certificate which contains an authorization <nl> + / / grant . If this is the case , the roles must be provided to the external state , for expansion <nl> + / / into privileges . <nl> + if ( shouldUseRolesFromConnection ( opCtx , userName ) ) { <nl> + auto & sslPeerInfo = SSLPeerInfo : : forSession ( opCtx - > getClient ( ) - > session ( ) ) ; <nl> + request . roles = std : : set < RoleName > ( ) ; <nl> + <nl> + / / In order to be hashable , the role names must be converted from unordered_set to a set . <nl> + std : : copy ( sslPeerInfo . roles . begin ( ) , <nl> + sslPeerInfo . roles . end ( ) , <nl> + std : : inserter ( * request . roles , request . roles - > begin ( ) ) ) ; <nl> + } <nl> + <nl> + auto cachedUser = _userCache . acquire ( opCtx , request ) ; <nl> invariant ( cachedUser ) ; <nl> <nl> LOGV2_DEBUG ( 20226 , 1 , " Returning user { userName } from cache " , " userName " _attr = userName ) ; <nl> void AuthorizationManagerImpl : : invalidateUserByName ( OperationContext * opCtx , <nl> LOGV2_DEBUG ( 20235 , 2 , " Invalidating user { userName } " , " userName " _attr = userName ) ; <nl> _updateCacheGeneration ( ) ; <nl> _authSchemaVersionCache . invalidateAll ( ) ; <nl> - _userCache . invalidate ( userName ) ; <nl> + / / Invalidate the named User , assuming no externally provided roles . When roles are defined <nl> + / / externally , there exists no user document which may become invalid . <nl> + _userCache . invalidate ( UserRequest ( userName , boost : : none ) ) ; <nl> } <nl> <nl> void AuthorizationManagerImpl : : invalidateUsersFromDB ( OperationContext * opCtx , StringData dbname ) { <nl> LOGV2_DEBUG ( 20236 , 2 , " Invalidating all users from database { dbname } " , " dbname " _attr = dbname ) ; <nl> _updateCacheGeneration ( ) ; <nl> _authSchemaVersionCache . invalidateAll ( ) ; <nl> - _userCache . invalidateIf ( [ & ] ( const UserName & user ) { return user . getDB ( ) = = dbname ; } ) ; <nl> + _userCache . invalidateIf ( <nl> + [ & ] ( const UserRequest & userRequest ) { return userRequest . name . getDB ( ) = = dbname ; } ) ; <nl> } <nl> <nl> void AuthorizationManagerImpl : : invalidateUserCache ( OperationContext * opCtx ) { <nl> std : : vector < AuthorizationManager : : CachedUserInfo > AuthorizationManagerImpl : : getU <nl> ret . reserve ( cacheData . size ( ) ) ; <nl> std : : transform ( <nl> cacheData . begin ( ) , cacheData . end ( ) , std : : back_inserter ( ret ) , [ ] ( const auto & info ) { <nl> - return AuthorizationManager : : CachedUserInfo { info . key , info . useCount > 0 } ; <nl> + return AuthorizationManager : : CachedUserInfo { info . key . name , info . useCount > 0 } ; <nl> } ) ; <nl> <nl> return ret ; <nl> AuthorizationManagerImpl : : UserCacheImpl : : UserCacheImpl ( <nl> _externalState ( externalState ) { } <nl> <nl> boost : : optional < User > AuthorizationManagerImpl : : UserCacheImpl : : lookup ( OperationContext * opCtx , <nl> - const UserName & userName ) { <nl> - LOGV2_DEBUG ( 20238 , 1 , " Getting user { userName } from disk " , " userName " _attr = userName ) ; <nl> + const UserRequest & userReq ) { <nl> + LOGV2_DEBUG ( 20238 , 1 , " Getting user record " , " userName " _attr = userReq . name ) ; <nl> <nl> / / Number of times to retry a user document that fetches due to transient AuthSchemaIncompatible <nl> / / errors . These errors should only ever occur during and shortly after schema upgrades . <nl> boost : : optional < User > AuthorizationManagerImpl : : UserCacheImpl : : lookup ( OperationC <nl> case schemaVersion26Final : <nl> case schemaVersion26Upgrade : { <nl> BSONObj userObj ; <nl> - uassertStatusOK ( _externalState - > getUserDescription ( opCtx , userName , & userObj ) ) ; <nl> + uassertStatusOK ( _externalState - > getUserDescription ( opCtx , userReq , & userObj ) ) ; <nl> <nl> - User user ( userName ) ; <nl> + User user ( userReq . name ) ; <nl> uassertStatusOK ( initializeUserFromPrivilegeDocument ( & user , userObj ) ) ; <nl> return user ; <nl> } <nl> mmm a / src / mongo / db / auth / authorization_manager_impl . h <nl> ppp b / src / mongo / db / auth / authorization_manager_impl . h <nl> class AuthorizationManagerImpl : public AuthorizationManager { <nl> / / Even though the dist cache permits for lookup to return boost : : none for non - existent <nl> / / values , the contract of the authorization manager is that it should throw an exception if <nl> / / the value can not be loaded , so if it returns , the value will always be set . <nl> - boost : : optional < User > lookup ( OperationContext * opCtx , const UserName & userName ) override ; <nl> + boost : : optional < User > lookup ( OperationContext * opCtx , const UserRequest & user ) override ; <nl> <nl> private : <nl> Mutex _mutex = MONGO_MAKE_LATCH ( " AuthorizationManagerImpl : : UserDistCacheImpl : : _mutex " ) ; <nl> mmm a / src / mongo / db / auth / authorization_manager_test . cpp <nl> ppp b / src / mongo / db / auth / authorization_manager_test . cpp <nl> class AuthzManagerExternalStateMockWithExplicitUserPrivileges <nl> * can control exactly what privileges are returned for the user . <nl> * / <nl> Status getUserDescription ( OperationContext * opCtx , <nl> - const UserName & userName , <nl> + const UserRequest & user , <nl> BSONObj * result ) override { <nl> - return _getUserDocument ( opCtx , userName , result ) ; <nl> + return _getUserDocument ( opCtx , user . name , result ) ; <nl> } <nl> <nl> private : <nl> mmm a / src / mongo / db / auth / authz_manager_external_state . cpp <nl> ppp b / src / mongo / db / auth / authz_manager_external_state . cpp <nl> <nl> <nl> # include " mongo / base / shim . h " <nl> # include " mongo / config . h " <nl> - # include " mongo / db / auth / authorization_manager_global_parameters_gen . h " <nl> # include " mongo / db / auth / authz_manager_external_state . h " <nl> # include " mongo / db / auth / user_name . h " <nl> # include " mongo / db / operation_context . h " <nl> std : : unique_ptr < AuthzManagerExternalState > AuthzManagerExternalState : : create ( ) { <nl> AuthzManagerExternalState : : AuthzManagerExternalState ( ) = default ; <nl> AuthzManagerExternalState : : ~ AuthzManagerExternalState ( ) = default ; <nl> <nl> - bool AuthzManagerExternalState : : shouldUseRolesFromConnection ( OperationContext * opCtx , <nl> - const UserName & userName ) { <nl> - # ifdef MONGO_CONFIG_SSL <nl> - if ( ! opCtx | | ! opCtx - > getClient ( ) | | ! opCtx - > getClient ( ) - > session ( ) ) { <nl> - return false ; <nl> - } <nl> - <nl> - if ( ! allowRolesFromX509Certificates ) { <nl> - return false ; <nl> - } <nl> - <nl> - auto & sslPeerInfo = SSLPeerInfo : : forSession ( opCtx - > getClient ( ) - > session ( ) ) ; <nl> - return sslPeerInfo . subjectName . toString ( ) = = userName . getUser ( ) & & <nl> - userName . getDB ( ) = = " $ external " & & ! sslPeerInfo . roles . empty ( ) ; <nl> - # else <nl> - return false ; <nl> - # endif <nl> - } <nl> - <nl> - <nl> } / / namespace mongo <nl> mmm a / src / mongo / db / auth / authz_manager_external_state . h <nl> ppp b / src / mongo / db / auth / authz_manager_external_state . h <nl> class AuthzManagerExternalState { <nl> virtual Status getStoredAuthorizationVersion ( OperationContext * opCtx , int * outVersion ) = 0 ; <nl> <nl> / * * <nl> - * Writes into " result " a document describing the named user and returns Status : : OK ( ) . The <nl> - * description includes the user credentials and customData , if present , the user ' s role <nl> - * membership and delegation information , a full list of the user ' s privileges , and a full <nl> - * list of the user ' s roles , including those roles held implicitly through other roles <nl> - * ( indirect roles ) . In the event that some of this information is inconsistent , the <nl> - * document will contain a " warnings " array , with std : : string messages describing <nl> - * inconsistencies . <nl> + * Writes into " result " a document describing the requested user and returns Status : : OK ( ) . <nl> + * The caller is required to provide all information necessary to unique identify the request <nl> + * for a user , including the user ' s name and any roles which the user must possess via <nl> + * out - of - band attestation . The returned description includes the user credentials and <nl> + * customData , if present , the user ' s role membership and delegation information , a full <nl> + * list of the user ' s privileges , and a full list of the user ' s roles , including those <nl> + * roles held implicitly through other roles ( indirect roles ) . In the event that some of this <nl> + * information is inconsistent , the document will contain a " warnings " array , <nl> + * with std : : string messages describing inconsistencies . <nl> * <nl> * If the user does not exist , returns ErrorCodes : : UserNotFound . <nl> * / <nl> virtual Status getUserDescription ( OperationContext * opCtx , <nl> - const UserName & userName , <nl> + const UserRequest & user , <nl> BSONObj * result ) = 0 ; <nl> <nl> / * * <nl> class AuthzManagerExternalState { <nl> <nl> protected : <nl> AuthzManagerExternalState ( ) ; / / This class should never be instantiated directly . <nl> - <nl> - / * * <nl> - * Returns true if roles for this user were provided by the client , and can be obtained from <nl> - * the connection . <nl> - * / <nl> - bool shouldUseRolesFromConnection ( OperationContext * opCtx , const UserName & username ) ; <nl> } ; <nl> <nl> } / / namespace mongo <nl> mmm a / src / mongo / db / auth / authz_manager_external_state_local . cpp <nl> ppp b / src / mongo / db / auth / authz_manager_external_state_local . cpp <nl> bool AuthzManagerExternalStateLocal : : hasAnyPrivilegeDocuments ( OperationContext * <nl> } <nl> <nl> Status AuthzManagerExternalStateLocal : : getUserDescription ( OperationContext * opCtx , <nl> - const UserName & userName , <nl> + const UserRequest & userReq , <nl> BSONObj * result ) { <nl> Status status = Status : : OK ( ) ; <nl> + const UserName & userName = userReq . name ; <nl> <nl> - if ( ! shouldUseRolesFromConnection ( opCtx , userName ) ) { <nl> + if ( ! userReq . roles ) { <nl> status = _getUserDocument ( opCtx , userName , result ) ; <nl> if ( ! status . isOK ( ) ) <nl> return status ; <nl> } else { <nl> / / We are able to artifically construct the external user from the request <nl> BSONArrayBuilder userRoles ; <nl> - auto & sslPeerInfo = SSLPeerInfo : : forSession ( opCtx - > getClient ( ) - > session ( ) ) ; <nl> - for ( const RoleName & role : sslPeerInfo . roles ) { <nl> + for ( const RoleName & role : * ( userReq . roles ) ) { <nl> userRoles < < BSON ( " role " < < role . getRole ( ) < < " db " < < role . getDB ( ) ) ; <nl> } <nl> * result = BSON ( " _id " < < userName . getUser ( ) < < " user " < < userName . getUser ( ) < < " db " <nl> mmm a / src / mongo / db / auth / authz_manager_external_state_local . h <nl> ppp b / src / mongo / db / auth / authz_manager_external_state_local . h <nl> class AuthzManagerExternalStateLocal : public AuthzManagerExternalState { <nl> <nl> Status getStoredAuthorizationVersion ( OperationContext * opCtx , int * outVersion ) override ; <nl> Status getUserDescription ( OperationContext * opCtx , <nl> - const UserName & userName , <nl> + const UserRequest & user , <nl> BSONObj * result ) override ; <nl> Status getRoleDescription ( OperationContext * opCtx , <nl> const RoleName & roleName , <nl> mmm a / src / mongo / db / auth / authz_manager_external_state_s . cpp <nl> ppp b / src / mongo / db / auth / authz_manager_external_state_s . cpp <nl> Status AuthzManagerExternalStateMongos : : getStoredAuthorizationVersion ( OperationC <nl> } <nl> <nl> Status AuthzManagerExternalStateMongos : : getUserDescription ( OperationContext * opCtx , <nl> - const UserName & userName , <nl> + const UserRequest & user , <nl> BSONObj * result ) { <nl> - if ( ! shouldUseRolesFromConnection ( opCtx , userName ) ) { <nl> + const UserName & userName = user . name ; <nl> + if ( ! user . roles ) { <nl> BSONObj usersInfoCmd = <nl> BSON ( " usersInfo " < < BSON_ARRAY ( BSON ( AuthorizationManager : : USER_NAME_FIELD_NAME <nl> < < userName . getUser ( ) <nl> Status AuthzManagerExternalStateMongos : : getUserDescription ( OperationContext * opC <nl> / / Obtain privilege information from the config servers for all roles acquired from the X509 <nl> / / certificate . <nl> BSONArrayBuilder userRolesBuilder ; <nl> - auto & sslPeerInfo = SSLPeerInfo : : forSession ( opCtx - > getClient ( ) - > session ( ) ) ; <nl> - for ( const RoleName & role : sslPeerInfo . roles ) { <nl> + for ( const RoleName & role : * user . roles ) { <nl> userRolesBuilder . append ( BSON ( <nl> AuthorizationManager : : ROLE_NAME_FIELD_NAME <nl> < < role . getRole ( ) < < AuthorizationManager : : ROLE_DB_FIELD_NAME < < role . getDB ( ) ) ) ; <nl> mmm a / src / mongo / db / auth / authz_manager_external_state_s . h <nl> ppp b / src / mongo / db / auth / authz_manager_external_state_s . h <nl> class AuthzManagerExternalStateMongos : public AuthzManagerExternalState { <nl> AuthorizationManager * authzManager ) override ; <nl> Status getStoredAuthorizationVersion ( OperationContext * opCtx , int * outVersion ) override ; <nl> Status getUserDescription ( OperationContext * opCtx , <nl> - const UserName & userName , <nl> + const UserRequest & user , <nl> BSONObj * result ) override ; <nl> Status getRoleDescription ( OperationContext * opCtx , <nl> const RoleName & roleName , <nl> mmm a / src / mongo / db / auth / user . h <nl> ppp b / src / mongo / db / auth / user . h <nl> class User { <nl> RestrictionDocuments _restrictions ; <nl> } ; <nl> <nl> - using UserCache = ReadThroughCache < UserName , User > ; <nl> + / * * <nl> + * Represents the properties required to request a UserHandle . <nl> + * This type is hashable and may be used as a key describing requests <nl> + * / <nl> + struct UserRequest { <nl> + UserRequest ( const UserName & name , boost : : optional < std : : set < RoleName > > roles ) <nl> + : name ( name ) , roles ( std : : move ( roles ) ) { } <nl> + <nl> + <nl> + template < typename H > <nl> + friend H AbslHashValue ( H h , const UserRequest & key ) { <nl> + auto state = H : : combine ( std : : move ( h ) , key . name ) ; <nl> + if ( key . roles ) { <nl> + for ( const auto & role : * key . roles ) { <nl> + state = H : : combine ( std : : move ( state ) , role ) ; <nl> + } <nl> + } <nl> + return state ; <nl> + } <nl> + <nl> + bool operator = = ( const UserRequest & key ) const { <nl> + return name = = key . name & & roles = = key . roles ; <nl> + } <nl> + <nl> + / / The name of the requested user <nl> + UserName name ; <nl> + / / Any authorization grants which should override and be used in favor of roles acquisition . <nl> + boost : : optional < std : : set < RoleName > > roles ; <nl> + } ; <nl> + <nl> + using UserCache = ReadThroughCache < UserRequest , User > ; <nl> using UserHandle = UserCache : : ValueHandle ; <nl> <nl> } / / namespace mongo <nl>
|
SERVER - 46498 Store connection specified roles in authorization cache key
|
mongodb/mongo
|
a1f6d2eb74268b140929c3f280c37299617d596a
|
2020-03-03T00:32:53Z
|
mmm a / build / deps / github_hashes / facebook / fbthrift - rev . txt <nl> ppp b / build / deps / github_hashes / facebook / fbthrift - rev . txt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit c574509c237264bc9a9172808bc556d64d2f1c58 <nl> + Subproject commit d5a773d3dbdc69ea61a2f2144fcf1f09fd7d62b0 <nl> mmm a / build / deps / github_hashes / facebook / folly - rev . txt <nl> ppp b / build / deps / github_hashes / facebook / folly - rev . txt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 2af6f0c7b251c0987e730ef90f15dc8442a75840 <nl> + Subproject commit 60be5ec6d5b85c89cadd6ff9a986fa59e88b714d <nl> mmm a / build / deps / github_hashes / facebook / wangle - rev . txt <nl> ppp b / build / deps / github_hashes / facebook / wangle - rev . txt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 58148f6dbb1feb30f9e5eb65d3d3edb984c59b8e <nl> + Subproject commit 448ec6a046b16501aa6b8a49523806a188c1d2c8 <nl>
|
Updating submodules
|
facebook/watchman
|
bc8e696dfe887dbb13843bdefec5d32da8effa4a
|
2019-07-28T23:23:58Z
|
new file mode 100644 <nl> index 0000000000 . . a364b4d543 <nl> mmm / dev / null <nl> ppp b / code / string_algorithms / src / pangram_checker / README . md <nl> <nl> + # # PANGRAM <nl> + A pangram is a sentence in which every letter of a given alphabet appears at least once . The most famous english pangram is " The quick brown fox jumps over a lazy dog . " . <nl> + <nl> + _We only try to implement pangram checker algorithms for sentences in english language . _ <nl> + <nl> + # # # # PROCEDURE <nl> + 1 . Set a flag variable and check the input string for every alphabet in the language starting from ' a ' . <nl> + 2 . Change the flag variable and add a break statement as soon as the first missing letter is encountered . <nl> + 3 . If every letter is comapared and it ' s presence evaluated to be true then exit the loop . <nl> + 4 . If the value of flag is unchanged , the sentence is a pangram . <nl> + 5 . Else , the sentence is not a pangram . <nl> + <nl> + <nl> + # # # # Complexity <nl> + The Time complexity for the above algorithm will be O ( n ) , where n is the length of input string . <nl> + <nl>
|
Created README . md file for pangram_checker
|
OpenGenus/cosmos
|
62d126c4bae73638ac325a80a080fb2884d24685
|
2018-02-15T17:32:52Z
|
mmm a / modules / planning / tasks / deciders / path_bounds_decider . cc <nl> ppp b / modules / planning / tasks / deciders / path_bounds_decider . cc <nl> Status PathBoundsDecider : : Process ( <nl> CHECK_NOTNULL ( frame ) ; <nl> CHECK_NOTNULL ( reference_line_info ) ; <nl> <nl> + / / Initialize . <nl> + InitPathBoundsDecider ( * frame , * reference_line_info ) ; <nl> + <nl> / / The decided path bounds should be in the format of : ( s , l_min , l_max ) . <nl> PathBoundary fallback_path_boundaries ; <nl> PathBoundary path_boundaries ; <nl> Status PathBoundsDecider : : Process ( <nl> } <nl> <nl> / / Generate path boundaries . <nl> - std : : string path_bounds_msg = <nl> - GenerateRegularPathBoundary ( frame , reference_line_info , & path_boundaries ) ; <nl> + std : : string path_bounds_msg = GenerateRegularPathBoundary ( <nl> + * frame , * reference_line_info , LaneBorrowInfo : : NO_BORROW , <nl> + & path_boundaries ) ; <nl> if ( path_bounds_msg ! = " " ) { <nl> return Status ( ErrorCode : : PLANNING_ERROR , path_bounds_msg ) ; <nl> } <nl> Status PathBoundsDecider : : Process ( <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> - std : : string PathBoundsDecider : : GenerateRegularPathBoundary ( <nl> - Frame * frame , ReferenceLineInfo * reference_line_info , <nl> - std : : vector < std : : tuple < double , double , double > > * const path_boundaries ) { <nl> - / / Sanity checks . <nl> - CHECK_NOTNULL ( frame ) ; <nl> - CHECK_NOTNULL ( reference_line_info ) ; <nl> + void PathBoundsDecider : : InitPathBoundsDecider ( <nl> + const Frame & frame , const ReferenceLineInfo & reference_line_info ) { <nl> + const ReferenceLine & reference_line = <nl> + reference_line_info . reference_line ( ) ; <nl> + const common : : TrajectoryPoint & planning_start_point = <nl> + frame . PlanningStartPoint ( ) ; <nl> + / / Reset variables . <nl> + blocking_obstacle_id_ = " " ; <nl> + adc_frenet_s_ = 0 . 0 ; <nl> + adc_frenet_l_ = 0 . 0 ; <nl> + adc_lane_width_ = 0 . 0 ; <nl> <nl> + / / Initialize some private variables . <nl> + / / ADC s / l info . <nl> + auto adc_frenet_position = <nl> + reference_line . GetFrenetPoint ( planning_start_point . path_point ( ) ) ; <nl> + adc_frenet_s_ = adc_frenet_position . s ( ) ; <nl> + adc_frenet_l_ = adc_frenet_position . l ( ) ; <nl> + auto adc_sl_info = reference_line . ToFrenetFrame ( planning_start_point ) ; <nl> + adc_frenet_sd_ = adc_sl_info . first [ 1 ] ; <nl> + adc_frenet_ld_ = adc_sl_info . second [ 1 ] * adc_frenet_sd_ ; <nl> + / / ADC ' s lane width . <nl> + double lane_left_width = 0 . 0 ; <nl> + double lane_right_width = 0 . 0 ; <nl> + if ( ! reference_line . GetLaneWidth ( adc_frenet_s_ , & lane_left_width , <nl> + & lane_right_width ) ) { <nl> + AWARN < < " Failed to get lane width at planning start point . " ; <nl> + adc_lane_width_ = kDefaultLaneWidth ; <nl> + } else { <nl> + adc_lane_width_ = lane_left_width + lane_right_width ; <nl> + } <nl> + } <nl> + <nl> + std : : string PathBoundsDecider : : GenerateRegularPathBoundary ( <nl> + const Frame & frame , const ReferenceLineInfo & reference_line_info , <nl> + const LaneBorrowInfo lane_borrow_info , <nl> + PathBoundary * const path_boundary ) { <nl> / / 1 . Initialize the path boundaries to be an indefinitely large area . <nl> - if ( ! InitPathBoundary ( reference_line_info - > reference_line ( ) , <nl> - frame - > PlanningStartPoint ( ) , path_boundaries ) ) { <nl> + if ( ! InitPathBoundary ( reference_line_info . reference_line ( ) , <nl> + path_boundary ) ) { <nl> const std : : string msg = " Failed to initialize path boundaries . " ; <nl> AERROR < < msg ; <nl> return msg ; <nl> } <nl> - / / PathBoundsDebugString ( * path_boundaries ) ; <nl> + / / PathBoundsDebugString ( * path_boundary ) ; <nl> <nl> / / 2 . Decide a rough boundary based on road info and ADC ' s position <nl> - if ( ! GetBoundaryFromLanesAndADC ( reference_line_info - > reference_line ( ) , 0 , 0 . 1 , <nl> - path_boundaries ) ) { <nl> + if ( ! GetBoundaryFromLanesAndADC ( reference_line_info . reference_line ( ) , <nl> + 0 , 0 . 1 , path_boundary ) ) { <nl> const std : : string msg = <nl> " Failed to decide a rough boundary based on " <nl> " road information . " ; <nl> AERROR < < msg ; <nl> return msg ; <nl> } <nl> - / / PathBoundsDebugString ( * path_boundaries ) ; <nl> + / / PathBoundsDebugString ( * path_boundary ) ; <nl> <nl> / / 3 . Fine - tune the boundary based on static obstacles <nl> - / / TODO ( all ) : in the future , add side - pass functionality . <nl> - if ( ! GetBoundaryFromStaticObstacles ( reference_line_info - > path_decision ( ) , <nl> - path_boundaries ) ) { <nl> + if ( ! GetBoundaryFromStaticObstacles ( <nl> + reference_line_info . path_decision ( ) , path_boundary ) ) { <nl> const std : : string msg = <nl> " Failed to decide fine tune the boundaries after " <nl> " taking into consideration all static obstacles . " ; <nl> AERROR < < msg ; <nl> return msg ; <nl> } <nl> - / / PathBoundsDebugString ( * path_boundaries ) ; <nl> + / / PathBoundsDebugString ( * path_boundary ) ; <nl> <nl> / / 4 . Adjust the boundary considering dynamic obstacles <nl> / / TODO ( all ) : may need to implement this in the future . <nl> std : : string PathBoundsDecider : : GenerateRegularPathBoundary ( <nl> <nl> std : : string PathBoundsDecider : : GenerateFallbackPathBoundary ( <nl> Frame * frame , ReferenceLineInfo * reference_line_info , <nl> - std : : vector < std : : tuple < double , double , double > > * const path_boundaries ) { <nl> + PathBoundary * const path_boundaries ) { <nl> / / Sanity checks . <nl> CHECK_NOTNULL ( frame ) ; <nl> CHECK_NOTNULL ( reference_line_info ) ; <nl> <nl> / / 1 . Initialize the path boundaries to be an indefinitely large area . <nl> if ( ! InitPathBoundary ( reference_line_info - > reference_line ( ) , <nl> - frame - > PlanningStartPoint ( ) , path_boundaries ) ) { <nl> + path_boundaries ) ) { <nl> const std : : string msg = " Failed to initialize fallback path boundaries . " ; <nl> AERROR < < msg ; <nl> return msg ; <nl> std : : string PathBoundsDecider : : GenerateFallbackPathBoundary ( <nl> } <nl> <nl> bool PathBoundsDecider : : InitPathBoundary ( <nl> - const ReferenceLine & reference_line , <nl> - const common : : TrajectoryPoint & planning_start_point , <nl> - std : : vector < std : : tuple < double , double , double > > * const path_boundaries ) { <nl> + const ReferenceLine & reference_line , PathBoundary * const path_boundary ) { <nl> / / Sanity checks . <nl> - CHECK_NOTNULL ( path_boundaries ) ; <nl> - path_boundaries - > clear ( ) ; <nl> - <nl> - / / Reset variables . <nl> - blocking_obstacle_id_ = " " ; <nl> - adc_frenet_s_ = 0 . 0 ; <nl> - adc_frenet_l_ = 0 . 0 ; <nl> - adc_lane_width_ = 0 . 0 ; <nl> - <nl> - / / Initialize some private variables . <nl> - / / ADC s / l info . <nl> - auto adc_frenet_position = <nl> - reference_line . GetFrenetPoint ( planning_start_point . path_point ( ) ) ; <nl> - adc_frenet_s_ = adc_frenet_position . s ( ) ; <nl> - adc_frenet_l_ = adc_frenet_position . l ( ) ; <nl> - auto adc_sl_info = reference_line . ToFrenetFrame ( planning_start_point ) ; <nl> - adc_frenet_sd_ = adc_sl_info . first [ 1 ] ; <nl> - adc_frenet_ld_ = adc_sl_info . second [ 1 ] * adc_frenet_sd_ ; <nl> - / / ADC ' s lane width . <nl> - double lane_left_width = 0 . 0 ; <nl> - double lane_right_width = 0 . 0 ; <nl> - if ( ! reference_line . GetLaneWidth ( adc_frenet_s_ , & lane_left_width , <nl> - & lane_right_width ) ) { <nl> - AWARN < < " Failed to get lane width at planning start point . " ; <nl> - adc_lane_width_ = kDefaultLaneWidth ; <nl> - } else { <nl> - adc_lane_width_ = lane_left_width + lane_right_width ; <nl> - } <nl> + CHECK_NOTNULL ( path_boundary ) ; <nl> + path_boundary - > clear ( ) ; <nl> <nl> / / Starting from ADC ' s current position , increment until the horizon , and <nl> / / set lateral bounds to be infinite at every spot . <nl> bool PathBoundsDecider : : InitPathBoundary ( <nl> curr_s < std : : min ( adc_frenet_s_ + kPathBoundsDeciderHorizon , <nl> reference_line . Length ( ) ) ; <nl> curr_s + = kPathBoundsDeciderResolution ) { <nl> - path_boundaries - > emplace_back ( curr_s , std : : numeric_limits < double > : : lowest ( ) , <nl> + path_boundary - > emplace_back ( curr_s , std : : numeric_limits < double > : : lowest ( ) , <nl> std : : numeric_limits < double > : : max ( ) ) ; <nl> } <nl> <nl> + / / return . <nl> + if ( path_boundary - > empty ( ) ) { <nl> + ADEBUG < < " Empty path boundary in InitPathBoundary " ; <nl> + return false ; <nl> + } <nl> return true ; <nl> } <nl> <nl> bool PathBoundsDecider : : GetBoundaryFromLanesAndADC ( <nl> / / obstacles whose headings differ from road - headings a lot . <nl> / / TODO ( all ) : ( future work ) this can be improved in the future . <nl> bool PathBoundsDecider : : GetBoundaryFromStaticObstacles ( <nl> - PathDecision * const path_decision , <nl> + const PathDecision & path_decision , <nl> std : : vector < std : : tuple < double , double , double > > * const path_boundaries ) { <nl> / / Preprocessing . <nl> - auto indexed_obstacles = path_decision - > obstacles ( ) ; <nl> + auto indexed_obstacles = path_decision . obstacles ( ) ; <nl> auto sorted_obstacles = SortObstaclesForSweepLine ( indexed_obstacles ) ; <nl> double center_line = adc_frenet_l_ ; <nl> size_t obs_idx = 0 ; <nl> mmm a / modules / planning / tasks / deciders / path_bounds_decider . h <nl> ppp b / modules / planning / tasks / deciders / path_bounds_decider . h <nl> namespace planning { <nl> <nl> class PathBoundsDecider : public Decider { <nl> public : <nl> + enum class LaneBorrowInfo { <nl> + LEFT_BORROW , <nl> + NO_BORROW , <nl> + RIGHT_BORROW , <nl> + } ; <nl> explicit PathBoundsDecider ( const TaskConfig & config ) ; <nl> <nl> private : <nl> common : : Status Process ( Frame * frame , <nl> ReferenceLineInfo * reference_line_info ) override ; <nl> <nl> - / * * <nl> - * @ brief : The regular path boundary generation considers the ADC itself <nl> - * and other static environments : <nl> - * - ADC ' s position ( lane - changing considerations ) <nl> - * - lane info <nl> - * - static obstacles <nl> - * The philosophy is : static environment must be and can only be taken <nl> - * care of by the path planning . <nl> - * @ param : frame <nl> - * @ param : reference_line_info <nl> - * @ param : The generated regular path_boundary , if there is one . <nl> - * @ return : A failure message . If succeeded , return " " ( empty string ) . <nl> - * / <nl> + void InitPathBoundsDecider ( <nl> + const Frame & frame , const ReferenceLineInfo & reference_line_info ) ; <nl> + <nl> + / * * @ brief : The regular path boundary generation considers the ADC itself <nl> + * and other static environments : <nl> + * - ADC ' s position ( lane - changing considerations ) <nl> + * - lane info <nl> + * - static obstacles <nl> + * The philosophy is : static environment must be and can only be taken <nl> + * care of by the path planning . <nl> + * @ param : frame <nl> + * @ param : reference_line_info <nl> + * @ param : lane_borrow_info : which lane to borrow . <nl> + * @ param : The generated regular path_boundary , if there is one . <nl> + * @ return : A failure message . If succeeded , return " " ( empty string ) . <nl> + * / <nl> std : : string GenerateRegularPathBoundary ( <nl> - Frame * frame , ReferenceLineInfo * reference_line_info , <nl> - std : : vector < std : : tuple < double , double , double > > * const path_boundaries ) ; <nl> - <nl> - / * * <nl> - * @ brief : The fallback path only considers : <nl> - * - ADC ' s position ( so that boundary must contain ADC ' s position ) <nl> - * - lane info <nl> - * It is supposed to be the last resort in case regular path generation <nl> - * fails so that speed decider can at least have some path and won ' t <nl> - * fail drastically . <nl> - * Therefore , it be reliable so that optimizer will not likely to <nl> - * fail with this boundary , and therefore doesn ' t consider any static <nl> - * obstacle . When the fallback path is used , stopping before static <nl> - * obstacles should be taken care of by the speed decider . Also , it <nl> - * doesn ' t consider any lane - borrowing . <nl> - * @ param : frame <nl> - * @ param : reference_line_info <nl> - * @ param : The generated fallback path_boundary , if there is one . <nl> - * @ return : A failure message . If succeeded , return " " ( empty string ) . <nl> - * / <nl> + const Frame & frame , const ReferenceLineInfo & reference_line_info , <nl> + const LaneBorrowInfo lane_borrow_info , <nl> + std : : vector < std : : tuple < double , double , double > > * const path_boundary ) ; <nl> + <nl> + / * * @ brief : The fallback path only considers : <nl> + * - ADC ' s position ( so that boundary must contain ADC ' s position ) <nl> + * - lane info <nl> + * It is supposed to be the last resort in case regular path generation <nl> + * fails so that speed decider can at least have some path and won ' t <nl> + * fail drastically . <nl> + * Therefore , it be reliable so that optimizer will not likely to <nl> + * fail with this boundary , and therefore doesn ' t consider any static <nl> + * obstacle . When the fallback path is used , stopping before static <nl> + * obstacles should be taken care of by the speed decider . Also , it <nl> + * doesn ' t consider any lane - borrowing . <nl> + * @ param : frame <nl> + * @ param : reference_line_info <nl> + * @ param : The generated fallback path_boundary , if there is one . <nl> + * @ return : A failure message . If succeeded , return " " ( empty string ) . <nl> + * / <nl> std : : string GenerateFallbackPathBoundary ( <nl> Frame * frame , ReferenceLineInfo * reference_line_info , <nl> std : : vector < std : : tuple < double , double , double > > * const path_boundaries ) ; <nl> <nl> - bool InitPathBoundary ( <nl> - const ReferenceLine & reference_line , <nl> - const common : : TrajectoryPoint & planning_start_point , <nl> - std : : vector < std : : tuple < double , double , double > > * const path_boundaries ) ; <nl> + / * * @ brief : Initializes an empty path boundary . <nl> + * / <nl> + bool InitPathBoundary ( const ReferenceLine & reference_line , <nl> + std : : vector < std : : tuple < double , double , double > > * const path_boundary ) ; <nl> <nl> + / * * @ brief : Refine the boundary based on lane - info and ADC ' s location . <nl> + * It will comply to the lane - boundary . However , if the ADC itself <nl> + * is out of the given lane ( s ) , it will adjust the boundary <nl> + * accordingly to include ADC ' s current position . <nl> + * / <nl> bool GetBoundaryFromLanesAndADC ( <nl> const ReferenceLine & reference_line , int lane_borrowing , <nl> double ADC_buffer , <nl> std : : vector < std : : tuple < double , double , double > > * const path_boundaries ) ; <nl> <nl> bool GetBoundaryFromStaticObstacles ( <nl> - PathDecision * const path_decision , <nl> + const PathDecision & path_decision , <nl> std : : vector < std : : tuple < double , double , double > > * const path_boundaries ) ; <nl> <nl> bool GetLaneInfoFromPoint ( double point_x , double point_y , double point_z , <nl> class PathBoundsDecider : public Decider { <nl> const std : : vector < std : : tuple < int , double , double , double , std : : string > > & <nl> new_entering_obstacles ) ; <nl> <nl> - / * * <nl> - * @ brief Update the path_boundary at " idx " , as well as the new center - line . <nl> - * It also checks if ADC is blocked ( lmax < lmin ) . <nl> - * @ param The current index of the path_bounds <nl> - * @ param The minimum left boundary ( l_max ) <nl> - * @ param The maximum right boundary ( l_min ) <nl> - * @ param The path_boundaries ( its content at idx will be updated ) <nl> - * @ param The center_line ( to be updated ) <nl> - * @ return If path is good , true ; if path is blocked , false . <nl> - * / <nl> + / * * @ brief Update the path_boundary at " idx " , as well as the new center - line . <nl> + * It also checks if ADC is blocked ( lmax < lmin ) . <nl> + * @ param The current index of the path_bounds <nl> + * @ param The minimum left boundary ( l_max ) <nl> + * @ param The maximum right boundary ( l_min ) <nl> + * @ param The path_boundaries ( its content at idx will be updated ) <nl> + * @ param The center_line ( to be updated ) <nl> + * @ return If path is good , true ; if path is blocked , false . <nl> + * / <nl> bool UpdatePathBoundaryAndCenterLine ( <nl> size_t idx , double left_bound , double right_bound , <nl> std : : vector < std : : tuple < double , double , double > > * const path_boundaries , <nl>
|
Planning : refactored path_bounds_decider .
|
ApolloAuto/apollo
|
8b19a9950a0daae7774c251ab64fcd467f5e369e
|
2019-03-21T17:40:09Z
|
mmm a / cmake / treedata / common / subdirs . txt <nl> ppp b / cmake / treedata / common / subdirs . txt <nl> xbmc / addons / kodi - dev - kit / include / kodi / c - api addons_kodi - dev - kit_include_kodi_c - a <nl> xbmc / addons / kodi - dev - kit / include / kodi / c - api / addon - instance addons_kodi - dev - kit_include_kodi_c - api_addon - instance <nl> xbmc / addons / kodi - dev - kit / include / kodi / c - api / addon - instance / pvr addons_kodi - dev - kit_include_kodi_c - api_addon - instance_pvr <nl> xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui addons_kodi - dev - kit_include_kodi_c - api_gui <nl> + xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls addons_kodi - dev - kit_include_kodi_c - api_gui_controls <nl> + xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs addons_kodi - dev - kit_include_kodi_c - api_gui_dialogs <nl> xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / input addons_kodi - dev - kit_include_kodi_c - api_gui_input <nl> xbmc / addons / kodi - dev - kit / include / kodi / gui addons_kodi - dev - kit_include_kodi_gui <nl> xbmc / addons / kodi - dev - kit / include / kodi / gui / controls addons_kodi - dev - kit_include_kodi_gui_controls <nl> mmm a / xbmc / addons / interfaces / gui / General . h <nl> ppp b / xbmc / addons / interfaces / gui / General . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / general . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / ListItem . h <nl> ppp b / xbmc / addons / interfaces / gui / ListItem . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / list_item . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / Window . h <nl> ppp b / xbmc / addons / interfaces / gui / Window . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / window . h " <nl> # include " threads / Event . h " <nl> # include " windows / GUIMediaWindow . h " <nl> <nl> mmm a / xbmc / addons / interfaces / gui / controls / Button . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / Button . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / button . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / controls / Edit . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / Edit . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / edit . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / controls / FadeLabel . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / FadeLabel . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / fade_label . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / controls / Image . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / Image . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / image . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / controls / Label . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / Label . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / label . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / controls / Progress . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / Progress . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / progress . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / controls / RadioButton . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / RadioButton . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / radio_button . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / controls / Rendering . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / Rendering . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / rendering . h " <nl> # include " guilib / IRenderingCallback . h " <nl> <nl> class CGUIRenderingControl ; <nl> mmm a / xbmc / addons / interfaces / gui / controls / SettingsSlider . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / SettingsSlider . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / settings_slider . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / controls / Slider . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / Slider . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / slider . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / controls / Spin . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / Spin . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / spin . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / controls / TextBox . h <nl> ppp b / xbmc / addons / interfaces / gui / controls / TextBox . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / controls / text_box . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / ContextMenu . h <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / ContextMenu . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / context_menu . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / ExtendedProgressBar . h <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / ExtendedProgressBar . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / extended_progress . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / FileBrowser . h <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / FileBrowser . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / filebrowser . h " <nl> <nl> # include < string > <nl> # include < vector > <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / Keyboard . h <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / Keyboard . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / keyboard . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / Numeric . h <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / Numeric . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / numeric . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / OK . h <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / OK . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / ok . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / Progress . h <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / Progress . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / progress . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / Select . h <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / Select . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / select . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / TextViewer . h <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / TextViewer . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / text_viewer . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / interfaces / gui / dialogs / YesNo . h <nl> ppp b / xbmc / addons / interfaces / gui / dialogs / YesNo . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h " <nl> + # include " addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / yes_no . h " <nl> <nl> extern " C " <nl> { <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / CMakeLists . txt <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / CMakeLists . txt <nl> <nl> - set ( HEADERS definitions . h ) <nl> + set ( HEADERS definitions . h <nl> + general . h <nl> + list_item . h <nl> + window . h ) <nl> <nl> if ( NOT ENABLE_STATIC_LIBS ) <nl> core_add_library ( addons_kodi - dev - kit_include_kodi_c - api_gui ) <nl> new file mode 100644 <nl> index 000000000000 . . 2e6cd53f8913 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / CMakeLists . txt <nl> <nl> + set ( HEADERS button . h <nl> + edit . h <nl> + fade_label . h <nl> + image . h <nl> + label . h <nl> + progress . h <nl> + radio_button . h <nl> + rendering . h <nl> + settings_slider . h <nl> + slider . h <nl> + spin . h <nl> + text_box . h ) <nl> + <nl> + if ( NOT ENABLE_STATIC_LIBS ) <nl> + core_add_library ( addons_kodi - dev - kit_include_kodi_c - api_gui_controls ) <nl> + endif ( ) <nl> new file mode 100644 <nl> index 000000000000 . . 84fd8227d1b4 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / button . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_BUTTON_H <nl> + # define C_API_GUI_CONTROLS_BUTTON_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_button <nl> + { <nl> + void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> + void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> + void ( * set_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * label ) ; <nl> + char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_label2 ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * label ) ; <nl> + char * ( * get_label2 ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_button ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_BUTTON_H * / <nl> new file mode 100644 <nl> index 000000000000 . . ca38b273fc02 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / edit . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_EDIT_H <nl> + # define C_API_GUI_CONTROLS_EDIT_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + / / / @ ingroup cpp_kodi_gui_windows_controls_CEdit_Defs <nl> + / / / @ { <nl> + / / / @ anchor AddonGUIInputType <nl> + / / / @ brief Text input types used on kodi : : gui : : controls : : CEdit <nl> + enum AddonGUIInputType <nl> + { <nl> + / / / Text inside edit control only readable <nl> + ADDON_INPUT_TYPE_READONLY = - 1 , <nl> + / / / Normal text entries <nl> + ADDON_INPUT_TYPE_TEXT = 0 , <nl> + / / / To use on edit control only numeric numbers <nl> + ADDON_INPUT_TYPE_NUMBER , <nl> + / / / To insert seconds <nl> + ADDON_INPUT_TYPE_SECONDS , <nl> + / / / To insert time <nl> + ADDON_INPUT_TYPE_TIME , <nl> + / / / To insert a date <nl> + ADDON_INPUT_TYPE_DATE , <nl> + / / / Used for write in IP addresses <nl> + ADDON_INPUT_TYPE_IPADDRESS , <nl> + / / / Text field used as password entry field with not visible text <nl> + ADDON_INPUT_TYPE_PASSWORD , <nl> + / / / Text field used as password entry field with not visible text but <nl> + / / / returned as MD5 value <nl> + ADDON_INPUT_TYPE_PASSWORD_MD5 , <nl> + / / / Use text field for search purpose <nl> + ADDON_INPUT_TYPE_SEARCH , <nl> + / / / Text field as filter <nl> + ADDON_INPUT_TYPE_FILTER , <nl> + / / / <nl> + ADDON_INPUT_TYPE_PASSWORD_NUMBER_VERIFY_NEW <nl> + } ; <nl> + / / / @ } <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_edit <nl> + { <nl> + void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> + void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> + void ( * set_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * label ) ; <nl> + char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> + char * ( * get_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_cursor_position ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + unsigned int position ) ; <nl> + unsigned int ( * get_cursor_position ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_input_type ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + int type , <nl> + const char * heading ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_edit ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_EDIT_H * / <nl> new file mode 100644 <nl> index 000000000000 . . fea014b6237b <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / fade_label . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_FADE_LABEL_H <nl> + # define C_API_GUI_CONTROLS_FADE_LABEL_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_fade_label <nl> + { <nl> + void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> + void ( * add_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> + char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_scrolling ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool scroll ) ; <nl> + void ( * reset ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_fade_label ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_FADE_LABEL_H * / <nl> new file mode 100644 <nl> index 000000000000 . . 4a46e6da5bd8 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / image . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_IMAGE_H <nl> + # define C_API_GUI_CONTROLS_IMAGE_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_image <nl> + { <nl> + void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> + void ( * set_filename ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + const char * filename , <nl> + bool use_cache ) ; <nl> + void ( * set_color_diffuse ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + uint32_t color_diffuse ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_image ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_IMAGE_H * / <nl> new file mode 100644 <nl> index 000000000000 . . d8a9fe4a58ee <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / label . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_LABEL_H <nl> + # define C_API_GUI_CONTROLS_LABEL_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_label <nl> + { <nl> + void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> + void ( * set_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> + char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_label ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_LABEL_H * / <nl> new file mode 100644 <nl> index 000000000000 . . 88638e085900 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / progress . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_PROGRESS_H <nl> + # define C_API_GUI_CONTROLS_PROGRESS_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_progress <nl> + { <nl> + void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> + void ( * set_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float percent ) ; <nl> + float ( * get_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_progress ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_PROGRESS_H * / <nl> new file mode 100644 <nl> index 000000000000 . . a672d9516a8a <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / radio_button . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_RADIO_BUTTON_H <nl> + # define C_API_GUI_CONTROLS_RADIO_BUTTON_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_radio_button <nl> + { <nl> + void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> + void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> + void ( * set_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> + char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_selected ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool selected ) ; <nl> + bool ( * is_selected ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_radio_button ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_RADIO_BUTTON_H * / <nl> new file mode 100644 <nl> index 000000000000 . . d4053a6411dd <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / rendering . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_RENDERING_H <nl> + # define C_API_GUI_CONTROLS_RENDERING_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_rendering <nl> + { <nl> + void ( * set_callbacks ) ( <nl> + KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + KODI_GUI_CLIENT_HANDLE clienthandle , <nl> + bool ( * createCB ) ( KODI_GUI_CLIENT_HANDLE , int , int , int , int , ADDON_HARDWARE_CONTEXT ) , <nl> + void ( * renderCB ) ( KODI_GUI_CLIENT_HANDLE ) , <nl> + void ( * stopCB ) ( KODI_GUI_CLIENT_HANDLE ) , <nl> + bool ( * dirtyCB ) ( KODI_GUI_CLIENT_HANDLE ) ) ; <nl> + void ( * destroy ) ( void * kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_rendering ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_RENDERING_H * / <nl> new file mode 100644 <nl> index 000000000000 . . 2cbc972bddfb <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / settings_slider . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_SETTINGS_SLIDER_H <nl> + # define C_API_GUI_CONTROLS_SETTINGS_SLIDER_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_settings_slider <nl> + { <nl> + void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> + void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> + void ( * set_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * label ) ; <nl> + void ( * reset ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_int_range ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int start , int end ) ; <nl> + void ( * set_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int value ) ; <nl> + int ( * get_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_int_interval ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int interval ) ; <nl> + void ( * set_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float percent ) ; <nl> + float ( * get_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_float_range ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + float start , <nl> + float end ) ; <nl> + void ( * set_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float value ) ; <nl> + float ( * get_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_float_interval ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + float interval ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_settings_slider ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_SETTINGS_SLIDER_H * / <nl> new file mode 100644 <nl> index 000000000000 . . 0a67208c7bab <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / slider . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_SLIDER_H <nl> + # define C_API_GUI_CONTROLS_SLIDER_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_slider <nl> + { <nl> + void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> + void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> + void ( * reset ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + char * ( * get_description ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_int_range ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int start , int end ) ; <nl> + void ( * set_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int value ) ; <nl> + int ( * get_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_int_interval ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int interval ) ; <nl> + void ( * set_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float percent ) ; <nl> + float ( * get_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_float_range ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + float start , <nl> + float end ) ; <nl> + void ( * set_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float value ) ; <nl> + float ( * get_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_float_interval ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + float interval ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_slider ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_SLIDER_H * / <nl> new file mode 100644 <nl> index 000000000000 . . d5e5c861a370 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / spin . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_SPIN_H <nl> + # define C_API_GUI_CONTROLS_SPIN_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_spin <nl> + { <nl> + void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> + void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> + void ( * set_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> + void ( * reset ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_type ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int type ) ; <nl> + void ( * add_string_label ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + const char * label , <nl> + const char * value ) ; <nl> + void ( * set_string_value ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + const char * value ) ; <nl> + char * ( * get_string_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * add_int_label ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + const char * label , <nl> + int value ) ; <nl> + void ( * set_int_range ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int start , int end ) ; <nl> + void ( * set_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int value ) ; <nl> + int ( * get_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_float_range ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + float start , <nl> + float end ) ; <nl> + void ( * set_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float value ) ; <nl> + float ( * get_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_float_interval ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_CONTROL_HANDLE handle , <nl> + float interval ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_spin ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_SPIN_H * / <nl> new file mode 100644 <nl> index 000000000000 . . 276d04cb28ac <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / controls / text_box . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_CONTROLS_TEXT_BOX_H <nl> + # define C_API_GUI_CONTROLS_TEXT_BOX_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_control_text_box <nl> + { <nl> + void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> + void ( * reset ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * set_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> + char * ( * get_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> + void ( * scroll ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , unsigned int scroll ) ; <nl> + void ( * set_auto_scrolling ) ( <nl> + KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int delay , int time , int repeat ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_control_text_box ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_CONTROLS_TEXT_BOX_H * / <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / definitions . h <nl> <nl> # define C_API_GUI_DEFINITIONS_H <nl> <nl> # include " . . / addon_base . h " <nl> - # include " input / action_ids . h " <nl> - <nl> - # include < stddef . h > <nl> - <nl> - # define ADDON_MAX_CONTEXT_ENTRIES 20 <nl> - # define ADDON_MAX_CONTEXT_ENTRY_NAME_LENGTH 80 <nl> <nl> # ifdef __cplusplus <nl> extern " C " <nl> extern " C " <nl> typedef void * KODI_GUI_LISTITEM_HANDLE ; <nl> typedef void * KODI_GUI_WINDOW_HANDLE ; <nl> <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_general <nl> - { <nl> - void ( * lock ) ( ) ; <nl> - void ( * unlock ) ( ) ; <nl> - int ( * get_screen_height ) ( KODI_HANDLE kodiBase ) ; <nl> - int ( * get_screen_width ) ( KODI_HANDLE kodiBase ) ; <nl> - int ( * get_video_resolution ) ( KODI_HANDLE kodiBase ) ; <nl> - int ( * get_current_window_dialog_id ) ( KODI_HANDLE kodiBase ) ; <nl> - int ( * get_current_window_id ) ( KODI_HANDLE kodiBase ) ; <nl> - ADDON_HARDWARE_CONTEXT ( * get_hw_context ) ( KODI_HANDLE kodiBase ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_general ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_button <nl> - { <nl> - void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> - void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> - void ( * set_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * label ) ; <nl> - char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_label2 ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * label ) ; <nl> - char * ( * get_label2 ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_button ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_edit <nl> - { <nl> - void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> - void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> - void ( * set_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * label ) ; <nl> - char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> - char * ( * get_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_cursor_position ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - unsigned int position ) ; <nl> - unsigned int ( * get_cursor_position ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_input_type ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - int type , <nl> - const char * heading ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_edit ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_fade_label <nl> - { <nl> - void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> - void ( * add_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> - char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_scrolling ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool scroll ) ; <nl> - void ( * reset ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_fade_label ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_image <nl> - { <nl> - void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> - void ( * set_filename ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - const char * filename , <nl> - bool use_cache ) ; <nl> - void ( * set_color_diffuse ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - uint32_t color_diffuse ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_image ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_label <nl> - { <nl> - void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> - void ( * set_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> - char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_label ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_progress <nl> - { <nl> - void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> - void ( * set_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float percent ) ; <nl> - float ( * get_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_progress ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_radio_button <nl> - { <nl> - void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> - void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> - void ( * set_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> - char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_selected ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool selected ) ; <nl> - bool ( * is_selected ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_radio_button ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_rendering <nl> - { <nl> - void ( * set_callbacks ) ( <nl> - KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - KODI_GUI_CLIENT_HANDLE clienthandle , <nl> - bool ( * createCB ) ( KODI_GUI_CLIENT_HANDLE , int , int , int , int , ADDON_HARDWARE_CONTEXT ) , <nl> - void ( * renderCB ) ( KODI_GUI_CLIENT_HANDLE ) , <nl> - void ( * stopCB ) ( KODI_GUI_CLIENT_HANDLE ) , <nl> - bool ( * dirtyCB ) ( KODI_GUI_CLIENT_HANDLE ) ) ; <nl> - void ( * destroy ) ( void * kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_rendering ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_settings_slider <nl> - { <nl> - void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> - void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> - void ( * set_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * label ) ; <nl> - void ( * reset ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_int_range ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int start , int end ) ; <nl> - void ( * set_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int value ) ; <nl> - int ( * get_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_int_interval ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int interval ) ; <nl> - void ( * set_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float percent ) ; <nl> - float ( * get_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_float_range ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - float start , <nl> - float end ) ; <nl> - void ( * set_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float value ) ; <nl> - float ( * get_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_float_interval ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - float interval ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_settings_slider ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_slider <nl> - { <nl> - void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> - void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> - void ( * reset ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - char * ( * get_description ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_int_range ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int start , int end ) ; <nl> - void ( * set_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int value ) ; <nl> - int ( * get_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_int_interval ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int interval ) ; <nl> - void ( * set_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float percent ) ; <nl> - float ( * get_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_float_range ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - float start , <nl> - float end ) ; <nl> - void ( * set_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float value ) ; <nl> - float ( * get_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_float_interval ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - float interval ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_slider ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_spin <nl> - { <nl> - void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> - void ( * set_enabled ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool enabled ) ; <nl> - void ( * set_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> - void ( * reset ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_type ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int type ) ; <nl> - void ( * add_string_label ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - const char * label , <nl> - const char * value ) ; <nl> - void ( * set_string_value ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - const char * value ) ; <nl> - char * ( * get_string_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * add_int_label ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - const char * label , <nl> - int value ) ; <nl> - void ( * set_int_range ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int start , int end ) ; <nl> - void ( * set_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int value ) ; <nl> - int ( * get_int_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_float_range ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - float start , <nl> - float end ) ; <nl> - void ( * set_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , float value ) ; <nl> - float ( * get_float_value ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_float_interval ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_CONTROL_HANDLE handle , <nl> - float interval ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_spin ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_control_text_box <nl> - { <nl> - void ( * set_visible ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , bool visible ) ; <nl> - void ( * reset ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * set_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , const char * text ) ; <nl> - char * ( * get_text ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle ) ; <nl> - void ( * scroll ) ( KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , unsigned int scroll ) ; <nl> - void ( * set_auto_scrolling ) ( <nl> - KODI_HANDLE kodiBase , KODI_GUI_CONTROL_HANDLE handle , int delay , int time , int repeat ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_control_text_box ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_dialogContextMenu <nl> - { <nl> - int ( * open ) ( KODI_HANDLE kodiBase , <nl> - const char * heading , <nl> - const char * entries [ ] , <nl> - unsigned int size ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_dialogContextMenu ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress <nl> - { <nl> - KODI_GUI_HANDLE ( * new_dialog ) ( KODI_HANDLE kodiBase , const char * title ) ; <nl> - void ( * delete_dialog ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> - char * ( * get_title ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> - void ( * set_title ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , const char * title ) ; <nl> - char * ( * get_text ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> - void ( * set_text ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , const char * text ) ; <nl> - bool ( * is_finished ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> - void ( * mark_finished ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> - float ( * get_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> - void ( * set_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , float percentage ) ; <nl> - void ( * set_progress ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_HANDLE handle , <nl> - int currentItem , <nl> - int itemCount ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_dialogFileBrowser <nl> - { <nl> - bool ( * show_and_get_directory ) ( KODI_HANDLE kodiBase , <nl> - const char * shares , <nl> - const char * heading , <nl> - const char * path_in , <nl> - char * * path_out , <nl> - bool writeOnly ) ; <nl> - bool ( * show_and_get_file ) ( KODI_HANDLE kodiBase , <nl> - const char * shares , <nl> - const char * mask , <nl> - const char * heading , <nl> - const char * path_in , <nl> - char * * path_out , <nl> - bool use_thumbs , <nl> - bool use_file_directories ) ; <nl> - bool ( * show_and_get_file_from_dir ) ( KODI_HANDLE kodiBase , <nl> - const char * directory , <nl> - const char * mask , <nl> - const char * heading , <nl> - const char * path_in , <nl> - char * * path_out , <nl> - bool use_thumbs , <nl> - bool use_file_directories , <nl> - bool singleList ) ; <nl> - bool ( * show_and_get_file_list ) ( KODI_HANDLE kodiBase , <nl> - const char * shares , <nl> - const char * mask , <nl> - const char * heading , <nl> - char * * * file_list , <nl> - unsigned int * entries , <nl> - bool use_thumbs , <nl> - bool use_file_directories ) ; <nl> - bool ( * show_and_get_source ) ( KODI_HANDLE kodiBase , <nl> - const char * path_in , <nl> - char * * path_out , <nl> - bool allow_network_shares , <nl> - const char * additional_share , <nl> - const char * type ) ; <nl> - bool ( * show_and_get_image ) ( KODI_HANDLE kodiBase , <nl> - const char * shares , <nl> - const char * heading , <nl> - const char * path_in , <nl> - char * * path_out ) ; <nl> - bool ( * show_and_get_image_list ) ( KODI_HANDLE kodiBase , <nl> - const char * shares , <nl> - const char * heading , <nl> - char * * * file_list , <nl> - unsigned int * entries ) ; <nl> - void ( * clear_file_list ) ( KODI_HANDLE kodiBase , char * * * file_list , unsigned int entries ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_dialogFileBrowser ; <nl> - <nl> - / / typedef void ( * char_callback_t ) ( CGUIKeyboard * ref , const std : : string & typedString ) ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_dialogKeyboard <nl> - { <nl> - bool ( * show_and_get_input_with_head ) ( KODI_HANDLE kodiBase , <nl> - const char * text_in , <nl> - char * * text_out , <nl> - const char * heading , <nl> - bool allow_empty_result , <nl> - bool hiddenInput , <nl> - unsigned int auto_close_ms ) ; <nl> - bool ( * show_and_get_input ) ( KODI_HANDLE kodiBase , <nl> - const char * text_in , <nl> - char * * text_out , <nl> - bool allow_empty_result , <nl> - unsigned int auto_close_ms ) ; <nl> - bool ( * show_and_get_new_password_with_head ) ( KODI_HANDLE kodiBase , <nl> - const char * password_in , <nl> - char * * password_out , <nl> - const char * heading , <nl> - bool allow_empty_result , <nl> - unsigned int auto_close_ms ) ; <nl> - bool ( * show_and_get_new_password ) ( KODI_HANDLE kodiBase , <nl> - const char * password_in , <nl> - char * * password_out , <nl> - unsigned int auto_close_ms ) ; <nl> - bool ( * show_and_verify_new_password_with_head ) ( KODI_HANDLE kodiBase , <nl> - char * * password_out , <nl> - const char * heading , <nl> - bool allow_empty_result , <nl> - unsigned int auto_close_ms ) ; <nl> - bool ( * show_and_verify_new_password ) ( KODI_HANDLE kodiBase , <nl> - char * * password_out , <nl> - unsigned int auto_close_ms ) ; <nl> - int ( * show_and_verify_password ) ( KODI_HANDLE kodiBase , <nl> - const char * password_in , <nl> - char * * password_out , <nl> - const char * heading , <nl> - int retries , <nl> - unsigned int auto_close_ms ) ; <nl> - bool ( * show_and_get_filter ) ( KODI_HANDLE kodiBase , <nl> - const char * text_in , <nl> - char * * text_out , <nl> - bool searching , <nl> - unsigned int auto_close_ms ) ; <nl> - bool ( * send_text_to_active_keyboard ) ( KODI_HANDLE kodiBase , <nl> - const char * text , <nl> - bool close_keyboard ) ; <nl> - bool ( * is_keyboard_activated ) ( KODI_HANDLE kodiBase ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_dialogKeyboard ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_dialogNumeric <nl> - { <nl> - bool ( * show_and_verify_new_password ) ( KODI_HANDLE kodiBase , char * * password ) ; <nl> - int ( * show_and_verify_password ) ( KODI_HANDLE kodiBase , <nl> - const char * password , <nl> - const char * heading , <nl> - int retries ) ; <nl> - bool ( * show_and_verify_input ) ( KODI_HANDLE kodiBase , <nl> - const char * verify_in , <nl> - char * * verify_out , <nl> - const char * heading , <nl> - bool verify_input ) ; <nl> - bool ( * show_and_get_time ) ( KODI_HANDLE kodiBase , struct tm * time , const char * heading ) ; <nl> - bool ( * show_and_get_date ) ( KODI_HANDLE kodiBase , struct tm * date , const char * heading ) ; <nl> - bool ( * show_and_get_ip_address ) ( KODI_HANDLE kodiBase , <nl> - const char * ip_address_in , <nl> - char * * ip_address_out , <nl> - const char * heading ) ; <nl> - bool ( * show_and_get_number ) ( KODI_HANDLE kodiBase , <nl> - const char * input_in , <nl> - char * * input_out , <nl> - const char * heading , <nl> - unsigned int auto_close_ms ) ; <nl> - bool ( * show_and_get_seconds ) ( KODI_HANDLE kodiBase , <nl> - const char * time_in , <nl> - char * * time_out , <nl> - const char * heading ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_dialogNumeric ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_dialogOK <nl> - { <nl> - void ( * show_and_get_input_single_text ) ( KODI_HANDLE kodiBase , <nl> - const char * heading , <nl> - const char * text ) ; <nl> - void ( * show_and_get_input_line_text ) ( KODI_HANDLE kodiBase , <nl> - const char * heading , <nl> - const char * line0 , <nl> - const char * line1 , <nl> - const char * line2 ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_dialogOK ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_dialogProgress <nl> - { <nl> - KODI_GUI_HANDLE ( * new_dialog ) ( KODI_HANDLE kodiBase ) ; <nl> - void ( * delete_dialog ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> - void ( * open ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> - void ( * set_heading ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , const char * heading ) ; <nl> - void ( * set_line ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_HANDLE handle , <nl> - unsigned int lineNo , <nl> - const char * line ) ; <nl> - void ( * set_can_cancel ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , bool canCancel ) ; <nl> - bool ( * is_canceled ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> - void ( * set_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , int percentage ) ; <nl> - int ( * get_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> - void ( * show_progress_bar ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , bool pnOff ) ; <nl> - void ( * set_progress_max ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , int max ) ; <nl> - void ( * set_progress_advance ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , int nSteps ) ; <nl> - bool ( * abort ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_dialogProgress ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_dialogSelect <nl> - { <nl> - int ( * open ) ( KODI_HANDLE kodiBase , <nl> - const char * heading , <nl> - const char * entries [ ] , <nl> - unsigned int size , <nl> - int selected , <nl> - unsigned int autoclose ) ; <nl> - bool ( * open_multi_select ) ( KODI_HANDLE kodiBase , <nl> - const char * heading , <nl> - const char * entryIDs [ ] , <nl> - const char * entryNames [ ] , <nl> - bool entriesSelected [ ] , <nl> - unsigned int size , <nl> - unsigned int autoclose ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_dialogSelect ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_dialogTextViewer <nl> - { <nl> - void ( * open ) ( KODI_HANDLE kodiBase , const char * heading , const char * text ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_dialogTextViewer ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_dialogYesNo <nl> - { <nl> - bool ( * show_and_get_input_single_text ) ( KODI_HANDLE kodiBase , <nl> - const char * heading , <nl> - const char * text , <nl> - bool * canceled , <nl> - const char * noLabel , <nl> - const char * yesLabel ) ; <nl> - bool ( * show_and_get_input_line_text ) ( KODI_HANDLE kodiBase , <nl> - const char * heading , <nl> - const char * line0 , <nl> - const char * line1 , <nl> - const char * line2 , <nl> - const char * noLabel , <nl> - const char * yesLabel ) ; <nl> - bool ( * show_and_get_input_line_button_text ) ( KODI_HANDLE kodiBase , <nl> - const char * heading , <nl> - const char * line0 , <nl> - const char * line1 , <nl> - const char * line2 , <nl> - bool * canceled , <nl> - const char * noLabel , <nl> - const char * yesLabel ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_dialogYesNo ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_listItem <nl> - { <nl> - KODI_GUI_LISTITEM_HANDLE ( * create ) <nl> - ( KODI_HANDLE kodiBase , <nl> - const char * label , <nl> - const char * label2 , <nl> - const char * icon_image , <nl> - const char * path ) ; <nl> - void ( * destroy ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle ) ; <nl> - <nl> - char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle ) ; <nl> - void ( * set_label ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , const char * label ) ; <nl> - char * ( * get_label2 ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle ) ; <nl> - void ( * set_label2 ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , const char * label ) ; <nl> - char * ( * get_art ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , const char * type ) ; <nl> - void ( * set_art ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_LISTITEM_HANDLE handle , <nl> - const char * type , <nl> - const char * image ) ; <nl> - char * ( * get_path ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle ) ; <nl> - void ( * set_path ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , const char * path ) ; <nl> - char * ( * get_property ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , const char * key ) ; <nl> - void ( * set_property ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_LISTITEM_HANDLE handle , <nl> - const char * key , <nl> - const char * value ) ; <nl> - void ( * select ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , bool select ) ; <nl> - bool ( * is_selected ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle ) ; <nl> - } AddonToKodiFuncTable_kodi_gui_listItem ; <nl> - <nl> - typedef struct gui_context_menu_pair <nl> - { <nl> - unsigned int id ; <nl> - char name [ ADDON_MAX_CONTEXT_ENTRY_NAME_LENGTH ] ; <nl> - } gui_context_menu_pair ; <nl> - <nl> - typedef struct AddonToKodiFuncTable_kodi_gui_window <nl> - { <nl> - / * Window creation functions * / <nl> - KODI_GUI_WINDOW_HANDLE ( * create ) <nl> - ( KODI_HANDLE kodiBase , <nl> - const char * xml_filename , <nl> - const char * default_skin , <nl> - bool as_dialog , <nl> - bool is_media ) ; <nl> - void ( * destroy ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> - <nl> - void ( * set_callbacks ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - KODI_GUI_CLIENT_HANDLE clienthandle , <nl> - bool ( * CBInit ) ( KODI_GUI_CLIENT_HANDLE ) , <nl> - bool ( * CBFocus ) ( KODI_GUI_CLIENT_HANDLE , int ) , <nl> - bool ( * CBClick ) ( KODI_GUI_CLIENT_HANDLE , int ) , <nl> - bool ( * CBOnAction ) ( KODI_GUI_CLIENT_HANDLE , enum ADDON_ACTION ) , <nl> - void ( * CBGetContextButtons ) ( <nl> - KODI_GUI_CLIENT_HANDLE , int , gui_context_menu_pair * , unsigned int * ) , <nl> - bool ( * CBOnContextButton ) ( KODI_GUI_CLIENT_HANDLE , int , unsigned int ) ) ; <nl> - bool ( * show ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> - bool ( * close ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> - bool ( * do_modal ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> - <nl> - / * Window control functions * / <nl> - bool ( * set_focus_id ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - int ( * get_focus_id ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> - void ( * set_control_label ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - int control_id , <nl> - const char * label ) ; <nl> - void ( * set_control_visible ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - int control_id , <nl> - bool visible ) ; <nl> - void ( * set_control_selected ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - int control_id , <nl> - bool selected ) ; <nl> - <nl> - / * Window property functions * / <nl> - void ( * set_property ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - const char * key , <nl> - const char * value ) ; <nl> - void ( * set_property_int ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - const char * key , <nl> - int value ) ; <nl> - void ( * set_property_bool ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - const char * key , <nl> - bool value ) ; <nl> - void ( * set_property_double ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - const char * key , <nl> - double value ) ; <nl> - char * ( * get_property ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , const char * key ) ; <nl> - int ( * get_property_int ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , const char * key ) ; <nl> - bool ( * get_property_bool ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , const char * key ) ; <nl> - double ( * get_property_double ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - const char * key ) ; <nl> - void ( * clear_properties ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> - void ( * clear_property ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , const char * key ) ; <nl> - <nl> - / * List item functions * / <nl> - void ( * clear_item_list ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> - void ( * add_list_item ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - KODI_GUI_LISTITEM_HANDLE item , <nl> - int list_position ) ; <nl> - void ( * remove_list_item_from_position ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - int list_position ) ; <nl> - void ( * remove_list_item ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - KODI_GUI_LISTITEM_HANDLE item ) ; <nl> - KODI_GUI_LISTITEM_HANDLE ( * get_list_item ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int list_position ) ; <nl> - void ( * set_current_list_position ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - int list_position ) ; <nl> - int ( * get_current_list_position ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> - int ( * get_list_size ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> - void ( * set_container_property ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - const char * key , <nl> - const char * value ) ; <nl> - void ( * set_container_content ) ( KODI_HANDLE kodiBase , <nl> - KODI_GUI_WINDOW_HANDLE handle , <nl> - const char * value ) ; <nl> - int ( * get_current_container_id ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> - <nl> - / * Various functions * / <nl> - void ( * mark_dirty_region ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> - <nl> - / * GUI control access functions * / <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_button ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_edit ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_fade_label ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_image ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_label ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_progress ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_radio_button ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_render_addon ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_settings_slider ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_slider ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_spin ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_text_box ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_dummy1 ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_dummy2 ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_dummy3 ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_dummy4 ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_dummy5 ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_dummy6 ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_dummy7 ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_dummy8 ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_dummy9 ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - KODI_GUI_CONTROL_HANDLE ( * get_control_dummy10 ) <nl> - ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> - / * This above used to add new get_control_ * functions * / <nl> - } AddonToKodiFuncTable_kodi_gui_window ; <nl> + struct AddonToKodiFuncTable_kodi_gui_general ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_button ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_edit ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_fade_label ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_label ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_image ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_progress ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_radio_button ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_rendering ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_settings_slider ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_slider ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_spin ; <nl> + struct AddonToKodiFuncTable_kodi_gui_control_text_box ; <nl> + struct AddonToKodiFuncTable_kodi_gui_dialogContextMenu ; <nl> + struct AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress ; <nl> + struct AddonToKodiFuncTable_kodi_gui_dialogFileBrowser ; <nl> + struct AddonToKodiFuncTable_kodi_gui_dialogKeyboard ; <nl> + struct AddonToKodiFuncTable_kodi_gui_dialogNumeric ; <nl> + struct AddonToKodiFuncTable_kodi_gui_dialogOK ; <nl> + struct AddonToKodiFuncTable_kodi_gui_dialogProgress ; <nl> + struct AddonToKodiFuncTable_kodi_gui_dialogSelect ; <nl> + struct AddonToKodiFuncTable_kodi_gui_dialogTextViewer ; <nl> + struct AddonToKodiFuncTable_kodi_gui_dialogYesNo ; <nl> + struct AddonToKodiFuncTable_kodi_gui_listItem ; <nl> + struct AddonToKodiFuncTable_kodi_gui_window ; <nl> <nl> typedef struct AddonToKodiFuncTable_kodi_gui <nl> { <nl> new file mode 100644 <nl> index 000000000000 . . bc35e916047c <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / CMakeLists . txt <nl> <nl> + set ( HEADERS context_menu . h <nl> + extended_progress . h <nl> + filebrowser . h <nl> + keyboard . h <nl> + numeric . h <nl> + ok . h <nl> + progress . h <nl> + select . h <nl> + text_viewer . h <nl> + yes_no . h ) <nl> + <nl> + if ( NOT ENABLE_STATIC_LIBS ) <nl> + core_add_library ( addons_kodi - dev - kit_include_kodi_c - api_gui_dialogs ) <nl> + endif ( ) <nl> new file mode 100644 <nl> index 000000000000 . . 8bb5370c280a <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / context_menu . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_DIALOGS_CONTEXT_MENU_H <nl> + # define C_API_GUI_DIALOGS_CONTEXT_MENU_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_dialogContextMenu <nl> + { <nl> + int ( * open ) ( KODI_HANDLE kodiBase , <nl> + const char * heading , <nl> + const char * entries [ ] , <nl> + unsigned int size ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_dialogContextMenu ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_DIALOGS_CONTEXT_MENU_H * / <nl> new file mode 100644 <nl> index 000000000000 . . e53588fc3869 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / extended_progress . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_DIALOGS_EXTENDED_PROGRESS_H <nl> + # define C_API_GUI_DIALOGS_EXTENDED_PROGRESS_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress <nl> + { <nl> + KODI_GUI_HANDLE ( * new_dialog ) ( KODI_HANDLE kodiBase , const char * title ) ; <nl> + void ( * delete_dialog ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> + char * ( * get_title ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> + void ( * set_title ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , const char * title ) ; <nl> + char * ( * get_text ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> + void ( * set_text ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , const char * text ) ; <nl> + bool ( * is_finished ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> + void ( * mark_finished ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> + float ( * get_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> + void ( * set_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , float percentage ) ; <nl> + void ( * set_progress ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_HANDLE handle , <nl> + int currentItem , <nl> + int itemCount ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_dialogExtendedProgress ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_DIALOGS_EXTENDED_PROGRESS_H * / <nl> new file mode 100644 <nl> index 000000000000 . . 7ae4facc5ff3 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / filebrowser . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_DIALOGS_FILEBROWSER_H <nl> + # define C_API_GUI_DIALOGS_FILEBROWSER_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_dialogFileBrowser <nl> + { <nl> + bool ( * show_and_get_directory ) ( KODI_HANDLE kodiBase , <nl> + const char * shares , <nl> + const char * heading , <nl> + const char * path_in , <nl> + char * * path_out , <nl> + bool writeOnly ) ; <nl> + bool ( * show_and_get_file ) ( KODI_HANDLE kodiBase , <nl> + const char * shares , <nl> + const char * mask , <nl> + const char * heading , <nl> + const char * path_in , <nl> + char * * path_out , <nl> + bool use_thumbs , <nl> + bool use_file_directories ) ; <nl> + bool ( * show_and_get_file_from_dir ) ( KODI_HANDLE kodiBase , <nl> + const char * directory , <nl> + const char * mask , <nl> + const char * heading , <nl> + const char * path_in , <nl> + char * * path_out , <nl> + bool use_thumbs , <nl> + bool use_file_directories , <nl> + bool singleList ) ; <nl> + bool ( * show_and_get_file_list ) ( KODI_HANDLE kodiBase , <nl> + const char * shares , <nl> + const char * mask , <nl> + const char * heading , <nl> + char * * * file_list , <nl> + unsigned int * entries , <nl> + bool use_thumbs , <nl> + bool use_file_directories ) ; <nl> + bool ( * show_and_get_source ) ( KODI_HANDLE kodiBase , <nl> + const char * path_in , <nl> + char * * path_out , <nl> + bool allow_network_shares , <nl> + const char * additional_share , <nl> + const char * type ) ; <nl> + bool ( * show_and_get_image ) ( KODI_HANDLE kodiBase , <nl> + const char * shares , <nl> + const char * heading , <nl> + const char * path_in , <nl> + char * * path_out ) ; <nl> + bool ( * show_and_get_image_list ) ( KODI_HANDLE kodiBase , <nl> + const char * shares , <nl> + const char * heading , <nl> + char * * * file_list , <nl> + unsigned int * entries ) ; <nl> + void ( * clear_file_list ) ( KODI_HANDLE kodiBase , char * * * file_list , unsigned int entries ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_dialogFileBrowser ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_DIALOGS_FILEBROWSER_H * / <nl> new file mode 100644 <nl> index 000000000000 . . fc3c34cecf23 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / keyboard . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_DIALOGS_KEYBOARD_H <nl> + # define C_API_GUI_DIALOGS_KEYBOARD_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_dialogKeyboard <nl> + { <nl> + bool ( * show_and_get_input_with_head ) ( KODI_HANDLE kodiBase , <nl> + const char * text_in , <nl> + char * * text_out , <nl> + const char * heading , <nl> + bool allow_empty_result , <nl> + bool hiddenInput , <nl> + unsigned int auto_close_ms ) ; <nl> + bool ( * show_and_get_input ) ( KODI_HANDLE kodiBase , <nl> + const char * text_in , <nl> + char * * text_out , <nl> + bool allow_empty_result , <nl> + unsigned int auto_close_ms ) ; <nl> + bool ( * show_and_get_new_password_with_head ) ( KODI_HANDLE kodiBase , <nl> + const char * password_in , <nl> + char * * password_out , <nl> + const char * heading , <nl> + bool allow_empty_result , <nl> + unsigned int auto_close_ms ) ; <nl> + bool ( * show_and_get_new_password ) ( KODI_HANDLE kodiBase , <nl> + const char * password_in , <nl> + char * * password_out , <nl> + unsigned int auto_close_ms ) ; <nl> + bool ( * show_and_verify_new_password_with_head ) ( KODI_HANDLE kodiBase , <nl> + char * * password_out , <nl> + const char * heading , <nl> + bool allow_empty_result , <nl> + unsigned int auto_close_ms ) ; <nl> + bool ( * show_and_verify_new_password ) ( KODI_HANDLE kodiBase , <nl> + char * * password_out , <nl> + unsigned int auto_close_ms ) ; <nl> + int ( * show_and_verify_password ) ( KODI_HANDLE kodiBase , <nl> + const char * password_in , <nl> + char * * password_out , <nl> + const char * heading , <nl> + int retries , <nl> + unsigned int auto_close_ms ) ; <nl> + bool ( * show_and_get_filter ) ( KODI_HANDLE kodiBase , <nl> + const char * text_in , <nl> + char * * text_out , <nl> + bool searching , <nl> + unsigned int auto_close_ms ) ; <nl> + bool ( * send_text_to_active_keyboard ) ( KODI_HANDLE kodiBase , <nl> + const char * text , <nl> + bool close_keyboard ) ; <nl> + bool ( * is_keyboard_activated ) ( KODI_HANDLE kodiBase ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_dialogKeyboard ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_DIALOGS_KEYBOARD_H * / <nl> new file mode 100644 <nl> index 000000000000 . . df23cd74a4fd <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / numeric . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_DIALOGS_NUMERIC_H <nl> + # define C_API_GUI_DIALOGS_NUMERIC_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_dialogNumeric <nl> + { <nl> + bool ( * show_and_verify_new_password ) ( KODI_HANDLE kodiBase , char * * password ) ; <nl> + int ( * show_and_verify_password ) ( KODI_HANDLE kodiBase , <nl> + const char * password , <nl> + const char * heading , <nl> + int retries ) ; <nl> + bool ( * show_and_verify_input ) ( KODI_HANDLE kodiBase , <nl> + const char * verify_in , <nl> + char * * verify_out , <nl> + const char * heading , <nl> + bool verify_input ) ; <nl> + bool ( * show_and_get_time ) ( KODI_HANDLE kodiBase , struct tm * time , const char * heading ) ; <nl> + bool ( * show_and_get_date ) ( KODI_HANDLE kodiBase , struct tm * date , const char * heading ) ; <nl> + bool ( * show_and_get_ip_address ) ( KODI_HANDLE kodiBase , <nl> + const char * ip_address_in , <nl> + char * * ip_address_out , <nl> + const char * heading ) ; <nl> + bool ( * show_and_get_number ) ( KODI_HANDLE kodiBase , <nl> + const char * input_in , <nl> + char * * input_out , <nl> + const char * heading , <nl> + unsigned int auto_close_ms ) ; <nl> + bool ( * show_and_get_seconds ) ( KODI_HANDLE kodiBase , <nl> + const char * time_in , <nl> + char * * time_out , <nl> + const char * heading ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_dialogNumeric ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_DIALOGS_NUMERIC_H * / <nl> new file mode 100644 <nl> index 000000000000 . . 9f37051de928 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / ok . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_DIALOGS_OK_H <nl> + # define C_API_GUI_DIALOGS_OK_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_dialogOK <nl> + { <nl> + void ( * show_and_get_input_single_text ) ( KODI_HANDLE kodiBase , <nl> + const char * heading , <nl> + const char * text ) ; <nl> + void ( * show_and_get_input_line_text ) ( KODI_HANDLE kodiBase , <nl> + const char * heading , <nl> + const char * line0 , <nl> + const char * line1 , <nl> + const char * line2 ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_dialogOK ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_DIALOGS_OK_H * / <nl> new file mode 100644 <nl> index 000000000000 . . f1c8972decac <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / progress . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_DIALOGS_PROGRESS_H <nl> + # define C_API_GUI_DIALOGS_PROGRESS_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_dialogProgress <nl> + { <nl> + KODI_GUI_HANDLE ( * new_dialog ) ( KODI_HANDLE kodiBase ) ; <nl> + void ( * delete_dialog ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> + void ( * open ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> + void ( * set_heading ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , const char * heading ) ; <nl> + void ( * set_line ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_HANDLE handle , <nl> + unsigned int lineNo , <nl> + const char * line ) ; <nl> + void ( * set_can_cancel ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , bool canCancel ) ; <nl> + bool ( * is_canceled ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> + void ( * set_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , int percentage ) ; <nl> + int ( * get_percentage ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> + void ( * show_progress_bar ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , bool pnOff ) ; <nl> + void ( * set_progress_max ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , int max ) ; <nl> + void ( * set_progress_advance ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle , int nSteps ) ; <nl> + bool ( * abort ) ( KODI_HANDLE kodiBase , KODI_GUI_HANDLE handle ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_dialogProgress ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_DIALOGS_PROGRESS_H * / <nl> new file mode 100644 <nl> index 000000000000 . . 41ab82f9a279 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / select . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_DIALOGS_SELECT_H <nl> + # define C_API_GUI_DIALOGS_SELECT_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_dialogSelect <nl> + { <nl> + int ( * open ) ( KODI_HANDLE kodiBase , <nl> + const char * heading , <nl> + const char * entries [ ] , <nl> + unsigned int size , <nl> + int selected , <nl> + unsigned int autoclose ) ; <nl> + bool ( * open_multi_select ) ( KODI_HANDLE kodiBase , <nl> + const char * heading , <nl> + const char * entryIDs [ ] , <nl> + const char * entryNames [ ] , <nl> + bool entriesSelected [ ] , <nl> + unsigned int size , <nl> + unsigned int autoclose ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_dialogSelect ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_DIALOGS_SELECT_H * / <nl> new file mode 100644 <nl> index 000000000000 . . eb38b0be7f13 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / text_viewer . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_DIALOGS_TEXT_VIEWER_H <nl> + # define C_API_GUI_DIALOGS_TEXT_VIEWER_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_dialogTextViewer <nl> + { <nl> + void ( * open ) ( KODI_HANDLE kodiBase , const char * heading , const char * text ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_dialogTextViewer ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_DIALOGS_TEXT_VIEWER_H * / <nl> new file mode 100644 <nl> index 000000000000 . . 01ed80622ff4 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / dialogs / yes_no . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_DIALOGS_YES_NO_H <nl> + # define C_API_GUI_DIALOGS_YES_NO_H <nl> + <nl> + # include " . . / definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_dialogYesNo <nl> + { <nl> + bool ( * show_and_get_input_single_text ) ( KODI_HANDLE kodiBase , <nl> + const char * heading , <nl> + const char * text , <nl> + bool * canceled , <nl> + const char * noLabel , <nl> + const char * yesLabel ) ; <nl> + bool ( * show_and_get_input_line_text ) ( KODI_HANDLE kodiBase , <nl> + const char * heading , <nl> + const char * line0 , <nl> + const char * line1 , <nl> + const char * line2 , <nl> + const char * noLabel , <nl> + const char * yesLabel ) ; <nl> + bool ( * show_and_get_input_line_button_text ) ( KODI_HANDLE kodiBase , <nl> + const char * heading , <nl> + const char * line0 , <nl> + const char * line1 , <nl> + const char * line2 , <nl> + bool * canceled , <nl> + const char * noLabel , <nl> + const char * yesLabel ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_dialogYesNo ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_DIALOGS_YES_NO_H * / <nl> new file mode 100644 <nl> index 000000000000 . . d0d256c55e2c <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / general . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_GENERAL_H <nl> + # define C_API_GUI_GENERAL_H <nl> + <nl> + # include " definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_general <nl> + { <nl> + void ( * lock ) ( ) ; <nl> + void ( * unlock ) ( ) ; <nl> + int ( * get_screen_height ) ( KODI_HANDLE kodiBase ) ; <nl> + int ( * get_screen_width ) ( KODI_HANDLE kodiBase ) ; <nl> + int ( * get_video_resolution ) ( KODI_HANDLE kodiBase ) ; <nl> + int ( * get_current_window_dialog_id ) ( KODI_HANDLE kodiBase ) ; <nl> + int ( * get_current_window_id ) ( KODI_HANDLE kodiBase ) ; <nl> + ADDON_HARDWARE_CONTEXT ( * get_hw_context ) ( KODI_HANDLE kodiBase ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_general ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_GENERAL_H * / <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / input / action_ids . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / input / action_ids . h <nl> <nl> # ifndef C_API_GUI_ACTION_IDS_H <nl> # define C_API_GUI_ACTION_IDS_H <nl> <nl> - / / / @ defgroup cpp_kodi_gui_key_action_ids enum ADDON_ACTION <nl> - / / / @ ingroup cpp_kodi_gui <nl> + / / / @ defgroup cpp_kodi_gui_Defs_action_ids enum ADDON_ACTION <nl> + / / / @ ingroup cpp_kodi_gui_Defs <nl> / / / @ brief * * Action Id ' s * * \ n <nl> / / / Actions that we have defined . <nl> / / / <nl> new file mode 100644 <nl> index 000000000000 . . a2adb8fb5883 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / list_item . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_LIST_ITEM_H <nl> + # define C_API_GUI_LIST_ITEM_H <nl> + <nl> + # include " definitions . h " <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_listItem <nl> + { <nl> + KODI_GUI_LISTITEM_HANDLE ( * create ) <nl> + ( KODI_HANDLE kodiBase , <nl> + const char * label , <nl> + const char * label2 , <nl> + const char * icon_image , <nl> + const char * path ) ; <nl> + void ( * destroy ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle ) ; <nl> + <nl> + char * ( * get_label ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle ) ; <nl> + void ( * set_label ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , const char * label ) ; <nl> + char * ( * get_label2 ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle ) ; <nl> + void ( * set_label2 ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , const char * label ) ; <nl> + char * ( * get_art ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , const char * type ) ; <nl> + void ( * set_art ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_LISTITEM_HANDLE handle , <nl> + const char * type , <nl> + const char * image ) ; <nl> + char * ( * get_path ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle ) ; <nl> + void ( * set_path ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , const char * path ) ; <nl> + char * ( * get_property ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , const char * key ) ; <nl> + void ( * set_property ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_LISTITEM_HANDLE handle , <nl> + const char * key , <nl> + const char * value ) ; <nl> + void ( * select ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle , bool select ) ; <nl> + bool ( * is_selected ) ( KODI_HANDLE kodiBase , KODI_GUI_LISTITEM_HANDLE handle ) ; <nl> + } AddonToKodiFuncTable_kodi_gui_listItem ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_LIST_ITEM_H * / <nl> new file mode 100644 <nl> index 000000000000 . . 0f844f5e9db3 <nl> mmm / dev / null <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / c - api / gui / window . h <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2020 Team Kodi <nl> + * This file is part of Kodi - https : / / kodi . tv <nl> + * <nl> + * SPDX - License - Identifier : GPL - 2 . 0 - or - later <nl> + * See LICENSES / README . md for more information . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # ifndef C_API_GUI_WINDOW_H <nl> + # define C_API_GUI_WINDOW_H <nl> + <nl> + # include " definitions . h " <nl> + # include " input / action_ids . h " <nl> + <nl> + # include < stddef . h > <nl> + <nl> + # define ADDON_MAX_CONTEXT_ENTRIES 20 <nl> + # define ADDON_MAX_CONTEXT_ENTRY_NAME_LENGTH 80 <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " <nl> + { <nl> + # endif / * __cplusplus * / <nl> + <nl> + typedef struct gui_context_menu_pair <nl> + { <nl> + unsigned int id ; <nl> + char name [ ADDON_MAX_CONTEXT_ENTRY_NAME_LENGTH ] ; <nl> + } gui_context_menu_pair ; <nl> + <nl> + typedef struct AddonToKodiFuncTable_kodi_gui_window <nl> + { <nl> + / * Window creation functions * / <nl> + KODI_GUI_WINDOW_HANDLE ( * create ) <nl> + ( KODI_HANDLE kodiBase , <nl> + const char * xml_filename , <nl> + const char * default_skin , <nl> + bool as_dialog , <nl> + bool is_media ) ; <nl> + void ( * destroy ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> + <nl> + void ( * set_callbacks ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + KODI_GUI_CLIENT_HANDLE clienthandle , <nl> + bool ( * CBInit ) ( KODI_GUI_CLIENT_HANDLE ) , <nl> + bool ( * CBFocus ) ( KODI_GUI_CLIENT_HANDLE , int ) , <nl> + bool ( * CBClick ) ( KODI_GUI_CLIENT_HANDLE , int ) , <nl> + bool ( * CBOnAction ) ( KODI_GUI_CLIENT_HANDLE , enum ADDON_ACTION ) , <nl> + void ( * CBGetContextButtons ) ( <nl> + KODI_GUI_CLIENT_HANDLE , int , gui_context_menu_pair * , unsigned int * ) , <nl> + bool ( * CBOnContextButton ) ( KODI_GUI_CLIENT_HANDLE , int , unsigned int ) ) ; <nl> + bool ( * show ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> + bool ( * close ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> + bool ( * do_modal ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> + <nl> + / * Window control functions * / <nl> + bool ( * set_focus_id ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + int ( * get_focus_id ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> + void ( * set_control_label ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + int control_id , <nl> + const char * label ) ; <nl> + void ( * set_control_visible ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + int control_id , <nl> + bool visible ) ; <nl> + void ( * set_control_selected ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + int control_id , <nl> + bool selected ) ; <nl> + <nl> + / * Window property functions * / <nl> + void ( * set_property ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + const char * key , <nl> + const char * value ) ; <nl> + void ( * set_property_int ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + const char * key , <nl> + int value ) ; <nl> + void ( * set_property_bool ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + const char * key , <nl> + bool value ) ; <nl> + void ( * set_property_double ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + const char * key , <nl> + double value ) ; <nl> + char * ( * get_property ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , const char * key ) ; <nl> + int ( * get_property_int ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , const char * key ) ; <nl> + bool ( * get_property_bool ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , const char * key ) ; <nl> + double ( * get_property_double ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + const char * key ) ; <nl> + void ( * clear_properties ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> + void ( * clear_property ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , const char * key ) ; <nl> + <nl> + / * List item functions * / <nl> + void ( * clear_item_list ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> + void ( * add_list_item ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + KODI_GUI_LISTITEM_HANDLE item , <nl> + int list_position ) ; <nl> + void ( * remove_list_item_from_position ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + int list_position ) ; <nl> + void ( * remove_list_item ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + KODI_GUI_LISTITEM_HANDLE item ) ; <nl> + KODI_GUI_LISTITEM_HANDLE ( * get_list_item ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int list_position ) ; <nl> + void ( * set_current_list_position ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + int list_position ) ; <nl> + int ( * get_current_list_position ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> + int ( * get_list_size ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> + void ( * set_container_property ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + const char * key , <nl> + const char * value ) ; <nl> + void ( * set_container_content ) ( KODI_HANDLE kodiBase , <nl> + KODI_GUI_WINDOW_HANDLE handle , <nl> + const char * value ) ; <nl> + int ( * get_current_container_id ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> + <nl> + / * Various functions * / <nl> + void ( * mark_dirty_region ) ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle ) ; <nl> + <nl> + / * GUI control access functions * / <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_button ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_edit ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_fade_label ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_image ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_label ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_progress ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_radio_button ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_render_addon ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_settings_slider ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_slider ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_spin ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_text_box ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_dummy1 ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_dummy2 ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_dummy3 ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_dummy4 ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_dummy5 ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_dummy6 ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_dummy7 ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_dummy8 ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_dummy9 ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + KODI_GUI_CONTROL_HANDLE ( * get_control_dummy10 ) <nl> + ( KODI_HANDLE kodiBase , KODI_GUI_WINDOW_HANDLE handle , int control_id ) ; <nl> + / * This above used to add new get_control_ * functions * / <nl> + } AddonToKodiFuncTable_kodi_gui_window ; <nl> + <nl> + # ifdef __cplusplus <nl> + } / * extern " C " * / <nl> + # endif / * __cplusplus * / <nl> + <nl> + # endif / * ! C_API_GUI_WINDOW_H * / <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / General . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / General . h <nl> <nl> # pragma once <nl> <nl> # include " . . / AddonBase . h " <nl> - # include " . . / c - api / gui / definitions . h " <nl> + # include " . . / c - api / gui / general . h " <nl> <nl> # ifdef __cplusplus <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / ListItem . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / ListItem . h <nl> <nl> # pragma once <nl> <nl> # include " . . / AddonBase . h " <nl> - # include " . . / c - api / gui / definitions . h " <nl> + # include " . . / c - api / gui / list_item . h " <nl> <nl> # ifdef __cplusplus <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / Window . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / Window . h <nl> <nl> # pragma once <nl> <nl> # include " . . / AddonBase . h " <nl> + # include " . . / c - api / gui / window . h " <nl> # include " ListItem . h " <nl> # include " input / ActionIDs . h " <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Button . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Button . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / button . h " <nl> # include " . . / Window . h " <nl> <nl> # ifdef __cplusplus <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Edit . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Edit . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / edit . h " <nl> # include " . . / Window . h " <nl> <nl> # ifdef __cplusplus <nl> namespace controls <nl> / / / @ brief * * Library definition values * * <nl> / / / <nl> <nl> - } / * namespace controls * / <nl> - } / * namespace gui * / <nl> - } / * namespace kodi * / <nl> - <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - / / / <nl> - / / / \ ingroup cpp_kodi_gui_controls_CEdit_Defs <nl> - / / / @ { <nl> - / / / @ anchor AddonGUIInputType <nl> - / / / @ brief Text input types used on kodi : : gui : : controls : : CEdit <nl> - enum AddonGUIInputType <nl> - { <nl> - / / / Text inside edit control only readable <nl> - ADDON_INPUT_TYPE_READONLY = - 1 , <nl> - / / / Normal text entries <nl> - ADDON_INPUT_TYPE_TEXT = 0 , <nl> - / / / To use on edit control only numeric numbers <nl> - ADDON_INPUT_TYPE_NUMBER , <nl> - / / / To insert seconds <nl> - ADDON_INPUT_TYPE_SECONDS , <nl> - / / / To insert time <nl> - ADDON_INPUT_TYPE_TIME , <nl> - / / / To insert a date <nl> - ADDON_INPUT_TYPE_DATE , <nl> - / / / Used for write in IP addresses <nl> - ADDON_INPUT_TYPE_IPADDRESS , <nl> - / / / Text field used as password entry field with not visible text <nl> - ADDON_INPUT_TYPE_PASSWORD , <nl> - / / / Text field used as password entry field with not visible text but <nl> - / / / returned as MD5 value <nl> - ADDON_INPUT_TYPE_PASSWORD_MD5 , <nl> - / / / Use text field for search purpose <nl> - ADDON_INPUT_TYPE_SEARCH , <nl> - / / / Text field as filter <nl> - ADDON_INPUT_TYPE_FILTER , <nl> - / / / <nl> - ADDON_INPUT_TYPE_PASSWORD_NUMBER_VERIFY_NEW <nl> - } ; <nl> - / / / @ } <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - namespace kodi <nl> - { <nl> - namespace gui <nl> - { <nl> - namespace controls <nl> - { <nl> - <nl> class ATTRIBUTE_HIDDEN CEdit : public CAddonGUIControlBase <nl> { <nl> public : <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / FadeLabel . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / FadeLabel . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / fade_label . h " <nl> # include " . . / Window . h " <nl> <nl> # ifdef __cplusplus <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Image . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Image . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / image . h " <nl> # include " . . / Window . h " <nl> <nl> # ifdef __cplusplus <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Label . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Label . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / label . h " <nl> # include " . . / Window . h " <nl> <nl> # ifdef __cplusplus <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Progress . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Progress . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / progress . h " <nl> # include " . . / Window . h " <nl> <nl> # ifdef __cplusplus <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / RadioButton . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / RadioButton . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / radio_button . h " <nl> # include " . . / Window . h " <nl> <nl> # ifdef __cplusplus <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Rendering . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Rendering . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / rendering . h " <nl> # include " . . / Window . h " <nl> # include " . . / renderHelper . h " <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / SettingsSlider . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / SettingsSlider . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / settings_slider . h " <nl> # include " . . / Window . h " <nl> <nl> # ifdef __cplusplus <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Slider . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Slider . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / slider . h " <nl> # include " . . / Window . h " <nl> <nl> # ifdef __cplusplus <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Spin . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / Spin . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / spin . h " <nl> # include " . . / Window . h " <nl> <nl> # ifdef __cplusplus <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / TextBox . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / controls / TextBox . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include " . . / . . / AddonBase . h " <nl> + # include " . . / . . / c - api / gui / controls / text_box . h " <nl> # include " . . / Window . h " <nl> <nl> # ifdef __cplusplus <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / ContextMenu . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / ContextMenu . h <nl> <nl> # pragma once <nl> <nl> # include " . . / . . / AddonBase . h " <nl> - # include " . . / . . / c - api / gui / definitions . h " <nl> + # include " . . / . . / c - api / gui / dialogs / context_menu . h " <nl> <nl> # ifdef __cplusplus <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / ExtendedProgress . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / ExtendedProgress . h <nl> <nl> # pragma once <nl> <nl> # include " . . / . . / AddonBase . h " <nl> - # include " . . / . . / c - api / gui / definitions . h " <nl> + # include " . . / . . / c - api / gui / dialogs / extended_progress . h " <nl> <nl> # ifdef __cplusplus <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / FileBrowser . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / FileBrowser . h <nl> <nl> # pragma once <nl> <nl> # include " . . / . . / AddonBase . h " <nl> - # include " . . / . . / c - api / gui / definitions . h " <nl> + # include " . . / . . / c - api / gui / dialogs / filebrowser . h " <nl> <nl> # ifdef __cplusplus <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / Keyboard . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / Keyboard . h <nl> <nl> # pragma once <nl> <nl> # include " . . / . . / AddonBase . h " <nl> - # include " . . / . . / c - api / gui / definitions . h " <nl> + # include " . . / . . / c - api / gui / dialogs / keyboard . h " <nl> <nl> # ifdef __cplusplus <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / Numeric . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / Numeric . h <nl> <nl> # pragma once <nl> <nl> # include " . . / . . / AddonBase . h " <nl> - # include " . . / . . / c - api / gui / definitions . h " <nl> + # include " . . / . . / c - api / gui / dialogs / numeric . h " <nl> <nl> # ifdef __cplusplus <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / OK . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / OK . h <nl> <nl> # pragma once <nl> <nl> # include " . . / . . / AddonBase . h " <nl> - # include " . . / . . / c - api / gui / definitions . h " <nl> + # include " . . / . . / c - api / gui / dialogs / ok . h " <nl> <nl> # ifdef __cplusplus <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / Progress . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / Progress . h <nl> <nl> # pragma once <nl> <nl> # include " . . / . . / AddonBase . h " <nl> - # include " . . / . . / c - api / gui / definitions . h " <nl> + # include " . . / . . / c - api / gui / dialogs / progress . h " <nl> <nl> # ifdef __cplusplus <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / Select . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / Select . h <nl> <nl> # pragma once <nl> <nl> # include " . . / . . / AddonBase . h " <nl> - # include " . . / . . / c - api / gui / definitions . h " <nl> + # include " . . / . . / c - api / gui / dialogs / select . h " <nl> <nl> # ifdef __cplusplus <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / TextViewer . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / TextViewer . h <nl> <nl> # pragma once <nl> <nl> # include " . . / . . / AddonBase . h " <nl> - # include " . . / . . / c - api / gui / definitions . h " <nl> + # include " . . / . . / c - api / gui / dialogs / text_viewer . h " <nl> <nl> # ifdef __cplusplus <nl> <nl> mmm a / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / YesNo . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / gui / dialogs / YesNo . h <nl> <nl> # pragma once <nl> <nl> # include " . . / . . / AddonBase . h " <nl> - # include " . . / . . / c - api / gui / definitions . h " <nl> + # include " . . / . . / c - api / gui / dialogs / yes_no . h " <nl> <nl> # ifdef __cplusplus <nl> <nl>
|
[ addons ] [ gui ] place all gui " C " subparts to own headers
|
xbmc/xbmc
|
b226678863a93643c419d5599ad215ce52963770
|
2020-09-12T07:39:51Z
|
mmm a / xbmc / Application . cpp <nl> ppp b / xbmc / Application . cpp <nl> void CApplication : : StopPlaying ( ) <nl> } <nl> } <nl> <nl> + void CApplication : : ResetSystemIdleTimer ( ) <nl> + { <nl> + / / reset system idle timer <nl> + m_idleTimer . StartZero ( ) ; <nl> + } <nl> + <nl> void CApplication : : ResetScreenSaver ( ) <nl> { <nl> / / reset our timers <nl> mmm a / xbmc / Application . h <nl> ppp b / xbmc / Application . h <nl> class CApplication : public CXBApplicationEx , public IPlayerCallback , public IMs <nl> int GetSubtitleDelay ( ) const ; <nl> int GetAudioDelay ( ) const ; <nl> void SetPlaySpeed ( int iSpeed ) ; <nl> + void ResetSystemIdleTimer ( ) ; <nl> void ResetScreenSaverTimer ( ) ; <nl> void StopScreenSaverTimer ( ) ; <nl> / / Wakes up from the screensaver and / or DPMS . Returns true if woken up . <nl> mmm a / xbmc / interfaces / json - rpc / InputOperations . cpp <nl> ppp b / xbmc / interfaces / json - rpc / InputOperations . cpp <nl> JSON_STATUS CInputOperations : : sendAction ( int actionID ) <nl> { <nl> if ( ! handleScreenSaver ( ) ) <nl> { <nl> + g_application . ResetSystemIdleTimer ( ) ; <nl> g_audioManager . PlayActionSound ( actionID ) ; <nl> g_application . getApplicationMessenger ( ) . SendAction ( CAction ( actionID ) , WINDOW_INVALID , false ) ; <nl> } <nl>
|
jsonrpc : reset system idle timer when an Input method is executed ( thanks amet )
|
xbmc/xbmc
|
95aeff2205b103a031b35c585dae764483af051c
|
2012-01-02T09:17:19Z
|
mmm a / include / swift / AST / Identifier . h <nl> ppp b / include / swift / AST / Identifier . h <nl> class Identifier { <nl> <nl> const char * Pointer ; <nl> <nl> + public : <nl> + enum : size_t { <nl> + NumLowBitsAvailable = 2 , <nl> + RequiredAlignment = 1 < < NumLowBitsAvailable , <nl> + SpareBitMask = ( ( intptr_t ) 1 < < NumLowBitsAvailable ) - 1 <nl> + } ; <nl> + <nl> + private : <nl> / / / Constructor , only accessible by ASTContext , which handles the uniquing . <nl> - explicit Identifier ( const char * Ptr ) : Pointer ( Ptr ) { } <nl> + explicit Identifier ( const char * Ptr ) : Pointer ( Ptr ) { <nl> + assert ( ( ( uintptr_t ) Ptr & SpareBitMask ) = = 0 <nl> + & & " Identifier pointer does not use any spare bits " ) ; <nl> + } <nl> + <nl> + / / / A type with the alignment expected of a valid \ c Identifier : : Pointer . <nl> + struct alignas ( uint32_t ) Aligner { } ; <nl> + <nl> + static_assert ( alignof ( Aligner ) > = RequiredAlignment , <nl> + " Identifier table will provide enough spare bits " ) ; <nl> + <nl> public : <nl> explicit Identifier ( ) : Pointer ( nullptr ) { } <nl> <nl> class Identifier { <nl> bool operator < ( Identifier RHS ) const { return Pointer < RHS . Pointer ; } <nl> <nl> static Identifier getEmptyKey ( ) { <nl> - return Identifier ( ( const char * ) <nl> - llvm : : DenseMapInfo < const void * > : : getEmptyKey ( ) ) ; <nl> + uintptr_t Val = static_cast < uintptr_t > ( - 1 ) ; <nl> + Val < < = NumLowBitsAvailable ; <nl> + return Identifier ( ( const char * ) Val ) ; <nl> } <nl> + <nl> static Identifier getTombstoneKey ( ) { <nl> - return Identifier ( ( const char * ) <nl> - llvm : : DenseMapInfo < const void * > : : getTombstoneKey ( ) ) ; <nl> + uintptr_t Val = static_cast < uintptr_t > ( - 2 ) ; <nl> + Val < < = NumLowBitsAvailable ; <nl> + return Identifier ( ( const char * ) Val ) ; <nl> } <nl> <nl> private : <nl> namespace llvm { <nl> static inline swift : : Identifier getFromVoidPointer ( void * P ) { <nl> return swift : : Identifier : : getFromOpaquePointer ( P ) ; <nl> } <nl> - enum { NumLowBitsAvailable = 2 } ; <nl> + enum { NumLowBitsAvailable = swift : : Identifier : : NumLowBitsAvailable } ; <nl> } ; <nl> <nl> } / / end namespace llvm <nl> class DeclBaseName { <nl> } ; <nl> <nl> private : <nl> - / / / In a special DeclName represenenting a subscript , this opaque pointer <nl> + / / / In a special DeclName representing a subscript , this opaque pointer <nl> / / / is used as the data of the base name identifier . <nl> / / / This is an implementation detail that should never leak outside of <nl> / / / DeclName . <nl> - static void * SubscriptIdentifierData ; <nl> + static const Identifier : : Aligner SubscriptIdentifierData ; <nl> / / / As above , for special constructor DeclNames . <nl> - static void * ConstructorIdentifierData ; <nl> + static const Identifier : : Aligner ConstructorIdentifierData ; <nl> / / / As above , for special destructor DeclNames . <nl> - static void * DestructorIdentifierData ; <nl> + static const Identifier : : Aligner DestructorIdentifierData ; <nl> <nl> Identifier Ident ; <nl> <nl> class DeclBaseName { <nl> DeclBaseName ( Identifier I ) : Ident ( I ) { } <nl> <nl> static DeclBaseName createSubscript ( ) { <nl> - return DeclBaseName ( Identifier ( ( const char * ) SubscriptIdentifierData ) ) ; <nl> + return DeclBaseName ( Identifier ( ( const char * ) & SubscriptIdentifierData ) ) ; <nl> } <nl> <nl> static DeclBaseName createConstructor ( ) { <nl> - return DeclBaseName ( Identifier ( ( const char * ) ConstructorIdentifierData ) ) ; <nl> + return DeclBaseName ( Identifier ( ( const char * ) & ConstructorIdentifierData ) ) ; <nl> } <nl> <nl> static DeclBaseName createDestructor ( ) { <nl> - return DeclBaseName ( Identifier ( ( const char * ) DestructorIdentifierData ) ) ; <nl> + return DeclBaseName ( Identifier ( ( const char * ) & DestructorIdentifierData ) ) ; <nl> } <nl> <nl> Kind getKind ( ) const { <nl> - if ( Ident . get ( ) = = SubscriptIdentifierData ) { <nl> + if ( Ident . get ( ) = = ( const char * ) & SubscriptIdentifierData ) { <nl> return Kind : : Subscript ; <nl> - } else if ( Ident . get ( ) = = ConstructorIdentifierData ) { <nl> + } else if ( Ident . get ( ) = = ( const char * ) & ConstructorIdentifierData ) { <nl> return Kind : : Constructor ; <nl> - } else if ( Ident . get ( ) = = DestructorIdentifierData ) { <nl> + } else if ( Ident . get ( ) = = ( const char * ) & DestructorIdentifierData ) { <nl> return Kind : : Destructor ; <nl> } else { <nl> return Kind : : Normal ; <nl> namespace llvm { <nl> static inline swift : : DeclName getFromVoidPointer ( void * ptr ) { <nl> return swift : : DeclName : : getFromOpaqueValue ( ptr ) ; <nl> } <nl> - enum { NumLowBitsAvailable = 0 } ; <nl> + enum { NumLowBitsAvailable = PointerLikeTypeTraits < swift : : DeclBaseName > : : NumLowBitsAvailable - 2 } ; <nl> } ; <nl> <nl> / / DeclNames hash just like pointers . <nl> mmm a / lib / AST / ASTContext . cpp <nl> ppp b / lib / AST / ASTContext . cpp <nl> struct ASTContext : : Implementation { <nl> <nl> / / FIXME : This is a StringMap rather than a StringSet because StringSet <nl> / / doesn ' t allow passing in a pre - existing allocator . <nl> - llvm : : StringMap < char , llvm : : BumpPtrAllocator & > IdentifierTable ; <nl> + llvm : : StringMap < Identifier : : Aligner , llvm : : BumpPtrAllocator & > <nl> + IdentifierTable ; <nl> <nl> / / / The declaration of Swift . AssignmentPrecedence . <nl> PrecedenceGroupDecl * AssignmentPrecedence = nullptr ; <nl> Identifier ASTContext : : getIdentifier ( StringRef Str ) const { <nl> if ( Str . data ( ) = = nullptr ) <nl> return Identifier ( nullptr ) ; <nl> <nl> - auto I = getImpl ( ) . IdentifierTable . insert ( std : : make_pair ( Str , char ( ) ) ) . first ; <nl> + auto pair = std : : make_pair ( Str , Identifier : : Aligner ( ) ) ; <nl> + auto I = getImpl ( ) . IdentifierTable . insert ( pair ) . first ; <nl> return Identifier ( I - > getKeyData ( ) ) ; <nl> } <nl> <nl> mmm a / lib / AST / Identifier . cpp <nl> ppp b / lib / AST / Identifier . cpp <nl> <nl> # include " clang / Basic / CharInfo . h " <nl> using namespace swift ; <nl> <nl> - void * DeclBaseName : : SubscriptIdentifierData = <nl> - & DeclBaseName : : SubscriptIdentifierData ; <nl> - void * DeclBaseName : : ConstructorIdentifierData = <nl> - & DeclBaseName : : ConstructorIdentifierData ; <nl> - void * DeclBaseName : : DestructorIdentifierData = <nl> - & DeclBaseName : : DestructorIdentifierData ; <nl> + constexpr const Identifier : : Aligner DeclBaseName : : SubscriptIdentifierData { } ; <nl> + constexpr const Identifier : : Aligner DeclBaseName : : ConstructorIdentifierData { } ; <nl> + constexpr const Identifier : : Aligner DeclBaseName : : DestructorIdentifierData { } ; <nl> <nl> raw_ostream & llvm : : operator < < ( raw_ostream & OS , Identifier I ) { <nl> if ( I . get ( ) = = nullptr ) <nl>
|
Merge pull request from brentdax / identify - yourself
|
apple/swift
|
c7129383b304e8b6f75845d398029a702ccd24af
|
2019-10-02T18:20:37Z
|
mmm a / lib / Sema / CodeSynthesis . cpp <nl> ppp b / lib / Sema / CodeSynthesis . cpp <nl> static void maybeMarkTransparent ( FuncDecl * accessor , <nl> AbstractStorageDecl * storage , <nl> TypeChecker & TC ) { <nl> auto * DC = storage - > getDeclContext ( ) ; <nl> - if ( isa < ProtocolDecl > ( DC ) ) <nl> + if ( isa < ProtocolDecl > ( DC ) | | isa < ClassDecl > ( DC ) ) <nl> return ; <nl> <nl> auto * nominal = DC - > getAsNominalTypeOrNominalTypeExtensionContext ( ) ; <nl> mmm a / test / SILGen / accessibility_warnings . swift <nl> ppp b / test / SILGen / accessibility_warnings . swift <nl> internal class InternalClass { <nl> / / CHECK - DAG : sil hidden { { ( \ [ . + \ ] ) * } } @ _TFC22accessibility_warnings13InternalClassg9publicVarSi <nl> public var publicVar = 0 <nl> <nl> - / / CHECK - DAG : sil hidden [ transparent ] @ _TFC22accessibility_warnings13InternalClassg19publicVarPrivateSetSi <nl> + / / CHECK - DAG : sil hidden @ _TFC22accessibility_warnings13InternalClassg19publicVarPrivateSetSi <nl> public private ( set ) var publicVarPrivateSet = 0 <nl> <nl> public public ( set ) var publicVarPublicSet = 0 <nl> mmm a / test / SILGen / addressors . swift <nl> ppp b / test / SILGen / addressors . swift <nl> class G { <nl> } <nl> } <nl> } <nl> - / / CHECK : sil hidden [ transparent ] @ _TFC10addressors1Gg5valueVs5Int32 : $ @ convention ( method ) ( @ guaranteed G ) - > Int32 { <nl> + / / CHECK : sil hidden @ _TFC10addressors1Gg5valueVs5Int32 : $ @ convention ( method ) ( @ guaranteed G ) - > Int32 { <nl> / / CHECK : bb0 ( [ [ SELF : % 0 ] ] : $ G ) : <nl> / / CHECK : [ [ ADDRESSOR : % . * ] ] = function_ref @ _TFC10addressors1Glo5valueVs5Int32 : $ @ convention ( method ) ( @ guaranteed G ) - > ( UnsafePointer < Int32 > , @ owned Builtin . NativeObject ) <nl> / / CHECK : [ [ T0 : % . * ] ] = apply [ [ ADDRESSOR ] ] ( [ [ SELF ] ] ) <nl> class G { <nl> / / CHECK : strong_release [ [ OWNER ] ] : $ Builtin . NativeObject <nl> / / CHECK : return [ [ VALUE ] ] : $ Int32 <nl> <nl> - / / CHECK : sil hidden [ transparent ] @ _TFC10addressors1Gs5valueVs5Int32 : $ @ convention ( method ) ( Int32 , @ guaranteed G ) - > ( ) { <nl> + / / CHECK : sil hidden @ _TFC10addressors1Gs5valueVs5Int32 : $ @ convention ( method ) ( Int32 , @ guaranteed G ) - > ( ) { <nl> / / CHECK : bb0 ( [ [ VALUE : % 0 ] ] : $ Int32 , [ [ SELF : % 1 ] ] : $ G ) : <nl> / / CHECK : [ [ ADDRESSOR : % . * ] ] = function_ref @ _TFC10addressors1Gao5valueVs5Int32 : $ @ convention ( method ) ( @ guaranteed G ) - > ( UnsafeMutablePointer < Int32 > , @ owned Builtin . NativeObject ) <nl> / / CHECK : [ [ T0 : % . * ] ] = apply [ [ ADDRESSOR ] ] ( [ [ SELF ] ] ) <nl> class G { <nl> / / CHECK : strong_release [ [ OWNER ] ] : $ Builtin . NativeObject <nl> <nl> / / materializeForSet for G . value <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC10addressors1Gm5valueVs5Int32 : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed G ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFC10addressors1Gm5valueVs5Int32 : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed G ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % 0 ] ] : $ Builtin . RawPointer , [ [ STORAGE : % 1 ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % 2 ] ] : $ G ) : <nl> / / Call the addressor . <nl> / / CHECK : [ [ ADDRESSOR : % . * ] ] = function_ref @ _TFC10addressors1Gao5valueVs5Int32 : $ @ convention ( method ) ( @ guaranteed G ) - > ( UnsafeMutablePointer < Int32 > , @ owned Builtin . NativeObject ) <nl> class G { <nl> / / CHECK : return [ [ RESULT ] ] <nl> <nl> / / materializeForSet callback for G . value <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFFC10addressors1Gm5valueVs5Int32U_T_ : $ @ convention ( thin ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ inout G , @ thick G . Type ) - > ( ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFFC10addressors1Gm5valueVs5Int32U_T_ : $ @ convention ( thin ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ inout G , @ thick G . Type ) - > ( ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % 0 ] ] : $ Builtin . RawPointer , [ [ STORAGE : % 1 ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % 2 ] ] : $ * G , [ [ SELFTYPE : % 3 ] ] : $ @ thick G . Type ) : <nl> / / CHECK : [ [ T0 : % . * ] ] = project_value_buffer $ Builtin . NativeObject in [ [ STORAGE ] ] : $ * Builtin . UnsafeValueBuffer <nl> / / CHECK : [ [ OWNER : % . * ] ] = load [ [ T0 ] ] <nl> class I { <nl> } <nl> } <nl> } <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC10addressors1Ig5valueVs5Int32 : $ @ convention ( method ) ( @ guaranteed I ) - > Int32 { <nl> + / / CHECK - LABEL : sil hidden @ _TFC10addressors1Ig5valueVs5Int32 : $ @ convention ( method ) ( @ guaranteed I ) - > Int32 { <nl> / / CHECK : bb0 ( [ [ SELF : % 0 ] ] : $ I ) : <nl> / / CHECK : [ [ ADDRESSOR : % . * ] ] = function_ref @ _TFC10addressors1Ilp5valueVs5Int32 : $ @ convention ( method ) ( @ guaranteed I ) - > ( UnsafePointer < Int32 > , @ owned Optional < Builtin . NativeObject > ) <nl> / / CHECK : [ [ T0 : % . * ] ] = apply [ [ ADDRESSOR ] ] ( [ [ SELF ] ] ) <nl> class I { <nl> / / CHECK : strong_unpin [ [ OWNER ] ] : $ Optional < Builtin . NativeObject > <nl> / / CHECK : return [ [ VALUE ] ] : $ Int32 <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC10addressors1Is5valueVs5Int32 : $ @ convention ( method ) ( Int32 , @ guaranteed I ) - > ( ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFC10addressors1Is5valueVs5Int32 : $ @ convention ( method ) ( Int32 , @ guaranteed I ) - > ( ) { <nl> / / CHECK : bb0 ( [ [ VALUE : % 0 ] ] : $ Int32 , [ [ SELF : % 1 ] ] : $ I ) : <nl> / / CHECK : [ [ ADDRESSOR : % . * ] ] = function_ref @ _TFC10addressors1Iap5valueVs5Int32 : $ @ convention ( method ) ( @ guaranteed I ) - > ( UnsafeMutablePointer < Int32 > , @ owned Optional < Builtin . NativeObject > ) <nl> / / CHECK : [ [ T0 : % . * ] ] = apply [ [ ADDRESSOR ] ] ( [ [ SELF ] ] ) <nl> class I { <nl> / / CHECK : store [ [ VALUE ] ] to [ [ T2 ] ] : $ * Int32 <nl> / / CHECK : strong_unpin [ [ OWNER ] ] : $ Optional < Builtin . NativeObject > <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC10addressors1Im5valueVs5Int32 : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed I ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFC10addressors1Im5valueVs5Int32 : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed I ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % 0 ] ] : $ Builtin . RawPointer , [ [ STORAGE : % 1 ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % 2 ] ] : $ I ) : <nl> / / Call the addressor . <nl> / / CHECK : [ [ ADDRESSOR : % . * ] ] = function_ref @ _TFC10addressors1Iap5valueVs5Int32 : $ @ convention ( method ) ( @ guaranteed I ) - > ( UnsafeMutablePointer < Int32 > , @ owned Optional < Builtin . NativeObject > ) <nl> class I { <nl> / / CHECK : return [ [ RESULT ] ] <nl> <nl> / / materializeForSet callback for I . value <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFFC10addressors1Im5valueVs5Int32U_T_ : $ @ convention ( thin ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ inout I , @ thick I . Type ) - > ( ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFFC10addressors1Im5valueVs5Int32U_T_ : $ @ convention ( thin ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ inout I , @ thick I . Type ) - > ( ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % 0 ] ] : $ Builtin . RawPointer , [ [ STORAGE : % 1 ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % 2 ] ] : $ * I , [ [ SELFTYPE : % 3 ] ] : $ @ thick I . Type ) : <nl> / / CHECK : [ [ T0 : % . * ] ] = project_value_buffer $ Optional < Builtin . NativeObject > in [ [ STORAGE ] ] : $ * Builtin . UnsafeValueBuffer <nl> / / CHECK : [ [ OWNER : % . * ] ] = load [ [ T0 ] ] <nl> mmm a / test / SILGen / c_materializeForSet_linkage . swift <nl> ppp b / test / SILGen / c_materializeForSet_linkage . swift <nl> extension NSReferencePoint : Pointable { } <nl> / / CHECK - LABEL : sil shared [ transparent ] [ fragile ] @ _TFVSC7NSPointm1xSf <nl> / / CHECK - LABEL : sil shared [ transparent ] [ fragile ] @ _TFVSC7NSPointm1ySf <nl> <nl> - / / CHECK - LABEL : sil shared [ transparent ] [ fragile ] @ _TFCSo16NSReferencePointm1xSf <nl> - / / CHECK - LABEL : sil shared [ transparent ] [ fragile ] @ _TFCSo16NSReferencePointm1ySf <nl> + / / CHECK - LABEL : sil shared @ _TFCSo16NSReferencePointm1xSf <nl> + / / CHECK - LABEL : sil shared @ _TFCSo16NSReferencePointm1ySf <nl> <nl> - / / CHECK - LABEL : sil shared [ transparent ] [ fragile ] @ _TFFCSo16NSReferencePointm1xSfU_T_ <nl> - / / CHECK - LABEL : sil shared [ transparent ] [ fragile ] @ _TFFCSo16NSReferencePointm1ySfU_T_ <nl> + / / CHECK - LABEL : sil shared @ _TFFCSo16NSReferencePointm1xSfU_T_ <nl> + / / CHECK - LABEL : sil shared @ _TFFCSo16NSReferencePointm1ySfU_T_ <nl> mmm a / test / SILGen / dynamic . swift <nl> ppp b / test / SILGen / dynamic . swift <nl> protocol Proto { <nl> <nl> / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Fooc <nl> / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Foo10objcMethod <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC7dynamic3Foog8objcPropSi <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC7dynamic3Foos8objcPropSi <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Foog8objcPropSi <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Foos8objcPropSi <nl> / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Foog9subscriptFT4objcPs9AnyObject__Si <nl> / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Foos9subscriptFT4objcPs9AnyObject__Si <nl> <nl> protocol Proto { <nl> <nl> / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Fooc <nl> / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Foo13dynamicMethod <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC7dynamic3Foog11dynamicPropSi <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC7dynamic3Foos11dynamicPropSi <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Foog11dynamicPropSi <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Foos11dynamicPropSi <nl> / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Foog9subscriptFT7dynamicSi_Si <nl> / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC7dynamic3Foos9subscriptFT7dynamicSi_Si <nl> <nl> mmm a / test / SILGen / guaranteed_self . swift <nl> ppp b / test / SILGen / guaranteed_self . swift <nl> class C : Fooable , Barrable { <nl> self . bas ( ) <nl> } <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC15guaranteed_self1Cg5prop1Si : $ @ convention ( objc_method ) ( C ) - > Int <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC15guaranteed_self1Cg5prop1Si : $ @ convention ( objc_method ) ( C ) - > Int <nl> / / CHECK : bb0 ( [ [ SELF : % . * ] ] : $ C ) : <nl> / / CHECK : [ [ SELF_COPY : % . * ] ] = copy_value [ [ SELF ] ] <nl> / / CHECK : apply { { . * } } ( [ [ SELF_COPY ] ] ) <nl> class C : Fooable , Barrable { <nl> / / CHECK - NOT : destroy_value [ [ SELF ] ] <nl> / / CHECK - NOT : destroy_value [ [ SELF_COPY ] ] <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC15guaranteed_self1Cs5prop1Si : $ @ convention ( objc_method ) ( Int , C ) - > ( ) <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC15guaranteed_self1Cs5prop1Si : $ @ convention ( objc_method ) ( Int , C ) - > ( ) <nl> / / CHECK : bb0 ( { { . * } } [ [ SELF : % . * ] ] : $ C ) : <nl> / / CHECK : [ [ SELF_COPY : % . * ] ] = copy_value [ [ SELF ] ] <nl> / / CHECK : apply { { . * } } [ [ SELF_COPY ] ] <nl> mmm a / test / SILGen / materializeForSet . swift <nl> ppp b / test / SILGen / materializeForSet . swift <nl> class Base { <nl> / / The ordering here is unfortunate : we generate the property <nl> / / getters and setters after we ' ve processed the decl . <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC17materializeForSet4Basem8computedSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed Base ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFC17materializeForSet4Basem8computedSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed Base ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % . * ] ] : $ Builtin . RawPointer , [ [ STORAGE : % . * ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % . * ] ] : $ Base ) : <nl> / / CHECK : [ [ ADDR : % . * ] ] = pointer_to_address [ [ BUFFER ] ] : $ Builtin . RawPointer to [ strict ] $ * Int <nl> / / CHECK : [ [ T0 : % . * ] ] = function_ref @ _TFC17materializeForSet4Baseg8computedSi <nl> class Base { <nl> / / CHECK : return [ [ T4 ] ] : $ ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) <nl> / / CHECK : } <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFFC17materializeForSet4Basem8computedSiU_T_ : $ @ convention ( thin ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ inout Base , @ thick Base . Type ) - > ( ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFFC17materializeForSet4Basem8computedSiU_T_ : $ @ convention ( thin ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ inout Base , @ thick Base . Type ) - > ( ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % . * ] ] : $ Builtin . RawPointer , [ [ STORAGE : % . * ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % . * ] ] : $ * Base , [ [ SELFTYPE : % . * ] ] : $ @ thick Base . Type ) : <nl> / / CHECK : [ [ T0 : % . * ] ] = load_borrow [ [ SELF ] ] <nl> / / CHECK : [ [ T1 : % . * ] ] = pointer_to_address [ [ BUFFER ] ] : $ Builtin . RawPointer to [ strict ] $ * Int <nl> class Base { <nl> / / CHECK : [ [ SETTER : % . * ] ] = function_ref @ _TFC17materializeForSet4Bases8computedSi <nl> / / CHECK : apply [ [ SETTER ] ] ( [ [ T2 ] ] , [ [ T0 ] ] ) <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC17materializeForSet4Basem6storedSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed Base ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFC17materializeForSet4Basem6storedSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed Base ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % . * ] ] : $ Builtin . RawPointer , [ [ STORAGE : % . * ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % . * ] ] : $ Base ) : <nl> / / CHECK : [ [ T0 : % . * ] ] = ref_element_addr [ [ SELF ] ] : $ Base , # Base . stored <nl> / / CHECK : [ [ T1 : % . * ] ] = address_to_pointer [ [ T0 ] ] : $ * Int to $ Builtin . RawPointer <nl> class HasDidSet : Base { <nl> didSet { } <nl> } <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC17materializeForSet9HasDidSetm6storedSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed HasDidSet ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFC17materializeForSet9HasDidSetm6storedSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed HasDidSet ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % . * ] ] : $ Builtin . RawPointer , [ [ STORAGE : % . * ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % . * ] ] : $ HasDidSet ) : <nl> / / CHECK : [ [ T2 : % . * ] ] = pointer_to_address [ [ BUFFER ] ] : $ Builtin . RawPointer to [ strict ] $ * Int <nl> / / CHECK : [ [ T0 : % . * ] ] = function_ref @ _TFC17materializeForSet9HasDidSetg6storedSi <nl> class HasDidSet : Base { <nl> set ( value ) { } <nl> } <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC17materializeForSet9HasDidSetm8computedSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed HasDidSet ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFC17materializeForSet9HasDidSetm8computedSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed HasDidSet ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % . * ] ] : $ Builtin . RawPointer , [ [ STORAGE : % . * ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % . * ] ] : $ HasDidSet ) : <nl> / / CHECK : [ [ T2 : % . * ] ] = pointer_to_address [ [ BUFFER ] ] : $ Builtin . RawPointer to [ strict ] $ * Int <nl> / / CHECK : [ [ T0 : % . * ] ] = function_ref @ _TFC17materializeForSet9HasDidSetg8computedSi <nl> class HasStoredDidSet { <nl> didSet { } <nl> } <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC17materializeForSet15HasStoredDidSetm6storedSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed HasStoredDidSet ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFC17materializeForSet15HasStoredDidSetm6storedSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed HasStoredDidSet ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % . * ] ] : $ Builtin . RawPointer , [ [ STORAGE : % . * ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % . * ] ] : $ HasStoredDidSet ) : <nl> / / CHECK : [ [ T2 : % . * ] ] = pointer_to_address [ [ BUFFER ] ] : $ Builtin . RawPointer to [ strict ] $ * Int <nl> / / CHECK : [ [ T0 : % . * ] ] = function_ref @ _TFC17materializeForSet15HasStoredDidSetg6storedSi <nl> class HasStoredDidSet { <nl> / / CHECK : } <nl> } <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFFC17materializeForSet15HasStoredDidSetm6storedSiU_T_ : $ @ convention ( thin ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ inout HasStoredDidSet , @ thick HasStoredDidSet . Type ) - > ( ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFFC17materializeForSet15HasStoredDidSetm6storedSiU_T_ : $ @ convention ( thin ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ inout HasStoredDidSet , @ thick HasStoredDidSet . Type ) - > ( ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % . * ] ] : $ Builtin . RawPointer , [ [ STORAGE : % . * ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % . * ] ] : $ * HasStoredDidSet , [ [ METATYPE : % . * ] ] : $ @ thick HasStoredDidSet . Type ) : <nl> / / CHECK : [ [ SELF_VALUE : % . * ] ] = load_borrow [ [ SELF ] ] : $ * HasStoredDidSet <nl> / / CHECK : [ [ BUFFER_ADDR : % . * ] ] = pointer_to_address [ [ BUFFER ] ] : $ Builtin . RawPointer to [ strict ] $ * Int <nl> class HasStoredDidSet { <nl> class HasWeak { <nl> weak var weakvar : HasWeak ? <nl> } <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC17materializeForSet7HasWeakm7weakvarXwGSqS0__ : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed HasWeak ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFC17materializeForSet7HasWeakm7weakvarXwGSqS0__ : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed HasWeak ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> / / CHECK : bb0 ( [ [ BUFFER : % . * ] ] : $ Builtin . RawPointer , [ [ STORAGE : % . * ] ] : $ * Builtin . UnsafeValueBuffer , [ [ SELF : % . * ] ] : $ HasWeak ) : <nl> / / CHECK : [ [ T2 : % . * ] ] = pointer_to_address [ [ BUFFER ] ] : $ Builtin . RawPointer to [ strict ] $ * Optional < HasWeak > <nl> / / CHECK : [ [ T0 : % . * ] ] = ref_element_addr [ [ SELF ] ] : $ HasWeak , # HasWeak . weakvar <nl> func inoutAccessOfLazyStructProperty ( l : inout LazyStructProperty ) { <nl> <nl> / / Test for materializeForSet vs lazy properties of classes . <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC17materializeForSet17LazyClassPropertym3catSi <nl> + / / CHECK - LABEL : sil hidden @ _TFC17materializeForSet17LazyClassPropertym3catSi <nl> <nl> class LazyClassProperty { <nl> lazy var cat : Int = 5 <nl> mmm a / test / SILGen / multi_file . swift <nl> ppp b / test / SILGen / multi_file . swift <nl> class HasComputedProperty : ProtocolWithProperty { <nl> set { } <nl> } <nl> } <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC10multi_file19HasComputedPropertym3fooSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed HasComputedProperty ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> + / / CHECK - LABEL : sil hidden @ _TFC10multi_file19HasComputedPropertym3fooSi : $ @ convention ( method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ guaranteed HasComputedProperty ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TTWC10multi_file19HasComputedPropertyS_20ProtocolWithPropertyS_FS1_m3fooSi : $ @ convention ( witness_method ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ inout HasComputedProperty ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> mmm a / test / SILGen / nsmanaged - witness . swift <nl> ppp b / test / SILGen / nsmanaged - witness . swift <nl> extension Foo : NativeIntProperty { } <nl> / / TODO : We can ' t emit a vtable entry for materializeForSet for ObjC types . <nl> / / CHECK - NOT : class_method { { . * } } Foo { { . * } } intProperty { { . * } } materializeForSet <nl> <nl> - / / CHECK - LABEL : sil shared [ transparent ] [ fragile ] @ _TFCSo3Foom11intPropertyVs5Int32 <nl> + / / CHECK - LABEL : sil shared @ _TFCSo3Foom11intPropertyVs5Int32 <nl> <nl> mmm a / test / SILGen / objc_bridging . swift <nl> ppp b / test / SILGen / objc_bridging . swift <nl> extension NSString { <nl> class Bas : NSObject { <nl> / / - - Bridging thunks for String properties convert between NSString <nl> var strRealProp : String = " Hello " <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC13objc_bridging3Basg11strRealPropSS : $ @ convention ( objc_method ) ( Bas ) - > @ autoreleased NSString { <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC13objc_bridging3Basg11strRealPropSS : $ @ convention ( objc_method ) ( Bas ) - > @ autoreleased NSString { <nl> / / CHECK : bb0 ( [ [ THIS : % . * ] ] : $ Bas ) : <nl> / / CHECK : [ [ THIS_COPY : % . * ] ] = copy_value [ [ THIS ] ] : $ Bas <nl> / / CHECK : / / function_ref objc_bridging . Bas . strRealProp . getter <nl> class Bas : NSObject { <nl> / / CHECK : } <nl> <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC13objc_bridging3Basg11strRealPropSS <nl> + / / CHECK - LABEL : sil hidden @ _TFC13objc_bridging3Basg11strRealPropSS <nl> / / CHECK : [ [ PROP_ADDR : % . * ] ] = ref_element_addr % 0 : { { . * } } , # Bas . strRealProp <nl> / / CHECK : [ [ PROP : % . * ] ] = load [ copy ] [ [ PROP_ADDR ] ] <nl> <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC13objc_bridging3Bass11strRealPropSS : $ @ convention ( objc_method ) ( NSString , Bas ) - > ( ) { <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC13objc_bridging3Bass11strRealPropSS : $ @ convention ( objc_method ) ( NSString , Bas ) - > ( ) { <nl> / / CHECK : bb0 ( [ [ VALUE : % . * ] ] : $ NSString , [ [ THIS : % . * ] ] : $ Bas ) : <nl> / / CHECK : [ [ VALUE_COPY : % . * ] ] = copy_value [ [ VALUE ] ] <nl> / / CHECK : [ [ THIS_COPY : % . * ] ] = copy_value [ [ THIS ] ] <nl> class Bas : NSObject { <nl> / / CHECK : destroy_value [ [ THIS_COPY ] ] <nl> / / CHECK : } / / end sil function ' _TToFC13objc_bridging3Bass11strRealPropSS ' <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC13objc_bridging3Bass11strRealPropSS <nl> + / / CHECK - LABEL : sil hidden @ _TFC13objc_bridging3Bass11strRealPropSS <nl> / / CHECK : bb0 ( % 0 : $ String , % 1 : $ Bas ) : <nl> <nl> / / CHECK : [ [ STR_ADDR : % . * ] ] = ref_element_addr % 1 : { { . * } } , # Bas . strRealProp <nl> class Bas : NSObject { <nl> get { return NSS } <nl> set { } <nl> } <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC13objc_bridging3Basg13nsstrRealPropCSo8NSString : $ @ convention ( objc_method ) ( Bas ) - > @ autoreleased NSString { <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC13objc_bridging3Basg13nsstrRealPropCSo8NSString : $ @ convention ( objc_method ) ( Bas ) - > @ autoreleased NSString { <nl> / / CHECK - NOT : swift_StringToNSString <nl> / / CHECK - NOT : _TZFE10FoundationSS36_unconditionallyBridgeFromObjectiveCfGSqCSo8NSString_SS <nl> / / CHECK : } <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC13objc_bridging3Bass13nsstrRealPropCSo8NSString : $ @ convention ( objc_method ) ( NSString , Bas ) - > <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC13objc_bridging3Bass13nsstrRealPropCSo8NSString : $ @ convention ( objc_method ) ( NSString , Bas ) - > <nl> / / CHECK - NOT : swift_StringToNSString <nl> / / CHECK - NOT : _TZFE10FoundationSS36_unconditionallyBridgeFromObjectiveCfGSqCSo8NSString_SS <nl> / / CHECK : } <nl> class Bas : NSObject { <nl> / / CHECK : return [ [ NSARRAY ] ] <nl> func arrayResult ( ) - > [ AnyObject ] { return [ ] } <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC13objc_bridging3Basg9arrayPropGSaSS_ : $ @ convention ( objc_method ) ( Bas ) - > @ autoreleased NSArray <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC13objc_bridging3Bass9arrayPropGSaSS_ : $ @ convention ( objc_method ) ( NSArray , Bas ) - > ( ) <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC13objc_bridging3Basg9arrayPropGSaSS_ : $ @ convention ( objc_method ) ( Bas ) - > @ autoreleased NSArray <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC13objc_bridging3Bass9arrayPropGSaSS_ : $ @ convention ( objc_method ) ( NSArray , Bas ) - > ( ) <nl> var arrayProp : [ String ] = [ ] <nl> } <nl> <nl> mmm a / test / SILGen / objc_dictionary_bridging . swift <nl> ppp b / test / SILGen / objc_dictionary_bridging . swift <nl> import gizmo <nl> var property : Dictionary < Foo , Foo > = [ : ] <nl> <nl> / / Property getter <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC24objc_dictionary_bridging3Foog8propertyGVs10DictionaryS0_S0__ : $ @ convention ( objc_method ) ( Foo ) - > @ autoreleased NSDictionary <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC24objc_dictionary_bridging3Foog8propertyGVs10DictionaryS0_S0__ : $ @ convention ( objc_method ) ( Foo ) - > @ autoreleased NSDictionary <nl> / / CHECK : bb0 ( [ [ SELF : % [ 0 - 9 ] + ] ] : $ Foo ) : <nl> / / CHECK : [ [ SELF_COPY : % . * ] ] = copy_value [ [ SELF ] ] <nl> / / CHECK : [ [ GETTER : % [ 0 - 9 ] + ] ] = function_ref @ _TFC24objc_dictionary_bridging3Foog8propertyGVs10DictionaryS0_S0__ : $ @ convention ( method ) ( @ guaranteed Foo ) - > @ owned Dictionary < Foo , Foo > <nl> import gizmo <nl> / / CHECK : } / / end sil function ' _TToFC24objc_dictionary_bridging3Foog8propertyGVs10DictionaryS0_S0__ ' <nl> <nl> / / Property setter <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC24objc_dictionary_bridging3Foos8propertyGVs10DictionaryS0_S0__ : $ @ convention ( objc_method ) ( NSDictionary , Foo ) - > ( ) <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC24objc_dictionary_bridging3Foos8propertyGVs10DictionaryS0_S0__ : $ @ convention ( objc_method ) ( NSDictionary , Foo ) - > ( ) <nl> / / CHECK : bb0 ( [ [ NSDICT : % [ 0 - 9 ] + ] ] : $ NSDictionary , [ [ SELF : % [ 0 - 9 ] + ] ] : $ Foo ) : <nl> / / CHECK : [ [ NSDICT_COPY : % . * ] ] = copy_value [ [ NSDICT ] ] <nl> / / CHECK : [ [ SELF_COPY : % . * ] ] = copy_value [ [ SELF ] ] <nl> import gizmo <nl> / / CHECK : destroy_value [ [ SELF_COPY ] ] <nl> / / CHECK : return [ [ RESULT ] ] : $ ( ) <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC24objc_dictionary_bridging3Foog19nonVerbatimProperty { { . * } } : $ @ convention ( objc_method ) ( Foo ) - > @ autoreleased NSDictionary <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC24objc_dictionary_bridging3Foog19nonVerbatimProperty { { . * } } : $ @ convention ( objc_method ) ( Foo ) - > @ autoreleased NSDictionary <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC24objc_dictionary_bridging3Foos19nonVerbatimProperty { { . * } } : $ @ convention ( objc_method ) ( NSDictionary , Foo ) - > ( ) <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC24objc_dictionary_bridging3Foos19nonVerbatimProperty { { . * } } : $ @ convention ( objc_method ) ( NSDictionary , Foo ) - > ( ) <nl> @ objc var nonVerbatimProperty : Dictionary < String , Int > = [ : ] <nl> } <nl> <nl> mmm a / test / SILGen / objc_final . swift <nl> ppp b / test / SILGen / objc_final . swift <nl> final class Foo { <nl> / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC10objc_final3Foo3foo <nl> <nl> @ objc var prop : Int = 0 <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC10objc_final3Foog4propSi <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC10objc_final3Foos4propSi <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC10objc_final3Foog4propSi <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC10objc_final3Foos4propSi <nl> } <nl> <nl> / / CHECK - LABEL : sil hidden @ _TF10objc_final7callFooFCS_3FooT_ <nl> mmm a / test / SILGen / objc_local . swift <nl> ppp b / test / SILGen / objc_local . swift <nl> <nl> import Foundation <nl> <nl> func foo ( ) { <nl> - / / CHECK - LABEL : sil private [ transparent ] [ thunk ] @ _TToFCF10objc_local3fooFT_T_L_3Foog1xSi <nl> - / / CHECK - LABEL : sil private [ transparent ] [ thunk ] @ _TToFCF10objc_local3fooFT_T_L_3Foos1xSi <nl> + / / CHECK - LABEL : sil private [ thunk ] @ _TToFCF10objc_local3fooFT_T_L_3Foog1xSi <nl> + / / CHECK - LABEL : sil private [ thunk ] @ _TToFCF10objc_local3fooFT_T_L_3Foos1xSi <nl> class Foo : NSObject { @ objc var x : Int = 0 } <nl> } <nl> mmm a / test / SILGen / objc_properties . swift <nl> ppp b / test / SILGen / objc_properties . swift <nl> class B : A { <nl> <nl> / / Test the @ NSCopying attribute . <nl> class TestNSCopying { <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC15objc_properties13TestNSCopyings8propertyCSo8NSString : $ @ convention ( method ) ( @ owned NSString , @ guaranteed TestNSCopying ) - > ( ) <nl> + / / CHECK - LABEL : sil hidden @ _TFC15objc_properties13TestNSCopyings8propertyCSo8NSString : $ @ convention ( method ) ( @ owned NSString , @ guaranteed TestNSCopying ) - > ( ) <nl> / / CHECK : bb0 ( % 0 : $ NSString , % 1 : $ TestNSCopying ) : <nl> / / CHECK : class_method [ volatile ] % 0 : $ NSString , # NSString . copy ! 1 . foreign <nl> @ NSCopying var property : NSString <nl> class TestComputedOutlet : NSObject { <nl> } <nl> <nl> class Singleton : NSObject { <nl> - / / CHECK - DAG : sil hidden [ transparent ] @ _TZFC15objc_properties9Singletong14sharedInstanceS0_ : $ @ convention ( method ) ( @ thick Singleton . Type ) - > @ owned Singleton <nl> - / / CHECK - DAG : sil hidden [ transparent ] [ thunk ] @ _TToZFC15objc_properties9Singletong14sharedInstanceS0_ : $ @ convention ( objc_method ) ( @ objc_metatype Singleton . Type ) - > @ autoreleased Singleton { <nl> + / / CHECK - DAG : sil hidden @ _TZFC15objc_properties9Singletong14sharedInstanceS0_ : $ @ convention ( method ) ( @ thick Singleton . Type ) - > @ owned Singleton <nl> + / / CHECK - DAG : sil hidden [ thunk ] @ _TToZFC15objc_properties9Singletong14sharedInstanceS0_ : $ @ convention ( objc_method ) ( @ objc_metatype Singleton . Type ) - > @ autoreleased Singleton { <nl> static let sharedInstance = Singleton ( ) <nl> <nl> - / / CHECK - DAG : sil hidden [ transparent ] @ _TZFC15objc_properties9Singletong1iSi : $ @ convention ( method ) ( @ thick Singleton . Type ) - > Int <nl> - / / CHECK - DAG : sil hidden [ transparent ] [ thunk ] @ _TToZFC15objc_properties9Singletong1iSi : $ @ convention ( objc_method ) ( @ objc_metatype Singleton . Type ) - > Int <nl> + / / CHECK - DAG : sil hidden @ _TZFC15objc_properties9Singletong1iSi : $ @ convention ( method ) ( @ thick Singleton . Type ) - > Int <nl> + / / CHECK - DAG : sil hidden [ thunk ] @ _TToZFC15objc_properties9Singletong1iSi : $ @ convention ( objc_method ) ( @ objc_metatype Singleton . Type ) - > Int <nl> static let i = 2 <nl> <nl> - / / CHECK - DAG : sil hidden [ transparent ] @ _TZFC15objc_properties9Singletong1jSS : $ @ convention ( method ) ( @ thick Singleton . Type ) - > @ owned String <nl> - / / CHECK - DAG : sil hidden [ transparent ] [ thunk ] @ _TToZFC15objc_properties9Singletong1jSS : $ @ convention ( objc_method ) ( @ objc_metatype Singleton . Type ) - > @ autoreleased NSString <nl> - / / CHECK - DAG : sil hidden [ transparent ] @ _TZFC15objc_properties9Singletons1jSS : $ @ convention ( method ) ( @ owned String , @ thick Singleton . Type ) - > ( ) <nl> - / / CHECK - DAG : sil hidden [ transparent ] [ thunk ] @ _TToZFC15objc_properties9Singletons1jSS : $ @ convention ( objc_method ) ( NSString , @ objc_metatype Singleton . Type ) - > ( ) <nl> + / / CHECK - DAG : sil hidden @ _TZFC15objc_properties9Singletong1jSS : $ @ convention ( method ) ( @ thick Singleton . Type ) - > @ owned String <nl> + / / CHECK - DAG : sil hidden [ thunk ] @ _TToZFC15objc_properties9Singletong1jSS : $ @ convention ( objc_method ) ( @ objc_metatype Singleton . Type ) - > @ autoreleased NSString <nl> + / / CHECK - DAG : sil hidden @ _TZFC15objc_properties9Singletons1jSS : $ @ convention ( method ) ( @ owned String , @ thick Singleton . Type ) - > ( ) <nl> + / / CHECK - DAG : sil hidden [ thunk ] @ _TToZFC15objc_properties9Singletons1jSS : $ @ convention ( objc_method ) ( NSString , @ objc_metatype Singleton . Type ) - > ( ) <nl> static var j = " Hello " <nl> <nl> / / CHECK - DAG : sil hidden [ thunk ] @ _TToZFC15objc_properties9Singletong1kSd : $ @ convention ( objc_method ) ( @ objc_metatype Singleton . Type ) - > Double <nl> class Singleton : NSObject { <nl> } <nl> <nl> class HasUnmanaged : NSObject { <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC15objc_properties12HasUnmanagedg3refGSqGVs9UnmanagedPs9AnyObject___ <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC15objc_properties12HasUnmanagedg3refGSqGVs9UnmanagedPs9AnyObject___ <nl> / / CHECK : bb0 ( [ [ CLS : % . * ] ] : $ HasUnmanaged ) : <nl> / / CHECK : [ [ CLS_COPY : % . * ] ] = copy_value [ [ CLS ] ] <nl> / / CHECK : [ [ NATIVE : % . + ] ] = function_ref @ _TFC15objc_properties12HasUnmanagedg3refGSqGVs9UnmanagedPs9AnyObject___ <nl> class HasUnmanaged : NSObject { <nl> / / CHECK : return [ [ RESULT ] ] : $ Optional < Unmanaged < AnyObject > > <nl> / / CHECK : } / / end sil function ' _TToFC15objc_properties12HasUnmanagedg3refGSqGVs9UnmanagedPs9AnyObject___ ' <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC15objc_properties12HasUnmanageds3refGSqGVs9UnmanagedPs9AnyObject___ <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC15objc_properties12HasUnmanageds3refGSqGVs9UnmanagedPs9AnyObject___ <nl> / / CHECK : bb0 ( [ [ NEW_VALUE : % . * ] ] : $ Optional < Unmanaged < AnyObject > > , [ [ SELF : % . * ] ] : $ HasUnmanaged ) : <nl> / / CHECK - NEXT : [ [ SELF_COPY : % . * ] ] = copy_value [ [ SELF ] ] : $ HasUnmanaged <nl> / / CHECK - NEXT : / / function_ref <nl> mmm a / test / SILGen / objc_protocols . swift <nl> ppp b / test / SILGen / objc_protocols . swift <nl> class StoredPropertyCount { <nl> } <nl> <nl> extension StoredPropertyCount : NSCounting { } <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC14objc_protocols19StoredPropertyCountg5countSi <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC14objc_protocols19StoredPropertyCountg5countSi <nl> <nl> class ComputedPropertyCount { <nl> @ objc var count : Int { return 0 } <nl> mmm a / test / SILGen / objc_set_bridging . swift <nl> ppp b / test / SILGen / objc_set_bridging . swift <nl> import gizmo <nl> var property : Set < Foo > = Set ( ) <nl> <nl> / / Property getter <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC17objc_set_bridging3Foog8property { { . * } } : $ @ convention ( objc_method ) ( Foo ) - > @ autoreleased NSSet <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC17objc_set_bridging3Foog8property { { . * } } : $ @ convention ( objc_method ) ( Foo ) - > @ autoreleased NSSet <nl> / / CHECK : bb0 ( [ [ SELF : % [ 0 - 9 ] + ] ] : $ Foo ) : <nl> / / CHECK : [ [ SELF_COPY ] ] = copy_value [ [ SELF ] ] : $ Foo <nl> / / CHECK : [ [ GETTER : % [ 0 - 9 ] + ] ] = function_ref @ _TFC17objc_set_bridging3Foog8property { { . * } } : $ @ convention ( method ) ( @ guaranteed Foo ) - > @ owned Set < Foo > <nl> import gizmo <nl> / / CHECK : } / / end sil function ' _TToFC17objc_set_bridging3Foog8property { { . * } } ' <nl> <nl> / / Property setter <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC17objc_set_bridging3Foos8property { { . * } } : $ @ convention ( objc_method ) ( NSSet , Foo ) - > ( ) { <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC17objc_set_bridging3Foos8property { { . * } } : $ @ convention ( objc_method ) ( NSSet , Foo ) - > ( ) { <nl> / / CHECK : bb0 ( [ [ NSSET : % [ 0 - 9 ] + ] ] : $ NSSet , [ [ SELF : % [ 0 - 9 ] + ] ] : $ Foo ) : <nl> / / CHECK : [ [ NSSET_COPY : % . * ] ] = copy_value [ [ NSSET ] ] : $ NSSet <nl> / / CHECK : [ [ SELF_COPY : % . * ] ] = copy_value [ [ SELF ] ] : $ Foo <nl> import gizmo <nl> / / CHECK : destroy_value [ [ SELF_COPY ] ] : $ Foo <nl> / / CHECK : return [ [ RESULT ] ] : $ ( ) <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC17objc_set_bridging3Foog19nonVerbatimProperty { { . * } } : $ @ convention ( objc_method ) ( Foo ) - > @ autoreleased NSSet <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC17objc_set_bridging3Foos19nonVerbatimProperty { { . * } } : $ @ convention ( objc_method ) ( NSSet , Foo ) - > ( ) { <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC17objc_set_bridging3Foog19nonVerbatimProperty { { . * } } : $ @ convention ( objc_method ) ( Foo ) - > @ autoreleased NSSet <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC17objc_set_bridging3Foos19nonVerbatimProperty { { . * } } : $ @ convention ( objc_method ) ( NSSet , Foo ) - > ( ) { <nl> @ objc var nonVerbatimProperty : Set < String > = Set ( ) <nl> } <nl> <nl> mmm a / test / SILGen / objc_thunks . swift <nl> ppp b / test / SILGen / objc_thunks . swift <nl> class Hoozit : Gizmo { <nl> <nl> var typicalProperty : Gizmo <nl> / / - - getter <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC11objc_thunks6Hoozitg15typicalPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Hoozit ) - > @ autoreleased Gizmo { <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC11objc_thunks6Hoozitg15typicalPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Hoozit ) - > @ autoreleased Gizmo { <nl> / / CHECK : bb0 ( [ [ SELF : % . * ] ] : $ Hoozit ) : <nl> / / CHECK - NEXT : [ [ SELF_COPY : % . * ] ] = copy_value [ [ SELF ] ] <nl> / / CHECK - NEXT : / / function_ref objc_thunks . Hoozit . typicalProperty . getter <nl> class Hoozit : Gizmo { <nl> / / CHECK - NEXT : return [ [ RES ] ] : $ Gizmo <nl> / / CHECK - NEXT : } <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC11objc_thunks6Hoozitg15typicalPropertyCSo5Gizmo : $ @ convention ( method ) ( @ guaranteed Hoozit ) - > @ owned Gizmo <nl> + / / CHECK - LABEL : sil hidden @ _TFC11objc_thunks6Hoozitg15typicalPropertyCSo5Gizmo : $ @ convention ( method ) ( @ guaranteed Hoozit ) - > @ owned Gizmo <nl> / / CHECK : bb0 ( % 0 : $ Hoozit ) : <nl> / / CHECK - NEXT : debug_value % 0 <nl> / / CHECK - NEXT : [ [ ADDR : % . * ] ] = ref_element_addr % 0 : { { . * } } , # Hoozit . typicalProperty <nl> class Hoozit : Gizmo { <nl> / / CHECK - NEXT : return [ [ RES ] ] <nl> <nl> / / - - setter <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC11objc_thunks6Hoozits15typicalPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Gizmo , Hoozit ) - > ( ) { <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC11objc_thunks6Hoozits15typicalPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Gizmo , Hoozit ) - > ( ) { <nl> / / CHECK : bb0 ( [ [ VALUE : % . * ] ] : $ Gizmo , [ [ THIS : % . * ] ] : $ Hoozit ) : <nl> / / CHECK : [ [ VALUE_COPY : % . * ] ] = copy_value [ [ VALUE ] ] : $ Gizmo <nl> / / CHECK : [ [ THIS_COPY : % . * ] ] = copy_value [ [ THIS ] ] : $ Hoozit <nl> class Hoozit : Gizmo { <nl> / / CHECK : return [ [ RES ] ] : $ ( ) , scope { { . * } } / / id : { { . * } } line : [ [ @ LINE - 28 ] ] : 7 : auto_gen <nl> / / CHECK : } / / end sil function ' _TToFC11objc_thunks6Hoozits15typicalPropertyCSo5Gizmo ' <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC11objc_thunks6Hoozits15typicalPropertyCSo5Gizmo <nl> + / / CHECK - LABEL : sil hidden @ _TFC11objc_thunks6Hoozits15typicalPropertyCSo5Gizmo <nl> / / CHECK : bb0 ( [ [ ARG0 : % . * ] ] : $ Gizmo , [ [ ARG1 : % . * ] ] : $ Hoozit ) : <nl> / / CHECK : [ [ ARG0_COPY : % . * ] ] = copy_value [ [ ARG0 ] ] <nl> / / CHECK : [ [ ADDR : % . * ] ] = ref_element_addr [ [ ARG1 ] ] : { { . * } } , # Hoozit . typicalProperty <nl> class Hoozit : Gizmo { <nl> / / NS_RETURNS_RETAINED getter by family ( - copy ) <nl> var copyProperty : Gizmo <nl> / / - - getter <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC11objc_thunks6Hoozitg12copyPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Hoozit ) - > @ owned Gizmo { <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC11objc_thunks6Hoozitg12copyPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Hoozit ) - > @ owned Gizmo { <nl> / / CHECK : bb0 ( [ [ SELF : % . * ] ] : $ Hoozit ) : <nl> / / CHECK - NEXT : [ [ SELF_COPY : % . * ] ] = copy_value [ [ SELF ] ] <nl> / / CHECK - NEXT : / / function_ref objc_thunks . Hoozit . copyProperty . getter <nl> class Hoozit : Gizmo { <nl> / / CHECK - NEXT : return [ [ RES ] ] <nl> / / CHECK - NEXT : } <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC11objc_thunks6Hoozitg12copyPropertyCSo5Gizmo <nl> + / / CHECK - LABEL : sil hidden @ _TFC11objc_thunks6Hoozitg12copyPropertyCSo5Gizmo <nl> / / CHECK : bb0 ( % 0 : $ Hoozit ) : <nl> / / CHECK : [ [ ADDR : % . * ] ] = ref_element_addr % 0 : { { . * } } , # Hoozit . copyProperty <nl> / / CHECK - NEXT : [ [ RES : % . * ] ] = load [ copy ] [ [ ADDR ] ] <nl> / / CHECK - NEXT : return [ [ RES ] ] <nl> <nl> / / - - setter is normal <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC11objc_thunks6Hoozits12copyPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Gizmo , Hoozit ) - > ( ) { <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC11objc_thunks6Hoozits12copyPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Gizmo , Hoozit ) - > ( ) { <nl> / / CHECK : bb0 ( [ [ VALUE : % . * ] ] : $ Gizmo , [ [ THIS : % . * ] ] : $ Hoozit ) : <nl> / / CHECK - NEXT : [ [ VALUE_COPY : % . * ] ] = copy_value [ [ VALUE ] ] <nl> / / CHECK - NEXT : [ [ THIS_COPY : % . * ] ] = copy_value [ [ THIS ] ] <nl> class Hoozit : Gizmo { <nl> / / CHECK - NEXT : destroy_value [ [ THIS_COPY ] ] <nl> / / CHECK - NEXT : return [ [ RES ] ] <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC11objc_thunks6Hoozits12copyPropertyCSo5Gizmo <nl> + / / CHECK - LABEL : sil hidden @ _TFC11objc_thunks6Hoozits12copyPropertyCSo5Gizmo <nl> / / CHECK : bb0 ( [ [ ARG1 : % . * ] ] : $ Gizmo , [ [ SELF : % . * ] ] : $ Hoozit ) : <nl> / / CHECK : [ [ ARG1_COPY : % . * ] ] = copy_value [ [ ARG1 ] ] <nl> / / CHECK : [ [ ADDR : % . * ] ] = ref_element_addr [ [ SELF ] ] : { { . * } } , # Hoozit . copyProperty <nl> class Hoozit : Gizmo { <nl> <nl> var initProperty : Gizmo <nl> / / - - getter <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC11objc_thunks6Hoozitg12initPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Hoozit ) - > @ autoreleased Gizmo { <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC11objc_thunks6Hoozitg12initPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Hoozit ) - > @ autoreleased Gizmo { <nl> / / CHECK : bb0 ( [ [ THIS : % . * ] ] : $ Hoozit ) : <nl> / / CHECK - NEXT : [ [ THIS_COPY : % . * ] ] = copy_value [ [ THIS ] ] <nl> / / CHECK - NEXT : / / function_ref <nl> class Hoozit : Gizmo { <nl> / / CHECK - NEXT : } <nl> <nl> / / - - setter <nl> - / / CHECK - LABEL : sil hidden [ transparent ] [ thunk ] @ _TToFC11objc_thunks6Hoozits12initPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Gizmo , Hoozit ) - > ( ) { <nl> + / / CHECK - LABEL : sil hidden [ thunk ] @ _TToFC11objc_thunks6Hoozits12initPropertyCSo5Gizmo : $ @ convention ( objc_method ) ( Gizmo , Hoozit ) - > ( ) { <nl> / / CHECK : bb0 ( [ [ VALUE : % . * ] ] : $ Gizmo , [ [ THIS : % . * ] ] : $ Hoozit ) : <nl> / / CHECK - NEXT : [ [ VALUE_COPY : % . * ] ] = copy_value [ [ VALUE ] ] <nl> / / CHECK - NEXT : [ [ THIS_COPY : % . * ] ] = copy_value [ [ THIS ] ] <nl> mmm a / test / SILGen / objc_witnesses . swift <nl> ppp b / test / SILGen / objc_witnesses . swift <nl> public class Positron : Lepton { <nl> public dynamic var spin : Float = 0 . 5 <nl> } <nl> <nl> - / / CHECK - LABEL : sil [ transparent ] [ fragile ] [ thunk ] @ _TTWC14objc_witnesses8PositronS_6LeptonS_FS1_g4spinSf <nl> - / / CHECK - LABEL : sil shared [ transparent ] [ fragile ] [ thunk ] @ _TTDFC14objc_witnesses8Positrong4spinSf <nl> + / / CHECK - LABEL : sil [ transparent ] [ thunk ] @ _TTWC14objc_witnesses8PositronS_6LeptonS_FS1_g4spinSf <nl> + / / CHECK - LABEL : sil shared [ transparent ] [ thunk ] @ _TTDFC14objc_witnesses8Positrong4spinSf <nl> mmm a / test / SILGen / properties . swift <nl> ppp b / test / SILGen / properties . swift <nl> public class DerivedClassWithPublicProperty : BaseClassWithInternalProperty { <nl> } <nl> } <nl> <nl> - / / CHECK - LABEL : sil hidden [ transparent ] @ _TFC10properties29BaseClassWithInternalPropertyg1xT_ <nl> + / / CHECK - LABEL : sil hidden @ _TFC10properties29BaseClassWithInternalPropertyg1xT_ <nl> <nl> - / / CHECK - LABEL : sil [ transparent ] [ fragile ] @ _TFC10properties30DerivedClassWithPublicPropertyg1xT_ <nl> + / / CHECK - LABEL : sil @ _TFC10properties30DerivedClassWithPublicPropertyg1xT_ <nl> / / CHECK : bb0 ( [ [ SELF : % . * ] ] : $ DerivedClassWithPublicProperty ) : <nl> / / CHECK : [ [ SELF_COPY : % . * ] ] = copy_value [ [ SELF ] ] : $ DerivedClassWithPublicProperty <nl> / / CHECK - NEXT : [ [ SUPER : % . * ] ] = upcast [ [ SELF_COPY ] ] : $ DerivedClassWithPublicProperty to $ BaseClassWithInternalProperty <nl> - / / CHECK - NEXT : [ [ METHOD : % . * ] ] = super_method [ [ SELF_COPY ] ] : $ DerivedClassWithPublicProperty , # BaseClassWithInternalProperty . x ! getter . 1 : ( BaseClassWithInternalProperty ) - > ( ) - > ( ) , $ @ convention ( method ) ( @ guaranteed BaseClassWithInternalProperty ) - > ( ) <nl> - / / CHECK - NEXT : [ [ RESULT : % . * ] ] = apply [ [ METHOD ] ] ( [ [ SUPER ] ] ) : $ @ convention ( method ) ( @ guaranteed BaseClassWithInternalProperty ) - > ( ) <nl> + / / CHECK : [ [ GETTER : % . * ] ] = function_ref @ _TFC10properties29BaseClassWithInternalPropertyg1xT_ <nl> + / / CHECK - NEXT : [ [ RESULT : % . * ] ] = apply [ [ GETTER ] ] ( [ [ SUPER ] ] ) : $ @ convention ( method ) ( @ guaranteed BaseClassWithInternalProperty ) - > ( ) <nl> / / CHECK - NEXT : destroy_value [ [ SUPER ] ] : $ BaseClassWithInternalProperty <nl> / / CHECK : } / / end sil function ' _TFC10properties30DerivedClassWithPublicPropertyg1xT_ ' <nl> mmm a / test / SILGen / specialize_attr . swift <nl> ppp b / test / SILGen / specialize_attr . swift <nl> public class ASubscriptable < Element > : TestSubscriptable { <nl> / / CHECK - LABEL : sil [ _specialize < Int > ] @ _TFC15specialize_attr14ASubscriptables9subscriptFSix : $ @ convention ( method ) < Element > ( @ in Element , Int , @ guaranteed ASubscriptable < Element > ) - > ( ) { <nl> <nl> / / ASubscriptable . subscript . materializeForSet with no attribute <nl> - / / CHECK - LABEL : sil [ transparent ] [ fragile ] @ _TFC15specialize_attr14ASubscriptablem9subscriptFSix : $ @ convention ( method ) < Element > ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , Int , @ guaranteed ASubscriptable < Element > ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> + / / CHECK - LABEL : sil @ _TFC15specialize_attr14ASubscriptablem9subscriptFSix : $ @ convention ( method ) < Element > ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , Int , @ guaranteed ASubscriptable < Element > ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> <nl> public class Addressable < Element > : TestSubscriptable { <nl> var storage : UnsafeMutablePointer < Element > <nl> public class Addressable < Element > : TestSubscriptable { <nl> <nl> <nl> / / Addressable . subscript . getter with no attribute <nl> - / / CHECK - LABEL : sil [ transparent ] [ fragile ] @ _TFC15specialize_attr11Addressableg9subscriptFSix : $ @ convention ( method ) < Element > ( Int , @ guaranteed Addressable < Element > ) - > @ out Element { <nl> + / / CHECK - LABEL : sil @ _TFC15specialize_attr11Addressableg9subscriptFSix : $ @ convention ( method ) < Element > ( Int , @ guaranteed Addressable < Element > ) - > @ out Element { <nl> <nl> / / Addressable . subscript . setter with no attribute <nl> - / / CHECK - LABEL : sil [ transparent ] [ fragile ] @ _TFC15specialize_attr11Addressables9subscriptFSix : $ @ convention ( method ) < Element > ( @ in Element , Int , @ guaranteed Addressable < Element > ) - > ( ) { <nl> + / / CHECK - LABEL : sil @ _TFC15specialize_attr11Addressables9subscriptFSix : $ @ convention ( method ) < Element > ( @ in Element , Int , @ guaranteed Addressable < Element > ) - > ( ) { <nl> <nl> / / Addressable . subscript . materializeForSet with no attribute <nl> - / / CHECK - LABEL : sil [ transparent ] [ fragile ] @ _TFC15specialize_attr11Addressablem9subscriptFSix : $ @ convention ( method ) < Element > ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , Int , @ guaranteed Addressable < Element > ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> + / / CHECK - LABEL : sil @ _TFC15specialize_attr11Addressablem9subscriptFSix : $ @ convention ( method ) < Element > ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , Int , @ guaranteed Addressable < Element > ) - > ( Builtin . RawPointer , Optional < Builtin . RawPointer > ) { <nl> mmm a / test / SILOptimizer / devirt_materializeForSet . swift <nl> ppp b / test / SILOptimizer / devirt_materializeForSet . swift <nl> <nl> / / Check that compiler does not crash on the devirtualization of materializeForSet methods <nl> / / and produces a correct code . <nl> <nl> - / / CHECK - LABEL : sil [ transparent ] [ fragile ] [ thunk ] @ _TTWC24devirt_materializeForSet7BaseFooS_3FooS_FS1_m3barSS <nl> + / / CHECK - LABEL : sil [ transparent ] [ thunk ] @ _TTWC24devirt_materializeForSet7BaseFooS_3FooS_FS1_m3barSS <nl> / / CHECK : checked_cast_br [ exact ] % { { . * } } : $ BaseFoo to $ ChildFoo <nl> / / CHECK : thin_function_to_pointer % { { . * } } : $ @ convention ( thin ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , @ inout ChildFoo , @ thick ChildFoo . Type ) - > ( ) to $ Builtin . RawPointer <nl> / / CHECK : enum $ Optional < Builtin . RawPointer > , # Optional . some ! enumelt . 1 , % { { . * } } : $ Builtin . RawPointer <nl> mmm a / test / multifile / synthesized - accessors / two - modules / library . swift <nl> ppp b / test / multifile / synthesized - accessors / two - modules / library . swift <nl> <nl> / / RUN : true <nl> <nl> + # if _runtime ( _ObjC ) <nl> + import Foundation <nl> + # endif <nl> + <nl> public struct FishAndChips { <nl> public var costPounds : Float <nl> public var costEuros : Float { <nl> public final class Beer { <nl> public class LazyCat { <nl> public lazy var purrs : Int = 10 <nl> } <nl> + <nl> + # if _runtime ( _ObjC ) <nl> + public final class FinalCountdown : NSObject { <nl> + public lazy var count : Int = 42 <nl> + } <nl> + # else <nl> + public final class FinalCountdown { <nl> + public lazy var count : Int = 42 <nl> + } <nl> + # endif <nl> mmm a / test / multifile / synthesized - accessors / two - modules / main . swift <nl> ppp b / test / multifile / synthesized - accessors / two - modules / main . swift <nl> <nl> / / RUN : rm - rf % t & & mkdir - p % t <nl> <nl> - / / RUN : mkdir - p % t / linker <nl> - / / RUN : % target - build - swift - emit - module - c % S / library . swift - o % t / linker / library . o <nl> - / / RUN : % target - build - swift - emit - library - c % S / library . swift - o % t / linker / library . o <nl> - / / RUN : % target - build - swift % S / main . swift % t / linker / library . o - I % t / linker / - L % t / linker / - o % t / linker / main <nl> + / / RUN : mkdir - p % t / onone % t / wmo <nl> + / / RUN : % target - build - swift - emit - module - emit - module - path % t / onone / library . swiftmodule - module - name = library - emit - library % S / library . swift - o % t / onone / library . % target - dylib - extension <nl> + / / RUN : % target - build - swift % S / main . swift % t / onone / library . % target - dylib - extension - I % t / onone / - o % t / onone / main <nl> + <nl> + / / RUN : % target - build - swift - emit - module - emit - module - path % t / wmo / library . swiftmodule - module - name = library - emit - library - O - wmo % S / library . swift - o % t / wmo / library . % target - dylib - extension <nl> + / / RUN : % target - build - swift % S / main . swift % t / wmo / library . % target - dylib - extension - I % t / wmo / - o % t / wmo / main <nl> <nl> / / REQUIRES : executable_test <nl> <nl> extension LazyCat : PurrExtractor { } <nl> <nl> / / Dummy statement <nl> _ = ( ) <nl> + <nl> + public func launchToday ( fc : FinalCountdown ) { <nl> + / / Check if the setter is not transparent and therefore does not try to <nl> + / / reference the hidden offet variable symbol in the module . <nl> + fc . count = 27 <nl> + } <nl> + <nl> mmm a / test / sil - func - extractor / basic . swift <nl> ppp b / test / sil - func - extractor / basic . swift <nl> <nl> <nl> / / EXTRACT - NOW - LABEL : sil hidden @ _TFC5basic7Vehicle3nowfT_Si : $ @ convention ( method ) ( @ guaranteed Vehicle ) - > Int { <nl> / / EXTRACT - NOW : bb0 <nl> - / / EXTRACT - NOW - NEXT : ref_element_addr <nl> - / / EXTRACT - NOW - NEXT : load <nl> + / / EXTRACT - NOW : = function_ref <nl> + / / EXTRACT - NOW - NEXT : apply <nl> / / EXTRACT - NOW - NEXT : return <nl> <nl> struct X { <nl>
|
SILGen : Don ’ t make class accessors transparent .
|
apple/swift
|
74d979f0ac6665cbbafb4a744609d5c1b141f8bd
|
2016-12-20T01:02:09Z
|
new file mode 100644 <nl> index 0000000000000 . . 051b1ab0388b8 <nl> mmm / dev / null <nl> ppp b / tensorflow / tensorboard / components / tf - graph / demo / demo_datasets . json <nl> <nl> + [ <nl> + { <nl> + " name " : " Mnist Eval " , <nl> + " path " : " mnist_eval . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " Mnist with summaries ( + stats ) " , <nl> + " path " : " mnist_with_summaries . pbtxt " , <nl> + " runMetadata " : [ <nl> + { <nl> + " tag " : " step100 " , <nl> + " path " : " mnist_with_summaries_step100 . pbtxt " <nl> + } , <nl> + { <nl> + " tag " : " step1000 " , <nl> + " path " : " mnist_with_summaries_step1000 . pbtxt " <nl> + } <nl> + ] <nl> + } , <nl> + { <nl> + " name " : " Mnist Train ( with shapes ) " , <nl> + " path " : " mnist_train_shapes . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " Inception Train ( huge ) " , <nl> + " path " : " inception_train . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " Inception Train Eval " , <nl> + " path " : " inception_train_eval . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " Inception Test " , <nl> + " path " : " inception_test_eval . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " PTB Word LSTM Train " , <nl> + " path " : " ptb_word_lstm_train . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " PTB Word LSTM Train Eval " , <nl> + " path " : " ptb_word_lstm_train_eval . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " PTB Word LSTM Test " , <nl> + " path " : " ptb_word_lstm_test_eval . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " Cifar10 Train ( + stats ) " , <nl> + " path " : " cifar10_train . pbtxt " , <nl> + " runMetadata " : [ <nl> + { <nl> + " tag " : " step0 " , <nl> + " path " : " cifar10_train_step0 . pbtxt " <nl> + } , <nl> + { <nl> + " tag " : " step100 " , <nl> + " path " : " cifar10_train_step100 . pbtxt " <nl> + } , <nl> + { <nl> + " tag " : " step200 " , <nl> + " path " : " cifar10_train_step200 . pbtxt " <nl> + } , <nl> + { <nl> + " tag " : " step300 " , <nl> + " path " : " cifar10_train_step300 . pbtxt " <nl> + } <nl> + ] <nl> + } , <nl> + { <nl> + " name " : " Cifar10 Multi - GPU Train " , <nl> + " path " : " cifar10_multi_gpu_train . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " Cifar10 Eval ( + stats ) " , <nl> + " path " : " cifar10_eval . pbtxt " , <nl> + " runMetadata " : [ <nl> + { <nl> + " tag " : " step0 " , <nl> + " path " : " cifar10_eval_step0 . pbtxt " <nl> + } , <nl> + { <nl> + " tag " : " step10 " , <nl> + " path " : " cifar10_eval_step10 . pbtxt " <nl> + } , <nl> + { <nl> + " tag " : " step20 " , <nl> + " path " : " cifar10_eval_step20 . pbtxt " <nl> + } <nl> + ] <nl> + } , <nl> + { <nl> + " name " : " Fatcat LSTM " , <nl> + " path " : " fatcat_lstm . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " Legacy Inception Renamed " , <nl> + " path " : " legacy_inception_renamed . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " Wolfe ( Broken ) " , <nl> + " path " : " wolfe1 . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " Wolfe ( Fixed ) " , <nl> + " path " : " wolfe2 . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " AlexNet " , <nl> + " path " : " alexnet . pbtxt " <nl> + } , <nl> + { <nl> + " name " : " TestError404 " , <nl> + " path " : " nofile " <nl> + } <nl> + ] <nl> mmm a / tensorflow / tensorboard / components / tf - graph / demo / tf - graph - demo . html <nl> ppp b / tensorflow / tensorboard / components / tf - graph / demo / tf - graph - demo . html <nl> <nl> < script > <nl> ( function ( ) { <nl> <nl> - var datasets = [ <nl> - { <nl> - name : " Mnist Eval " , <nl> - path : " mnist_eval . pbtxt " , <nl> - } , <nl> - { <nl> - name : " Mnist with summaries ( + stats ) " , <nl> - path : " mnist_with_summaries . pbtxt " , <nl> - runMetadata : [ <nl> - { <nl> - tag : " step100 " , <nl> - path : " mnist_with_summaries_step100 . pbtxt " <nl> - } , <nl> - { <nl> - tag : " step1000 " , <nl> - path : " mnist_with_summaries_step1000 . pbtxt " <nl> - } <nl> - ] <nl> - } , <nl> - { <nl> - name : " Mnist Train ( with shapes ) " , <nl> - path : " mnist_train_shapes . pbtxt " , <nl> - } , <nl> - { <nl> - name : " Inception Train ( huge ) " , <nl> - path : " inception_train . pbtxt " , <nl> - } , <nl> - { <nl> - name : " Inception Train Eval " , <nl> - path : " inception_train_eval . pbtxt " , <nl> - } , <nl> - { <nl> - name : " Inception Test " , <nl> - path : " inception_test_eval . pbtxt " , <nl> - } , <nl> - { <nl> - name : " PTB Word LSTM Train " , <nl> - path : " ptb_word_lstm_train . pbtxt " , <nl> - } , <nl> - { <nl> - name : " PTB Word LSTM Train Eval " , <nl> - path : " ptb_word_lstm_train_eval . pbtxt " , <nl> - } , <nl> - { <nl> - name : " PTB Word LSTM Test " , <nl> - path : " ptb_word_lstm_test_eval . pbtxt " , <nl> - } , <nl> - { <nl> - name : " Cifar10 Train ( + stats ) " , <nl> - path : " cifar10_train . pbtxt " , <nl> - runMetadata : [ <nl> - { <nl> - tag : " step0 " , <nl> - path : " cifar10_train_step0 . pbtxt " <nl> - } , <nl> - { <nl> - tag : " step100 " , <nl> - path : " cifar10_train_step100 . pbtxt " <nl> - } , <nl> - { <nl> - tag : " step200 " , <nl> - path : " cifar10_train_step200 . pbtxt " <nl> - } , <nl> - { <nl> - tag : " step300 " , <nl> - path : " cifar10_train_step300 . pbtxt " <nl> - } <nl> - ] <nl> - } , <nl> - { <nl> - name : " Cifar10 Multi - GPU Train " , <nl> - path : " cifar10_multi_gpu_train . pbtxt " , <nl> - } , <nl> - { <nl> - name : " Cifar10 Eval ( + stats ) " , <nl> - path : " cifar10_eval . pbtxt " , <nl> - runMetadata : [ <nl> - { <nl> - tag : " step0 " , <nl> - path : " cifar10_eval_step0 . pbtxt " <nl> - } , <nl> - { <nl> - tag : " step10 " , <nl> - path : " cifar10_eval_step10 . pbtxt " <nl> - } , <nl> - { <nl> - tag : " step20 " , <nl> - path : " cifar10_eval_step20 . pbtxt " <nl> - } , <nl> - ] <nl> - } , <nl> - { <nl> - name : " Fatcat LSTM " , <nl> - path : " fatcat_lstm . pbtxt " , <nl> - } , <nl> - { <nl> - name : " Legacy Inception Renamed " , <nl> - path : " legacy_inception_renamed . pbtxt " , <nl> - } , <nl> - { <nl> - name : " Wolfe ( Broken ) " , <nl> - path : " wolfe1 . pbtxt " , <nl> - } , <nl> - { <nl> - name : " Wolfe ( Fixed ) " , <nl> - path : " wolfe2 . pbtxt " , <nl> - } , <nl> - { <nl> - name : " AlexNet " , <nl> - path : " alexnet . pbtxt " , <nl> - } , <nl> - { <nl> - name : " TestError404 " , <nl> - path : " nofile " <nl> - } <nl> - ] ; <nl> - <nl> Polymer ( { <nl> is : ' tf - graph - demo ' , <nl> properties : { <nl> datasets : { <nl> - type : Object , <nl> - value : function ( ) { <nl> - return this . _getDatasets ( ) ; <nl> - } <nl> + type : Object <nl> } , <nl> selectedDataset : { <nl> type : Number , <nl> <nl> _renderHierarchy : Object , <nl> _progress : Object <nl> } , <nl> + created : function ( ) { <nl> + if ( typeof DEMO_DATASETS = = = ' undefined ' ) { <nl> + DEMO_DATASETS = ' demo_datasets . json ' ; <nl> + } <nl> + d3 . json ( DEMO_DATASETS , function ( error , datasets ) { <nl> + if ( error ) { <nl> + console . log ( ' Error loading demo datasets : ' ) ; <nl> + console . log ( error ) ; <nl> + return ; <nl> + } <nl> + <nl> + if ( typeof DEMO_DIR_PREFIX = = = ' undefined ' ) { <nl> + DEMO_DIR_PREFIX = ' ' ; <nl> + } <nl> + _ . each ( datasets , function ( dataset ) { <nl> + dataset . path = this . _normalizePath ( dataset . path ) ; <nl> + if ( dataset . runMetadata ! = null ) { <nl> + _ . each ( dataset . runMetadata , function ( metadata ) { <nl> + metadata . path = this . _normalizePath ( metadata . path ) ; <nl> + } , this ) ; <nl> + } <nl> + } , this ) ; <nl> + this . set ( ' datasets ' , datasets ) ; <nl> + } . bind ( this ) ) ; <nl> + } , <nl> _normalizePath : function ( path ) { <nl> return this . resolveUrl ( ' tf_model_zoo / ' + path ) <nl> . replace ( ' tf_model_zoo ' , DEMO_DIR_PREFIX + ' tf_model_zoo ' ) ; <nl> - } , <nl> - _getDatasets : function ( ) { <nl> - if ( typeof DEMO_DIR_PREFIX = = = ' undefined ' ) { <nl> - DEMO_DIR_PREFIX = ' ' ; <nl> - } <nl> - _ . each ( datasets , function ( dataset ) { <nl> - dataset . path = this . _normalizePath ( dataset . path ) ; <nl> - if ( dataset . runMetadata ! = null ) { <nl> - _ . each ( dataset . runMetadata , function ( metadata ) { <nl> - metadata . path = this . _normalizePath ( metadata . path ) ; <nl> - } , this ) ; <nl> - } <nl> - } , this ) ; <nl> - return datasets ; <nl> } <nl> } ) ; <nl> } ) ( ) ; <nl>
|
Split the demo datasets JSON file for the tf graph demo out into an external file .
|
tensorflow/tensorflow
|
dd92f1b28ab8a084b0c210c59d4d23e28392ad16
|
2016-07-06T19:03:41Z
|
mmm a / dbms / src / Formats / JSONEachRowRowInputStream . cpp <nl> ppp b / dbms / src / Formats / JSONEachRowRowInputStream . cpp <nl> enum <nl> NESTED_FIELD = size_t ( - 2 ) <nl> } ; <nl> <nl> - } / / unnamed namespace <nl> + } <nl> <nl> <nl> JSONEachRowRowInputStream : : JSONEachRowRowInputStream ( ReadBuffer & istr_ , const Block & header_ , const FormatSettings & format_settings ) <nl> JSONEachRowRowInputStream : : JSONEachRowRowInputStream ( ReadBuffer & istr_ , const B <nl> size_t num_columns = header . columns ( ) ; <nl> for ( size_t i = 0 ; i < num_columns ; + + i ) <nl> { <nl> - const String & colname = columnName ( i ) ; <nl> + const String & colname = columnName ( i ) ; <nl> name_map [ colname ] = i ; / / / NOTE You could place names more cache - locally . <nl> if ( format_settings . import_nested_json ) <nl> { <nl> JSONEachRowRowInputStream : : JSONEachRowRowInputStream ( ReadBuffer & istr_ , const B <nl> } <nl> } <nl> <nl> - const String & JSONEachRowRowInputStream : : columnName ( size_t i ) const <nl> + const String & JSONEachRowRowInputStream : : columnName ( size_t i ) const <nl> { <nl> - return header . safeGetByPosition ( i ) . name ; <nl> + return header . getByPosition ( i ) . name ; <nl> } <nl> <nl> size_t JSONEachRowRowInputStream : : columnIndex ( const StringRef & name ) const <nl>
|
Minor modifications
|
ClickHouse/ClickHouse
|
9a50300e42b693defc98ed412e6284edfa189d93
|
2018-10-09T18:14:30Z
|
mmm a / language / Greek / strings . xml <nl> ppp b / language / Greek / strings . xml <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " standalone = " yes " ? > <nl> - < ! - - $ Revision $ - - > < ! - - Translator : Ydatografida / Email : ydatografida @ gmail . com / Date of translation : 03 / 04 / 2012 / Last update ( by CutSickAss ) : 08 / 03 / 2012 / Based on english strings version 1E + 42 - - > <nl> + < ! - - $ Revision $ - - > < ! - - Translator : Ydatografida / Email : ydatografida @ gmail . com / Date of translation : 03 / 04 / 2012 / Last update ( by CutSickAss ) : 13 / 03 / 2012 / Based on english strings version 1E + 42 - - > <nl> < strings > <nl> < string id = " 0 " > Εφαρμογές < / string > <nl> < string id = " 1 " > Φωτογραφίες < / string > <nl> <nl> < string id = " 247 " > Scripts < / string > <nl> < string id = " 248 " > Γλώσσα < / string > <nl> < string id = " 249 " > Μουσική < / string > <nl> - < string id = " 250 " > Απεικόνιση < / string > <nl> + < string id = " 250 " > Οπτικοποίηση < / string > <nl> < string id = " 251 " > Επιλογή καταλόγου προορισμού < / string > <nl> < string id = " 252 " > Στέρεο έξοδος σ ' όλα τα ηχεία < / string > <nl> < string id = " 253 " > Αριθμός καναλιών < / string > <nl> <nl> < string id = " 369 " > Τίτλος < / string > <nl> < string id = " 370 " > Καταιγίδες < / string > <nl> < string id = " 371 " > Διάσπαρτα < / string > <nl> - < string id = " 372 " > Υετός < / string > <nl> + < string id = " 372 " > Επί το πλείστον < / string > <nl> < string id = " 373 " > Αίθριος < / string > <nl> < string id = " 374 " > Νέφη < / string > <nl> < string id = " 375 " > Χιόνι < / string > <nl> <nl> < string id = " 387 " > Νεφοσκεπής < / string > <nl> < string id = " 388 " > τις πρώτες πρωινές ώρες < / string > <nl> < string id = " 389 " > Μπόρα < / string > <nl> - < string id = " 390 " > Σύντομες ελαφρές χιονοπτώσεις < / string > <nl> + < string id = " 390 " > Ελαφρές χιονοπτώσεις < / string > <nl> < string id = " 391 " > Ελαχ . < / string > <nl> < string id = " 392 " > Μεσ . < / string > <nl> < string id = " 393 " > Μεγ . < / string > <nl> <nl> < string id = " 495 " > Αύξηση δειγματοληψίας ανάλυσης σε γραφικό περιβάλλον ( GUI ) < / string > <nl> < string id = " 496 " > Βαθμονόμηση < / string > <nl> < string id = " 497 " > Εμφάνιση επεκτάσεων αρχείων < / string > <nl> - < string id = " 498 " > Ταξιν : Τύπος < / string > <nl> + < string id = " 498 " > Ταξ . : Τύπος < / string > <nl> < string id = " 499 " > Αδυναμία σύνδεσης στην υπηρεσία έρευνας < / string > <nl> < string id = " 500 " > Απέτυχε η λήψη των πληροφοριών άλμπουμ < / string > <nl> < string id = " 501 " > Αναζήτηση για ονόματα άλμπουμ . . . < / string > <nl> <nl> < string id = " 503 " > Απασχολημένο < / string > <nl> < string id = " 504 " > Κενός < / string > <nl> < string id = " 505 " > Φόρτωση πληροφοριών πολυμέσων . . . < / string > <nl> - < string id = " 507 " > Ταξιν : Χρήση < / string > <nl> - < string id = " 510 " > Ενεργοποίηση απεικονίσεων < / string > <nl> + < string id = " 507 " > Ταξ . : Χρήση < / string > <nl> + < string id = " 510 " > Ενεργοποίηση οπτικοποιήσεων < / string > <nl> < string id = " 511 " > Ενεργοποίηση εναλλαγής λειτουργίας βίντεο < / string > <nl> < string id = " 512 " > Παράθυρο εκκίνησης < / string > <nl> < string id = " 513 " > Αρχική οθόνη < / string > <nl> <nl> < string id = " 1034 " > Yπομενού < / string > <nl> < string id = " 1035 " > Ενεργοποίηση πλήκτρων υπομενού < / string > <nl> < string id = " 1036 " > Αγαπημένα < / string > <nl> - < string id = " 1037 " > Επεκτάσεις βίντεο < / string > <nl> - < string id = " 1038 " > Επεκτάσεις μουσικής < / string > <nl> - < string id = " 1039 " > Επεκτάσεις εικόνας < / string > <nl> + < string id = " 1037 " > Πρόσθετα βίντεο < / string > <nl> + < string id = " 1038 " > Πρόσθετα μουσικής < / string > <nl> + < string id = " 1039 " > Πρόσθετα εικόνας < / string > <nl> < string id = " 1040 " > Φόρτωση φακέλου < / string > <nl> < string id = " 1041 " > Ανακτήθηκαν % i αντικείμενα < / string > <nl> < string id = " 1042 " > Ανακτήθηκαν % i από % i αντικείμενα < / string > <nl> - < string id = " 1043 " > Επεκτάσεις εφαρμογής < / string > <nl> - < string id = " 1044 " > Ορισμός πρόσθετου σελιδοδείκτη < / string > <nl> - < string id = " 1045 " > Ρυθμίσεις επέκτασης < / string > <nl> + < string id = " 1043 " > Πρόσθετες εφαρμογές < / string > <nl> + < string id = " 1044 " > Ορισμός μικρογραφίας plugin < / string > <nl> + < string id = " 1045 " > Ρυθμίσεις πρόσθετου < / string > <nl> < string id = " 1046 " > Σημεία πρόσβασης < / string > <nl> < string id = " 1047 " > Άλλα . . . < / string > <nl> < string id = " 1048 " > - Όνομα χρήστη < / string > <nl> <nl> < string id = " 10034 " > Ρυθμίσεις - Προφίλ < / string > <nl> < string id = " 10040 " > Περιηγητής Πρόσθετων < / string > <nl> <nl> - < string id = " 10100 " > Διάλογος Ναι / Όχι < / string > <nl> - < string id = " 10101 " > Διάλογος διαδικασίας < / string > <nl> + < string id = " 10100 " > Παράθυρο Ναι / Όχι < / string > <nl> + < string id = " 10101 " > Παράθυρο διαδικασίας < / string > <nl> <nl> < string id = " 10210 " > Αναζήτηση για υπότιτλους . . . < / string > <nl> < string id = " 10211 " > Προσωρινή αποθήκευση υπότιτλων . . . < / string > <nl> <nl> < string id = " 10523 " > Πληροφορίες < / string > <nl> < string id = " 10524 " > Πληροφορίες ταινίας < / string > <nl> <nl> - < string id = " 12000 " > Επιλογή διαλόγου < / string > <nl> + < string id = " 12000 " > Παράθυρο επιλογής < / string > <nl> < string id = " 12001 " > Μουσική / Πληροφορίες < / string > <nl> - < string id = " 12002 " > Διάλογος OK < / string > <nl> + < string id = " 12002 " > Παράθυρο OK < / string > <nl> < string id = " 12003 " > Βίντεο / Πληροφορίες < / string > <nl> < string id = " 12004 " > Scripts / Πληροφορίες < / string > <nl> < string id = " 12005 " > Βίντεο πλήρους οθόνης < / string > <nl> - < string id = " 12006 " > Απεικόνιση μουσικής < / string > <nl> + < string id = " 12006 " > Μουσική οπτικοποίηση < / string > <nl> <nl> - < string id = " 12008 " > Διάλογος στοιβαγμένου αρχείου < / string > <nl> + < string id = " 12008 " > Παράθυρο στοιβαγμένου αρχείου < / string > <nl> < string id = " 12009 " > Ανακατασκευή περιεχομένων . . . < / string > <nl> < string id = " 12010 " > Επιστροφή στη μουσική < / string > <nl> < string id = " 12011 " > Επιστροφή στα βίντεο < / string > <nl> <nl> < string id = " 12326 " > Εισαγωγή κωδικού πρόσβασης < / string > <nl> < string id = " 12327 " > Εισαγωγή κεντρικού κωδικού < / string > <nl> < string id = " 12328 " > Εισάγετε κωδικό ξεκλειδώματος < / string > <nl> - < string id = " 12329 " > ή πατήστε C για ακύρωση < / string > <nl> + < string id = " 12329 " > ή πιέστε C για ακύρωση < / string > <nl> < string id = " 12330 " > Εισάγετε συνδυασμό πλήκτρων και < / string > <nl> - < string id = " 12331 " > πατήστε Εντάξει , ή Επιστροφή για ακύρωση < / string > <nl> + < string id = " 12331 " > πιέστε Εντάξει , ή Επιστροφή για ακύρωση < / string > <nl> < string id = " 12332 " > Τοποθέτηση κλειδώματος < / string > <nl> < string id = " 12333 " > Ξεκλείδωμα < / string > <nl> < string id = " 12334 " > Επανατοποθέτηση κλειδώματος < / string > <nl> <nl> < string id = " 12362 " > Απενεργοποίηση συστήματος όταν εξαντληθούν οι προσπάθειες εισαγωγής < / string > <nl> < string id = " 12367 " > Ο κεντρικός κωδικός δεν είναι έγκυρος < / string > <nl> < string id = " 12368 " > Παρακαλώ , εισάγετε έναν έγκυρο κεντρικό κωδικό < / string > <nl> - < string id = " 12373 " > Ρυθμίσεις & amp ; διαχείριση αρχείων < / string > <nl> + < string id = " 12373 " > Ρυθμίσεις & amp ; διαχείριση αρχείων < / string > <nl> < string id = " 12376 " > Ορισμός ως προεπιλογή για όλες τις ταινίες < / string > <nl> < string id = " 12377 " > Διαγράφει όλες τις προηγούμενες αποθηκευμένες τιμές < / string > <nl> < string id = " 12378 " > Χρονικό διάστημα προβολής κάθε εικόνας < / string > <nl> <nl> < string id = " 13106 " > Ανενεργός < / string > <nl> < string id = " 13107 " > Ενεργός κατά την αναπαραγωγή βίντεο < / string > <nl> < string id = " 13108 " > Πάντα ενεργός < / string > <nl> - < string id = " 13109 " > Δοκιμή ανάλυσης < / string > <nl> + < string id = " 13109 " > Δοκιμή & amp ; εφαρμογή ανάλυσης < / string > <nl> < string id = " 13110 " > Αποθήκευση ανάλυσης ; < / string > <nl> < string id = " 13111 " > Θέλετε να διατηρήσετε αυτή την ανάλυση ; < / string > <nl> <nl> <nl> < string id = " 13386 " > Αναζήτηση βασισμένη στην χρήση χρόνου < / string > <nl> < string id = " 13387 " > Πρότυπο ονομασίας κομματιού ( δεξιά πλευρά ) < / string > <nl> < string id = " 13388 " > Προκαθορισμένα < / string > <nl> - < string id = " 13389 " > Δεν υπάρχουν διαθέσιμα προκαθορισμένα γι ' αυτή την απεικόνιση < / string > <nl> - < string id = " 13390 " > Δεν υπάρχουν διαθέσιμες ρυθμίσεις γι ' αυτή την απεικόνιση < / string > <nl> + < string id = " 13389 " > Δεν υπάρχουν διαθέσιμα προκαθορισμένα & # 10 ; γι ' αυτή την οπτικοποίηση < / string > <nl> + < string id = " 13390 " > Δεν υπάρχουν διαθέσιμες ρυθμίσεις & # 10 ; γι ' αυτή την οπτικοποίηση < / string > <nl> < string id = " 13391 " > Εξαγωγή / Εισαγωγή < / string > <nl> - < string id = " 13392 " > Χρήση απεικονίσεων κατά την αναπαραγωγή ήχου < / string > <nl> + < string id = " 13392 " > Χρήση οπτικοποιήσεων κατά την αναπαραγωγή μουσικής < / string > <nl> < string id = " 13393 " > Υπολόγισε το μέγεθος < / string > <nl> < string id = " 13394 " > Υπολογισμός μεγέθους φακέλου < / string > <nl> < string id = " 13395 " > Ρυθμίσεις βίντεο < / string > <nl> <nl> < string id = " 14089 " > Χρήση γραμματοσειράς στους υπότιτλους < / string > <nl> < string id = " 14090 " > Διεθνοποίηση < / string > <nl> < string id = " 14091 " > Κωδικοποίηση χαρακτήρων < / string > <nl> - < string id = " 14092 " > Αποσφαλμάτωση < / string > <nl> + < string id = " 14092 " > Εντοπισμός σφαλμάτων < / string > <nl> < string id = " 14093 " > Ασφάλεια < / string > <nl> < string id = " 14094 " > Συσκευές εισόδου < / string > <nl> < string id = " 14095 " > Εξοικονόμηση ενέργειας < / string > <nl> <nl> < string id = " 20000 " > Φάκελος αποθήκευσης μουσικής < / string > <nl> < string id = " 20001 " > Χρήση εξωτερικού αναπαραγωγέα DVD < / string > <nl> < string id = " 20002 " > Εξωτερικός αναπαραγωγέας DVD < / string > <nl> - < string id = " 20003 " > Φάκελος εκπαιδευτών < / string > <nl> + < string id = " 20003 " > Φάκελος trainers < / string > <nl> < string id = " 20004 " > Φάκελος στιγμιότυπου < / string > <nl> <nl> < string id = " 20006 " > Φάκελος λίστας αναπαραγωγής < / string > <nl> <nl> <nl> < string id = " 20189 " > Ενεργοποίηση αυτόματης κύλισης στην επισκόπηση πλοκής & amp ; κριτικής < / string > <nl> < string id = " 20190 " > Προσαρμογή < / string > <nl> - < string id = " 20191 " > Ενεργοποίηση καταγραφής αποσφαλμάτωσης < / string > <nl> + < string id = " 20191 " > Ενεργοποίηση καταγραφής σφαλμάτων ( debug log ) < / string > <nl> < string id = " 20192 " > Λήψη πρόσθετων πληροφοριών κατά τις ενημερώσεις συλλογής < / string > <nl> < string id = " 20193 " > Προκαθορισμένη υπηρεσία πληροφοριών άλμπουμ < / string > <nl> < string id = " 20194 " > Προκαθορισμένη υπηρεσία πληροφοριών καλλιτέχνη < / string > <nl> <nl> < string id = " 20332 " > Χρήση φακέλων ή ονομάτων αρχείων στις αναζητήσεις ; < / string > <nl> < string id = " 20333 " > Ορισμός περιεχομένου < / string > <nl> < string id = " 20334 " > Φάκελος < / string > <nl> - < string id = " 20335 " > Κατόπτευση κατ ' επανάληψη του περιεχομένου ; < / string > <nl> + < string id = " 20335 " > Έλεγχος περιεχομένου κατ ' επανάληψη ; < / string > <nl> < string id = " 20336 " > Ξεκλείδωμα πηγών < / string > <nl> < string id = " 20337 " > Ηθοποιός < / string > <nl> < string id = " 20338 " > Ταινία < / string > <nl> <nl> < string id = " 21367 " > Ταινία & amp ; εναλλακτικός φάκελος υποτίτλων < / string > <nl> < string id = " 21368 " > Παράκαμψη γραμματοσειρών υποτίτλων ASS / SSA < / string > <nl> <nl> - < string id = " 21369 " > Ενεργοποίηση ποντικιού < / string > <nl> + < string id = " 21369 " > Ενεργοποίηση ποντικιού και υποστήριξης Οθόνης Αφής < / string > <nl> < string id = " 21370 " > Ενεργοποίηση ήχων πλοήγησης κατά την εκτέλεση πολυμέσων < / string > <nl> < string id = " 21371 " > Μικρογραφία < / string > <nl> < string id = " 21372 " > Περιοχή αναπαραγωγέα DVD < / string > <nl> < string id = " 21373 " > Έξοδος βίντεο < / string > <nl> - < string id = " 21374 " > Απεικόνιση οθόνης < / string > <nl> + < string id = " 21374 " > Αναλογία οθόνης < / string > <nl> < string id = " 21375 " > Κανονική < / string > <nl> < string id = " 21376 " > Letterbox < / string > <nl> < string id = " 21377 " > Ευρεία προβολή < / string > <nl> <nl> < string id = " 22011 " > Θερμοκρασία CPU : < / string > <nl> < string id = " 22012 " > Συνολική μνήμη < / string > <nl> < string id = " 22013 " > Δεδομένα προφίλ < / string > <nl> - < string id = " 22014 " > Χρήση ' Αμυδρού φωτός ' κατά τη παύση της αναπαραγωγής βίντεο < / string > <nl> + < string id = " 22014 " > Χρήση ' Αμυδρού φωτός ' κατά την παύση της αναπαραγωγής βίντεο < / string > <nl> < string id = " 22015 " > Όλες οι εγγραφές < / string > <nl> < string id = " 22016 " > Aνά τίτλο < / string > <nl> < string id = " 22017 " > Ανά ομάδα < / string > <nl> < string id = " 22018 " > Δικτυακά κανάλια < / string > <nl> < string id = " 22019 " > Εγγραφές ανά τίτλο < / string > <nl> < string id = " 22020 " > Οδηγός < / string > <nl> - < string id = " 22021 " > Επιτρεπόμενο σφάλμα στο λόγο απεικόνισης για να ελαχιστοποιηθούν οι μαύρες μπάρες < / string > <nl> + < string id = " 22021 " > Επιτρεπόμενο σφάλμα στην αναλογία οθόνης για να ελαχιστοποιηθούν οι μαύρες μπάρες < / string > <nl> < string id = " 22022 " > Εμφάνιση αρχείων βίντεο στις λίστες < / string > <nl> < string id = " 22023 " > Κατασκευαστής DirectX : < / string > <nl> < string id = " 22024 " > Έκδοση Direct3D : < / string > <nl> <nl> < string id = " 24007 " > Πληροφορίες ταινίας < / string > <nl> < string id = " 24008 " > Προφύλαξη οθόνης < / string > <nl> < string id = " 24009 " > Script < / string > <nl> - < string id = " 24010 " > Απεικόνιση < / string > <nl> - < string id = " 24011 " > Φύλαξη πρόσθετου < / string > <nl> + < string id = " 24010 " > Οπτικοποίηση < / string > <nl> + < string id = " 24011 " > Αποθετήριο πρόσθετων < / string > <nl> < string id = " 24012 " > Υπότιτλοι < / string > <nl> < string id = " 24013 " > Στίχοι < / string > <nl> < string id = " 24014 " > Πληροφορίες τηλεόρασης < / string > <nl> <nl> < string id = " 24032 " > Όλα τα πρόσθετα < / string > <nl> < string id = " 24033 " > Λήψη πρόσθετων < / string > <nl> < string id = " 24034 " > Έλεγχος για ενημερώσεις < / string > <nl> - < string id = " 24035 " > Αναγκασμένη ανανέωση < / string > <nl> + < string id = " 24035 " > Εξαναγκασμένη ανανέωση < / string > <nl> < string id = " 24036 " > Καταγραφή αλλαγών < / string > <nl> < string id = " 24037 " > Κατάργηση εγκατάστασης < / string > <nl> < string id = " 24038 " > Εγκατάσταση < / string > <nl> <nl> < string id = " 24042 " > Λήψη % i % % < / string > <nl> < string id = " 24043 " > Διαθέσιμες ενημερώσεις < / string > <nl> < string id = " 24044 " > Δεν πληρούνται οι Εξαρτήσεις < / string > <nl> - < string id = " 24045 " > Η Επέκταση δεν έχει τη σωστή δομή < / string > <nl> - < string id = " 24046 " > % s χρησιμοποιείται από την εγκατεστημένη ( νες ) Επέκταση ( εις ) < / string > <nl> - < string id = " 24047 " > Αδυναμία απεγκατάστασης αυτής της Επέκτασης < / string > <nl> + < string id = " 24045 " > Το Πρόσθετο δεν έχει τη σωστή δομή < / string > <nl> + < string id = " 24046 " > % s χρησιμοποιείται από τα εγκατεστημένα Πρόσθετα < / string > <nl> + < string id = " 24047 " > Αδυναμία απεγκατάστασης αυτού του Πρόσθετου < / string > <nl> < string id = " 24048 " > Επαναφορά < / string > <nl> <nl> < string id = " 24050 " > Διαθέσιμα πρόσθετα < / string > <nl> <nl> < string id = " 33018 " > Σήμερα το βράδυ < / string > <nl> < string id = " 33019 " > Αύριο το βράδυ < / string > <nl> < string id = " 33020 " > Kατάσταση καιρού < / string > <nl> - < string id = " 33021 " > Υετός < / string > <nl> + < string id = " 33021 " > Βροχόπτωση < / string > <nl> < string id = " 33022 " > Βροχή < / string > <nl> < string id = " 33023 " > Υγρασία < / string > <nl> < string id = " 33024 " > Αίσθηση < / string > <nl> <nl> < string id = " 33078 " > Επόμενη σελίδα < / string > <nl> < string id = " 33079 " > Αγαπητό < / string > <nl> < string id = " 33080 " > Απεχθές < / string > <nl> - < string id = " 33081 " > Αυτό το αρχείο είναι στοιβαγμένο , επιλέξτε το μέρος αυτού που επιθυμείτε να αναπαραχθεί . < / string > <nl> + < string id = " 33081 " > Αυτό το αρχείο είναι στοιβαγμένο , επιλέξτε από που να γίνει αναπαραγωγή . < / string > <nl> < string id = " 33082 " > Διαδρομή για το script < / string > <nl> < string id = " 33083 " > Ενεργοποίηση προσαρμοσμένου πλήκτρου script < / string > <nl> <nl> <nl> < string id = " 35001 " > Γενική συσκευή HID < / string > <nl> < string id = " 35002 " > Γενικός προσαρμογέας δικτύου < / string > <nl> < string id = " 35003 " > Γενικός δίσκος < / string > <nl> - < string id = " 35004 " > Δεν υπάρχουν διαθέσιμες ρυθμίσεις για αυτό το περιφερειακό . < / string > <nl> + < string id = " 35004 " > Δεν υπάρχουν διαθέσιμες ρυθμίσεις & # 10 ; για αυτό το περιφερειακό . < / string > <nl> < string id = " 35005 " > Η νέα συσκευή έχει ρυθμιστεί < / string > <nl> < string id = " 35006 " > Η συσκευή έχει αφαιρεθεί < / string > <nl> < string id = " 35007 " > Το Keymap να χρησιμοποιηθεί για τη συγκεκριμένη συσκευή < / string > <nl> <nl> < string id = " 36001 " > Pulse - Eight Nyxboard < / string > <nl> < string id = " 36002 " > Μετάβαση στο πληκτρολόγιο εντολών < / string > <nl> < string id = " 36003 " > Ενεργοποίηση διακόπτη εντολών < / string > <nl> - < string id = " 36004 " > Πατήστε το " user " ως πλήκτρο εντολών < / string > <nl> + < string id = " 36004 " > Πιέστε το " user " ως πλήκτρο εντολών < / string > <nl> < string id = " 36005 " > Ενεργοποίηση διακόπτη εντολών < / string > <nl> < string id = " 36006 " > Αδυναμία εκκίνησης του προσαρμογέα < / string > <nl> - < string id = " 36007 " > Ενεργοποιήστε την τηλεόραση κατά την εκκίνηση του XBMC < / string > <nl> + < string id = " 36007 " > Ενεργοποίηση της τηλεόρασης κατά την εκκίνηση του XBMC < / string > <nl> < string id = " 36008 " > Απενεργοποίηση συσκευών κατά τη διακοπή λειτουργίας του XBMC < / string > <nl> - < string id = " 36009 " > Βάλτε συσκευές σε κατάσταση αναμονής κατά την ενεργοποίηση της προφύλαξης οθόνης < / string > <nl> + < string id = " 36009 " > Συσκευές σε κατάσταση αναμονής κατά την προφύλαξη οθόνης < / string > <nl> < string id = " 36010 " > < / string > <nl> < string id = " 36011 " > Δεν ήταν δυνατή η ανίχνευση της θύρας CEC . Ρυθμίστε την χειροκίνητα . < / string > <nl> < string id = " 36012 " > Δεν ήταν δυνατή η ανίχνευση του προσαρμογέα CEC . < / string > <nl>
|
Merge pull request from CutSickAss / patch - 13
|
xbmc/xbmc
|
33464a57a7bad970ecde6728fa804bc69fe3e013
|
2012-03-13T17:03:31Z
|
mmm a / eosio_build . sh <nl> ppp b / eosio_build . sh <nl> <nl> - DCMAKE_C_COMPILER = " $ { C_COMPILER } " - DWASM_ROOT = " $ { WASM_ROOT } " - DCORE_SYMBOL_NAME = " $ { CORE_SYMBOL_NAME } " \ <nl> - DOPENSSL_ROOT_DIR = " $ { OPENSSL_ROOT_DIR } " - DBUILD_MONGO_DB_PLUGIN = true \ <nl> - DENABLE_COVERAGE_TESTING = " $ { ENABLE_COVERAGE_TESTING } " - DBUILD_DOXYGEN = " $ { DOXYGEN } " \ <nl> - - DCMAKE_INSTALL_PREFIX = " / usr / local / eosio " " $ { SOURCE_DIR } " <nl> + - DCMAKE_INSTALL_PREFIX = " / usr / local / eosio " $ { LOCAL_CMAKE_FLAGS } " $ { SOURCE_DIR } " <nl> then <nl> printf " \ \ n \ \ t > > > > > > > > > > > > > > > > > > > > CMAKE building EOSIO has exited with the above error . \ \ n \ \ n " <nl> exit - 1 <nl>
|
Merge pull request from kesar / patch - 1
|
EOSIO/eos
|
4ce71b6e30d7c9939aaa445b8f80874775e525d0
|
2018-10-02T13:40:12Z
|
mmm a / cmake / modules / AddSwift . cmake <nl> ppp b / cmake / modules / AddSwift . cmake <nl> function ( _add_variant_c_compile_flags ) <nl> endforeach ( ) <nl> endif ( ) <nl> <nl> + set ( ICU_UC_INCLUDE_DIR $ { SWIFT_ $ { CFLAGS_SDK } _ $ { CFLAGS_ARCH } _ICU_UC_INCLUDE } ) <nl> + if ( NOT " $ { ICU_UC_INCLUDE_DIR } " STREQUAL " " AND <nl> + NOT " $ { ICU_UC_INCLUDE_DIR } " STREQUAL " / usr / include " AND <nl> + NOT " $ { ICU_UC_INCLUDE_DIR } " STREQUAL " / usr / $ { SWIFT_SDK_ $ { CFLAGS_SDK } _ARCH_ $ { CFLAGS_ARCH } _TRIPLE } / include " AND <nl> + NOT " $ { ICU_UC_INCLUDE_DIR } " STREQUAL " / usr / $ { SWIFT_SDK_ $ { SWIFT_HOST_VARIANT_SDK } _ARCH_ $ { SWIFT_HOST_VARIANT_ARCH } _TRIPLE } / include " ) <nl> + if ( SWIFT_COMPILER_IS_MSVC_LIKE ) <nl> + list ( APPEND result - I ; $ { ICU_UC_INCLUDE_DIR } ) <nl> + else ( ) <nl> + list ( APPEND result - isystem ; $ { ICU_UC_INCLUDE_DIR } ) <nl> + endif ( ) <nl> + endif ( ) <nl> + <nl> + set ( ICU_I18N_INCLUDE_DIR $ { SWIFT_ $ { CFLAGS_SDK } _ $ { CFLAGS_ARCH } _ICU_I18N_INCLUDE } ) <nl> + if ( NOT " $ { ICU_I18N_INCLUDE_DIR } " STREQUAL " " AND <nl> + NOT " $ { ICU_I18N_INCLUDE_DIR } " STREQUAL " / usr / include " AND <nl> + NOT " $ { ICU_I18N_INCLUDE_DIR } " STREQUAL " / usr / $ { SWIFT_SDK_ $ { CFLAGS_SDK } _ARCH_ $ { CFLAGS_ARCH } _TRIPLE } / include " AND <nl> + NOT " $ { ICU_I18N_INCLUDE_DIR } " STREQUAL " / usr / $ { SWIFT_SDK_ $ { SWIFT_HOST_VARIANT_SDK } _ARCH_ $ { SWIFT_HOST_VARIANT_ARCH } _TRIPLE } / include " ) <nl> + if ( SWIFT_COMPILER_IS_MSVC_LIKE ) <nl> + list ( APPEND result - I ; $ { ICU_I18N_INCLUDE_DIR } ) <nl> + else ( ) <nl> + list ( APPEND result - isystem ; $ { ICU_I18N_INCLUDE_DIR } ) <nl> + endif ( ) <nl> + endif ( ) <nl> + <nl> set ( " $ { CFLAGS_RESULT_VAR_NAME } " " $ { result } " PARENT_SCOPE ) <nl> endfunction ( ) <nl> <nl> function ( _add_swift_library_single target name ) <nl> RESULT_VAR_NAME c_compile_flags <nl> ) <nl> <nl> - if ( SWIFTLIB_SINGLE_TARGET_LIBRARY ) <nl> - if ( NOT " $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_UC_INCLUDE } " STREQUAL " " AND <nl> - NOT " $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_UC_INCLUDE } " STREQUAL " / usr / include " AND <nl> - NOT " $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_UC_INCLUDE } " STREQUAL " / usr / $ { SWIFT_SDK_ $ { SWIFTLIB_SINGLE_SDK } _ARCH_ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _TRIPLE } / include " AND <nl> - NOT " $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_UC_INCLUDE } " STREQUAL " / usr / $ { SWIFT_SDK_ $ { SWIFT_HOST_VARIANT_SDK } _ARCH_ $ { SWIFT_HOST_VARIANT_ARCH } _TRIPLE } / include " ) <nl> - if ( SWIFT_COMPILER_IS_MSVC_LIKE ) <nl> - list ( APPEND c_compile_flags - I ; $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_UC_INCLUDE } ) <nl> - else ( ) <nl> - list ( APPEND c_compile_flags - isystem ; $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_UC_INCLUDE } ) <nl> - endif ( ) <nl> - endif ( ) <nl> - if ( NOT " $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_I18N_INCLUDE } " STREQUAL " " AND <nl> - NOT " $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_I18N_INCLUDE } " STREQUAL " / usr / include " AND <nl> - NOT " $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_I18N_INCLUDE } " STREQUAL " / usr / $ { SWIFT_SDK_ $ { SWIFTLIB_SINGLE_SDK } _ARCH_ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _TRIPLE } / include " AND <nl> - NOT " $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_I18N_INCLUDE } " STREQUAL " / usr / $ { SWIFT_SDK_ $ { SWIFT_HOST_VARIANT_SDK } _ARCH_ $ { SWIFT_HOST_VARIANT_ARCH } _TRIPLE } / include " ) <nl> - if ( SWIFT_COMPILER_IS_MSVC_LIKE ) <nl> - list ( APPEND c_compile_flags - I ; $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_I18N_INCLUDE } ) <nl> - else ( ) <nl> - list ( APPEND c_compile_flags - isystem ; $ { SWIFT_ $ { SWIFTLIB_SINGLE_SDK } _ $ { SWIFTLIB_SINGLE_ARCHITECTURE } _ICU_I18N_INCLUDE } ) <nl> - endif ( ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> if ( SWIFTLIB_IS_STDLIB ) <nl> # We don ' t ever want to link against the ABI - breakage checking symbols <nl> # in the standard library , runtime , or overlays because they only rely <nl>
|
build : inline the ICU handling into the CFLAGS handling
|
apple/swift
|
7e79874e0cdbdbc530f7de9f483607948986b2cd
|
2019-04-05T23:05:15Z
|
mmm a / src / core / tsi / ssl_transport_security . c <nl> ppp b / src / core / tsi / ssl_transport_security . c <nl> tsi_result tsi_create_ssl_server_handshaker_factory ( <nl> <nl> int tsi_ssl_peer_matches_name ( const tsi_peer * peer , const char * name ) { <nl> size_t i = 0 ; <nl> - const tsi_peer_property * property = tsi_peer_get_property_by_name ( <nl> - peer , TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY ) ; <nl> - if ( property = = NULL | | property - > type ! = TSI_PEER_PROPERTY_TYPE_STRING ) { <nl> - gpr_log ( GPR_ERROR , " Invalid x509 subject common name property . " ) ; <nl> - return 0 ; <nl> - } <nl> - if ( does_entry_match_name ( property - > value . string . data , <nl> - property - > value . string . length , name ) ) { <nl> - return 1 ; <nl> - } <nl> + size_t san_count = 0 ; <nl> <nl> - property = tsi_peer_get_property_by_name ( <nl> + / * Check the SAN first . * / <nl> + const tsi_peer_property * property = tsi_peer_get_property_by_name ( <nl> peer , TSI_X509_SUBJECT_ALTERNATIVE_NAMES_PEER_PROPERTY ) ; <nl> if ( property = = NULL | | property - > type ! = TSI_PEER_PROPERTY_TYPE_LIST ) { <nl> gpr_log ( GPR_ERROR , " Invalid x509 subject alternative names property . " ) ; <nl> return 0 ; <nl> } <nl> <nl> - for ( i = 0 ; i < property - > value . list . child_count ; i + + ) { <nl> + san_count = property - > value . list . child_count ; <nl> + for ( i = 0 ; i < san_count ; i + + ) { <nl> const tsi_peer_property * alt_name_property = <nl> & property - > value . list . children [ i ] ; <nl> if ( alt_name_property - > type ! = TSI_PEER_PROPERTY_TYPE_STRING ) { <nl> int tsi_ssl_peer_matches_name ( const tsi_peer * peer , const char * name ) { <nl> return 1 ; <nl> } <nl> } <nl> + <nl> + / * If there ' s no SAN , try the CN . * / <nl> + if ( san_count = = 0 ) { <nl> + property = tsi_peer_get_property_by_name ( <nl> + peer , TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY ) ; <nl> + if ( property = = NULL | | property - > type ! = TSI_PEER_PROPERTY_TYPE_STRING ) { <nl> + gpr_log ( GPR_ERROR , " Invalid x509 subject common name property . " ) ; <nl> + return 0 ; <nl> + } <nl> + if ( does_entry_match_name ( property - > value . string . data , <nl> + property - > value . string . length , name ) ) { <nl> + return 1 ; <nl> + } <nl> + } <nl> + <nl> return 0 ; / * Not found . * / <nl> } <nl> mmm a / src / node / test / interop_sanity_test . js <nl> ppp b / src / node / test / interop_sanity_test . js <nl> var server ; <nl> <nl> var port ; <nl> <nl> - var name_override = ' foo . test . google . com ' ; <nl> + var name_override = ' foo . test . google . fr ' ; <nl> <nl> describe ( ' Interop tests ' , function ( ) { <nl> before ( function ( done ) { <nl> mmm a / src / php / tests / interop / interop_client . php <nl> ppp b / src / php / tests / interop / interop_client . php <nl> function cancelAfterFirstResponse ( $ stub ) { <nl> new Grpc \ BaseStub ( <nl> $ server_address , <nl> [ <nl> - ' grpc . ssl_target_name_override ' = > ' foo . test . google . com ' , <nl> + ' grpc . ssl_target_name_override ' = > ' foo . test . google . fr ' , <nl> ' credentials ' = > $ credentials <nl> ] ) ) ; <nl> <nl> mmm a / src / php / tests / unit_tests / SecureEndToEndTest . php <nl> ppp b / src / php / tests / unit_tests / SecureEndToEndTest . php <nl> public function setUp ( ) { <nl> $ this - > channel = new Grpc \ Channel ( <nl> ' localhost : ' . $ port , <nl> [ <nl> - ' grpc . ssl_target_name_override ' = > ' foo . test . google . com ' , <nl> + ' grpc . ssl_target_name_override ' = > ' foo . test . google . fr ' , <nl> ' credentials ' = > $ credentials <nl> ] ) ; <nl> } <nl> mmm a / src / ruby / bin / interop / interop_client . rb <nl> ppp b / src / ruby / bin / interop / interop_client . rb <nl> def perform_large_unary ( fill_username : false , fill_oauth_scope : false ) <nl> # validates the the command line options , returning them as a Hash . <nl> def parse_args <nl> args = Args . new <nl> - args . host_override = ' foo . test . google . com ' <nl> + args . host_override = ' foo . test . google . fr ' <nl> OptionParser . new do | opts | <nl> opts . on ( ' - - oauth_scope scope ' , <nl> ' Scope for OAuth tokens ' ) { | v | args [ ' oauth_scope ' ] = v } <nl> mmm a / src / ruby / bin / math_client . rb <nl> ppp b / src / ruby / bin / math_client . rb <nl> def main <nl> if options [ ' secure ' ] <nl> stub_opts = { <nl> : creds = > test_creds , <nl> - GRPC : : Core : : Channel : : SSL_TARGET = > ' foo . test . google . com ' <nl> + GRPC : : Core : : Channel : : SSL_TARGET = > ' foo . test . google . fr ' <nl> } <nl> p stub_opts <nl> p options [ ' host ' ] <nl> mmm a / src / ruby / bin / noproto_client . rb <nl> ppp b / src / ruby / bin / noproto_client . rb <nl> def main <nl> if options [ ' secure ' ] <nl> stub_opts = { <nl> : creds = > test_creds , <nl> - GRPC : : Core : : Channel : : SSL_TARGET = > ' foo . test . google . com ' <nl> + GRPC : : Core : : Channel : : SSL_TARGET = > ' foo . test . google . fr ' <nl> } <nl> p stub_opts <nl> p options [ ' host ' ] <nl> mmm a / src / ruby / spec / client_server_spec . rb <nl> ppp b / src / ruby / spec / client_server_spec . rb <nl> def new_client_call <nl> @ server = GRPC : : Core : : Server . new ( @ server_queue , nil , server_creds ) <nl> server_port = @ server . add_http2_port ( server_host , true ) <nl> @ server . start <nl> - args = { Channel : : SSL_TARGET = > ' foo . test . google . com ' } <nl> + args = { Channel : : SSL_TARGET = > ' foo . test . google . fr ' } <nl> @ ch = Channel . new ( " 0 . 0 . 0 . 0 : # { server_port } " , args , <nl> GRPC : : Core : : Credentials . new ( certs [ 0 ] , nil , nil ) ) <nl> end <nl> mmm a / src / ruby / spec / generic / client_stub_spec . rb <nl> ppp b / src / ruby / spec / generic / client_stub_spec . rb <nl> def load_test_certs <nl> host = FAKE_HOST <nl> blk = proc do <nl> opts = { <nl> - GRPC : : Core : : Channel : : SSL_TARGET = > ' foo . test . google . com ' , <nl> + GRPC : : Core : : Channel : : SSL_TARGET = > ' foo . test . google . fr ' , <nl> a_channel_arg : ' an_arg ' , <nl> creds : GRPC : : Core : : Credentials . new ( certs [ 0 ] , nil , nil ) <nl> } <nl> mmm a / test / core / end2end / dualstack_socket_test . c <nl> ppp b / test / core / end2end / dualstack_socket_test . c <nl> void test_connect ( const char * server_host , const char * client_host , int port , <nl> } <nl> <nl> / * Send a trivial request . * / <nl> - c = grpc_channel_create_call_old ( client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> void test_connect ( const char * server_host , const char * client_host , int port , <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( server , tag ( 100 ) ) ) ; <nl> cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> mmm a / test / core / end2end / fixtures / chttp2_simple_ssl_fullstack . c <nl> ppp b / test / core / end2end / fixtures / chttp2_simple_ssl_fullstack . c <nl> static void chttp2_init_client_simple_ssl_secure_fullstack ( <nl> grpc_ssl_credentials_create ( NULL , NULL ) ; <nl> grpc_arg ssl_name_override = { GRPC_ARG_STRING , <nl> GRPC_SSL_TARGET_NAME_OVERRIDE_ARG , <nl> - { " foo . test . google . com " } } ; <nl> + { " foo . test . google . fr " } } ; <nl> grpc_channel_args * new_client_args = <nl> grpc_channel_args_copy_and_add ( client_args , & ssl_name_override ) ; <nl> chttp2_init_client_secure_fullstack ( f , new_client_args , ssl_creds ) ; <nl> mmm a / test / core / end2end / fixtures / chttp2_simple_ssl_with_oauth2_fullstack . c <nl> ppp b / test / core / end2end / fixtures / chttp2_simple_ssl_with_oauth2_fullstack . c <nl> static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack ( <nl> grpc_composite_credentials_create ( ssl_creds , oauth2_creds ) ; <nl> grpc_arg ssl_name_override = { GRPC_ARG_STRING , <nl> GRPC_SSL_TARGET_NAME_OVERRIDE_ARG , <nl> - { " foo . test . google . com " } } ; <nl> + { " foo . test . google . fr " } } ; <nl> grpc_channel_args * new_client_args = <nl> grpc_channel_args_copy_and_add ( client_args , & ssl_name_override ) ; <nl> chttp2_init_client_secure_fullstack ( f , new_client_args , ssl_oauth2_creds ) ; <nl> mmm a / test / core / end2end / tests / cancel_after_accept . c <nl> ppp b / test / core / end2end / tests / cancel_after_accept . c <nl> static void test_cancel_after_accept ( grpc_end2end_test_config config , <nl> int was_cancelled = 2 ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> grpc_metadata_array_init ( & initial_metadata_recv ) ; <nl> mmm a / test / core / end2end / tests / cancel_after_accept_and_writes_closed . c <nl> ppp b / test / core / end2end / tests / cancel_after_accept_and_writes_closed . c <nl> static void test_cancel_after_accept_and_writes_closed ( <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_cancel_after_accept_and_writes_closed ( <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> mmm a / test / core / end2end / tests / cancel_after_accept_and_writes_closed_legacy . c <nl> ppp b / test / core / end2end / tests / cancel_after_accept_and_writes_closed_legacy . c <nl> static void test_cancel_after_accept_and_writes_closed ( <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_cancel_after_accept_and_writes_closed ( <nl> grpc_call_invoke_old ( c , f . client_cq , tag ( 2 ) , tag ( 3 ) , 0 ) ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / cancel_after_accept_legacy . c <nl> ppp b / test / core / end2end / tests / cancel_after_accept_legacy . c <nl> static void test_cancel_after_accept ( grpc_end2end_test_config config , <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_cancel_after_accept ( grpc_end2end_test_config config , <nl> grpc_call_invoke_old ( c , f . client_cq , tag ( 2 ) , tag ( 3 ) , 0 ) ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / cancel_after_invoke . c <nl> ppp b / test / core / end2end / tests / cancel_after_invoke . c <nl> static void test_cancel_after_invoke ( grpc_end2end_test_config config , <nl> grpc_byte_buffer_create ( & request_payload_slice , 1 ) ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> grpc_metadata_array_init ( & initial_metadata_recv ) ; <nl> mmm a / test / core / end2end / tests / cancel_after_invoke_legacy . c <nl> ppp b / test / core / end2end / tests / cancel_after_invoke_legacy . c <nl> static void test_cancel_after_invoke ( grpc_end2end_test_config config , <nl> gpr_timespec deadline = five_seconds_time ( ) ; <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> mmm a / test / core / end2end / tests / cancel_before_invoke . c <nl> ppp b / test / core / end2end / tests / cancel_before_invoke . c <nl> static void test_cancel_before_invoke ( grpc_end2end_test_config config , int test_ <nl> grpc_byte_buffer_create ( & request_payload_slice , 1 ) ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_cancel ( c ) ) ; <nl> mmm a / test / core / end2end / tests / cancel_before_invoke_legacy . c <nl> ppp b / test / core / end2end / tests / cancel_before_invoke_legacy . c <nl> static void test_cancel_before_invoke ( grpc_end2end_test_config config ) { <nl> gpr_timespec deadline = five_seconds_time ( ) ; <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> mmm a / test / core / end2end / tests / cancel_in_a_vacuum . c <nl> ppp b / test / core / end2end / tests / cancel_in_a_vacuum . c <nl> static void test_cancel_in_a_vacuum ( grpc_end2end_test_config config , <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = mode . initiate_cancel ( c ) ) ; <nl> mmm a / test / core / end2end / tests / cancel_in_a_vacuum_legacy . c <nl> ppp b / test / core / end2end / tests / cancel_in_a_vacuum_legacy . c <nl> static void test_cancel_in_a_vacuum ( grpc_end2end_test_config config , <nl> gpr_timespec deadline = five_seconds_time ( ) ; <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> mmm a / test / core / end2end / tests / census_simple_request . c <nl> ppp b / test / core / end2end / tests / census_simple_request . c <nl> static void test_body ( grpc_end2end_test_fixture f ) { <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> tag ( 1 ) ; <nl> static void test_body ( grpc_end2end_test_fixture f ) { <nl> cq_verify ( v_client ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / census_simple_request_legacy . c <nl> ppp b / test / core / end2end / tests / census_simple_request_legacy . c <nl> static void test_body ( grpc_end2end_test_fixture f ) { <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> tag ( 1 ) ; <nl> static void test_body ( grpc_end2end_test_fixture f ) { <nl> cq_verify ( v_client ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / disappearing_server . c <nl> ppp b / test / core / end2end / tests / disappearing_server . c <nl> static void do_request_and_shutdown_server ( grpc_end2end_test_fixture * f , <nl> grpc_call * s ; <nl> gpr_timespec deadline = five_seconds_time ( ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f - > client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f - > client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void do_request_and_shutdown_server ( grpc_end2end_test_fixture * f , <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f - > server , tag ( 100 ) ) ) ; <nl> cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> mmm a / test / core / end2end / tests / disappearing_server_legacy . c <nl> ppp b / test / core / end2end / tests / disappearing_server_legacy . c <nl> static void do_request_and_shutdown_server ( grpc_end2end_test_fixture * f , <nl> grpc_call * s ; <nl> gpr_timespec deadline = five_seconds_time ( ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f - > client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f - > client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void do_request_and_shutdown_server ( grpc_end2end_test_fixture * f , <nl> cq_verify ( v_client ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f - > server , tag ( 100 ) ) ) ; <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / early_server_shutdown_finishes_inflight_calls . c <nl> ppp b / test / core / end2end / tests / early_server_shutdown_finishes_inflight_calls . c <nl> static void test_early_server_shutdown_finishes_inflight_calls ( <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_early_server_shutdown_finishes_inflight_calls ( <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> mmm a / test / core / end2end / tests / early_server_shutdown_finishes_inflight_calls_legacy . c <nl> ppp b / test / core / end2end / tests / early_server_shutdown_finishes_inflight_calls_legacy . c <nl> static void test_early_server_shutdown_finishes_inflight_calls ( <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_early_server_shutdown_finishes_inflight_calls ( <nl> cq_verify ( v_client ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / empty_batch . c <nl> ppp b / test / core / end2end / tests / empty_batch . c <nl> static void empty_batch_body ( grpc_end2end_test_fixture f ) { <nl> grpc_op * op = NULL ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( c , op , 0 , tag ( 1 ) ) ) ; <nl> mmm a / test / core / end2end / tests / graceful_server_shutdown . c <nl> ppp b / test / core / end2end / tests / graceful_server_shutdown . c <nl> static void test_early_server_shutdown_finishes_inflight_calls ( <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_early_server_shutdown_finishes_inflight_calls ( <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> mmm a / test / core / end2end / tests / graceful_server_shutdown_legacy . c <nl> ppp b / test / core / end2end / tests / graceful_server_shutdown_legacy . c <nl> static void test_early_server_shutdown_finishes_inflight_calls ( <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_early_server_shutdown_finishes_inflight_calls ( <nl> cq_verify ( v_client ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / invoke_large_request . c <nl> ppp b / test / core / end2end / tests / invoke_large_request . c <nl> static void test_invoke_large_request ( grpc_end2end_test_config config ) { <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_invoke_large_request ( grpc_end2end_test_config config ) { <nl> cq_verify_empty ( v_client ) ; <nl> <nl> cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> mmm a / test / core / end2end / tests / invoke_large_request_legacy . c <nl> ppp b / test / core / end2end / tests / invoke_large_request_legacy . c <nl> static void test_invoke_large_request ( grpc_end2end_test_config config ) { <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_invoke_large_request ( grpc_end2end_test_config config ) { <nl> request ( as this request is very large ) * / <nl> cq_verify_empty ( v_client ) ; <nl> <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / max_concurrent_streams . c <nl> ppp b / test / core / end2end / tests / max_concurrent_streams . c <nl> static void simple_request_body ( grpc_end2end_test_fixture f ) { <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void simple_request_body ( grpc_end2end_test_fixture f ) { <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> static void test_max_concurrent_streams ( grpc_end2end_test_config config ) { <nl> / * start two requests - ensuring that the second is not accepted until <nl> the first completes * / <nl> deadline = five_seconds_time ( ) ; <nl> - c1 = grpc_channel_create_call_old ( f . client , " / alpha " , " foo . test . google . com " , <nl> + c1 = grpc_channel_create_call_old ( f . client , " / alpha " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c1 ) ; <nl> - c2 = grpc_channel_create_call_old ( f . client , " / beta " , " foo . test . google . com " , <nl> + c2 = grpc_channel_create_call_old ( f . client , " / beta " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c1 ) ; <nl> <nl> static void test_max_concurrent_streams ( grpc_end2end_test_config config ) { <nl> <nl> cq_expect_server_rpc_new ( v_server , & s1 , tag ( 100 ) , <nl> live_call = = 300 ? " / alpha " : " / beta " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> static void test_max_concurrent_streams ( grpc_end2end_test_config config ) { <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 200 ) ) ) ; <nl> cq_expect_server_rpc_new ( v_server , & s2 , tag ( 200 ) , <nl> live_call = = 300 ? " / alpha " : " / beta " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> mmm a / test / core / end2end / tests / max_concurrent_streams_legacy . c <nl> ppp b / test / core / end2end / tests / max_concurrent_streams_legacy . c <nl> static void simple_request_body ( grpc_end2end_test_fixture f ) { <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void simple_request_body ( grpc_end2end_test_fixture f ) { <nl> cq_verify ( v_client ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> static void test_max_concurrent_streams ( grpc_end2end_test_config config ) { <nl> / * start two requests - ensuring that the second is not accepted until <nl> the first completes * / <nl> deadline = five_seconds_time ( ) ; <nl> - c1 = grpc_channel_create_call_old ( f . client , " / alpha " , " foo . test . google . com " , <nl> + c1 = grpc_channel_create_call_old ( f . client , " / alpha " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c1 ) ; <nl> - c2 = grpc_channel_create_call_old ( f . client , " / beta " , " foo . test . google . com " , <nl> + c2 = grpc_channel_create_call_old ( f . client , " / beta " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c1 ) ; <nl> <nl> static void test_max_concurrent_streams ( grpc_end2end_test_config config ) { <nl> <nl> cq_expect_server_rpc_new ( v_server , & s1 , tag ( 100 ) , <nl> live_call = = 300 ? " / alpha " : " / beta " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> static void test_max_concurrent_streams ( grpc_end2end_test_config config ) { <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 200 ) ) ) ; <nl> cq_expect_server_rpc_new ( v_server , & s2 , tag ( 200 ) , <nl> live_call = = 300 ? " / alpha " : " / beta " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> mmm a / test / core / end2end / tests / ping_pong_streaming . c <nl> ppp b / test / core / end2end / tests / ping_pong_streaming . c <nl> static void test_pingpong_streaming ( grpc_end2end_test_config config , <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> gpr_log ( GPR_INFO , " testing with % d message pairs . " , messages ) ; <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_pingpong_streaming ( grpc_end2end_test_config config , <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> <nl> cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> grpc_call_server_accept_old ( s , f . server_cq , tag ( 102 ) ) ) ; <nl> mmm a / test / core / end2end / tests / ping_pong_streaming_legacy . c <nl> ppp b / test / core / end2end / tests / ping_pong_streaming_legacy . c <nl> static void test_pingpong_streaming ( grpc_end2end_test_config config , <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> gpr_log ( GPR_INFO , " testing with % d message pairs . " , messages ) ; <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_pingpong_streaming ( grpc_end2end_test_config config , <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> mmm a / test / core / end2end / tests / request_response_with_binary_metadata_and_payload . c <nl> ppp b / test / core / end2end / tests / request_response_with_binary_metadata_and_payload . c <nl> static void test_request_response_with_metadata_and_payload ( <nl> int was_cancelled = 2 ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> grpc_metadata_array_init ( & initial_metadata_recv ) ; <nl> static void test_request_response_with_metadata_and_payload ( <nl> GPR_ASSERT ( status = = GRPC_STATUS_UNIMPLEMENTED ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( details , " xyz " ) ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( call_details . method , " / foo " ) ) ; <nl> - GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . com " ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . fr " ) ) ; <nl> GPR_ASSERT ( was_cancelled = = 0 ) ; <nl> GPR_ASSERT ( byte_buffer_eq_string ( request_payload_recv , " hello world " ) ) ; <nl> GPR_ASSERT ( byte_buffer_eq_string ( response_payload_recv , " hello you " ) ) ; <nl> mmm a / test / core / end2end / tests / request_response_with_binary_metadata_and_payload_legacy . c <nl> ppp b / test / core / end2end / tests / request_response_with_binary_metadata_and_payload_legacy . c <nl> static void test_request_response_with_metadata_and_payload ( <nl> gpr_slice_unref ( request_payload_slice ) ; <nl> gpr_slice_unref ( response_payload_slice ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_request_response_with_metadata_and_payload ( <nl> cq_verify ( v_client ) ; <nl> <nl> cq_expect_server_rpc_new ( <nl> - v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , deadline , " key1 - bin " , <nl> + v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , deadline , " key1 - bin " , <nl> " \ xc0 \ xc1 \ xc2 \ xc3 \ xc4 \ xc5 \ xc6 \ xc7 \ xc8 \ xc9 \ xca \ xcb \ xcc " , " key2 - bin " , <nl> " \ x10 \ x11 \ x12 \ x13 \ x14 \ x15 \ x16 \ x17 \ x18 \ x19 \ x1a \ x1b \ x1c \ x1d " , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> mmm a / test / core / end2end / tests / request_response_with_metadata_and_payload . c <nl> ppp b / test / core / end2end / tests / request_response_with_metadata_and_payload . c <nl> static void test_request_response_with_metadata_and_payload ( <nl> int was_cancelled = 2 ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> grpc_metadata_array_init ( & initial_metadata_recv ) ; <nl> static void test_request_response_with_metadata_and_payload ( <nl> GPR_ASSERT ( status = = GRPC_STATUS_UNIMPLEMENTED ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( details , " xyz " ) ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( call_details . method , " / foo " ) ) ; <nl> - GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . com " ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . fr " ) ) ; <nl> GPR_ASSERT ( was_cancelled = = 0 ) ; <nl> GPR_ASSERT ( byte_buffer_eq_string ( request_payload_recv , " hello world " ) ) ; <nl> GPR_ASSERT ( byte_buffer_eq_string ( response_payload_recv , " hello you " ) ) ; <nl> mmm a / test / core / end2end / tests / request_response_with_metadata_and_payload_legacy . c <nl> ppp b / test / core / end2end / tests / request_response_with_metadata_and_payload_legacy . c <nl> static void test_request_response_with_metadata_and_payload ( <nl> gpr_slice_unref ( request_payload_slice ) ; <nl> gpr_slice_unref ( response_payload_slice ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_request_response_with_metadata_and_payload ( <nl> cq_expect_write_accepted ( v_client , tag ( 4 ) , GRPC_OP_OK ) ; <nl> cq_verify ( v_client ) ; <nl> <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , " key1 " , " val1 " , " key2 " , " val2 " , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / request_response_with_payload . c <nl> ppp b / test / core / end2end / tests / request_response_with_payload . c <nl> static void request_response_with_payload ( grpc_end2end_test_fixture f ) { <nl> int was_cancelled = 2 ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> grpc_metadata_array_init ( & initial_metadata_recv ) ; <nl> static void request_response_with_payload ( grpc_end2end_test_fixture f ) { <nl> GPR_ASSERT ( status = = GRPC_STATUS_UNIMPLEMENTED ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( details , " xyz " ) ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( call_details . method , " / foo " ) ) ; <nl> - GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . com " ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . fr " ) ) ; <nl> GPR_ASSERT ( was_cancelled = = 0 ) ; <nl> GPR_ASSERT ( byte_buffer_eq_string ( request_payload_recv , " hello world " ) ) ; <nl> GPR_ASSERT ( byte_buffer_eq_string ( response_payload_recv , " hello you " ) ) ; <nl> mmm a / test / core / end2end / tests / request_response_with_payload_legacy . c <nl> ppp b / test / core / end2end / tests / request_response_with_payload_legacy . c <nl> static void request_response_with_payload ( grpc_end2end_test_fixture f ) { <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void request_response_with_payload ( grpc_end2end_test_fixture f ) { <nl> cq_expect_write_accepted ( v_client , tag ( 4 ) , GRPC_OP_OK ) ; <nl> cq_verify ( v_client ) ; <nl> <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / request_response_with_trailing_metadata_and_payload . c <nl> ppp b / test / core / end2end / tests / request_response_with_trailing_metadata_and_payload . c <nl> static void test_request_response_with_metadata_and_payload ( <nl> int was_cancelled = 2 ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> grpc_metadata_array_init ( & initial_metadata_recv ) ; <nl> static void test_request_response_with_metadata_and_payload ( <nl> GPR_ASSERT ( status = = GRPC_STATUS_UNIMPLEMENTED ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( details , " xyz " ) ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( call_details . method , " / foo " ) ) ; <nl> - GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . com " ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . fr " ) ) ; <nl> GPR_ASSERT ( was_cancelled = = 1 ) ; <nl> GPR_ASSERT ( byte_buffer_eq_string ( request_payload_recv , " hello world " ) ) ; <nl> GPR_ASSERT ( byte_buffer_eq_string ( response_payload_recv , " hello you " ) ) ; <nl> mmm a / test / core / end2end / tests / request_response_with_trailing_metadata_and_payload_legacy . c <nl> ppp b / test / core / end2end / tests / request_response_with_trailing_metadata_and_payload_legacy . c <nl> static void test_request_response_with_metadata_and_payload ( <nl> gpr_slice_unref ( request_payload_slice ) ; <nl> gpr_slice_unref ( response_payload_slice ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_request_response_with_metadata_and_payload ( <nl> cq_expect_write_accepted ( v_client , tag ( 4 ) , GRPC_OP_OK ) ; <nl> cq_verify ( v_client ) ; <nl> <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , " key1 " , " val1 " , " key2 " , " val2 " , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / request_with_large_metadata . c <nl> ppp b / test / core / end2end / tests / request_with_large_metadata . c <nl> static void test_request_with_large_metadata ( grpc_end2end_test_config config ) { <nl> const int large_size = 64 * 1024 ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> meta . key = " key " ; <nl> static void test_request_with_large_metadata ( grpc_end2end_test_config config ) { <nl> GPR_ASSERT ( status = = GRPC_STATUS_UNIMPLEMENTED ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( details , " xyz " ) ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( call_details . method , " / foo " ) ) ; <nl> - GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . com " ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . fr " ) ) ; <nl> GPR_ASSERT ( was_cancelled = = 0 ) ; <nl> GPR_ASSERT ( byte_buffer_eq_string ( request_payload_recv , " hello world " ) ) ; <nl> GPR_ASSERT ( contains_metadata ( & request_metadata_recv , " key " , meta . value ) ) ; <nl> mmm a / test / core / end2end / tests / request_with_large_metadata_legacy . c <nl> ppp b / test / core / end2end / tests / request_with_large_metadata_legacy . c <nl> static void test_request_with_large_metadata ( grpc_end2end_test_config config ) { <nl> ( ( char * ) meta . value ) [ large_size ] = 0 ; <nl> meta . value_length = large_size ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_request_with_large_metadata ( grpc_end2end_test_config config ) { <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> grpc_call_invoke_old ( c , f . client_cq , tag ( 2 ) , tag ( 3 ) , 0 ) ) ; <nl> <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , " key " , meta . value , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / request_with_payload . c <nl> ppp b / test / core / end2end / tests / request_with_payload . c <nl> static void test_invoke_request_with_payload ( grpc_end2end_test_config config ) { <nl> int was_cancelled = 2 ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> grpc_metadata_array_init ( & initial_metadata_recv ) ; <nl> static void test_invoke_request_with_payload ( grpc_end2end_test_config config ) { <nl> GPR_ASSERT ( status = = GRPC_STATUS_UNIMPLEMENTED ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( details , " xyz " ) ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( call_details . method , " / foo " ) ) ; <nl> - GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . com " ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . fr " ) ) ; <nl> GPR_ASSERT ( was_cancelled = = 0 ) ; <nl> GPR_ASSERT ( byte_buffer_eq_string ( request_payload_recv , " hello world " ) ) ; <nl> <nl> mmm a / test / core / end2end / tests / request_with_payload_legacy . c <nl> ppp b / test / core / end2end / tests / request_with_payload_legacy . c <nl> static void test_invoke_request_with_payload ( grpc_end2end_test_config config ) { <nl> / * byte buffer holds the slice , we can unref it already * / <nl> gpr_slice_unref ( payload_slice ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_invoke_request_with_payload ( grpc_end2end_test_config config ) { <nl> cq_expect_write_accepted ( v_client , tag ( 4 ) , GRPC_OP_OK ) ; <nl> cq_verify ( v_client ) ; <nl> <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / simple_delayed_request . c <nl> ppp b / test / core / end2end / tests / simple_delayed_request . c <nl> static void simple_delayed_request_body ( grpc_end2end_test_config config , <nl> config . init_client ( f , client_args ) ; <nl> <nl> c = grpc_channel_create_call ( f - > client , f - > client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> grpc_metadata_array_init ( & initial_metadata_recv ) ; <nl> static void simple_delayed_request_body ( grpc_end2end_test_config config , <nl> GPR_ASSERT ( status = = GRPC_STATUS_UNIMPLEMENTED ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( details , " xyz " ) ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( call_details . method , " / foo " ) ) ; <nl> - GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . com " ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . fr " ) ) ; <nl> GPR_ASSERT ( was_cancelled = = 0 ) ; <nl> <nl> gpr_free ( details ) ; <nl> mmm a / test / core / end2end / tests / simple_delayed_request_legacy . c <nl> ppp b / test / core / end2end / tests / simple_delayed_request_legacy . c <nl> static void simple_delayed_request_body ( grpc_end2end_test_config config , <nl> <nl> config . init_client ( f , client_args ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f - > client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f - > client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void simple_delayed_request_body ( grpc_end2end_test_config config , <nl> cq_verify ( v_client ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f - > server , tag ( 100 ) ) ) ; <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / simple_request . c <nl> ppp b / test / core / end2end / tests / simple_request . c <nl> static void simple_request_body ( grpc_end2end_test_fixture f ) { <nl> int was_cancelled = 2 ; <nl> <nl> c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> - " foo . test . google . com " , deadline ) ; <nl> + " foo . test . google . fr " , deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> grpc_metadata_array_init ( & initial_metadata_recv ) ; <nl> static void simple_request_body ( grpc_end2end_test_fixture f ) { <nl> GPR_ASSERT ( status = = GRPC_STATUS_UNIMPLEMENTED ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( details , " xyz " ) ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( call_details . method , " / foo " ) ) ; <nl> - GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . com " ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . fr " ) ) ; <nl> GPR_ASSERT ( was_cancelled = = 0 ) ; <nl> <nl> gpr_free ( details ) ; <nl> mmm a / test / core / end2end / tests / simple_request_legacy . c <nl> ppp b / test / core / end2end / tests / simple_request_legacy . c <nl> static void simple_request_body ( grpc_end2end_test_fixture f ) { <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void simple_request_body ( grpc_end2end_test_fixture f ) { <nl> cq_verify ( v_client ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> static void simple_request_body2 ( grpc_end2end_test_fixture f ) { <nl> cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void simple_request_body2 ( grpc_end2end_test_fixture f ) { <nl> cq_verify ( v_client ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> - cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . com " , <nl> + cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , " foo . test . google . fr " , <nl> deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> mmm a / test / core / end2end / tests / thread_stress . c <nl> ppp b / test / core / end2end / tests / thread_stress . c <nl> static void start_request ( void ) { <nl> gpr_slice slice = gpr_slice_malloc ( 100 ) ; <nl> grpc_byte_buffer * buf ; <nl> grpc_call * call = grpc_channel_create_call_old ( <nl> - g_fixture . client , " / Foo " , " foo . test . google . com " , g_test_end_time ) ; <nl> + g_fixture . client , " / Foo " , " foo . test . google . fr " , g_test_end_time ) ; <nl> <nl> memset ( GPR_SLICE_START_PTR ( slice ) , 1 , GPR_SLICE_LENGTH ( slice ) ) ; <nl> buf = grpc_byte_buffer_create ( & slice , 1 ) ; <nl> mmm a / test / core / end2end / tests / thread_stress_legacy . c <nl> ppp b / test / core / end2end / tests / thread_stress_legacy . c <nl> static void start_request ( void ) { <nl> gpr_slice slice = gpr_slice_malloc ( 100 ) ; <nl> grpc_byte_buffer * buf ; <nl> grpc_call * call = grpc_channel_create_call_old ( <nl> - g_fixture . client , " / Foo " , " foo . test . google . com " , g_test_end_time ) ; <nl> + g_fixture . client , " / Foo " , " foo . test . google . fr " , g_test_end_time ) ; <nl> <nl> memset ( GPR_SLICE_START_PTR ( slice ) , 1 , GPR_SLICE_LENGTH ( slice ) ) ; <nl> buf = grpc_byte_buffer_create ( & slice , 1 ) ; <nl> mmm a / test / core / end2end / tests / writes_done_hangs_with_pending_read . c <nl> ppp b / test / core / end2end / tests / writes_done_hangs_with_pending_read . c <nl> static void test_writes_done_hangs_with_pending_read ( <nl> gpr_slice_unref ( request_payload_slice ) ; <nl> gpr_slice_unref ( response_payload_slice ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_writes_done_hangs_with_pending_read ( <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> mmm a / test / core / end2end / tests / writes_done_hangs_with_pending_read_legacy . c <nl> ppp b / test / core / end2end / tests / writes_done_hangs_with_pending_read_legacy . c <nl> static void test_writes_done_hangs_with_pending_read ( <nl> gpr_slice_unref ( request_payload_slice ) ; <nl> gpr_slice_unref ( response_payload_slice ) ; <nl> <nl> - c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . com " , <nl> + c = grpc_channel_create_call_old ( f . client , " / foo " , " foo . test . google . fr " , <nl> deadline ) ; <nl> GPR_ASSERT ( c ) ; <nl> <nl> static void test_writes_done_hangs_with_pending_read ( <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = grpc_server_request_call_old ( f . server , tag ( 100 ) ) ) ; <nl> cq_expect_server_rpc_new ( v_server , & s , tag ( 100 ) , " / foo " , <nl> - " foo . test . google . com " , deadline , NULL ) ; <nl> + " foo . test . google . fr " , deadline , NULL ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> GPR_ASSERT ( GRPC_CALL_OK = = <nl> mmm a / test / cpp / interop / client . cc <nl> ppp b / test / cpp / interop / client . cc <nl> DEFINE_bool ( enable_ssl , false , " Whether to use ssl / tls . " ) ; <nl> DEFINE_bool ( use_prod_roots , false , " True to use SSL roots for google " ) ; <nl> DEFINE_int32 ( server_port , 0 , " Server port . " ) ; <nl> DEFINE_string ( server_host , " 127 . 0 . 0 . 1 " , " Server host to connect to " ) ; <nl> - DEFINE_string ( server_host_override , " foo . test . google . com " , <nl> + DEFINE_string ( server_host_override , " foo . test . google . fr " , <nl> " Override the server host which is sent in HTTP header " ) ; <nl> DEFINE_string ( test_case , " large_unary " , <nl> " Configure different test cases . Valid options are : " <nl> mmm a / test / cpp / util / create_test_channel . cc <nl> ppp b / test / cpp / util / create_test_channel . cc <nl> std : : shared_ptr < ChannelInterface > CreateTestChannel ( <nl> / / Shortcut for end2end and interop tests . <nl> std : : shared_ptr < ChannelInterface > CreateTestChannel ( const grpc : : string & server , <nl> bool enable_ssl ) { <nl> - return CreateTestChannel ( server , " foo . test . google . com " , enable_ssl , false ) ; <nl> + return CreateTestChannel ( server , " foo . test . google . fr " , enable_ssl , false ) ; <nl> } <nl> <nl> } / / namespace grpc <nl>
|
Verifying the peer name on the X509 Certs correctly .
|
grpc/grpc
|
597a4f2273f9dda0dbac45b021706ce8b715f93c
|
2015-02-24T00:41:26Z
|
mmm a / src / video_core / engines / shader_bytecode . h <nl> ppp b / src / video_core / engines / shader_bytecode . h <nl> <nl> <nl> # pragma once <nl> <nl> + # include < array > <nl> # include < bitset > <nl> # include < optional > <nl> # include < tuple > <nl>
|
shader_bytecode : Include missing < array >
|
yuzu-emu/yuzu
|
4d63f9794575f6180fbecb1d7dce7fcd3875439f
|
2019-06-24T04:51:02Z
|
mmm a / build / cocos2d_libs . xcodeproj / project . pbxproj <nl> ppp b / build / cocos2d_libs . xcodeproj / project . pbxproj <nl> <nl> 29394CF519B01DBA00D2DE1A / * UIWebViewImpl - ios . h in Headers * / = { isa = PBXBuildFile ; fileRef = 29394CEE19B01DBA00D2DE1A / * UIWebViewImpl - ios . h * / ; } ; <nl> 29394CF619B01DBA00D2DE1A / * UIWebViewImpl - ios . mm in Sources * / = { isa = PBXBuildFile ; fileRef = 29394CEF19B01DBA00D2DE1A / * UIWebViewImpl - ios . mm * / ; } ; <nl> 29394CF719B01DBA00D2DE1A / * UIWebViewImpl - ios . mm in Sources * / = { isa = PBXBuildFile ; fileRef = 29394CEF19B01DBA00D2DE1A / * UIWebViewImpl - ios . mm * / ; } ; <nl> + 296BF6151A44059B0038EC44 / * UIShaders . h in Headers * / = { isa = PBXBuildFile ; fileRef = 296BF6141A44059B0038EC44 / * UIShaders . h * / ; } ; <nl> + 296BF6161A44059B0038EC44 / * UIShaders . h in Headers * / = { isa = PBXBuildFile ; fileRef = 296BF6141A44059B0038EC44 / * UIShaders . h * / ; } ; <nl> + 296BF6181A4405CB0038EC44 / * UIShaders . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 296BF6171A4405CB0038EC44 / * UIShaders . cpp * / ; } ; <nl> + 296BF6191A4405CB0038EC44 / * UIShaders . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 296BF6171A4405CB0038EC44 / * UIShaders . cpp * / ; } ; <nl> 2986667F18B1B246000E39CA / * CCTweenFunction . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 2986667818B1B079000E39CA / * CCTweenFunction . cpp * / ; } ; <nl> 299754F4193EC95400A54AC3 / * ObjectFactory . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 299754F2193EC95400A54AC3 / * ObjectFactory . cpp * / ; } ; <nl> 299754F5193EC95400A54AC3 / * ObjectFactory . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 299754F2193EC95400A54AC3 / * ObjectFactory . cpp * / ; } ; <nl> <nl> 29394CEF19B01DBA00D2DE1A / * UIWebViewImpl - ios . mm * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . objcpp ; path = " UIWebViewImpl - ios . mm " ; sourceTree = " < group > " ; } ; <nl> 2958244919873D8E00F9746D / * UIScale9Sprite . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = UIScale9Sprite . cpp ; sourceTree = " < group > " ; } ; <nl> 2958244A19873D8E00F9746D / * UIScale9Sprite . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = UIScale9Sprite . h ; sourceTree = " < group > " ; } ; <nl> + 296BF6131A4403380038EC44 / * ccShader_grayscale . frag * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . glsl ; path = ccShader_grayscale . frag ; sourceTree = " < group > " ; } ; <nl> + 296BF6141A44059B0038EC44 / * UIShaders . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = UIShaders . h ; sourceTree = " < group > " ; } ; <nl> + 296BF6171A4405CB0038EC44 / * UIShaders . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = UIShaders . cpp ; sourceTree = " < group > " ; } ; <nl> 2986667818B1B079000E39CA / * CCTweenFunction . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = CCTweenFunction . cpp ; sourceTree = " < group > " ; } ; <nl> 2986667918B1B079000E39CA / * CCTweenFunction . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = CCTweenFunction . h ; sourceTree = " < group > " ; } ; <nl> 299754F2193EC95400A54AC3 / * ObjectFactory . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = ObjectFactory . cpp ; path = . . / base / ObjectFactory . cpp ; sourceTree = " < group > " ; } ; <nl> <nl> 2905F9E618CF08D000240AA3 / * ui * / = { <nl> isa = PBXGroup ; <nl> children = ( <nl> + 296BF6121A4403380038EC44 / * shaders * / , <nl> 29CB8F531929D67D00C841D6 / * widgets * / , <nl> 29CB8F521929D65500C841D6 / * experimental * / , <nl> 29CB8F511929D64500C841D6 / * base * / , <nl> <nl> path = UIEditBox ; <nl> sourceTree = " < group > " ; <nl> } ; <nl> + 296BF6121A4403380038EC44 / * shaders * / = { <nl> + isa = PBXGroup ; <nl> + children = ( <nl> + 296BF6131A4403380038EC44 / * ccShader_grayscale . frag * / , <nl> + 296BF6141A44059B0038EC44 / * UIShaders . h * / , <nl> + 296BF6171A4405CB0038EC44 / * UIShaders . cpp * / , <nl> + ) ; <nl> + path = shaders ; <nl> + sourceTree = " < group > " ; <nl> + } ; <nl> 29CB8F501929D63600C841D6 / * layout * / = { <nl> isa = PBXGroup ; <nl> children = ( <nl> <nl> 5034CA2F191D591100CE6051 / * ccShader_PositionTexture . vert in Headers * / , <nl> 15AE1C1219AAE2C600C27E9E / * CCPhysicsDebugNode . h in Headers * / , <nl> 50ABBE951925AB6F00A911A9 / * CCProfiling . h in Headers * / , <nl> + 296BF6151A44059B0038EC44 / * UIShaders . h in Headers * / , <nl> 5034CA4B191D591100CE6051 / * ccShader_Label_df_glow . frag in Headers * / , <nl> 50ABBE4F1925AB6F00A911A9 / * CCEventCustom . h in Headers * / , <nl> 50ABBD521925AB0000A911A9 / * Quaternion . h in Headers * / , <nl> <nl> 50ABBD571925AB0000A911A9 / * TransformUtils . h in Headers * / , <nl> 1A570115180BC8EE0088DEC7 / * CCDrawNode . h in Headers * / , <nl> 1A57011E180BC90D0088DEC7 / * CCGrabber . h in Headers * / , <nl> + 296BF6161A44059B0038EC44 / * UIShaders . h in Headers * / , <nl> 1A570122180BC90D0088DEC7 / * CCGrid . h in Headers * / , <nl> 15AE1AB319AAD40300C27E9E / * b2CircleContact . h in Headers * / , <nl> 5034CA2E191D591100CE6051 / * ccShader_PositionTextureA8Color . frag in Headers * / , <nl> <nl> 15AE1B5119AADA9900C27E9E / * UIPageView . cpp in Sources * / , <nl> 50ED2BE619BEAF7900A0AB90 / * UIEditBoxImpl - wp8 . cpp in Sources * / , <nl> 15AE18EC19AAD35000C27E9E / * CCActionObject . cpp in Sources * / , <nl> + 296BF6181A4405CB0038EC44 / * UIShaders . cpp in Sources * / , <nl> 1A01C68E18F57BE800EFE3A6 / * CCDictionary . cpp in Sources * / , <nl> 50ABBD381925AB0000A911A9 / * CCAffineTransform . cpp in Sources * / , <nl> 46C02E0718E91123004B7456 / * xxhash . c in Sources * / , <nl> <nl> 50ABC0061926664800A911A9 / * CCThread - apple . mm in Sources * / , <nl> B375107C1823ACA100B3BA6A / * CCPhysicsBodyInfo_chipmunk . cpp in Sources * / , <nl> 50ABBEB61925AB6F00A911A9 / * CCUserDefault - android . cpp in Sources * / , <nl> + 296BF6191A4405CB0038EC44 / * UIShaders . cpp in Sources * / , <nl> 1A57034C180BD09B0088DEC7 / * tinyxml2 . cpp in Sources * / , <nl> 50ABBDB61925AB4100A911A9 / * CCTexture2D . cpp in Sources * / , <nl> 15AE1BAB19AADFDF00C27E9E / * UILayout . cpp in Sources * / , <nl> mmm a / cocos / 2d / libcocos2d . vcxproj <nl> ppp b / cocos / 2d / libcocos2d . vcxproj <nl> xcopy / Y / Q " $ ( ProjectDir ) . . \ . . \ external \ chipmunk \ prebuilt \ win32 \ release - lib \ * . * <nl> < ClCompile Include = " . . \ renderer \ CCVertexIndexData . cpp " / > <nl> < ClCompile Include = " . . \ storage \ local - storage \ LocalStorage . cpp " / > <nl> < ClCompile Include = " . . \ ui \ CocosGUI . cpp " / > <nl> + < ClCompile Include = " . . \ ui \ shaders \ UIShaders . cpp " / > <nl> < ClCompile Include = " . . \ ui \ UIButton . cpp " / > <nl> < ClCompile Include = " . . \ ui \ UICheckBox . cpp " / > <nl> < ClCompile Include = " . . \ ui \ UIDeprecated . cpp " / > <nl> xcopy / Y / Q " $ ( ProjectDir ) . . \ . . \ external \ chipmunk \ prebuilt \ win32 \ release - lib \ * . * <nl> < ClInclude Include = " . . \ storage \ local - storage \ LocalStorage . h " / > <nl> < ClInclude Include = " . . \ ui \ CocosGUI . h " / > <nl> < ClInclude Include = " . . \ ui \ GUIExport . h " / > <nl> + < ClInclude Include = " . . \ ui \ shaders \ UIShaders . h " / > <nl> < ClInclude Include = " . . \ ui \ UIButton . h " / > <nl> < ClInclude Include = " . . \ ui \ UICheckBox . h " / > <nl> < ClInclude Include = " . . \ ui \ UIDeprecated . h " / > <nl> xcopy / Y / Q " $ ( ProjectDir ) . . \ . . \ external \ chipmunk \ prebuilt \ win32 \ release - lib \ * . * <nl> < None Include = " . . \ math \ Vec2 . inl " / > <nl> < None Include = " . . \ math \ Vec3 . inl " / > <nl> < None Include = " . . \ math \ Vec4 . inl " / > <nl> + < None Include = " . . \ ui \ shaders \ ccShader_grayscale . frag " / > <nl> < None Include = " cocos2d . def " / > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> mmm a / cocos / 2d / libcocos2d . vcxproj . filters <nl> ppp b / cocos / 2d / libcocos2d . vcxproj . filters <nl> <nl> - < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> + < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < Project ToolsVersion = " 4 . 0 " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> < ItemGroup > <nl> < Filter Include = " physics " > <nl> <nl> < Filter Include = " cocostudio \ reader \ WidgetReader \ ArmatureNodeReader " > <nl> < UniqueIdentifier > { e1848cce - b225 - 42c4 - bb6e - 6430b6da123b } < / UniqueIdentifier > <nl> < / Filter > <nl> + < Filter Include = " ui \ shaders " > <nl> + < UniqueIdentifier > { e6eaa24a - a21e - 4c1d - b6b2 - 19326d129af2 } < / UniqueIdentifier > <nl> + < / Filter > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ClCompile Include = " . . \ physics \ CCPhysicsBody . cpp " > <nl> <nl> < ClCompile Include = " . . \ editor - support \ cocostudio \ WidgetReader \ ArmatureNodeReader \ ArmatureNodeReader . cpp " > <nl> < Filter > cocostudio \ reader \ WidgetReader \ ArmatureNodeReader < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ ui \ shaders \ UIShaders . cpp " > <nl> + < Filter > ui \ shaders < / Filter > <nl> + < / ClCompile > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ClInclude Include = " . . \ physics \ CCPhysicsBody . h " > <nl> <nl> < ClInclude Include = " . . \ editor - support \ cocostudio \ WidgetReader \ ArmatureNodeReader \ CSArmatureNode_generated . h " > <nl> < Filter > cocostudio \ reader \ WidgetReader \ ArmatureNodeReader < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " . . \ ui \ shaders \ UIShaders . h " > <nl> + < Filter > ui \ shaders < / Filter > <nl> + < / ClInclude > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < None Include = " . . \ math \ Mat4 . inl " > <nl> <nl> < None Include = " . . \ 3d \ CCAnimationCurve . inl " > <nl> < Filter > 3d < / Filter > <nl> < / None > <nl> + < None Include = " . . \ ui \ shaders \ ccShader_grayscale . frag " > <nl> + < Filter > ui \ shaders < / Filter > <nl> + < / None > <nl> < / ItemGroup > <nl> < / Project > <nl> \ No newline at end of file <nl> mmm a / cocos / 2d / libcocos2d_8_1 / libcocos2d_8_1 / libcocos2d_8_1 . Shared / libcocos2d_8_1 . Shared . vcxitems <nl> ppp b / cocos / 2d / libcocos2d_8_1 / libcocos2d_8_1 / libcocos2d_8_1 . Shared / libcocos2d_8_1 . Shared . vcxitems <nl> <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocosbuilder \ CocosBuilder . h " / > <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimeline . h " / > <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineCache . h " / > <nl> + < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineNode . h " / > <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCFrame . h " / > <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCNodeReader . h " / > <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCTimeLine . h " / > <nl> <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ storage \ local - storage \ LocalStorage . h " / > <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ CocosGUI . h " / > <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ GUIExport . h " / > <nl> + < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ shaders \ UIShaders . h " / > <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ UIButton . h " / > <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ UICheckBox . h " / > <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ UIDeprecated . h " / > <nl> <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocosbuilder \ CCSpriteLoader . cpp " / > <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimeline . cpp " / > <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineCache . cpp " / > <nl> + < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineNode . cpp " / > <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCFrame . cpp " / > <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCNodeReader . cpp " / > <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCTimeLine . cpp " / > <nl> <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ renderer \ CCVertexIndexData . cpp " / > <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ storage \ local - storage \ LocalStorage . cpp " / > <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ CocosGUI . cpp " / > <nl> + < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ shaders \ UIShaders . cpp " / > <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ UIButton . cpp " / > <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ UICheckBox . cpp " / > <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ UIDeprecated . cpp " / > <nl> <nl> < / None > <nl> < None Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ renderer \ ccShader_Position_uColor . frag " / > <nl> < None Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ renderer \ ccShader_Position_uColor . vert " / > <nl> + < None Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ shaders \ ccShader_grayscale . frag " / > <nl> < None Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ cocos2d . def " / > <nl> < None Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ libcocos2d . vcxproj . filters " / > <nl> < None Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ libcocos2d_wp8 . vcxproj . filters " / > <nl> mmm a / cocos / 2d / libcocos2d_8_1 / libcocos2d_8_1 / libcocos2d_8_1 . Shared / libcocos2d_8_1 . Shared . vcxitems . filters <nl> ppp b / cocos / 2d / libcocos2d_8_1 / libcocos2d_8_1 / libcocos2d_8_1 . Shared / libcocos2d_8_1 . Shared . vcxitems . filters <nl> <nl> < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ WidgetReader \ ArmatureNodeReader \ ArmatureNodeReader . h " > <nl> < Filter > cocostudio \ reader \ WidgetReader \ ArmatureNodeReader < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ shaders \ UIShaders . h " > <nl> + < Filter > ui \ shaders < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineNode . h " > <nl> + < Filter > cocostudio \ TimelineAction < / Filter > <nl> + < / ClInclude > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ cocos2d . cpp " / > <nl> <nl> < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ WidgetReader \ ArmatureNodeReader \ ArmatureNodeReader . cpp " > <nl> < Filter > cocostudio \ reader \ WidgetReader \ ArmatureNodeReader < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ shaders \ UIShaders . cpp " > <nl> + < Filter > ui \ shaders < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineNode . cpp " > <nl> + < Filter > cocostudio \ TimelineAction < / Filter > <nl> + < / ClCompile > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < Filter Include = " 2d " > <nl> <nl> < Filter Include = " cocostudio \ reader \ WidgetReader \ ArmatureNodeReader " > <nl> < UniqueIdentifier > { 1151b6b3 - 739f - 4cff - add0 - 6b772fa7d226 } < / UniqueIdentifier > <nl> < / Filter > <nl> + < Filter Include = " ui \ shaders " > <nl> + < UniqueIdentifier > { 10d3def7 - 52ba - 4939 - 8de7 - d9960a752f1e } < / UniqueIdentifier > <nl> + < / Filter > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < None Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ cocos2d . def " / > <nl> <nl> < None Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ libcocos2d_wp8 . vcxproj . filters " > <nl> < Filter > 2d < / Filter > <nl> < / None > <nl> + < None Include = " $ ( MSBuildThisFileDirectory ) . . \ . . \ . . \ . . \ ui \ shaders \ ccShader_grayscale . frag " > <nl> + < Filter > ui \ shaders < / Filter > <nl> + < / None > <nl> < / ItemGroup > <nl> < / Project > <nl> \ No newline at end of file <nl> mmm a / cocos / 2d / libcocos2d_wp8 . vcxproj <nl> ppp b / cocos / 2d / libcocos2d_wp8 . vcxproj <nl> <nl> < ClInclude Include = " . . \ editor - support \ cocosbuilder \ CocosBuilder . h " / > <nl> < ClInclude Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimeline . h " / > <nl> < ClInclude Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineCache . h " / > <nl> + < ClInclude Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineNode . h " / > <nl> < ClInclude Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCFrame . h " / > <nl> < ClInclude Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCNodeReader . h " / > <nl> < ClInclude Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCTimeLine . h " / > <nl> <nl> < ClInclude Include = " . . \ renderer \ CCVertexIndexData . h " / > <nl> < ClInclude Include = " . . \ storage \ local - storage \ LocalStorage . h " / > <nl> < ClInclude Include = " . . \ ui \ CocosGUI . h " / > <nl> + < ClInclude Include = " . . \ ui \ shaders \ UIShaders . h " / > <nl> < ClInclude Include = " . . \ ui \ UIButton . h " / > <nl> < ClInclude Include = " . . \ ui \ UIDeprecated . h " / > <nl> < ClInclude Include = " . . \ ui \ UIEditBox \ UIEditBox . h " / > <nl> <nl> < ClCompile Include = " . . \ editor - support \ cocosbuilder \ CCSpriteLoader . cpp " / > <nl> < ClCompile Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimeline . cpp " / > <nl> < ClCompile Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineCache . cpp " / > <nl> + < ClCompile Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineNode . cpp " / > <nl> < ClCompile Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCFrame . cpp " / > <nl> < ClCompile Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCNodeReader . cpp " / > <nl> < ClCompile Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCTimeLine . cpp " / > <nl> <nl> < ClCompile Include = " . . \ renderer \ CCVertexIndexData . cpp " / > <nl> < ClCompile Include = " . . \ storage \ local - storage \ LocalStorage . cpp " / > <nl> < ClCompile Include = " . . \ ui \ CocosGUI . cpp " / > <nl> + < ClCompile Include = " . . \ ui \ shaders \ UIShaders . cpp " / > <nl> < ClCompile Include = " . . \ ui \ UIButton . cpp " / > <nl> < ClCompile Include = " . . \ ui \ UICheckBox . cpp " / > <nl> < ClCompile Include = " . . \ ui \ UIDeprecated . cpp " / > <nl> <nl> < None Include = " . . \ renderer \ ccShader_PositionTexture_uColor . vert " / > <nl> < None Include = " . . \ renderer \ ccShader_Position_uColor . frag " / > <nl> < None Include = " . . \ renderer \ ccShader_Position_uColor . vert " / > <nl> + < None Include = " . . \ ui \ shaders \ ccShader_grayscale . frag " / > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ProjectReference Include = " . . \ . . \ external \ Box2D \ proj . wp8 \ Box2D . vcxproj " > <nl> mmm a / cocos / 2d / libcocos2d_wp8 . vcxproj . filters <nl> ppp b / cocos / 2d / libcocos2d_wp8 . vcxproj . filters <nl> <nl> < Filter Include = " cocostudio \ reader \ WidgetReader \ ArmatureNodeReader " > <nl> < UniqueIdentifier > { 939d9d3e - 06b3 - 494e - affd - 070c2c1cbe1d } < / UniqueIdentifier > <nl> < / Filter > <nl> + < Filter Include = " ui \ shaders " > <nl> + < UniqueIdentifier > { f6df0f43 - 3b03 - 4746 - b786 - 4323895be3b1 } < / UniqueIdentifier > <nl> + < / Filter > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ClCompile Include = " CCAction . cpp " > <nl> <nl> < ClCompile Include = " . . \ editor - support \ cocostudio \ WidgetReader \ ArmatureNodeReader \ ArmatureNodeReader . cpp " > <nl> < Filter > cocostudio \ reader \ WidgetReader \ ArmatureNodeReader < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ ui \ shaders \ UIShaders . cpp " > <nl> + < Filter > ui \ shaders < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineNode . cpp " > <nl> + < Filter > cocostudio \ TimelineAction < / Filter > <nl> + < / ClCompile > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ClInclude Include = " CCAction . h " > <nl> <nl> < ClInclude Include = " . . \ editor - support \ cocostudio \ WidgetReader \ ArmatureNodeReader \ CSArmatureNode_generated . h " > <nl> < Filter > cocostudio \ reader \ WidgetReader \ ArmatureNodeReader < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " . . \ ui \ shaders \ UIShaders . h " > <nl> + < Filter > ui \ shaders < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ editor - support \ cocostudio \ ActionTimeline \ CCActionTimelineNode . h " > <nl> + < Filter > cocostudio \ TimelineAction < / Filter > <nl> + < / ClInclude > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < None Include = " . . \ math \ Mat4 . inl " > <nl> <nl> < None Include = " . . \ renderer \ ccShader_Position_uColor . vert " > <nl> < Filter > renderer \ shaders < / Filter > <nl> < / None > <nl> + < None Include = " . . \ ui \ shaders \ ccShader_grayscale . frag " > <nl> + < Filter > ui \ shaders < / Filter > <nl> + < / None > <nl> < / ItemGroup > <nl> < / Project > <nl> \ No newline at end of file <nl> mmm a / cocos / ui / Android . mk <nl> ppp b / cocos / ui / Android . mk <nl> UIWebViewImpl - android . cpp \ <nl> UIEditBox / UIEditBox . cpp \ <nl> UIEditBox / UIEditBoxImpl - android . cpp \ <nl> UILayoutComponent . cpp \ <nl> + shaders / UIShaders . cpp \ <nl> <nl> LOCAL_EXPORT_C_INCLUDES : = $ ( LOCAL_PATH ) / . . / editor - support <nl> <nl> mmm a / cocos / ui / CMakeLists . txt <nl> ppp b / cocos / ui / CMakeLists . txt <nl> set ( COCOS_UI_SRC <nl> ui / UIWidget . cpp <nl> ui / UIEditBox / UIEditBox . cpp <nl> ui / UILayoutComponent . cpp <nl> + ui / shaders / UIShaders . cpp <nl> $ { COCOS_UI_SPECIFIC_SRC } <nl> <nl> ) <nl> mmm a / cocos / ui / UIButton . cpp <nl> ppp b / cocos / ui / UIButton . cpp <nl> void Button : : onPressStateChangedToNormal ( ) <nl> _buttonNormalRenderer - > setVisible ( true ) ; <nl> _buttonClickedRenderer - > setVisible ( false ) ; <nl> _buttonDisableRenderer - > setVisible ( false ) ; <nl> + _buttonNormalRenderer - > setState ( Scale9Sprite : : State : : NORMAL ) ; <nl> + <nl> if ( _pressedTextureLoaded ) <nl> { <nl> if ( _pressedActionEnabled ) <nl> { <nl> _buttonNormalRenderer - > stopAllActions ( ) ; <nl> _buttonClickedRenderer - > stopAllActions ( ) ; <nl> + <nl> Action * zoomAction = ScaleTo : : create ( ZOOM_ACTION_TIME_STEP , _normalTextureScaleXInSize , _normalTextureScaleYInSize ) ; <nl> _buttonNormalRenderer - > runAction ( zoomAction ) ; <nl> _buttonClickedRenderer - > setScale ( _pressedTextureScaleXInSize , _pressedTextureScaleYInSize ) ; <nl> void Button : : onPressStateChangedToNormal ( ) <nl> } <nl> else <nl> { <nl> - if ( _scale9Enabled ) <nl> + _buttonNormalRenderer - > stopAllActions ( ) ; <nl> + _buttonNormalRenderer - > setScale ( _normalTextureScaleXInSize , _normalTextureScaleYInSize ) ; <nl> + <nl> + _titleRenderer - > stopAllActions ( ) ; <nl> + if ( _unifySize ) <nl> { <nl> - _buttonNormalRenderer - > setColor ( Color3B : : WHITE ) ; <nl> + _titleRenderer - > setScaleX ( 1 . 0f ) ; <nl> + _titleRenderer - > setScaleY ( 1 . 0f ) ; <nl> } <nl> else <nl> { <nl> - _buttonNormalRenderer - > stopAllActions ( ) ; <nl> - _buttonNormalRenderer - > setScale ( _normalTextureScaleXInSize , _normalTextureScaleYInSize ) ; <nl> - <nl> - _titleRenderer - > stopAllActions ( ) ; <nl> - if ( _unifySize ) <nl> - { <nl> - _titleRenderer - > setScaleX ( 1 . 0f ) ; <nl> - _titleRenderer - > setScaleY ( 1 . 0f ) ; <nl> - } <nl> - else <nl> - { <nl> - _titleRenderer - > setScaleX ( _normalTextureScaleXInSize ) ; <nl> - _titleRenderer - > setScaleY ( _normalTextureScaleYInSize ) ; <nl> - } <nl> + _titleRenderer - > setScaleX ( _normalTextureScaleXInSize ) ; <nl> + _titleRenderer - > setScaleY ( _normalTextureScaleYInSize ) ; <nl> } <nl> } <nl> } <nl> <nl> void Button : : onPressStateChangedToPressed ( ) <nl> { <nl> + _buttonNormalRenderer - > setState ( Scale9Sprite : : State : : NORMAL ) ; <nl> + <nl> if ( _pressedTextureLoaded ) <nl> { <nl> _buttonNormalRenderer - > setVisible ( false ) ; <nl> void Button : : onPressStateChangedToPressed ( ) <nl> { <nl> _buttonNormalRenderer - > stopAllActions ( ) ; <nl> _buttonClickedRenderer - > stopAllActions ( ) ; <nl> - Action * zoomAction = ScaleTo : : create ( ZOOM_ACTION_TIME_STEP , _pressedTextureScaleXInSize + _zoomScale , _pressedTextureScaleYInSize + _zoomScale ) ; <nl> + <nl> + Action * zoomAction = ScaleTo : : create ( ZOOM_ACTION_TIME_STEP , <nl> + _pressedTextureScaleXInSize + _zoomScale , <nl> + _pressedTextureScaleYInSize + _zoomScale ) ; <nl> _buttonClickedRenderer - > runAction ( zoomAction ) ; <nl> + <nl> _buttonNormalRenderer - > setScale ( _pressedTextureScaleXInSize + _zoomScale , _pressedTextureScaleYInSize + _zoomScale ) ; <nl> <nl> _titleRenderer - > stopAllActions ( ) ; <nl> - / / we must call zoomAction - > clone here <nl> - _titleRenderer - > runAction ( zoomAction - > clone ( ) ) ; <nl> if ( _unifySize ) <nl> { <nl> Action * zoomTitleAction = ScaleTo : : create ( ZOOM_ACTION_TIME_STEP , 1 + _zoomScale , 1 + _zoomScale ) ; <nl> void Button : : onPressStateChangedToPressed ( ) <nl> _buttonNormalRenderer - > setVisible ( true ) ; <nl> _buttonClickedRenderer - > setVisible ( true ) ; <nl> _buttonDisableRenderer - > setVisible ( false ) ; <nl> - if ( _scale9Enabled ) <nl> + <nl> + _buttonNormalRenderer - > stopAllActions ( ) ; <nl> + _buttonNormalRenderer - > setScale ( _normalTextureScaleXInSize + _zoomScale , _normalTextureScaleYInSize + _zoomScale ) ; <nl> + <nl> + _titleRenderer - > stopAllActions ( ) ; <nl> + if ( _unifySize ) <nl> { <nl> - _buttonNormalRenderer - > setColor ( Color3B : : GRAY ) ; <nl> + _titleRenderer - > setScaleX ( 1 . 0f + _zoomScale ) ; <nl> + _titleRenderer - > setScaleY ( 1 . 0f + _zoomScale ) ; <nl> } <nl> else <nl> { <nl> - _buttonNormalRenderer - > stopAllActions ( ) ; <nl> - _buttonNormalRenderer - > setScale ( _normalTextureScaleXInSize + _zoomScale , _normalTextureScaleYInSize + _zoomScale ) ; <nl> - <nl> - _titleRenderer - > stopAllActions ( ) ; <nl> - if ( _unifySize ) <nl> - { <nl> - _titleRenderer - > setScaleX ( 1 . 0f + _zoomScale ) ; <nl> - _titleRenderer - > setScaleY ( 1 . 0f + _zoomScale ) ; <nl> - } <nl> - else <nl> - { <nl> - _titleRenderer - > setScaleX ( _normalTextureScaleXInSize + _zoomScale ) ; <nl> - _titleRenderer - > setScaleY ( _normalTextureScaleYInSize + _zoomScale ) ; <nl> - } <nl> + _titleRenderer - > setScaleX ( _normalTextureScaleXInSize + _zoomScale ) ; <nl> + _titleRenderer - > setScaleY ( _normalTextureScaleYInSize + _zoomScale ) ; <nl> } <nl> } <nl> } <nl> <nl> void Button : : onPressStateChangedToDisabled ( ) <nl> { <nl> - _buttonNormalRenderer - > setVisible ( false ) ; <nl> + / / if disable resource is null <nl> + if ( ! _disabledTextureLoaded ) <nl> + { <nl> + if ( _normalTextureLoaded ) <nl> + { <nl> + _buttonNormalRenderer - > setState ( Scale9Sprite : : State : : GRAY ) ; <nl> + } <nl> + } <nl> + else <nl> + { <nl> + _buttonNormalRenderer - > setVisible ( false ) ; <nl> + _buttonDisableRenderer - > setVisible ( true ) ; <nl> + } <nl> + <nl> _buttonClickedRenderer - > setVisible ( false ) ; <nl> - _buttonDisableRenderer - > setVisible ( true ) ; <nl> _buttonNormalRenderer - > setScale ( _normalTextureScaleXInSize , _normalTextureScaleYInSize ) ; <nl> _buttonClickedRenderer - > setScale ( _pressedTextureScaleXInSize , _pressedTextureScaleYInSize ) ; <nl> } <nl> mmm a / cocos / ui / UICheckBox . cpp <nl> ppp b / cocos / ui / UICheckBox . cpp <nl> _backGroundSelectedTexType ( TextureResType : : LOCAL ) , <nl> _frontCrossTexType ( TextureResType : : LOCAL ) , <nl> _backGroundDisabledTexType ( TextureResType : : LOCAL ) , <nl> _frontCrossDisabledTexType ( TextureResType : : LOCAL ) , <nl> + _zoomScale ( 0 . 1f ) , <nl> + _backgroundTextureScaleX ( 1 . 0 ) , <nl> + _backgroundTextureScaleY ( 1 . 0 ) , <nl> _backGroundFileName ( " " ) , <nl> _backGroundSelectedFileName ( " " ) , <nl> _frontCrossFileName ( " " ) , <nl> CheckBox * CheckBox : : create ( const std : : string & backGround , <nl> return nullptr ; <nl> } <nl> <nl> + CheckBox * CheckBox : : create ( const std : : string & backGround , <nl> + const std : : string & cross , <nl> + TextureResType texType ) <nl> + { <nl> + CheckBox * pWidget = new ( std : : nothrow ) CheckBox ; <nl> + if ( pWidget & & pWidget - > init ( backGround , <nl> + " " , <nl> + cross , <nl> + " " , <nl> + " " , <nl> + texType ) ) <nl> + { <nl> + pWidget - > autorelease ( ) ; <nl> + return pWidget ; <nl> + } <nl> + CC_SAFE_DELETE ( pWidget ) ; <nl> + return nullptr ; <nl> + } <nl> + <nl> bool CheckBox : : init ( const std : : string & backGround , <nl> const std : : string & backGroundSeleted , <nl> const std : : string & cross , <nl> void CheckBox : : onPressStateChangedToNormal ( ) <nl> _backGroundBoxDisabledRenderer - > setVisible ( false ) ; <nl> _frontCrossDisabledRenderer - > setVisible ( false ) ; <nl> <nl> + _backGroundBoxRenderer - > setGLProgramState ( this - > getNormalGLProgramState ( ) ) ; <nl> + _frontCrossRenderer - > setGLProgramState ( this - > getNormalGLProgramState ( ) ) ; <nl> + <nl> + <nl> + _backGroundBoxRenderer - > setScale ( _backgroundTextureScaleX , _backgroundTextureScaleY ) ; <nl> + _frontCrossRenderer - > setScale ( _backgroundTextureScaleX , _backgroundTextureScaleY ) ; <nl> + <nl> + <nl> if ( _isSelected ) <nl> { <nl> _frontCrossRenderer - > setVisible ( true ) ; <nl> void CheckBox : : onPressStateChangedToNormal ( ) <nl> <nl> void CheckBox : : onPressStateChangedToPressed ( ) <nl> { <nl> - _backGroundBoxRenderer - > setVisible ( false ) ; <nl> - _backGroundSelectedBoxRenderer - > setVisible ( true ) ; <nl> - _backGroundBoxDisabledRenderer - > setVisible ( false ) ; <nl> - _frontCrossDisabledRenderer - > setVisible ( false ) ; <nl> + _backGroundBoxRenderer - > setGLProgramState ( this - > getNormalGLProgramState ( ) ) ; <nl> + _frontCrossRenderer - > setGLProgramState ( this - > getNormalGLProgramState ( ) ) ; <nl> + <nl> + if ( _backGroundSelectedFileName . empty ( ) ) <nl> + { <nl> + _backGroundBoxRenderer - > setScale ( _backgroundTextureScaleX + _zoomScale , <nl> + _backgroundTextureScaleY + _zoomScale ) ; <nl> + _frontCrossRenderer - > setScale ( _backgroundTextureScaleX + _zoomScale , <nl> + _backgroundTextureScaleY + _zoomScale ) ; <nl> + } <nl> + else <nl> + { <nl> + _backGroundBoxRenderer - > setVisible ( false ) ; <nl> + _backGroundSelectedBoxRenderer - > setVisible ( true ) ; <nl> + _backGroundBoxDisabledRenderer - > setVisible ( false ) ; <nl> + _frontCrossDisabledRenderer - > setVisible ( false ) ; <nl> + } <nl> } <nl> <nl> void CheckBox : : onPressStateChangedToDisabled ( ) <nl> { <nl> - _backGroundBoxRenderer - > setVisible ( false ) ; <nl> + if ( _backGroundDisabledFileName . empty ( ) | | _frontCrossDisabledFileName . empty ( ) ) <nl> + { <nl> + _backGroundBoxRenderer - > setGLProgramState ( this - > getGrayGLProgramState ( ) ) ; <nl> + _frontCrossRenderer - > setGLProgramState ( this - > getGrayGLProgramState ( ) ) ; <nl> + } <nl> + else <nl> + { <nl> + _backGroundBoxRenderer - > setVisible ( false ) ; <nl> + _backGroundBoxDisabledRenderer - > setVisible ( true ) ; <nl> + <nl> + } <nl> + <nl> _backGroundSelectedBoxRenderer - > setVisible ( false ) ; <nl> - _backGroundBoxDisabledRenderer - > setVisible ( true ) ; <nl> _frontCrossRenderer - > setVisible ( false ) ; <nl> + _backGroundBoxRenderer - > setScale ( _backgroundTextureScaleX , _backgroundTextureScaleY ) ; <nl> + _frontCrossRenderer - > setScale ( _backgroundTextureScaleX , _backgroundTextureScaleY ) ; <nl> + <nl> if ( _isSelected ) <nl> { <nl> _frontCrossDisabledRenderer - > setVisible ( true ) ; <nl> } <nl> } <nl> + <nl> + void CheckBox : : setZoomScale ( float scale ) <nl> + { <nl> + _zoomScale = scale ; <nl> + } <nl> + <nl> + float CheckBox : : getZoomScale ( ) const <nl> + { <nl> + return _zoomScale ; <nl> + } <nl> <nl> void CheckBox : : setSelected ( bool selected ) <nl> { <nl> void CheckBox : : backGroundTextureScaleChangedWithSize ( ) <nl> if ( _ignoreSize ) <nl> { <nl> _backGroundBoxRenderer - > setScale ( 1 . 0f ) ; <nl> + _backgroundTextureScaleX = _backgroundTextureScaleY = 1 . 0f ; <nl> } <nl> else <nl> { <nl> void CheckBox : : backGroundTextureScaleChangedWithSize ( ) <nl> if ( textureSize . width < = 0 . 0f | | textureSize . height < = 0 . 0f ) <nl> { <nl> _backGroundBoxRenderer - > setScale ( 1 . 0f ) ; <nl> + _backgroundTextureScaleX = _backgroundTextureScaleY = 1 . 0f ; <nl> return ; <nl> } <nl> float scaleX = _contentSize . width / textureSize . width ; <nl> float scaleY = _contentSize . height / textureSize . height ; <nl> + _backgroundTextureScaleX = scaleX ; <nl> + _backgroundTextureScaleY = scaleY ; <nl> _backGroundBoxRenderer - > setScaleX ( scaleX ) ; <nl> _backGroundBoxRenderer - > setScaleY ( scaleY ) ; <nl> } <nl> void CheckBox : : copySpecialProperties ( Widget * widget ) <nl> _checkBoxEventSelector = checkBox - > _checkBoxEventSelector ; <nl> _checkBoxEventCallback = checkBox - > _checkBoxEventCallback ; <nl> _ccEventCallback = checkBox - > _ccEventCallback ; <nl> + _zoomScale = checkBox - > _zoomScale ; <nl> + _backgroundTextureScaleX = checkBox - > _backgroundTextureScaleX ; <nl> + _backgroundTextureScaleY = checkBox - > _backgroundTextureScaleY ; <nl> } <nl> } <nl> <nl> mmm a / cocos / ui / UICheckBox . h <nl> ppp b / cocos / ui / UICheckBox . h <nl> class CC_GUI_DLL CheckBox : public Widget <nl> const std : : string & backGroundDisabled , <nl> const std : : string & frontCrossDisabled , <nl> TextureResType texType = TextureResType : : LOCAL ) ; <nl> + <nl> + / * * <nl> + * use less resource to create a CheckBox <nl> + * / <nl> + static CheckBox * create ( const std : : string & backGround , <nl> + const std : : string & cross , <nl> + TextureResType texType = TextureResType : : LOCAL ) ; <nl> <nl> / * * <nl> * Load textures for checkbox . <nl> class CC_GUI_DLL CheckBox : public Widget <nl> * / <nl> virtual std : : string getDescription ( ) const override ; <nl> <nl> + / * * When user pressed the button , the button will zoom to a scale . <nl> + * The final scale of the button equals ( button original scale + _zoomScale ) <nl> + * @ since v3 . 3 <nl> + * / <nl> + void setZoomScale ( float scale ) ; <nl> + / * * <nl> + * @ brief Return a zoom scale <nl> + * @ since v3 . 3 <nl> + * / <nl> + float getZoomScale ( ) const ; <nl> + <nl> CC_CONSTRUCTOR_ACCESS : <nl> virtual bool init ( ) override ; <nl> virtual bool init ( const std : : string & backGround , <nl> class CC_GUI_DLL CheckBox : public Widget <nl> TextureResType _backGroundDisabledTexType ; <nl> TextureResType _frontCrossDisabledTexType ; <nl> <nl> + float _zoomScale ; <nl> + float _backgroundTextureScaleX ; <nl> + float _backgroundTextureScaleY ; <nl> std : : string _backGroundFileName ; <nl> std : : string _backGroundSelectedFileName ; <nl> std : : string _frontCrossFileName ; <nl> mmm a / cocos / ui / UIScale9Sprite . cpp <nl> ppp b / cocos / ui / UIScale9Sprite . cpp <nl> <nl> # include " 2d / CCSpriteFrameCache . h " <nl> # include " base / CCVector . h " <nl> # include " base / CCDirector . h " <nl> + # include " renderer / CCGLProgram . h " <nl> + # include " ui / shaders / UIShaders . h " <nl> + # include " renderer / ccShaders . h " <nl> <nl> NS_CC_BEGIN <nl> namespace ui { <nl> y + = ytranslate ; \ <nl> return NULL ; <nl> } <nl> <nl> + void Scale9Sprite : : setState ( cocos2d : : ui : : Scale9Sprite : : State state ) <nl> + { <nl> + GLProgramState * glState = nullptr ; <nl> + switch ( state ) <nl> + { <nl> + case State : : NORMAL : <nl> + { <nl> + glState = GLProgramState : : getOrCreateWithGLProgramName ( GLProgram : : SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP ) ; <nl> + } <nl> + break ; <nl> + case State : : GRAY : <nl> + { <nl> + auto program = GLProgram : : createWithByteArrays ( ccPositionTextureColor_noMVP_vert , <nl> + ccUIGrayScale_frag ) ; <nl> + glState = GLProgramState : : getOrCreateWithGLProgram ( program ) ; <nl> + } <nl> + default : <nl> + break ; <nl> + } <nl> + <nl> + if ( nullptr ! = _scale9Image ) <nl> + { <nl> + _scale9Image - > setGLProgramState ( glState ) ; <nl> + } <nl> + <nl> + if ( _scale9Enabled ) <nl> + { <nl> + for ( auto & sp : _protectedChildren ) <nl> + { <nl> + sp - > setGLProgramState ( glState ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> / * * sets the opacity . <nl> @ warning If the the texture has premultiplied alpha then , the R , G and B channels will be modifed . <nl> Values goes from 0 to 255 , where 255 means fully opaque . <nl> mmm a / cocos / ui / UIScale9Sprite . h <nl> ppp b / cocos / ui / UIScale9Sprite . h <nl> namespace ui { <nl> * / <nl> virtual ~ Scale9Sprite ( ) ; <nl> <nl> + <nl> + enum class State <nl> + { <nl> + NORMAL , <nl> + GRAY <nl> + } ; <nl> + <nl> public : <nl> static Scale9Sprite * create ( ) ; <nl> <nl> namespace ui { <nl> virtual void setContentSize ( const Size & size ) override ; <nl> virtual void setAnchorPoint ( const Vec2 & anchorPoint ) override ; <nl> <nl> + / * * <nl> + * @ since v3 . 4 <nl> + * / <nl> + void setState ( State state ) ; <nl> + <nl> Size getOriginalSize ( ) const ; <nl> void setPreferredSize ( const Size & size ) ; <nl> Size getPreferredSize ( ) const ; <nl> mmm a / cocos / ui / UISlider . cpp <nl> ppp b / cocos / ui / UISlider . cpp <nl> _barLength ( 0 . 0 ) , <nl> _percent ( 0 ) , <nl> _scale9Enabled ( false ) , <nl> _prevIgnoreSize ( true ) , <nl> + _zoomScale ( 0 . 1f ) , <nl> + _sliderBallNormalTextureScaleX ( 1 . 0 ) , <nl> + _sliderBallNormalTextureScaleY ( 1 . 0 ) , <nl> _textureFile ( " " ) , <nl> _progressBarTextureFile ( " " ) , <nl> _slidBallNormalTextureFile ( " " ) , <nl> Slider * Slider : : create ( ) <nl> CC_SAFE_DELETE ( widget ) ; <nl> return nullptr ; <nl> } <nl> + <nl> + Slider * Slider : : create ( const std : : string & barTextureName , <nl> + const std : : string & normalBallTextureName , <nl> + TextureResType resType ) <nl> + { <nl> + Slider * widget = new ( std : : nothrow ) Slider ( ) ; <nl> + if ( widget & & widget - > init ( ) ) <nl> + { <nl> + widget - > loadBarTexture ( barTextureName ) ; <nl> + widget - > loadSlidBallTextureNormal ( normalBallTextureName ) ; <nl> + widget - > autorelease ( ) ; <nl> + return widget ; <nl> + } <nl> + CC_SAFE_DELETE ( widget ) ; <nl> + return nullptr ; <nl> + } <nl> <nl> bool Slider : : init ( ) <nl> { <nl> void Slider : : onPressStateChangedToNormal ( ) <nl> _slidBallNormalRenderer - > setVisible ( true ) ; <nl> _slidBallPressedRenderer - > setVisible ( false ) ; <nl> _slidBallDisabledRenderer - > setVisible ( false ) ; <nl> + <nl> + _slidBallNormalRenderer - > setGLProgramState ( this - > getNormalGLProgramState ( ) ) ; <nl> + _slidBallNormalRenderer - > setScale ( _sliderBallNormalTextureScaleX , _sliderBallNormalTextureScaleY ) ; <nl> } <nl> <nl> void Slider : : onPressStateChangedToPressed ( ) <nl> { <nl> - _slidBallNormalRenderer - > setVisible ( false ) ; <nl> - _slidBallPressedRenderer - > setVisible ( true ) ; <nl> - _slidBallDisabledRenderer - > setVisible ( false ) ; <nl> + _slidBallNormalRenderer - > setGLProgramState ( this - > getNormalGLProgramState ( ) ) ; <nl> + <nl> + <nl> + if ( _slidBallPressedTextureFile . empty ( ) ) <nl> + { <nl> + _slidBallNormalRenderer - > setScale ( _sliderBallNormalTextureScaleX + _zoomScale , <nl> + _sliderBallNormalTextureScaleY + _zoomScale ) ; <nl> + } <nl> + else <nl> + { <nl> + _slidBallNormalRenderer - > setVisible ( false ) ; <nl> + _slidBallPressedRenderer - > setVisible ( true ) ; <nl> + _slidBallDisabledRenderer - > setVisible ( false ) ; <nl> + } <nl> } <nl> <nl> void Slider : : onPressStateChangedToDisabled ( ) <nl> { <nl> - _slidBallNormalRenderer - > setVisible ( false ) ; <nl> + if ( _slidBallDisabledTextureFile . empty ( ) ) <nl> + { <nl> + _slidBallNormalRenderer - > setGLProgramState ( this - > getGrayGLProgramState ( ) ) ; <nl> + } <nl> + else <nl> + { <nl> + _slidBallNormalRenderer - > setVisible ( false ) ; <nl> + _slidBallDisabledRenderer - > setVisible ( true ) ; <nl> + } <nl> + <nl> + _slidBallNormalRenderer - > setScale ( _sliderBallNormalTextureScaleX , _sliderBallNormalTextureScaleY ) ; <nl> + <nl> _slidBallPressedRenderer - > setVisible ( false ) ; <nl> - _slidBallDisabledRenderer - > setVisible ( true ) ; <nl> } <nl> + <nl> + <nl> + void Slider : : setZoomScale ( float scale ) <nl> + { <nl> + _zoomScale = scale ; <nl> + } <nl> + <nl> + float Slider : : getZoomScale ( ) const <nl> + { <nl> + return _zoomScale ; <nl> + } <nl> + <nl> <nl> std : : string Slider : : getDescription ( ) const <nl> { <nl> mmm a / cocos / ui / UISlider . h <nl> ppp b / cocos / ui / UISlider . h <nl> class CC_GUI_DLL Slider : public Widget <nl> * / <nl> static Slider * create ( ) ; <nl> <nl> + static Slider * create ( const std : : string & barTextureName , <nl> + const std : : string & normalBallTextureName , <nl> + TextureResType resType = TextureResType : : LOCAL ) ; <nl> + <nl> / * * <nl> * Load texture for slider bar . <nl> * <nl> class CC_GUI_DLL Slider : public Widget <nl> * <nl> * @ param texType @ see TextureResType <nl> * / <nl> - void loadBarTexture ( const std : : string & fileName , TextureResType texType = TextureResType : : LOCAL ) ; <nl> + void loadBarTexture ( const std : : string & fileName , TextureResType resType = TextureResType : : LOCAL ) ; <nl> <nl> / * * <nl> * Sets if slider is using scale9 renderer . <nl> class CC_GUI_DLL Slider : public Widget <nl> * @ param texType @ see TextureResType <nl> * / <nl> void loadSlidBallTextures ( const std : : string & normal , <nl> - const std : : string & pressed , <nl> - const std : : string & disabled , <nl> + const std : : string & pressed = " " , <nl> + const std : : string & disabled = " " , <nl> TextureResType texType = TextureResType : : LOCAL ) ; <nl> <nl> / * * <nl> class CC_GUI_DLL Slider : public Widget <nl> * <nl> * @ param texType @ see TextureResType <nl> * / <nl> - void loadSlidBallTextureNormal ( const std : : string & normal , TextureResType texType = TextureResType : : LOCAL ) ; <nl> + void loadSlidBallTextureNormal ( const std : : string & normal , TextureResType resType = TextureResType : : LOCAL ) ; <nl> <nl> / * * <nl> * Load selected state texture for slider ball . <nl> class CC_GUI_DLL Slider : public Widget <nl> * <nl> * @ param texType @ see TextureResType <nl> * / <nl> - void loadSlidBallTexturePressed ( const std : : string & pressed , TextureResType texType = TextureResType : : LOCAL ) ; <nl> + void loadSlidBallTexturePressed ( const std : : string & pressed , TextureResType resType = TextureResType : : LOCAL ) ; <nl> <nl> / * * <nl> * Load dark state texture for slider ball . <nl> class CC_GUI_DLL Slider : public Widget <nl> * <nl> * @ param texType @ see TextureResType <nl> * / <nl> - void loadSlidBallTextureDisabled ( const std : : string & disabled , TextureResType texType = TextureResType : : LOCAL ) ; <nl> + void loadSlidBallTextureDisabled ( const std : : string & disabled , TextureResType resType = TextureResType : : LOCAL ) ; <nl> <nl> / * * <nl> * Load dark state texture for slider progress bar . <nl> class CC_GUI_DLL Slider : public Widget <nl> * <nl> * @ param texType @ see TextureResType <nl> * / <nl> - void loadProgressBarTexture ( const std : : string & fileName , TextureResType texType = TextureResType : : LOCAL ) ; <nl> + void loadProgressBarTexture ( const std : : string & fileName , TextureResType resType = TextureResType : : LOCAL ) ; <nl> <nl> / * * <nl> * Changes the progress direction of slider . <nl> class CC_GUI_DLL Slider : public Widget <nl> * / <nl> virtual std : : string getDescription ( ) const override ; <nl> <nl> + / * * When user pressed the button , the button will zoom to a scale . <nl> + * The final scale of the button equals ( button original scale + _zoomScale ) <nl> + * @ since v3 . 3 <nl> + * / <nl> + void setZoomScale ( float scale ) ; <nl> + / * * <nl> + * @ brief Return a zoom scale <nl> + * @ since v3 . 3 <nl> + * / <nl> + float getZoomScale ( ) const ; <nl> + <nl> + <nl> CC_CONSTRUCTOR_ACCESS : <nl> virtual bool init ( ) override ; <nl> <nl> class CC_GUI_DLL Slider : public Widget <nl> <nl> bool _scale9Enabled ; <nl> bool _prevIgnoreSize ; <nl> + <nl> + float _zoomScale ; <nl> + float _sliderBallNormalTextureScaleX ; <nl> + float _sliderBallNormalTextureScaleY ; <nl> + <nl> std : : string _textureFile ; <nl> std : : string _progressBarTextureFile ; <nl> std : : string _slidBallNormalTextureFile ; <nl> mmm a / cocos / ui / UIWidget . cpp <nl> ppp b / cocos / ui / UIWidget . cpp <nl> THE SOFTWARE . <nl> # include " base / CCEventFocus . h " <nl> # include " base / CCEventDispatcher . h " <nl> # include " ui / UILayoutComponent . h " <nl> + # include " renderer / CCGLProgram . h " <nl> + # include " renderer / CCGLProgramState . h " <nl> + # include " renderer / ccShaders . h " <nl> + # include " ui / shaders / UIShaders . h " <nl> <nl> NS_CC_BEGIN <nl> <nl> void Widget : : copyClonedWidgetChildren ( Widget * model ) <nl> } <nl> } <nl> } <nl> + <nl> + GLProgramState * Widget : : getNormalGLProgramState ( ) const <nl> + { <nl> + GLProgramState * glState = nullptr ; <nl> + glState = GLProgramState : : getOrCreateWithGLProgramName ( GLProgram : : SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP ) ; <nl> + return glState ; <nl> + } <nl> + <nl> + GLProgramState * Widget : : getGrayGLProgramState ( ) const <nl> + { <nl> + auto program = GLProgram : : createWithByteArrays ( ccPositionTextureColor_noMVP_vert , <nl> + ccUIGrayScale_frag ) ; <nl> + GLProgramState * glState = GLProgramState : : getOrCreateWithGLProgram ( program ) ; <nl> + return glState ; <nl> + } <nl> <nl> void Widget : : copySpecialProperties ( Widget * model ) <nl> { <nl> mmm a / cocos / ui / UIWidget . h <nl> ppp b / cocos / ui / UIWidget . h <nl> class CC_GUI_DLL Widget : public ProtectedNode , public LayoutParameterProtocol <nl> void dispatchFocusEvent ( Widget * widgetLoseFocus , Widget * widgetGetFocus ) ; <nl> <nl> protected : <nl> + / * * <nl> + * Get a normal state GLProgramState <nl> + * @ since v3 . 4 <nl> + * / <nl> + <nl> + GLProgramState * getNormalGLProgramState ( ) const ; <nl> + <nl> + / * * <nl> + * Get a disabled state GLProgramState <nl> + * @ since v3 . 4 <nl> + * / <nl> + GLProgramState * getGrayGLProgramState ( ) const ; <nl> + <nl> + <nl> / / call back function called when size changed . <nl> virtual void onSizeChanged ( ) ; <nl> <nl> new file mode 100644 <nl> index 000000000000 . . 40d9459dad2a <nl> mmm / dev / null <nl> ppp b / cocos / ui / shaders / UIShaders . cpp <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + <nl> + http : / / www . cocos2d - x . org <nl> + <nl> + Permission is hereby granted , free of charge , to any person obtaining a copy <nl> + of this software and associated documentation files ( the " Software " ) , to deal <nl> + in the Software without restriction , including without limitation the rights <nl> + to use , copy , modify , merge , publish , distribute , sublicense , and / or sell <nl> + copies of the Software , and to permit persons to whom the Software is <nl> + furnished to do so , subject to the following conditions : <nl> + <nl> + The above copyright notice and this permission notice shall be included in <nl> + all copies or substantial portions of the Software . <nl> + <nl> + THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR <nl> + IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , <nl> + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL THE <nl> + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER <nl> + LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> + THE SOFTWARE . <nl> + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + # include " UIShaders . h " <nl> + <nl> + # define STRINGIFY ( A ) # A <nl> + <nl> + NS_CC_BEGIN <nl> + <nl> + / / include the gray scale shader <nl> + # include " ccShader_grayscale . frag " <nl> + <nl> + NS_CC_END <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 000000000000 . . 821e26313d9d <nl> mmm / dev / null <nl> ppp b / cocos / ui / shaders / UIShaders . h <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + Copyright ( c ) 2013 - 2014 Chukong Technologies Inc . <nl> + <nl> + http : / / www . cocos2d - x . org <nl> + <nl> + Permission is hereby granted , free of charge , to any person obtaining a copy <nl> + of this software and associated documentation files ( the " Software " ) , to deal <nl> + in the Software without restriction , including without limitation the rights <nl> + to use , copy , modify , merge , publish , distribute , sublicense , and / or sell <nl> + copies of the Software , and to permit persons to whom the Software is <nl> + furnished to do so , subject to the following conditions : <nl> + <nl> + The above copyright notice and this permission notice shall be included in <nl> + all copies or substantial portions of the Software . <nl> + <nl> + THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR <nl> + IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , <nl> + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL THE <nl> + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER <nl> + LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> + THE SOFTWARE . <nl> + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + # ifndef __UISHADERS_H__ <nl> + # define __UISHADERS_H__ <nl> + <nl> + # include " platform / CCGL . h " <nl> + # include " platform / CCPlatformMacros . h " <nl> + <nl> + NS_CC_BEGIN <nl> + <nl> + extern CC_DLL const GLchar * ccUIGrayScale_frag ; <nl> + <nl> + NS_CC_END <nl> + <nl> + # endif / * __UISHADERS_H__ * / <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 000000000000 . . 32092e3f83c0 <nl> mmm / dev / null <nl> ppp b / cocos / ui / shaders / ccShader_grayscale . frag <nl> <nl> + const char * ccUIGrayScale_frag = STRINGIFY ( <nl> + <nl> + \ n # ifdef GL_ES \ n <nl> + \ nprecision mediump float ; \ n <nl> + \ n # endif \ n <nl> + \ n \ n <nl> + \ nvarying vec4 v_fragmentColor ; \ n <nl> + \ nvarying vec2 v_texCoord ; \ n <nl> + \ n \ n <nl> + \ nvoid main ( void ) \ n <nl> + \ n { \ n <nl> + \ nvec4 c = texture2D ( CC_Texture0 , v_texCoord ) ; \ n <nl> + \ ngl_FragColor . xyz = vec3 ( 0 . 2126 * c . r + 0 . 7152 * c . g + 0 . 0722 * c . b ) ; \ n <nl> + \ ngl_FragColor . w = c . w ; \ n <nl> + \ n } \ n <nl> + ) ; <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / CocosGUIScene . cpp <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / CocosGUIScene . cpp <nl> g_guisTests [ ] = <nl> UISceneManager * sceneManager = UISceneManager : : sharedUISceneManager ( ) ; <nl> sceneManager - > setCurrentUISceneId ( kUIButtonTest ) ; <nl> sceneManager - > setMinUISceneId ( kUIButtonTest ) ; <nl> - sceneManager - > setMaxUISceneId ( kUIButtonFlipTest ) ; <nl> + sceneManager - > setMaxUISceneId ( kUIButtonDisableDefaultTest ) ; <nl> Scene * scene = sceneManager - > currentUIScene ( ) ; <nl> Director : : getInstance ( ) - > replaceScene ( scene ) ; <nl> } <nl> g_guisTests [ ] = <nl> UISceneManager * sceneManager = UISceneManager : : sharedUISceneManager ( ) ; <nl> sceneManager - > setCurrentUISceneId ( kUICheckBoxTest ) ; <nl> sceneManager - > setMinUISceneId ( kUICheckBoxTest ) ; <nl> - sceneManager - > setMaxUISceneId ( kUICheckBoxTest ) ; <nl> + sceneManager - > setMaxUISceneId ( kUICheckBoxDefaultBehaviorTest ) ; <nl> Scene * scene = sceneManager - > currentUIScene ( ) ; <nl> Director : : getInstance ( ) - > replaceScene ( scene ) ; <nl> } <nl> g_guisTests [ ] = <nl> UISceneManager * sceneManager = UISceneManager : : sharedUISceneManager ( ) ; <nl> sceneManager - > setCurrentUISceneId ( kUISliderTest ) ; <nl> sceneManager - > setMinUISceneId ( kUISliderTest ) ; <nl> - sceneManager - > setMaxUISceneId ( kUISliderTest_Scale9 ) ; <nl> + sceneManager - > setMaxUISceneId ( kUISliderDisabledDefaultTest ) ; <nl> Scene * scene = sceneManager - > currentUIScene ( ) ; <nl> Director : : getInstance ( ) - > replaceScene ( scene ) ; <nl> } <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UIButtonTest / UIButtonTest . cpp <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UIButtonTest / UIButtonTest . cpp <nl> bool UIButtonTest : : init ( ) <nl> _uiLayer - > addChild ( alert ) ; <nl> <nl> / / Create the button <nl> - Button * button = Button : : create ( " cocosui / animationbuttonnormal . png " ) ; <nl> + Button * button = Button : : create ( " cocosui / animationbuttonnormal . png " , <nl> + " cocosui / animationbuttonpressed . png " ) ; <nl> CCLOG ( " content size should be greater than 0 : width = % f , height = % f " , button - > getContentSize ( ) . width , <nl> button - > getContentSize ( ) . height ) ; <nl> button - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , widgetSize . height / 2 . 0f ) ) ; <nl> bool UIButtonFlipTest : : init ( ) <nl> titleLabel - > setNormalizedPosition ( Vec2 ( 0 . 8 , 0 . 7 ) ) ; <nl> this - > addChild ( titleLabel ) ; <nl> <nl> + return true ; <nl> + } <nl> + return false ; <nl> + } <nl> + <nl> + / / UIButtonNormalDefaultTest <nl> + UIButtonNormalDefaultTest : : UIButtonNormalDefaultTest ( ) <nl> + : _displayValueLabel ( nullptr ) <nl> + { <nl> + <nl> + } <nl> + <nl> + UIButtonNormalDefaultTest : : ~ UIButtonNormalDefaultTest ( ) <nl> + { <nl> + } <nl> + <nl> + bool UIButtonNormalDefaultTest : : init ( ) <nl> + { <nl> + if ( UIScene : : init ( ) ) <nl> + { <nl> + Size widgetSize = _widget - > getContentSize ( ) ; <nl> + <nl> + / / Add a label in which the button events will be displayed <nl> + _displayValueLabel = Text : : create ( " " , " fonts / Marker Felt . ttf " , 32 ) ; <nl> + _displayValueLabel - > setAnchorPoint ( Vec2 ( 0 . 5f , - 1 . 0f ) ) ; <nl> + _displayValueLabel - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , widgetSize . height / 2 . 0f ) ) ; <nl> + _uiLayer - > addChild ( _displayValueLabel ) ; <nl> + <nl> + / / Add the alert <nl> + Text * alert = Text : : create ( " Button should scale when clicked " , " fonts / Marker Felt . ttf " , 20 ) ; <nl> + alert - > setColor ( Color3B ( 159 , 168 , 176 ) ) ; <nl> + <nl> + alert - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , <nl> + widgetSize . height / 2 . 0f - alert - > getContentSize ( ) . height * 1 . 75f ) ) ; <nl> + <nl> + _uiLayer - > addChild ( alert ) ; <nl> + <nl> + / / Create the button <nl> + Button * button = Button : : create ( " cocosui / animationbuttonnormal . png " ) ; <nl> + button - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f - 80 , widgetSize . height / 2 . 0f + 40 ) ) ; <nl> + button - > setZoomScale ( 0 . 4f ) ; <nl> + button - > setPressedActionEnabled ( true ) ; <nl> + _uiLayer - > addChild ( button ) ; <nl> + <nl> + / / Create the button <nl> + Button * buttonScale9 = Button : : create ( " cocosui / button . png " ) ; <nl> + / / open scale9 render <nl> + buttonScale9 - > setScale9Enabled ( true ) ; <nl> + buttonScale9 - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f + 50 , widgetSize . height / 2 . 0f + 40 ) ) ; <nl> + buttonScale9 - > setContentSize ( Size ( 150 , 70 ) ) ; <nl> + buttonScale9 - > setPressedActionEnabled ( true ) ; <nl> + _uiLayer - > addChild ( buttonScale9 ) ; <nl> + <nl> + <nl> + <nl> + <nl> + return true ; <nl> + } <nl> + return false ; <nl> + } <nl> + <nl> + <nl> + / / UIButtonDisableDefaultTest <nl> + UIButtonDisableDefaultTest : : UIButtonDisableDefaultTest ( ) <nl> + : _displayValueLabel ( nullptr ) <nl> + { <nl> + <nl> + } <nl> + <nl> + UIButtonDisableDefaultTest : : ~ UIButtonDisableDefaultTest ( ) <nl> + { <nl> + } <nl> + <nl> + bool UIButtonDisableDefaultTest : : init ( ) <nl> + { <nl> + if ( UIScene : : init ( ) ) <nl> + { <nl> + Size widgetSize = _widget - > getContentSize ( ) ; <nl> + <nl> + / / Add a label in which the button events will be displayed <nl> + _displayValueLabel = Text : : create ( " " , " fonts / Marker Felt . ttf " , 32 ) ; <nl> + _displayValueLabel - > setAnchorPoint ( Vec2 ( 0 . 5f , - 1 . 0f ) ) ; <nl> + _displayValueLabel - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , widgetSize . height / 2 . 0f ) ) ; <nl> + _uiLayer - > addChild ( _displayValueLabel ) ; <nl> + <nl> + / / Add the alert <nl> + Text * alert = Text : : create ( " Left button will turn normal when clicked " , " fonts / Marker Felt . ttf " , 20 ) ; <nl> + alert - > setColor ( Color3B ( 159 , 168 , 176 ) ) ; <nl> + <nl> + alert - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , <nl> + widgetSize . height / 2 . 0f - alert - > getContentSize ( ) . height * 1 . 75f ) ) ; <nl> + <nl> + _uiLayer - > addChild ( alert ) ; <nl> + <nl> + / / Create the button <nl> + Button * button = Button : : create ( " cocosui / animationbuttonnormal . png " ) ; <nl> + button - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f - 80 , widgetSize . height / 2 . 0f + 40 ) ) ; <nl> + button - > setZoomScale ( 0 . 4f ) ; <nl> + button - > setPressedActionEnabled ( true ) ; <nl> + button - > setBright ( false ) ; <nl> + button - > addClickEventListener ( [ = ] ( Ref * ) { <nl> + button - > setBright ( true ) ; <nl> + } ) ; <nl> + _uiLayer - > addChild ( button ) ; <nl> + <nl> + / / Create the button <nl> + Button * buttonScale9 = Button : : create ( " cocosui / button . png " ) ; <nl> + / / open scale9 render <nl> + buttonScale9 - > setScale9Enabled ( true ) ; <nl> + buttonScale9 - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f + 50 , widgetSize . height / 2 . 0f + 40 ) ) ; <nl> + buttonScale9 - > setContentSize ( Size ( 150 , 70 ) ) ; <nl> + buttonScale9 - > setPressedActionEnabled ( true ) ; <nl> + buttonScale9 - > setEnabled ( false ) ; <nl> + buttonScale9 - > setBright ( false ) ; <nl> + _uiLayer - > addChild ( buttonScale9 ) ; <nl> + <nl> + <nl> + <nl> + <nl> return true ; <nl> } <nl> return false ; <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UIButtonTest / UIButtonTest . h <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UIButtonTest / UIButtonTest . h <nl> class UIButtonFlipTest : public UIScene <nl> UI_SCENE_CREATE_FUNC ( UIButtonFlipTest ) <nl> Text * _displayValueLabel ; <nl> } ; <nl> + <nl> + class UIButtonNormalDefaultTest : public UIScene <nl> + { <nl> + public : <nl> + UIButtonNormalDefaultTest ( ) ; <nl> + ~ UIButtonNormalDefaultTest ( ) ; <nl> + bool init ( ) ; <nl> + <nl> + protected : <nl> + UI_SCENE_CREATE_FUNC ( UIButtonNormalDefaultTest ) <nl> + Text * _displayValueLabel ; <nl> + } ; <nl> + <nl> + class UIButtonDisableDefaultTest : public UIScene <nl> + { <nl> + public : <nl> + UIButtonDisableDefaultTest ( ) ; <nl> + ~ UIButtonDisableDefaultTest ( ) ; <nl> + bool init ( ) ; <nl> + <nl> + protected : <nl> + UI_SCENE_CREATE_FUNC ( UIButtonDisableDefaultTest ) <nl> + Text * _displayValueLabel ; <nl> + } ; <nl> # endif / * defined ( __TestCpp__UIButtonTest__ ) * / <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UICheckBoxTest / UICheckBoxTest . cpp <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UICheckBoxTest / UICheckBoxTest . cpp <nl> void UICheckBoxTest : : selectedEvent ( Ref * pSender , CheckBox : : EventType type ) <nl> } <nl> <nl> } <nl> + <nl> + <nl> + / / UICheckBoxDefaultBehaviorTest <nl> + UICheckBoxDefaultBehaviorTest : : UICheckBoxDefaultBehaviorTest ( ) <nl> + : _displayValueLabel ( nullptr ) <nl> + { <nl> + <nl> + } <nl> + <nl> + UICheckBoxDefaultBehaviorTest : : ~ UICheckBoxDefaultBehaviorTest ( ) <nl> + { <nl> + } <nl> + <nl> + bool UICheckBoxDefaultBehaviorTest : : init ( ) <nl> + { <nl> + if ( UIScene : : init ( ) ) <nl> + { <nl> + Size widgetSize = _widget - > getContentSize ( ) ; ; <nl> + <nl> + / / Add a label in which the checkbox events will be displayed <nl> + _displayValueLabel = Text : : create ( " No Event " , " fonts / Marker Felt . ttf " , 32 ) ; <nl> + _displayValueLabel - > setAnchorPoint ( Vec2 ( 0 . 5f , - 1 ) ) ; <nl> + _displayValueLabel - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , widgetSize . height / 2 . 0f ) ) ; <nl> + _uiLayer - > addChild ( _displayValueLabel ) ; <nl> + <nl> + / / Add the alert <nl> + Text * alert = Text : : create ( " Only left two and the last checkbox can be cliked ! " , " fonts / Marker Felt . ttf " , 20 ) ; <nl> + alert - > setColor ( Color3B ( 159 , 168 , 176 ) ) ; <nl> + alert - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , <nl> + widgetSize . height / 2 . 0f - alert - > getContentSize ( ) . height * 1 . 75f ) ) ; <nl> + _uiLayer - > addChild ( alert ) ; <nl> + <nl> + / / Create the checkbox <nl> + CheckBox * checkBox = CheckBox : : create ( " cocosui / check_box_normal . png " , <nl> + " cocosui / check_box_active . png " ) ; <nl> + checkBox - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f - 50 , widgetSize . height / 2 . 0f ) ) ; <nl> + <nl> + _uiLayer - > addChild ( checkBox ) ; <nl> + <nl> + <nl> + / / Create the checkbox <nl> + CheckBox * checkBox2 = CheckBox : : create ( " cocosui / check_box_normal . png " , <nl> + " cocosui / check_box_active . png " ) ; <nl> + checkBox2 - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f - 150 , widgetSize . height / 2 . 0f ) ) ; <nl> + checkBox2 - > ignoreContentAdaptWithSize ( false ) ; <nl> + checkBox2 - > setZoomScale ( 0 . 5 ) ; <nl> + checkBox2 - > setContentSize ( Size ( 80 , 80 ) ) ; <nl> + checkBox2 - > setName ( " bigCheckBox " ) ; <nl> + _uiLayer - > addChild ( checkBox2 ) ; <nl> + <nl> + <nl> + / / Create the checkbox <nl> + CheckBox * checkBoxDisabled = CheckBox : : create ( " cocosui / check_box_normal . png " , <nl> + " cocosui / check_box_active . png " ) ; <nl> + checkBoxDisabled - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f + 20 , widgetSize . height / 2 . 0f ) ) ; <nl> + checkBoxDisabled - > setEnabled ( false ) ; <nl> + checkBoxDisabled - > setBright ( false ) ; <nl> + _uiLayer - > addChild ( checkBoxDisabled ) ; <nl> + <nl> + CheckBox * checkBoxDisabled2 = CheckBox : : create ( " cocosui / check_box_normal . png " , <nl> + " cocosui / check_box_active . png " ) ; <nl> + checkBoxDisabled2 - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f + 70 , widgetSize . height / 2 . 0f ) ) ; <nl> + checkBoxDisabled2 - > setBright ( false ) ; <nl> + checkBoxDisabled2 - > setSelected ( true ) ; <nl> + _uiLayer - > addChild ( checkBoxDisabled2 ) ; <nl> + return true ; <nl> + } <nl> + return false ; <nl> + } <nl> + <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UICheckBoxTest / UICheckBoxTest . h <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UICheckBoxTest / UICheckBoxTest . h <nl> class UICheckBoxTest : public UIScene <nl> Text * _displayValueLabel ; <nl> } ; <nl> <nl> + class UICheckBoxDefaultBehaviorTest : public UIScene <nl> + { <nl> + public : <nl> + UICheckBoxDefaultBehaviorTest ( ) ; <nl> + ~ UICheckBoxDefaultBehaviorTest ( ) ; <nl> + bool init ( ) ; <nl> + <nl> + protected : <nl> + UI_SCENE_CREATE_FUNC ( UICheckBoxDefaultBehaviorTest ) <nl> + Text * _displayValueLabel ; <nl> + } ; <nl> + <nl> # endif / * defined ( __TestCpp__UICheckBoxTest__ ) * / <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISceneManager . cpp <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISceneManager . cpp <nl> static const char * s_testArray [ ] = <nl> " UIButtonIgnoreContentSizeTest " , <nl> " UIButtonTitleEffectTest " , <nl> " UIButtonFlipTest " , <nl> + " UIButtonNormalDefaultTest " , <nl> + " UIButtonDisableDefaultTest " , <nl> <nl> # if ( CC_TARGET_PLATFORM = = CC_PLATFORM_IOS ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_ANDROID ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_MAC ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_WIN32 ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_TIZEN ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_WP8 ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_WINRT ) <nl> " UIEditBoxTest " , <nl> # endif <nl> " UICheckBoxTest " , <nl> + " UICheckBoxDefaultBehaviorTest " , <nl> " UISliderTest " , <nl> " UISliderTest_Scale9 " , <nl> + " UISliderNormalDefaultTest " , <nl> + " UISliderDisabledDefaultTest " , <nl> <nl> " UIImageViewTest " , <nl> " UIImageViewTest_Scale9 " , <nl> Scene * UISceneManager : : currentUIScene ( ) <nl> return UIButtonTitleEffectTest : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> case kUIButtonFlipTest : <nl> return UIButtonFlipTest : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> + case kUIButtonNormalDefaultTest : <nl> + return UIButtonNormalDefaultTest : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> + case kUIButtonDisableDefaultTest : <nl> + return UIButtonDisableDefaultTest : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> + <nl> case kUICheckBoxTest : <nl> return UICheckBoxTest : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> + case kUICheckBoxDefaultBehaviorTest : <nl> + return UICheckBoxDefaultBehaviorTest : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> <nl> case kUISliderTest : <nl> return UISliderTest : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> <nl> case kUISliderTest_Scale9 : <nl> return UISliderTest_Scale9 : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> + case kUISliderNormalDefaultTest : <nl> + return UISliderNormalDefaultTest : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> + case kUISliderDisabledDefaultTest : <nl> + return UISliderDisabledDefaultTest : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> <nl> case kUIImageViewTest : <nl> return UIImageViewTest : : sceneWithTitle ( s_testArray [ _currentUISceneId ] ) ; <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISceneManager . h <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISceneManager . h <nl> enum <nl> kUIButtonIgnoreContentSizeTest , <nl> kUIButtonTitleEffectTest , <nl> kUIButtonFlipTest , <nl> + kUIButtonNormalDefaultTest , <nl> + kUIButtonDisableDefaultTest , <nl> # if ( CC_TARGET_PLATFORM = = CC_PLATFORM_IOS ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_ANDROID ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_MAC ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_WIN32 ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_TIZEN ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_WP8 ) | | ( CC_TARGET_PLATFORM = = CC_PLATFORM_WINRT ) <nl> kUIEditBoxTest , <nl> # endif <nl> kUICheckBoxTest , <nl> + kUICheckBoxDefaultBehaviorTest , <nl> kUISliderTest , <nl> kUISliderTest_Scale9 , <nl> + kUISliderNormalDefaultTest , <nl> + kUISliderDisabledDefaultTest , <nl> kUIImageViewTest , <nl> kUIImageViewTest_Scale9 , <nl> kUIImageViewTest_ContentSize , <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISliderTest / UISliderTest . cpp <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISliderTest / UISliderTest . cpp <nl> void UISliderTest_Scale9 : : sliderEvent ( Ref * pSender , Slider : : EventType type ) <nl> _displayValueLabel - > setString ( String : : createWithFormat ( " Percent % d " , percent ) - > getCString ( ) ) ; <nl> } <nl> } <nl> + <nl> + <nl> + / / UISliderNormalDefaultTest <nl> + <nl> + UISliderNormalDefaultTest : : UISliderNormalDefaultTest ( ) <nl> + : _displayValueLabel ( nullptr ) <nl> + { <nl> + <nl> + } <nl> + <nl> + UISliderNormalDefaultTest : : ~ UISliderNormalDefaultTest ( ) <nl> + { <nl> + } <nl> + <nl> + bool UISliderNormalDefaultTest : : init ( ) <nl> + { <nl> + if ( UIScene : : init ( ) ) <nl> + { <nl> + Size widgetSize = _widget - > getContentSize ( ) ; <nl> + <nl> + / / Add a label in which the slider alert will be displayed <nl> + _displayValueLabel = Text : : create ( " " , " Arial " , 32 ) ; <nl> + _displayValueLabel - > setAnchorPoint ( Vec2 ( 0 . 5f , - 1 ) ) ; <nl> + _displayValueLabel - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , widgetSize . height / 2 . 0f + 100 ) ) ; <nl> + _uiLayer - > addChild ( _displayValueLabel ) ; <nl> + <nl> + / / Add the alert <nl> + Text * alert = Text : : create ( " when pressed , the slider ball should scale " , " fonts / Marker Felt . ttf " , 20 ) ; <nl> + alert - > setColor ( Color3B ( 159 , 168 , 176 ) ) ; <nl> + alert - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , <nl> + widgetSize . height / 2 . 0f - alert - > getContentSize ( ) . height * 3 . 75f ) ) ; <nl> + _uiLayer - > addChild ( alert ) ; <nl> + <nl> + / / Create the slider <nl> + Slider * slider = Slider : : create ( ) ; <nl> + slider - > loadBarTexture ( " cocosui / sliderTrack . png " ) ; <nl> + slider - > loadSlidBallTextures ( " cocosui / sliderThumb . png " ) ; <nl> + slider - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , <nl> + widgetSize . height / 2 . 0f + 50 ) ) ; <nl> + _uiLayer - > addChild ( slider ) ; <nl> + <nl> + Slider * sliderScale9 = Slider : : create ( " cocosui / sliderTrack2 . png " , " cocosui / sliderThumb . png " ) ; <nl> + sliderScale9 - > setScale9Enabled ( true ) ; <nl> + sliderScale9 - > setCapInsets ( Rect ( 0 , 0 , 0 , 0 ) ) ; <nl> + sliderScale9 - > setZoomScale ( 1 . 0 ) ; <nl> + sliderScale9 - > setContentSize ( Size ( 250 . 0f , 19 ) ) ; <nl> + sliderScale9 - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , widgetSize . height / 2 . 0f - 20 ) ) ; <nl> + _uiLayer - > addChild ( sliderScale9 ) ; <nl> + <nl> + <nl> + return true ; <nl> + } <nl> + return false ; <nl> + } <nl> + <nl> + / / UISliderDisabledDefaultTest <nl> + <nl> + UISliderDisabledDefaultTest : : UISliderDisabledDefaultTest ( ) <nl> + : _displayValueLabel ( nullptr ) <nl> + { <nl> + <nl> + } <nl> + <nl> + UISliderDisabledDefaultTest : : ~ UISliderDisabledDefaultTest ( ) <nl> + { <nl> + } <nl> + <nl> + bool UISliderDisabledDefaultTest : : init ( ) <nl> + { <nl> + if ( UIScene : : init ( ) ) <nl> + { <nl> + Size widgetSize = _widget - > getContentSize ( ) ; <nl> + <nl> + / / Add a label in which the slider alert will be displayed <nl> + _displayValueLabel = Text : : create ( " " , " Arial " , 32 ) ; <nl> + _displayValueLabel - > setAnchorPoint ( Vec2 ( 0 . 5f , - 1 ) ) ; <nl> + _displayValueLabel - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , widgetSize . height / 2 . 0f + 100 ) ) ; <nl> + _uiLayer - > addChild ( _displayValueLabel ) ; <nl> + <nl> + / / Add the alert <nl> + Text * alert = Text : : create ( " slider ball should be gray . " , " fonts / Marker Felt . ttf " , 20 ) ; <nl> + alert - > setColor ( Color3B ( 159 , 168 , 176 ) ) ; <nl> + alert - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , <nl> + widgetSize . height / 2 . 0f - alert - > getContentSize ( ) . height * 3 . 75f ) ) ; <nl> + _uiLayer - > addChild ( alert ) ; <nl> + <nl> + / / Create the slider <nl> + Slider * slider = Slider : : create ( ) ; <nl> + slider - > loadBarTexture ( " cocosui / slidbar . png " ) ; <nl> + slider - > loadSlidBallTextureNormal ( " cocosui / sliderballnormal . png " ) ; <nl> + slider - > setEnabled ( false ) ; <nl> + slider - > setBright ( false ) ; <nl> + slider - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , <nl> + widgetSize . height / 2 . 0f + 50 ) ) ; <nl> + _uiLayer - > addChild ( slider ) ; <nl> + <nl> + Slider * sliderScale9 = Slider : : create ( " cocosui / slidbar . png " , " cocosui / sliderballnormal . png " ) ; <nl> + sliderScale9 - > setScale9Enabled ( true ) ; <nl> + sliderScale9 - > setEnabled ( false ) ; <nl> + sliderScale9 - > setBright ( false ) ; <nl> + sliderScale9 - > setCapInsets ( Rect ( 0 , 0 , 0 , 0 ) ) ; <nl> + sliderScale9 - > setContentSize ( Size ( 250 . 0f , 10 ) ) ; <nl> + sliderScale9 - > setPosition ( Vec2 ( widgetSize . width / 2 . 0f , widgetSize . height / 2 . 0f - 20 ) ) ; <nl> + _uiLayer - > addChild ( sliderScale9 ) ; <nl> + <nl> + <nl> + return true ; <nl> + } <nl> + return false ; <nl> + } <nl> + <nl> + <nl> mmm a / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISliderTest / UISliderTest . h <nl> ppp b / tests / cpp - tests / Classes / UITest / CocoStudioGUITest / UISliderTest / UISliderTest . h <nl> class UISliderTest_Scale9 : public UIScene <nl> Text * _displayValueLabel ; <nl> } ; <nl> <nl> + <nl> + class UISliderNormalDefaultTest : public UIScene <nl> + { <nl> + public : <nl> + UISliderNormalDefaultTest ( ) ; <nl> + ~ UISliderNormalDefaultTest ( ) ; <nl> + bool init ( ) ; <nl> + <nl> + protected : <nl> + UI_SCENE_CREATE_FUNC ( UISliderNormalDefaultTest ) <nl> + Text * _displayValueLabel ; <nl> + } ; <nl> + <nl> + class UISliderDisabledDefaultTest : public UIScene <nl> + { <nl> + public : <nl> + UISliderDisabledDefaultTest ( ) ; <nl> + ~ UISliderDisabledDefaultTest ( ) ; <nl> + bool init ( ) ; <nl> + <nl> + protected : <nl> + UI_SCENE_CREATE_FUNC ( UISliderDisabledDefaultTest ) <nl> + Text * _displayValueLabel ; <nl> + } ; <nl> + <nl> # endif / * defined ( __TestCpp__UISliderTest__ ) * / <nl>
|
Merge pull request from andyque / modifyWidgetDefaultBehavior
|
cocos2d/cocos2d-x
|
dde5648d7ee323b7abc40b0bb481f21106a8b8ff
|
2014-12-26T01:27:45Z
|
mmm a / tensorflow / contrib / eager / python / checkpointable_utils . py <nl> ppp b / tensorflow / contrib / eager / python / checkpointable_utils . py <nl> def run ( self , fetches , feed_dict = None , * * kwargs ) : <nl> fetches = fetches , feed_dict = feed_dict , * * kwargs ) <nl> <nl> <nl> - class Saver ( object ) : <nl> + class CheckpointableSaver ( object ) : <nl> " " " Saves and restores a ` Checkpointable ` object and its dependencies . <nl> <nl> See ` Checkpointable ` for details of dependency management . ` Saver ` wraps <nl> def restore ( self , save_path , session = None ) : <nl> load_status = CheckpointLoadStatus ( <nl> checkpoint , feed_dict = file_prefix_feed_dict ) <nl> return load_status <nl> + <nl> + <nl> + class Checkpoint ( core_checkpointable . Checkpointable ) : <nl> + " " " A utility class which groups ` Checkpointable ` objects . <nl> + <nl> + Accepts arbitrary keyword arguments to its constructor and saves those values <nl> + with a checkpoint . Maintains a ` save_counter ` for numbering checkpoints . <nl> + <nl> + Example usage : <nl> + <nl> + ` ` ` python <nl> + import tensorflow as tf <nl> + import tensorflow . contrib . eager as tfe <nl> + import os <nl> + <nl> + checkpoint_directory = " / tmp / training_checkpoints " <nl> + checkpoint_prefix = os . path . join ( checkpoint_directory , " ckpt " ) <nl> + <nl> + root = tfe . Checkpoint ( optimizer = optimizer , model = model ) <nl> + root . restore ( tf . train . latest_checkpoint ( checkpoint_directory ) ) <nl> + for _ in range ( num_training_steps ) : <nl> + optimizer . minimize ( . . . ) <nl> + root . save ( file_prefix = checkpoint_prefix ) <nl> + ` ` ` <nl> + <nl> + For more manual control over saving , use ` tfe . CheckpointableSaver ` directly . <nl> + <nl> + Attributes : <nl> + save_counter : Incremented when ` save ( ) ` is called . Used to number <nl> + checkpoints . <nl> + " " " <nl> + <nl> + def __init__ ( self , * * kwargs ) : <nl> + " " " Group objects into a training checkpoint . <nl> + <nl> + Args : <nl> + * * kwargs : Keyword arguments are set as attributes of this object , and are <nl> + saved with the checkpoint . Attribute values must derive from <nl> + ` CheckpointableBase ` . <nl> + Raises : <nl> + ValueError : If objects in ` kwargs ` are not Checkpointable . <nl> + " " " <nl> + super ( Checkpoint , self ) . __init__ ( ) <nl> + for k , v in sorted ( kwargs . items ( ) , key = lambda item : item [ 0 ] ) : <nl> + if not isinstance ( v , core_checkpointable . CheckpointableBase ) : <nl> + raise ValueError ( <nl> + ( " ` Checkpoint ` was expecting an object derived from " <nl> + " ` CheckpointableBase ` , got % s . " ) % ( v , ) ) <nl> + setattr ( self , k , v ) <nl> + self . _save_counter = None # Created lazily for restore - on - create . <nl> + self . _saver = CheckpointableSaver ( weakref . ref ( self ) ) <nl> + <nl> + def _maybe_create_save_counter ( self ) : <nl> + " " " Create a save counter if it does not yet exist . " " " <nl> + if self . _save_counter is None : <nl> + # Initialized to 0 and incremented before saving . <nl> + self . _save_counter = add_variable ( <nl> + self , name = " save_counter " , initializer = 0 , dtype = dtypes . int64 ) <nl> + <nl> + @ property <nl> + def save_counter ( self ) : <nl> + " " " An integer variable which starts at zero and is incremented on save . <nl> + <nl> + Used to number checkpoints . <nl> + <nl> + Returns : <nl> + The save counter variable . <nl> + " " " <nl> + self . _maybe_create_save_counter ( ) <nl> + return self . _save_counter <nl> + <nl> + def save ( self , file_prefix , session = None ) : <nl> + " " " Save a checkpoint . Wraps ` tfe . CheckpointableSaver . save ` . " " " <nl> + assign_op = self . save_counter . assign_add ( 1 ) <nl> + if context . in_graph_mode ( ) : <nl> + if session is None : <nl> + session = ops . get_default_session ( ) <nl> + session . run ( assign_op ) <nl> + return self . _saver . save ( <nl> + file_prefix = file_prefix , <nl> + checkpoint_number = self . save_counter , <nl> + session = session ) <nl> + <nl> + def restore ( self , save_path ) : <nl> + " " " Restore a checkpoint . Wraps ` tfe . CheckpointableSaver . restore ` . " " " <nl> + status = self . _saver . restore ( save_path = save_path ) <nl> + # Create the save counter now so it gets initialized with other variables <nl> + # when graph building . Creating it earlier would lead to double <nl> + # initialization when executing eagerly . <nl> + self . _maybe_create_save_counter ( ) <nl> + return status <nl> mmm a / tensorflow / contrib / eager / python / checkpointable_utils_test . py <nl> ppp b / tensorflow / contrib / eager / python / checkpointable_utils_test . py <nl> <nl> <nl> import functools <nl> import os <nl> - import weakref <nl> <nl> import six <nl> <nl> def call ( self , values ) : <nl> return self . _via_track_layer ( self . _named_dense ( values ) ) <nl> <nl> <nl> - class Checkpoint ( checkpointable . Checkpointable ) : <nl> - " " " A utility class which groups ` Checkpointable ` objects . " " " <nl> - <nl> - def __init__ ( self , * * kwargs ) : <nl> - super ( Checkpoint , self ) . __init__ ( ) <nl> - for k , v in sorted ( kwargs . items ( ) , key = lambda item : item [ 0 ] ) : <nl> - setattr ( self , k , v ) <nl> - self . _save_counter = None # Created lazily for restore - on - create . <nl> - self . _saver = checkpointable_utils . Saver ( weakref . ref ( self ) ) <nl> - <nl> - @ property <nl> - def save_counter ( self ) : <nl> - " " " An integer variable which starts at zero and is incremented on save . <nl> - <nl> - Used to number checkpoints . <nl> - <nl> - Returns : <nl> - The save counter variable . <nl> - " " " <nl> - if self . _save_counter is None : <nl> - # Initialized to 0 and incremented before saving . <nl> - self . _save_counter = checkpointable_utils . add_variable ( <nl> - self , name = " save_counter " , initializer = 0 , dtype = dtypes . int64 ) <nl> - return self . _save_counter <nl> - <nl> - def save ( self , file_prefix , session = None ) : <nl> - assign_op = self . save_counter . assign_add ( 1 ) <nl> - if context . in_graph_mode ( ) : <nl> - if session is None : <nl> - session = ops . get_default_session ( ) <nl> - session . run ( assign_op ) <nl> - return self . _saver . save ( <nl> - file_prefix = file_prefix , <nl> - checkpoint_number = self . save_counter , <nl> - session = session ) <nl> - <nl> - def restore ( self , save_path ) : <nl> - status = self . _saver . restore ( save_path = save_path ) <nl> - # Create the save counter now so it gets initialized with other variables <nl> - # when graph building . Creating it earlier would lead to double <nl> - # initialization when executing eagerly . <nl> - self . save_counter # pylint : disable = pointless - statement <nl> - return status <nl> - <nl> - <nl> class InterfaceTests ( test . TestCase ) : <nl> <nl> @ test_util . run_in_graph_and_eager_modes ( assert_no_eager_garbage = True ) <nl> def testNamingWithOptimizer ( self ) : <nl> other_network = MyNetwork ( ) <nl> optimizer = CheckpointableAdam ( 0 . 001 ) <nl> optimizer_step = training_util . get_or_create_global_step ( ) <nl> - root_checkpointable = Checkpoint ( <nl> + root_checkpointable = checkpointable_utils . Checkpoint ( <nl> optimizer = optimizer , network = network , optimizer_step = optimizer_step ) <nl> if context . in_eager_mode ( ) : <nl> optimizer . minimize ( <nl> def testNamingWithOptimizer ( self ) : <nl> def testSaveRestore ( self ) : <nl> network = MyNetwork ( ) <nl> optimizer = CheckpointableAdam ( 0 . 001 ) <nl> - root_checkpointable = Checkpoint ( optimizer = optimizer , network = network ) <nl> + root_checkpointable = checkpointable_utils . Checkpoint ( <nl> + optimizer = optimizer , network = network ) <nl> input_value = constant_op . constant ( [ [ 3 . ] ] ) <nl> if context . in_eager_mode ( ) : <nl> optimizer . minimize ( <nl> def testSaveRestore ( self ) : <nl> return # Restore - on - create is only supported when executing eagerly <nl> on_create_network = MyNetwork ( ) <nl> on_create_optimizer = CheckpointableAdam ( 0 . 001 ) <nl> - on_create_root = Checkpoint ( <nl> + on_create_root = checkpointable_utils . Checkpoint ( <nl> optimizer = on_create_optimizer , network = on_create_network ) <nl> # Deferred restoration <nl> status = on_create_root . restore ( save_path = save_path ) <nl> def testDeferredRestorationUsageEager ( self ) : <nl> for training_continuation in range ( 3 ) : <nl> network = MyNetwork ( ) <nl> optimizer = CheckpointableAdam ( 0 . 001 ) <nl> - root = Checkpoint ( <nl> + root = checkpointable_utils . Checkpoint ( <nl> optimizer = optimizer , network = network , <nl> optimizer_step = training_util . get_or_create_global_step ( ) ) <nl> root . restore ( core_saver . latest_checkpoint ( checkpoint_directory ) ) <nl> def testUsageGraph ( self ) : <nl> with ops . Graph ( ) . as_default ( ) : <nl> network = MyNetwork ( ) <nl> optimizer = CheckpointableAdam ( 0 . 001 ) <nl> - root = Checkpoint ( <nl> + root = checkpointable_utils . Checkpoint ( <nl> optimizer = optimizer , network = network , <nl> global_step = training_util . get_or_create_global_step ( ) ) <nl> input_value = constant_op . constant ( [ [ 3 . ] ] ) <nl> def testAgnosticUsage ( self ) : <nl> graph = ops . get_default_graph ( ) ) : <nl> network = MyNetwork ( ) <nl> optimizer = CheckpointableAdam ( 0 . 001 ) <nl> - root = Checkpoint ( <nl> + root = checkpointable_utils . Checkpoint ( <nl> optimizer = optimizer , network = network , <nl> global_step = training_util . get_or_create_global_step ( ) ) <nl> checkpoint_path = core_saver . latest_checkpoint ( checkpoint_directory ) <nl> def add_dep ( self ) : <nl> self . evaluate ( state_ops . assign ( original . dep . var , 123 . ) ) <nl> checkpoint_directory = self . get_temp_dir ( ) <nl> checkpoint_prefix = os . path . join ( checkpoint_directory , " ckpt " ) <nl> - save_path = checkpointable_utils . Saver ( original ) . save ( checkpoint_prefix ) <nl> + save_path = checkpointable_utils . CheckpointableSaver ( <nl> + original ) . save ( checkpoint_prefix ) <nl> load_into = LateDependencies ( ) <nl> - status = checkpointable_utils . Saver ( load_into ) . restore ( save_path ) <nl> + status = checkpointable_utils . CheckpointableSaver ( <nl> + load_into ) . restore ( save_path ) <nl> with self . assertRaises ( AssertionError ) : <nl> status . assert_consumed ( ) <nl> load_into . add_dep ( ) <nl> def add_dep ( self ) : <nl> self . evaluate ( state_ops . assign ( dep_after_var . dep . var , - 14 . ) ) <nl> checkpoint_directory = self . get_temp_dir ( ) <nl> checkpoint_prefix = os . path . join ( checkpoint_directory , " ckpt " ) <nl> - save_path = checkpointable_utils . Saver ( dep_after_var ) . save ( <nl> + save_path = checkpointable_utils . CheckpointableSaver ( dep_after_var ) . save ( <nl> checkpoint_prefix ) <nl> <nl> loaded_dep_after_var = DepAfterVar ( ) <nl> - status = checkpointable_utils . Saver ( loaded_dep_after_var ) . restore ( save_path ) <nl> + status = checkpointable_utils . CheckpointableSaver ( <nl> + loaded_dep_after_var ) . restore ( save_path ) <nl> loaded_dep_after_var . add_dep ( ) <nl> status . assert_consumed ( ) <nl> status . run_restore_ops ( ) <nl> def testDeferredSlotRestoration ( self ) : <nl> # ` root ` . Create a one - off grouping so that slot variables for ` root . var ` <nl> # get initialized too . <nl> self . evaluate ( checkpointable_utils . gather_initializers ( <nl> - Checkpoint ( root = root , optimizer = optimizer ) ) ) <nl> + checkpointable_utils . Checkpoint ( root = root , optimizer = optimizer ) ) ) <nl> self . evaluate ( train_op ) <nl> else : <nl> optimizer . minimize ( root . var . read_value ) <nl> self . evaluate ( state_ops . assign ( root . var , 12 . ) ) <nl> - no_slots_path = checkpointable_utils . Saver ( root ) . save ( <nl> + no_slots_path = checkpointable_utils . CheckpointableSaver ( root ) . save ( <nl> os . path . join ( checkpoint_directory , " no_slots " ) ) <nl> root . optimizer = optimizer <nl> self . evaluate ( state_ops . assign ( root . var , 13 . ) ) <nl> self . evaluate ( state_ops . assign ( optimizer . get_slot ( name = " m " , var = root . var ) , <nl> 14 . ) ) <nl> - slots_path = checkpointable_utils . Saver ( root ) . save ( <nl> + slots_path = checkpointable_utils . CheckpointableSaver ( root ) . save ( <nl> os . path . join ( checkpoint_directory , " with_slots " ) ) <nl> new_root = checkpointable . Checkpointable ( ) <nl> # Load the slot - containing checkpoint ( deferred ) , then immediately overwrite <nl> # the non - slot variable ( also deferred ) . <nl> - slot_status = checkpointable_utils . Saver ( new_root ) . restore ( slots_path ) <nl> - no_slot_status = checkpointable_utils . Saver ( new_root ) . restore ( no_slots_path ) <nl> + slot_status = checkpointable_utils . CheckpointableSaver ( <nl> + new_root ) . restore ( slots_path ) <nl> + no_slot_status = checkpointable_utils . CheckpointableSaver ( <nl> + new_root ) . restore ( no_slots_path ) <nl> with self . assertRaises ( AssertionError ) : <nl> no_slot_status . assert_consumed ( ) <nl> new_root . var = checkpointable_utils . add_variable ( <nl> def testOverlappingRestores ( self ) : <nl> save_root . dep . var = checkpointable_utils . add_variable ( <nl> save_root . dep , name = " var " , initializer = 0 . ) <nl> self . evaluate ( state_ops . assign ( save_root . dep . var , 12 . ) ) <nl> - saver = checkpointable_utils . Saver ( save_root ) <nl> + saver = checkpointable_utils . CheckpointableSaver ( save_root ) <nl> first_path = saver . save ( os . path . join ( checkpoint_directory , " first " ) ) <nl> self . evaluate ( state_ops . assign ( save_root . dep . var , 13 . ) ) <nl> second_path = saver . save ( os . path . join ( checkpoint_directory , " second " ) ) <nl> <nl> first_root = checkpointable . Checkpointable ( ) <nl> second_root = checkpointable . Checkpointable ( ) <nl> - first_status = checkpointable_utils . Saver ( first_root ) . restore ( first_path ) <nl> - second_status = checkpointable_utils . Saver ( second_root ) . restore ( second_path ) <nl> + first_status = checkpointable_utils . CheckpointableSaver ( <nl> + first_root ) . restore ( first_path ) <nl> + second_status = checkpointable_utils . CheckpointableSaver ( <nl> + second_root ) . restore ( second_path ) <nl> load_dep = checkpointable . Checkpointable ( ) <nl> load_dep . var = checkpointable_utils . add_variable ( <nl> load_dep , name = " var " , shape = [ ] ) <nl> def testOverlappingRestores ( self ) : <nl> # determines the final value . <nl> first_root = checkpointable . Checkpointable ( ) <nl> second_root = checkpointable . Checkpointable ( ) <nl> - second_status = checkpointable_utils . Saver ( second_root ) . restore ( second_path ) <nl> - first_status = checkpointable_utils . Saver ( first_root ) . restore ( first_path ) <nl> + second_status = checkpointable_utils . CheckpointableSaver ( <nl> + second_root ) . restore ( second_path ) <nl> + first_status = checkpointable_utils . CheckpointableSaver ( <nl> + first_root ) . restore ( first_path ) <nl> load_dep = checkpointable . Checkpointable ( ) <nl> load_dep . var = checkpointable_utils . add_variable ( <nl> load_dep , name = " var " , shape = [ ] ) <nl> def testAmbiguousLoad ( self ) : <nl> save_root . dep_two . dep_three = dep_three <nl> checkpointable_utils . add_variable ( dep_three , name = " var " , initializer = 0 . ) <nl> self . evaluate ( checkpointable_utils . gather_initializers ( save_root ) ) <nl> - save_path = checkpointable_utils . Saver ( save_root ) . save ( <nl> + save_path = checkpointable_utils . CheckpointableSaver ( save_root ) . save ( <nl> os . path . join ( checkpoint_directory , " ckpt " ) ) <nl> load_root = checkpointable . Checkpointable ( ) <nl> - checkpointable_utils . Saver ( load_root ) . restore ( save_path ) <nl> + checkpointable_utils . CheckpointableSaver ( load_root ) . restore ( save_path ) <nl> load_root . dep_one = checkpointable . Checkpointable ( ) <nl> load_root . dep_two = checkpointable . Checkpointable ( ) <nl> load_root . dep_one . dep_three = checkpointable . Checkpointable ( ) <nl> def testObjectsCombined ( self ) : <nl> checkpointable_utils . add_variable ( <nl> save_root . dep_two , name = " var2 " , initializer = 64 . , dtype = dtypes . float64 ) <nl> self . evaluate ( checkpointable_utils . gather_initializers ( save_root ) ) <nl> - save_path = checkpointable_utils . Saver ( save_root ) . save ( <nl> + save_path = checkpointable_utils . CheckpointableSaver ( save_root ) . save ( <nl> os . path . join ( checkpoint_directory , " ckpt " ) ) <nl> load_root = checkpointable . Checkpointable ( ) <nl> load_root . dep_one = checkpointable . Checkpointable ( ) <nl> def testObjectsCombined ( self ) : <nl> load_root . dep_one , name = " var1 " , shape = [ ] , dtype = dtypes . float64 ) <nl> v2 = checkpointable_utils . add_variable ( <nl> load_root . dep_one , name = " var2 " , shape = [ ] , dtype = dtypes . float64 ) <nl> - status = checkpointable_utils . Saver ( load_root ) . restore ( <nl> + status = checkpointable_utils . CheckpointableSaver ( load_root ) . restore ( <nl> save_path ) . assert_consumed ( ) <nl> status . run_restore_ops ( ) <nl> self . assertEqual ( 32 . , self . evaluate ( v1 ) ) <nl> def testDependencyLoop ( self ) : <nl> second , " v2 " , initializer = [ 1 . , 1 . , 2 . , 3 . ] ) <nl> self . evaluate ( checkpointable_utils . gather_initializers ( first ) ) <nl> checkpoint_directory = self . get_temp_dir ( ) <nl> - save_path = checkpointable_utils . Saver ( first ) . save ( <nl> + save_path = checkpointable_utils . CheckpointableSaver ( first ) . save ( <nl> os . path . join ( checkpoint_directory , " ckpt " ) ) <nl> <nl> # Test deferred loading <nl> first_load = checkpointable . Checkpointable ( ) <nl> - status = checkpointable_utils . Saver ( first_load ) . restore ( save_path ) <nl> + status = checkpointable_utils . CheckpointableSaver ( <nl> + first_load ) . restore ( save_path ) <nl> second_load = checkpointable . Checkpointable ( ) <nl> first_load . second = second_load <nl> second_load . first = first_load <nl> def testDependencyLoop ( self ) : <nl> self . assertAllEqual ( [ 2 . , 7 . , 1 . ] , self . evaluate ( first_load . v ) ) <nl> self . evaluate ( second_load . v . assign ( [ 2 . , 7 . , 1 . , 8 . ] ) ) <nl> self . assertAllEqual ( [ 2 . , 7 . , 1 . , 8 . ] , self . evaluate ( second_load . v ) ) <nl> - status = checkpointable_utils . Saver ( first_load ) . restore ( <nl> + status = checkpointable_utils . CheckpointableSaver ( first_load ) . restore ( <nl> save_path ) . assert_consumed ( ) <nl> status . run_restore_ops ( ) <nl> self . assertAllEqual ( [ 3 . , 1 . , 4 . ] , self . evaluate ( first_load . v ) ) <nl> def testRestoreOnAssign ( self ) : <nl> name = " blah " , initializer = 0 . ) <nl> self . evaluate ( first . var1 . assign ( 4 . ) ) <nl> self . evaluate ( first . var2 . assign ( 8 . ) ) <nl> - save_path = checkpointable_utils . Saver ( first ) . save ( <nl> + save_path = checkpointable_utils . CheckpointableSaver ( first ) . save ( <nl> checkpoint_prefix ) <nl> restore_graph = ops . Graph ( ) <nl> with restore_graph . as_default ( ) , self . test_session ( restore_graph ) : <nl> second = checkpointable . Checkpointable ( ) <nl> second . var2 = variable_scope . get_variable ( <nl> name = " blah " , initializer = 0 . ) <nl> - status = checkpointable_utils . Saver ( second ) . restore ( save_path ) <nl> + status = checkpointable_utils . CheckpointableSaver ( <nl> + second ) . restore ( save_path ) <nl> recreated_var1 = variable_scope . get_variable ( <nl> name = " outside_var " , initializer = 0 . ) <nl> status . run_restore_ops ( ) <nl> def testManySavesGraph ( self ) : <nl> obj . opt = CheckpointableAdam ( 0 . 1 ) <nl> obj . opt . minimize ( obj . var . read_value ( ) ) <nl> self . evaluate ( checkpointable_utils . gather_initializers ( obj ) ) <nl> - saver = checkpointable_utils . Saver ( obj ) <nl> + saver = checkpointable_utils . CheckpointableSaver ( obj ) <nl> saver . save ( checkpoint_prefix ) <nl> before_ops = graph . get_operations ( ) <nl> saver . save ( checkpoint_prefix ) <nl> def testManyRestoresGraph ( self ) : <nl> obj . opt = CheckpointableAdam ( 0 . 1 ) <nl> obj . opt . minimize ( obj . var . read_value ( ) ) <nl> self . evaluate ( checkpointable_utils . gather_initializers ( obj ) ) <nl> - saver = checkpointable_utils . Saver ( obj ) <nl> + saver = checkpointable_utils . CheckpointableSaver ( obj ) <nl> save_path = saver . save ( checkpoint_prefix ) <nl> saver . restore ( save_path ) <nl> before_ops = graph . get_operations ( ) <nl> def _initialized_model ( self ) : <nl> network = MyNetwork ( ) <nl> optimizer = CheckpointableAdam ( 0 . 001 ) <nl> optimizer_step = training_util . get_or_create_global_step ( ) <nl> - root_checkpointable = Checkpoint ( <nl> + root_checkpointable = checkpointable_utils . Checkpoint ( <nl> optimizer = optimizer , network = network , optimizer_step = optimizer_step ) <nl> train_op = optimizer . minimize ( <nl> functools . partial ( network , input_value ) , <nl> def testLoadFromNameBasedSaver ( self ) : <nl> self . _set_sentinels ( root ) <nl> with self . assertRaises ( AssertionError ) : <nl> self . _check_sentinels ( root ) <nl> - object_saver = checkpointable_utils . Saver ( root ) <nl> + object_saver = checkpointable_utils . CheckpointableSaver ( root ) <nl> status = object_saver . restore ( save_path ) <nl> with self . assertRaises ( AssertionError ) : <nl> status . assert_consumed ( ) <nl> def testSaveGraphLoadEager ( self ) : <nl> with save_graph . as_default ( ) , self . test_session ( <nl> graph = save_graph ) as session : <nl> root = self . _initialized_model ( ) <nl> - object_saver = checkpointable_utils . Saver ( root ) <nl> + object_saver = checkpointable_utils . CheckpointableSaver ( root ) <nl> save_path = object_saver . save ( <nl> session = session , file_prefix = checkpoint_prefix ) <nl> with context . eager_mode ( ) : <nl> def testSaveEagerLoadGraph ( self ) : <nl> checkpoint_prefix = os . path . join ( checkpoint_directory , " ckpt " ) <nl> with context . eager_mode ( ) : <nl> root = self . _initialized_model ( ) <nl> - object_saver = checkpointable_utils . Saver ( root ) <nl> + object_saver = checkpointable_utils . CheckpointableSaver ( root ) <nl> save_path = object_saver . save ( file_prefix = checkpoint_prefix ) <nl> with context . graph_mode ( ) : <nl> save_graph = ops . Graph ( ) <nl>
|
Checkpointable : Move the checkpoint - grouping utility out of the unit test file
|
tensorflow/tensorflow
|
7b71b0cfd9f7b4ceb17295cba5b651a04764c37b
|
2018-02-27T21:24:30Z
|
mmm a / src / txmempool . cpp <nl> ppp b / src / txmempool . cpp <nl> void CTxMemPool : : TrimToSize ( size_t sizelimit , std : : vector < uint256 > * pvNoSpendsRe <nl> <nl> unsigned nTxnRemoved = 0 ; <nl> CFeeRate maxFeeRateRemoved ( 0 ) ; <nl> - while ( DynamicMemoryUsage ( ) > sizelimit ) { <nl> + while ( ! mapTx . empty ( ) & & DynamicMemoryUsage ( ) > sizelimit ) { <nl> indexed_transaction_set : : index < descendant_score > : : type : : iterator it = mapTx . get < descendant_score > ( ) . begin ( ) ; <nl> <nl> / / We set the new mempool min fee to the feerate of the removed set , plus the <nl>
|
Stop trimming when mapTx is empty
|
bitcoin/bitcoin
|
96806c39f4ef395975c0cd7d654dcb71c4790be2
|
2016-06-19T08:34:57Z
|
mmm a / jstests / concurrency / fsm_workloads / refine_collection_shard_key_zone_ops . js <nl> ppp b / jstests / concurrency / fsm_workloads / refine_collection_shard_key_zone_ops . js <nl> var $ config = ( function ( ) { <nl> try { <nl> attemptSwapZoneRange ( db , latchCollName , currentZoneRangeMap ) ; <nl> } catch ( e ) { <nl> - / / If we get either : <nl> - / / 1 ) a RangeOverlapConflict error , or <nl> - / / 2 ) an error indicating that the range isn ' t equal to the range on disk , <nl> - / / <nl> - / / This is because the current zone removal logic doesn ' t perform a query on a <nl> - / / fully extended shard key . This means that if a refine conflicts with zone <nl> - / / removal , we may not remove this zone because the removal query won ' t match the <nl> - / / refined ( extended ) shard key . Retrying swapping the zone range will allow us to <nl> - / / target the shard key in its refined state . <nl> - / / <nl> - / / TODO SERVER - 44283 : Remove the RangeOverlapConflict retry logic due to no longer <nl> - / / attempting to remove using the unextended shard key . <nl> - if ( e . code = = = ErrorCodes . RangeOverlapConflict | | <nl> - ( e . message . includes ( ' " b " ' ) & & e . message . includes ( ' are not equal ' ) ) ) { <nl> + / / During the process of attempting to swap the zone range , the collection may <nl> + / / become refined . Retrying swapping the zone range will allow us to target the <nl> + / / shard key in its refined state . <nl> + if ( e . message . includes ( ' " b " ' ) & & e . message . includes ( ' are not equal ' ) ) { <nl> jsTestLog ( " Retrying swapZoneRange on collection " + latchCollName + <nl> " due to refineCollectionShardKey conflict " ) ; <nl> for ( let zoneRange of Object . values ( currentZoneRangeMap ) ) { <nl> var $ config = ( function ( ) { <nl> setup : setup , <nl> passConnectionCache : true , <nl> } ; <nl> - } ) ( ) ; <nl> \ No newline at end of file <nl> + } ) ( ) ; <nl> mmm a / src / mongo / db / s / config / sharding_catalog_manager_assign_key_range_to_zone_test . cpp <nl> ppp b / src / mongo / db / s / config / sharding_catalog_manager_assign_key_range_to_zone_test . cpp <nl> TEST_F ( AssignKeyRangeWithOneRangeFixture , RemoveWithInvalidMaxShardKeyShouldFail <nl> assertOnlyZone ( shardedNS ( ) , getExistingRange ( ) , zoneName ( ) ) ; <nl> } <nl> <nl> - TEST_F ( AssignKeyRangeWithOneRangeFixture , RemoveThatIsOnlyMinPrefixOfExistingShouldNotRemoveRange ) { <nl> + TEST_F ( AssignKeyRangeWithOneRangeFixture , RemoveWithPartialMinPrefixShouldRemoveRange ) { <nl> NamespaceString ns ( " compound . shard " ) ; <nl> CollectionType shardedCollection ; <nl> shardedCollection . setNs ( ns ) ; <nl> TEST_F ( AssignKeyRangeWithOneRangeFixture , RemoveThatIsOnlyMinPrefixOfExistingSho <nl> - > removeKeyRangeFromZone ( <nl> operationContext ( ) , ns , ChunkRange ( BSON ( " x " < < 0 ) , BSON ( " x " < < 10 < < " y " < < 10 ) ) ) ) ; <nl> <nl> - { <nl> - auto findStatus = findOneOnConfigCollection ( <nl> - operationContext ( ) , TagsType : : ConfigNS , BSON ( " min " < < existingRange . getMin ( ) ) ) ; <nl> - ASSERT_OK ( findStatus ) ; <nl> - <nl> - auto tagDocStatus = TagsType : : fromBSON ( findStatus . getValue ( ) ) ; <nl> - ASSERT_OK ( tagDocStatus . getStatus ( ) ) ; <nl> - <nl> - auto tagDoc = tagDocStatus . getValue ( ) ; <nl> - ASSERT_EQ ( ns , tagDoc . getNS ( ) ) ; <nl> - ASSERT_BSONOBJ_EQ ( existingRange . getMin ( ) , tagDoc . getMinKey ( ) ) ; <nl> - ASSERT_BSONOBJ_EQ ( existingRange . getMax ( ) , tagDoc . getMaxKey ( ) ) ; <nl> - ASSERT_EQ ( zoneName ( ) , tagDoc . getTag ( ) ) ; <nl> - } <nl> - <nl> - { <nl> - const auto existingRange = getExistingRange ( ) ; <nl> - auto findStatus = findOneOnConfigCollection ( <nl> - operationContext ( ) , TagsType : : ConfigNS , BSON ( " min " < < existingRange . getMin ( ) ) ) ; <nl> - ASSERT_OK ( findStatus ) ; <nl> - <nl> - auto tagDocStatus = TagsType : : fromBSON ( findStatus . getValue ( ) ) ; <nl> - ASSERT_OK ( tagDocStatus . getStatus ( ) ) ; <nl> - <nl> - auto tagDoc = tagDocStatus . getValue ( ) ; <nl> - ASSERT_EQ ( shardedNS ( ) , tagDoc . getNS ( ) ) ; <nl> - ASSERT_BSONOBJ_EQ ( existingRange . getMin ( ) , tagDoc . getMinKey ( ) ) ; <nl> - ASSERT_BSONOBJ_EQ ( existingRange . getMax ( ) , tagDoc . getMaxKey ( ) ) ; <nl> - ASSERT_EQ ( zoneName ( ) , tagDoc . getTag ( ) ) ; <nl> - } <nl> + / / Check that zone range removal targets a shard key in its refined ( expanded ) state . <nl> + auto findStatus = findOneOnConfigCollection ( <nl> + operationContext ( ) , TagsType : : ConfigNS , BSON ( " min " < < existingRange . getMin ( ) ) ) ; <nl> + ASSERT_EQUALS ( ErrorCodes : : NoMatchingDocument , findStatus ) ; <nl> } <nl> <nl> - TEST_F ( AssignKeyRangeWithOneRangeFixture , RemoveThatIsOnlyMaxPrefixOfExistingShouldNotRemoveRange ) { <nl> + TEST_F ( AssignKeyRangeWithOneRangeFixture , RemoveWithPartialMaxPrefixShouldRemoveRange ) { <nl> NamespaceString ns ( " compound . shard " ) ; <nl> CollectionType shardedCollection ; <nl> shardedCollection . setNs ( ns ) ; <nl> TEST_F ( AssignKeyRangeWithOneRangeFixture , RemoveThatIsOnlyMaxPrefixOfExistingSho <nl> - > removeKeyRangeFromZone ( <nl> operationContext ( ) , ns , ChunkRange ( BSON ( " x " < < 0 < < " y " < < 0 ) , BSON ( " x " < < 10 ) ) ) ) ; <nl> <nl> - { <nl> - auto findStatus = findOneOnConfigCollection ( <nl> - operationContext ( ) , TagsType : : ConfigNS , BSON ( " min " < < existingRange . getMin ( ) ) ) ; <nl> - ASSERT_OK ( findStatus ) ; <nl> - <nl> - auto tagDocStatus = TagsType : : fromBSON ( findStatus . getValue ( ) ) ; <nl> - ASSERT_OK ( tagDocStatus . getStatus ( ) ) ; <nl> - <nl> - auto tagDoc = tagDocStatus . getValue ( ) ; <nl> - ASSERT_EQ ( ns , tagDoc . getNS ( ) ) ; <nl> - ASSERT_BSONOBJ_EQ ( existingRange . getMin ( ) , tagDoc . getMinKey ( ) ) ; <nl> - ASSERT_BSONOBJ_EQ ( existingRange . getMax ( ) , tagDoc . getMaxKey ( ) ) ; <nl> - ASSERT_EQ ( zoneName ( ) , tagDoc . getTag ( ) ) ; <nl> - } <nl> - <nl> - { <nl> - const auto existingRange = getExistingRange ( ) ; <nl> - auto findStatus = findOneOnConfigCollection ( <nl> - operationContext ( ) , TagsType : : ConfigNS , BSON ( " min " < < existingRange . getMin ( ) ) ) ; <nl> - ASSERT_OK ( findStatus ) ; <nl> - <nl> - auto tagDocStatus = TagsType : : fromBSON ( findStatus . getValue ( ) ) ; <nl> - ASSERT_OK ( tagDocStatus . getStatus ( ) ) ; <nl> - <nl> - auto tagDoc = tagDocStatus . getValue ( ) ; <nl> - ASSERT_EQ ( shardedNS ( ) , tagDoc . getNS ( ) ) ; <nl> - ASSERT_BSONOBJ_EQ ( existingRange . getMin ( ) , tagDoc . getMinKey ( ) ) ; <nl> - ASSERT_BSONOBJ_EQ ( existingRange . getMax ( ) , tagDoc . getMaxKey ( ) ) ; <nl> - ASSERT_EQ ( zoneName ( ) , tagDoc . getTag ( ) ) ; <nl> - } <nl> + / / Check that zone range removal targets a shard key in its refined ( expanded ) state . <nl> + auto findStatus = findOneOnConfigCollection ( <nl> + operationContext ( ) , TagsType : : ConfigNS , BSON ( " min " < < existingRange . getMin ( ) ) ) ; <nl> + ASSERT_EQUALS ( ErrorCodes : : NoMatchingDocument , findStatus ) ; <nl> } <nl> <nl> } / / namespace <nl> mmm a / src / mongo / db / s / config / sharding_catalog_manager_zone_operations . cpp <nl> ppp b / src / mongo / db / s / config / sharding_catalog_manager_zone_operations . cpp <nl> Status ShardingCatalogManager : : removeKeyRangeFromZone ( OperationContext * opCtx , <nl> return fullShardKeyStatus . getStatus ( ) ; <nl> } <nl> <nl> + const auto & fullShardKeyRange = namespaceNotSharded ? range : fullShardKeyStatus . getValue ( ) ; <nl> + <nl> BSONObjBuilder removeBuilder ; <nl> removeBuilder . append ( TagsType : : ns ( ) , nss . ns ( ) ) ; <nl> - removeBuilder . append ( TagsType : : min ( ) , range . getMin ( ) ) ; <nl> - removeBuilder . append ( TagsType : : max ( ) , range . getMax ( ) ) ; <nl> + removeBuilder . append ( TagsType : : min ( ) , fullShardKeyRange . getMin ( ) ) ; <nl> + removeBuilder . append ( TagsType : : max ( ) , fullShardKeyRange . getMax ( ) ) ; <nl> <nl> return Grid : : get ( opCtx ) - > catalogClient ( ) - > removeConfigDocuments ( <nl> opCtx , TagsType : : ConfigNS , removeBuilder . obj ( ) , kNoWaitWriteConcern ) ; <nl>
|
SERVER - 44283 Change removeKeyRangeFromZone to use the bounds found from the fully extended shard key .
|
mongodb/mongo
|
4e707f244d88b112b15080afa2361210715b12d2
|
2019-12-05T17:13:57Z
|
mmm a / unittest / apiexample_test . cc <nl> ppp b / unittest / apiexample_test . cc <nl> <nl> <nl> / / # include " log . h " <nl> # include " include_gunit . h " <nl> - # include " tesseract / baseapi . h " <nl> + # include " baseapi . h " <nl> # include " leptonica / allheaders . h " <nl> # include < iostream > <nl> # include < string > <nl>
|
Update apiexample_test . cc
|
tesseract-ocr/tesseract
|
873586ec9b376b51f92f0b7f01f91846f25e0a54
|
2018-06-19T04:52:46Z
|
mmm a / src / mongo / db / s / balancer / migration_manager . cpp <nl> ppp b / src / mongo / db / s / balancer / migration_manager . cpp <nl> void MigrationManager : : startRecoveryAndAcquireDistLocks ( OperationContext * txn ) { <nl> <nl> / / Load the active migrations from the config . migrations collection . <nl> auto statusWithMigrationsQueryResponse = <nl> - Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> txn , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> repl : : ReadConcernLevel : : kLocalReadConcern , <nl> mmm a / src / mongo / db / s / balancer / migration_manager_test . cpp <nl> ppp b / src / mongo / db / s / balancer / migration_manager_test . cpp <nl> void MigrationManagerTest : : setUpMigration ( const ChunkType & chunk , const ShardId & <nl> } <nl> <nl> void MigrationManagerTest : : checkMigrationsCollectionIsEmptyAndLocksAreUnlocked ( ) { <nl> - auto statusWithMigrationsQueryResponse = <nl> - shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> - operationContext ( ) , <nl> - ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> - repl : : ReadConcernLevel : : kMajorityReadConcern , <nl> - NamespaceString ( MigrationType : : ConfigNS ) , <nl> - BSONObj ( ) , <nl> - BSONObj ( ) , <nl> - boost : : none ) ; <nl> + auto statusWithMigrationsQueryResponse = shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> + operationContext ( ) , <nl> + ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + repl : : ReadConcernLevel : : kMajorityReadConcern , <nl> + NamespaceString ( MigrationType : : ConfigNS ) , <nl> + BSONObj ( ) , <nl> + BSONObj ( ) , <nl> + boost : : none ) ; <nl> Shard : : QueryResponse migrationsQueryResponse = <nl> uassertStatusOK ( statusWithMigrationsQueryResponse ) ; <nl> ASSERT_EQUALS ( 0U , migrationsQueryResponse . docs . size ( ) ) ; <nl> <nl> - auto statusWithLocksQueryResponse = shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + auto statusWithLocksQueryResponse = shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> operationContext ( ) , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> repl : : ReadConcernLevel : : kMajorityReadConcern , <nl> TEST_F ( MigrationManagerTest , InterruptMigration ) { <nl> / / Check that the migration that was active when the migration manager was interrupted can be <nl> / / found in config . migrations ( and thus would be recovered if a migration manager were to start <nl> / / up again ) . <nl> - auto statusWithMigrationsQueryResponse = <nl> - shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> - operationContext ( ) , <nl> - ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> - repl : : ReadConcernLevel : : kMajorityReadConcern , <nl> - NamespaceString ( MigrationType : : ConfigNS ) , <nl> - BSON ( MigrationType : : name ( chunk . getName ( ) ) ) , <nl> - BSONObj ( ) , <nl> - boost : : none ) ; <nl> + auto statusWithMigrationsQueryResponse = shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> + operationContext ( ) , <nl> + ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + repl : : ReadConcernLevel : : kMajorityReadConcern , <nl> + NamespaceString ( MigrationType : : ConfigNS ) , <nl> + BSON ( MigrationType : : name ( chunk . getName ( ) ) ) , <nl> + BSONObj ( ) , <nl> + boost : : none ) ; <nl> Shard : : QueryResponse migrationsQueryResponse = <nl> uassertStatusOK ( statusWithMigrationsQueryResponse ) ; <nl> ASSERT_EQUALS ( 1U , migrationsQueryResponse . docs . size ( ) ) ; <nl> mmm a / src / mongo / db / s / balancer / scoped_migration_request . cpp <nl> ppp b / src / mongo / db / s / balancer / scoped_migration_request . cpp <nl> StatusWith < ScopedMigrationRequest > ScopedMigrationRequest : : writeMigration ( <nl> / / for the request because this migration request will join the active one once <nl> / / scheduled . <nl> auto statusWithMigrationQueryResult = <nl> - grid . shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + grid . shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> txn , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> repl : : ReadConcernLevel : : kLocalReadConcern , <nl> mmm a / src / mongo / db / s / balancer / scoped_migration_request_test . cpp <nl> ppp b / src / mongo / db / s / balancer / scoped_migration_request_test . cpp <nl> class ScopedMigrationRequestTest : public ConfigServerTestFixture { <nl> <nl> void ScopedMigrationRequestTest : : checkMigrationsCollectionForDocument ( <nl> std : : string chunkName , const unsigned long expectedNumberOfDocuments ) { <nl> - auto response = shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + auto response = shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> operationContext ( ) , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> repl : : ReadConcernLevel : : kMajorityReadConcern , <nl> mmm a / src / mongo / s / catalog / dist_lock_catalog_impl . cpp <nl> ppp b / src / mongo / s / catalog / dist_lock_catalog_impl . cpp <nl> Status DistLockCatalogImpl : : ping ( OperationContext * txn , StringData processID , Da <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> _locksNS . db ( ) . toString ( ) , <nl> request . toBSON ( ) , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kNotIdempotent ) ; <nl> <nl> auto findAndModifyStatus = extractFindAndModifyNewObj ( std : : move ( resultStatus ) ) ; <nl> StatusWith < LocksType > DistLockCatalogImpl : : grabLock ( OperationContext * txn , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> _locksNS . db ( ) . toString ( ) , <nl> request . toBSON ( ) , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kNoRetry ) ; / / Dist lock manager is handling own retries <nl> <nl> auto findAndModifyStatus = extractFindAndModifyNewObj ( std : : move ( resultStatus ) ) ; <nl> StatusWith < LocksType > DistLockCatalogImpl : : overtakeLock ( OperationContext * txn , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> _locksNS . db ( ) . toString ( ) , <nl> request . toBSON ( ) , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kNotIdempotent ) ; <nl> <nl> auto findAndModifyStatus = extractFindAndModifyNewObj ( std : : move ( resultStatus ) ) ; <nl> Status DistLockCatalogImpl : : _unlock ( OperationContext * txn , const FindAndModifyRe <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> _locksNS . db ( ) . toString ( ) , <nl> request . toBSON ( ) , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kIdempotent ) ; <nl> <nl> auto findAndModifyStatus = extractFindAndModifyNewObj ( std : : move ( resultStatus ) ) ; <nl> Status DistLockCatalogImpl : : unlockAll ( OperationContext * txn , const std : : string & <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> _locksNS . db ( ) . toString ( ) , <nl> cmdObj , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kIdempotent ) ; <nl> <nl> if ( ! response . isOK ( ) ) { <nl> StatusWith < DistLockCatalog : : ServerInfo > DistLockCatalogImpl : : getServerInfo ( Opera <nl> kReadPref , <nl> " admin " , <nl> BSON ( " serverStatus " < < 1 ) , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kIdempotent ) ; <nl> <nl> if ( ! resultStatus . isOK ( ) ) { <nl> Status DistLockCatalogImpl : : stopPing ( OperationContext * txn , StringData processId <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> _locksNS . db ( ) . toString ( ) , <nl> request . toBSON ( ) , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kNotIdempotent ) ; <nl> <nl> auto findAndModifyStatus = extractFindAndModifyNewObj ( std : : move ( resultStatus ) ) ; <nl> StatusWith < vector < BSONObj > > DistLockCatalogImpl : : _findOnConfig ( <nl> const BSONObj & query , <nl> const BSONObj & sort , <nl> boost : : optional < long long > limit ) { <nl> - auto result = _client - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + auto result = _client - > getConfigShard ( ) - > exhaustiveFind ( <nl> txn , readPref , repl : : ReadConcernLevel : : kMajorityReadConcern , nss , query , sort , limit ) ; <nl> if ( ! result . isOK ( ) ) { <nl> return result . getStatus ( ) ; <nl> mmm a / src / mongo / s / catalog / sharding_catalog_add_shard_test . cpp <nl> ppp b / src / mongo / s / catalog / sharding_catalog_add_shard_test . cpp <nl> class AddShardTest : public ConfigServerTestFixture { <nl> * / <nl> void assertChangeWasLogged ( const ShardType & addedShard ) { <nl> auto response = assertGet ( <nl> - getConfigShard ( ) - > exhaustiveFindOnConfig ( operationContext ( ) , <nl> - ReadPreferenceSetting { <nl> - ReadPreference : : PrimaryOnly } , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( " config . changelog " ) , <nl> - BSON ( " what " <nl> - < < " addShard " <nl> - < < " details . name " <nl> - < < addedShard . getName ( ) ) , <nl> - BSONObj ( ) , <nl> - 1 ) ) ; <nl> + getConfigShard ( ) - > exhaustiveFind ( operationContext ( ) , <nl> + ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( " config . changelog " ) , <nl> + BSON ( " what " <nl> + < < " addShard " <nl> + < < " details . name " <nl> + < < addedShard . getName ( ) ) , <nl> + BSONObj ( ) , <nl> + 1 ) ) ; <nl> ASSERT_EQ ( 1U , response . docs . size ( ) ) ; <nl> auto logEntryBSON = response . docs . front ( ) ; <nl> auto logEntry = assertGet ( ChangeLogType : : fromBSON ( logEntryBSON ) ) ; <nl> mmm a / src / mongo / s / catalog / sharding_catalog_assign_key_range_to_zone_test . cpp <nl> ppp b / src / mongo / s / catalog / sharding_catalog_assign_key_range_to_zone_test . cpp <nl> class AssignKeyRangeToZoneTestFixture : public ConfigServerTestFixture { <nl> const ChunkRange & range , <nl> const string & zoneName ) { <nl> auto findStatus = <nl> - getConfigShard ( ) - > exhaustiveFindOnConfig ( operationContext ( ) , <nl> - kReadPref , <nl> - repl : : ReadConcernLevel : : kMajorityReadConcern , <nl> - NamespaceString ( TagsType : : ConfigNS ) , <nl> - BSONObj ( ) , <nl> - BSONObj ( ) , <nl> - 1 ) ; <nl> + getConfigShard ( ) - > exhaustiveFind ( operationContext ( ) , <nl> + kReadPref , <nl> + repl : : ReadConcernLevel : : kMajorityReadConcern , <nl> + NamespaceString ( TagsType : : ConfigNS ) , <nl> + BSONObj ( ) , <nl> + BSONObj ( ) , <nl> + 1 ) ; <nl> ASSERT_OK ( findStatus . getStatus ( ) ) ; <nl> <nl> auto findResult = findStatus . getValue ( ) ; <nl> mmm a / src / mongo / s / catalog / sharding_catalog_client_impl . cpp <nl> ppp b / src / mongo / s / catalog / sharding_catalog_client_impl . cpp <nl> StatusWith < BSONObj > ShardingCatalogClientImpl : : getGlobalSettings ( OperationContex <nl> <nl> StatusWith < VersionType > ShardingCatalogClientImpl : : getConfigVersion ( <nl> OperationContext * txn , repl : : ReadConcernLevel readConcern ) { <nl> - auto findStatus = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + auto findStatus = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> txn , <nl> kConfigReadSelector , <nl> readConcern , <nl> bool ShardingCatalogClientImpl : : runUserManagementWriteCommand ( OperationContext * <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> dbname , <nl> cmdToRun , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kNotIdempotent ) ; <nl> <nl> if ( ! response . isOK ( ) ) { <nl> bool ShardingCatalogClientImpl : : runUserManagementReadCommand ( OperationContext * t <nl> kConfigPrimaryPreferredSelector , <nl> dbname , <nl> cmdObj , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kIdempotent ) ; <nl> if ( resultStatus . isOK ( ) ) { <nl> result - > appendElements ( resultStatus . getValue ( ) . response ) ; <nl> void ShardingCatalogClientImpl : : writeConfigServerDirect ( OperationContext * txn , <nl> } <nl> <nl> auto configShard = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) ; <nl> - * batchResponse = configShard - > runBatchWriteCommandOnConfig ( <nl> - txn , batchRequest , Shard : : RetryPolicy : : kNotIdempotent ) ; <nl> + * batchResponse = <nl> + configShard - > runBatchWriteCommand ( txn , batchRequest , Shard : : RetryPolicy : : kNotIdempotent ) ; <nl> } <nl> <nl> Status ShardingCatalogClientImpl : : insertConfigDocument ( OperationContext * txn , <nl> Status ShardingCatalogClientImpl : : insertConfigDocument ( OperationContext * txn , <nl> auto configShard = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) ; <nl> for ( int retry = 1 ; retry < = kMaxWriteRetry ; retry + + ) { <nl> auto response = <nl> - configShard - > runBatchWriteCommandOnConfig ( txn , request , Shard : : RetryPolicy : : kNoRetry ) ; <nl> + configShard - > runBatchWriteCommand ( txn , request , Shard : : RetryPolicy : : kNoRetry ) ; <nl> <nl> Status status = response . toStatus ( ) ; <nl> <nl> StatusWith < bool > ShardingCatalogClientImpl : : updateConfigDocument ( <nl> <nl> auto configShard = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) ; <nl> auto response = <nl> - configShard - > runBatchWriteCommandOnConfig ( txn , request , Shard : : RetryPolicy : : kIdempotent ) ; <nl> + configShard - > runBatchWriteCommand ( txn , request , Shard : : RetryPolicy : : kIdempotent ) ; <nl> <nl> Status status = response . toStatus ( ) ; <nl> if ( ! status . isOK ( ) ) { <nl> Status ShardingCatalogClientImpl : : removeConfigDocuments ( OperationContext * txn , <nl> <nl> auto configShard = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) ; <nl> auto response = <nl> - configShard - > runBatchWriteCommandOnConfig ( txn , request , Shard : : RetryPolicy : : kIdempotent ) ; <nl> + configShard - > runBatchWriteCommand ( txn , request , Shard : : RetryPolicy : : kIdempotent ) ; <nl> <nl> return response . toStatus ( ) ; <nl> } <nl> Status ShardingCatalogClientImpl : : _createCappedConfigCollection ( <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> " config " , <nl> createCmd , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kIdempotent ) ; <nl> <nl> if ( ! result . isOK ( ) ) { <nl> StatusWith < long long > ShardingCatalogClientImpl : : _runCountCommandOnConfig ( Operat <nl> kConfigReadSelector , <nl> ns . db ( ) . toString ( ) , <nl> countBuilder . done ( ) , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kIdempotent ) ; <nl> if ( ! resultStatus . isOK ( ) ) { <nl> return resultStatus . getStatus ( ) ; <nl> StatusWith < repl : : OpTimeWith < vector < BSONObj > > > ShardingCatalogClientImpl : : _exhaus <nl> const BSONObj & query , <nl> const BSONObj & sort , <nl> boost : : optional < long long > limit ) { <nl> - auto response = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + auto response = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> txn , readPref , readConcern , nss , query , sort , limit ) ; <nl> if ( ! response . isOK ( ) ) { <nl> return response . getStatus ( ) ; <nl> mmm a / src / mongo / s / catalog / sharding_catalog_config_initialization_test . cpp <nl> ppp b / src / mongo / s / catalog / sharding_catalog_config_initialization_test . cpp <nl> TEST_F ( ConfigInitializationTest , BuildsNecessaryIndexes ) { <nl> } <nl> <nl> TEST_F ( ConfigInitializationTest , CompatibleIndexAlreadyExists ) { <nl> - getConfigShard ( ) - > createIndexOnConfig ( <nl> + getConfigShard ( ) - > createIndex ( <nl> operationContext ( ) , NamespaceString ( ShardType : : ConfigNS ) , BSON ( " host " < < 1 ) , true ) ; <nl> <nl> ASSERT_OK ( catalogManager ( ) - > initializeConfigDatabaseIfNeeded ( operationContext ( ) ) ) ; <nl> TEST_F ( ConfigInitializationTest , CompatibleIndexAlreadyExists ) { <nl> TEST_F ( ConfigInitializationTest , IncompatibleIndexAlreadyExists ) { <nl> / / Make the index non - unique even though its supposed to be unique , make sure initialization <nl> / / fails <nl> - getConfigShard ( ) - > createIndexOnConfig ( <nl> + getConfigShard ( ) - > createIndex ( <nl> operationContext ( ) , NamespaceString ( ShardType : : ConfigNS ) , BSON ( " host " < < 1 ) , false ) ; <nl> <nl> ASSERT_EQUALS ( ErrorCodes : : IndexOptionsConflict , <nl> mmm a / src / mongo / s / catalog / sharding_catalog_manager_chunk_operations_impl . cpp <nl> ppp b / src / mongo / s / catalog / sharding_catalog_manager_chunk_operations_impl . cpp <nl> Status checkCollectionVersionEpoch ( OperationContext * txn , <nl> const NamespaceString & nss , <nl> const ChunkType & aChunk , <nl> const OID & collectionEpoch ) { <nl> - auto findResponseWith = <nl> - Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> - txn , <nl> - ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( ChunkType : : ConfigNS ) , <nl> - BSON ( ChunkType : : ns ( ) < < nss . ns ( ) ) , <nl> - BSONObj ( ) , <nl> - 1 ) ; <nl> + auto findResponseWith = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> + txn , <nl> + ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( ChunkType : : ConfigNS ) , <nl> + BSON ( ChunkType : : ns ( ) < < nss . ns ( ) ) , <nl> + BSONObj ( ) , <nl> + 1 ) ; <nl> if ( ! findResponseWith . isOK ( ) ) { <nl> return findResponseWith . getStatus ( ) ; <nl> } <nl> Status checkChunkIsOnShard ( OperationContext * txn , <nl> < < shard ) ; <nl> <nl> / / Must use local read concern because we ' re going to perform subsequent writes . <nl> - auto findResponseWith = <nl> - Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> - txn , <nl> - ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( ChunkType : : ConfigNS ) , <nl> - chunkQuery , <nl> - BSONObj ( ) , <nl> - 1 ) ; <nl> + auto findResponseWith = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> + txn , <nl> + ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( ChunkType : : ConfigNS ) , <nl> + chunkQuery , <nl> + BSONObj ( ) , <nl> + 1 ) ; <nl> if ( ! findResponseWith . isOK ( ) ) { <nl> return findResponseWith . getStatus ( ) ; <nl> } <nl> Status ShardingCatalogManagerImpl : : commitChunkSplit ( OperationContext * txn , <nl> Lock : : ExclusiveLock lk ( txn - > lockState ( ) , _kChunkOpLock ) ; <nl> <nl> / / Get the chunk with highest version for this namespace <nl> - auto findStatus = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + auto findStatus = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> txn , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> repl : : ReadConcernLevel : : kLocalReadConcern , <nl> Status ShardingCatalogManagerImpl : : commitChunkMerge ( OperationContext * txn , <nl> Lock : : ExclusiveLock lk ( txn - > lockState ( ) , _kChunkOpLock ) ; <nl> <nl> / / Get the chunk with the highest version for this namespace <nl> - auto findStatus = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + auto findStatus = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> txn , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> repl : : ReadConcernLevel : : kLocalReadConcern , <nl> StatusWith < BSONObj > ShardingCatalogManagerImpl : : commitChunkMigration ( <nl> } <nl> <nl> / / Must use local read concern because we will perform subsequent writes . <nl> - auto findResponse = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + auto findResponse = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> txn , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> repl : : ReadConcernLevel : : kLocalReadConcern , <nl> mmm a / src / mongo / s / catalog / sharding_catalog_manager_impl . cpp <nl> ppp b / src / mongo / s / catalog / sharding_catalog_manager_impl . cpp <nl> Status ShardingCatalogManagerImpl : : _initConfigIndexes ( OperationContext * txn ) { <nl> const bool unique = true ; <nl> auto configShard = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) ; <nl> <nl> - Status result = <nl> - configShard - > createIndexOnConfig ( txn , <nl> - NamespaceString ( ChunkType : : ConfigNS ) , <nl> - BSON ( ChunkType : : ns ( ) < < 1 < < ChunkType : : min ( ) < < 1 ) , <nl> - unique ) ; <nl> + Status result = configShard - > createIndex ( txn , <nl> + NamespaceString ( ChunkType : : ConfigNS ) , <nl> + BSON ( ChunkType : : ns ( ) < < 1 < < ChunkType : : min ( ) < < 1 ) , <nl> + unique ) ; <nl> if ( ! result . isOK ( ) ) { <nl> return Status ( result . code ( ) , <nl> str : : stream ( ) < < " couldn ' t create ns_1_min_1 index on config db " <nl> < < causedBy ( result ) ) ; <nl> } <nl> <nl> - result = configShard - > createIndexOnConfig ( <nl> + result = configShard - > createIndex ( <nl> txn , <nl> NamespaceString ( ChunkType : : ConfigNS ) , <nl> BSON ( ChunkType : : ns ( ) < < 1 < < ChunkType : : shard ( ) < < 1 < < ChunkType : : min ( ) < < 1 ) , <nl> Status ShardingCatalogManagerImpl : : _initConfigIndexes ( OperationContext * txn ) { <nl> < < causedBy ( result ) ) ; <nl> } <nl> <nl> - result = configShard - > createIndexOnConfig ( <nl> - txn , <nl> - NamespaceString ( ChunkType : : ConfigNS ) , <nl> - BSON ( ChunkType : : ns ( ) < < 1 < < ChunkType : : DEPRECATED_lastmod ( ) < < 1 ) , <nl> - unique ) ; <nl> + result = <nl> + configShard - > createIndex ( txn , <nl> + NamespaceString ( ChunkType : : ConfigNS ) , <nl> + BSON ( ChunkType : : ns ( ) < < 1 < < ChunkType : : DEPRECATED_lastmod ( ) < < 1 ) , <nl> + unique ) ; <nl> if ( ! result . isOK ( ) ) { <nl> return Status ( result . code ( ) , <nl> str : : stream ( ) < < " couldn ' t create ns_1_lastmod_1 index on config db " <nl> < < causedBy ( result ) ) ; <nl> } <nl> <nl> - result = configShard - > createIndexOnConfig ( <nl> - txn , <nl> - NamespaceString ( MigrationType : : ConfigNS ) , <nl> - BSON ( MigrationType : : ns ( ) < < 1 < < MigrationType : : min ( ) < < 1 ) , <nl> - unique ) ; <nl> + result = configShard - > createIndex ( txn , <nl> + NamespaceString ( MigrationType : : ConfigNS ) , <nl> + BSON ( MigrationType : : ns ( ) < < 1 < < MigrationType : : min ( ) < < 1 ) , <nl> + unique ) ; <nl> if ( ! result . isOK ( ) ) { <nl> return Status ( result . code ( ) , <nl> str : : stream ( ) < < " couldn ' t create ns_1_min_1 index on config . migrations " <nl> < < causedBy ( result ) ) ; <nl> } <nl> <nl> - result = configShard - > createIndexOnConfig ( <nl> + result = configShard - > createIndex ( <nl> txn , NamespaceString ( ShardType : : ConfigNS ) , BSON ( ShardType : : host ( ) < < 1 ) , unique ) ; <nl> if ( ! result . isOK ( ) ) { <nl> return Status ( result . code ( ) , <nl> Status ShardingCatalogManagerImpl : : _initConfigIndexes ( OperationContext * txn ) { <nl> < < causedBy ( result ) ) ; <nl> } <nl> <nl> - result = configShard - > createIndexOnConfig ( <nl> + result = configShard - > createIndex ( <nl> txn , NamespaceString ( LocksType : : ConfigNS ) , BSON ( LocksType : : lockID ( ) < < 1 ) , ! unique ) ; <nl> if ( ! result . isOK ( ) ) { <nl> return Status ( result . code ( ) , <nl> Status ShardingCatalogManagerImpl : : _initConfigIndexes ( OperationContext * txn ) { <nl> < < causedBy ( result ) ) ; <nl> } <nl> <nl> - result = <nl> - configShard - > createIndexOnConfig ( txn , <nl> - NamespaceString ( LocksType : : ConfigNS ) , <nl> - BSON ( LocksType : : state ( ) < < 1 < < LocksType : : process ( ) < < 1 ) , <nl> - ! unique ) ; <nl> + result = configShard - > createIndex ( txn , <nl> + NamespaceString ( LocksType : : ConfigNS ) , <nl> + BSON ( LocksType : : state ( ) < < 1 < < LocksType : : process ( ) < < 1 ) , <nl> + ! unique ) ; <nl> if ( ! result . isOK ( ) ) { <nl> return Status ( result . code ( ) , <nl> str : : stream ( ) < < " couldn ' t create state and process id index on config db " <nl> < < causedBy ( result ) ) ; <nl> } <nl> <nl> - result = configShard - > createIndexOnConfig ( <nl> + result = configShard - > createIndex ( <nl> txn , NamespaceString ( LockpingsType : : ConfigNS ) , BSON ( LockpingsType : : ping ( ) < < 1 ) , ! unique ) ; <nl> if ( ! result . isOK ( ) ) { <nl> return Status ( result . code ( ) , <nl> Status ShardingCatalogManagerImpl : : _initConfigIndexes ( OperationContext * txn ) { <nl> < < causedBy ( result ) ) ; <nl> } <nl> <nl> - result = configShard - > createIndexOnConfig ( txn , <nl> - NamespaceString ( TagsType : : ConfigNS ) , <nl> - BSON ( TagsType : : ns ( ) < < 1 < < TagsType : : min ( ) < < 1 ) , <nl> - unique ) ; <nl> + result = configShard - > createIndex ( txn , <nl> + NamespaceString ( TagsType : : ConfigNS ) , <nl> + BSON ( TagsType : : ns ( ) < < 1 < < TagsType : : min ( ) < < 1 ) , <nl> + unique ) ; <nl> if ( ! result . isOK ( ) ) { <nl> return Status ( result . code ( ) , <nl> str : : stream ( ) < < " couldn ' t create ns_1_min_1 index on config db " <nl> < < causedBy ( result ) ) ; <nl> } <nl> <nl> - result = configShard - > createIndexOnConfig ( txn , <nl> - NamespaceString ( TagsType : : ConfigNS ) , <nl> - BSON ( TagsType : : ns ( ) < < 1 < < TagsType : : tag ( ) < < 1 ) , <nl> - ! unique ) ; <nl> + result = configShard - > createIndex ( txn , <nl> + NamespaceString ( TagsType : : ConfigNS ) , <nl> + BSON ( TagsType : : ns ( ) < < 1 < < TagsType : : tag ( ) < < 1 ) , <nl> + ! unique ) ; <nl> if ( ! result . isOK ( ) ) { <nl> return Status ( result . code ( ) , <nl> str : : stream ( ) < < " couldn ' t create ns_1_tag_1 index on config db " <nl> mmm a / src / mongo / s / catalog / sharding_catalog_manager_shard_operations_impl . cpp <nl> ppp b / src / mongo / s / catalog / sharding_catalog_manager_shard_operations_impl . cpp <nl> StatusWith < std : : string > generateNewShardName ( OperationContext * txn ) { <nl> BSONObjBuilder shardNameRegex ; <nl> shardNameRegex . appendRegex ( ShardType : : name ( ) , " ^ shard " ) ; <nl> <nl> - auto findStatus = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFindOnConfig ( <nl> + auto findStatus = Grid : : get ( txn ) - > shardRegistry ( ) - > getConfigShard ( ) - > exhaustiveFind ( <nl> txn , <nl> kConfigReadSelector , <nl> repl : : ReadConcernLevel : : kMajorityReadConcern , <nl> mmm a / src / mongo / s / catalog / sharding_catalog_manager_zone_operations_impl . cpp <nl> ppp b / src / mongo / s / catalog / sharding_catalog_manager_zone_operations_impl . cpp <nl> Status checkForOveralappedZonedKeyRange ( OperationContext * txn , <nl> const KeyPattern & shardKeyPattern ) { <nl> DistributionStatus chunkDist ( ns , ShardToChunksMap { } ) ; <nl> <nl> - auto tagStatus = configServer - > exhaustiveFindOnConfig ( txn , <nl> - kConfigPrimarySelector , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( TagsType : : ConfigNS ) , <nl> - BSON ( TagsType : : ns ( ns . ns ( ) ) ) , <nl> - BSONObj ( ) , <nl> - 0 ) ; <nl> + auto tagStatus = configServer - > exhaustiveFind ( txn , <nl> + kConfigPrimarySelector , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( TagsType : : ConfigNS ) , <nl> + BSON ( TagsType : : ns ( ns . ns ( ) ) ) , <nl> + BSONObj ( ) , <nl> + 0 ) ; <nl> if ( ! tagStatus . isOK ( ) ) { <nl> return tagStatus . getStatus ( ) ; <nl> } <nl> StatusWith < ChunkRange > includeFullShardKey ( OperationContext * txn , <nl> const NamespaceString & ns , <nl> const ChunkRange & range , <nl> KeyPattern * shardKeyPatternOut ) { <nl> - auto findCollStatus = <nl> - configServer - > exhaustiveFindOnConfig ( txn , <nl> - kConfigPrimarySelector , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( CollectionType : : ConfigNS ) , <nl> - BSON ( CollectionType : : fullNs ( ns . ns ( ) ) ) , <nl> - BSONObj ( ) , <nl> - 1 ) ; <nl> + auto findCollStatus = configServer - > exhaustiveFind ( txn , <nl> + kConfigPrimarySelector , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( CollectionType : : ConfigNS ) , <nl> + BSON ( CollectionType : : fullNs ( ns . ns ( ) ) ) , <nl> + BSONObj ( ) , <nl> + 1 ) ; <nl> <nl> if ( ! findCollStatus . isOK ( ) ) { <nl> return findCollStatus . getStatus ( ) ; <nl> Status ShardingCatalogManagerImpl : : removeShardFromZone ( OperationContext * txn , <nl> / / <nl> <nl> auto findShardExistsStatus = <nl> - configShard - > exhaustiveFindOnConfig ( txn , <nl> - kConfigPrimarySelector , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - shardNS , <nl> - BSON ( ShardType : : name ( ) < < shardName ) , <nl> - BSONObj ( ) , <nl> - 1 ) ; <nl> + configShard - > exhaustiveFind ( txn , <nl> + kConfigPrimarySelector , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + shardNS , <nl> + BSON ( ShardType : : name ( ) < < shardName ) , <nl> + BSONObj ( ) , <nl> + 1 ) ; <nl> <nl> if ( ! findShardExistsStatus . isOK ( ) ) { <nl> return findShardExistsStatus . getStatus ( ) ; <nl> Status ShardingCatalogManagerImpl : : removeShardFromZone ( OperationContext * txn , <nl> / / Check how many shards belongs to this zone . <nl> / / <nl> <nl> - auto findShardStatus = <nl> - configShard - > exhaustiveFindOnConfig ( txn , <nl> - kConfigPrimarySelector , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - shardNS , <nl> - BSON ( ShardType : : tags ( ) < < zoneName ) , <nl> - BSONObj ( ) , <nl> - 2 ) ; <nl> + auto findShardStatus = configShard - > exhaustiveFind ( txn , <nl> + kConfigPrimarySelector , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + shardNS , <nl> + BSON ( ShardType : : tags ( ) < < zoneName ) , <nl> + BSONObj ( ) , <nl> + 2 ) ; <nl> <nl> if ( ! findShardStatus . isOK ( ) ) { <nl> return findShardStatus . getStatus ( ) ; <nl> Status ShardingCatalogManagerImpl : : removeShardFromZone ( OperationContext * txn , <nl> } <nl> <nl> auto findChunkRangeStatus = <nl> - configShard - > exhaustiveFindOnConfig ( txn , <nl> - kConfigPrimarySelector , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( TagsType : : ConfigNS ) , <nl> - BSON ( TagsType : : tag ( ) < < zoneName ) , <nl> - BSONObj ( ) , <nl> - 1 ) ; <nl> + configShard - > exhaustiveFind ( txn , <nl> + kConfigPrimarySelector , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( TagsType : : ConfigNS ) , <nl> + BSON ( TagsType : : tag ( ) < < zoneName ) , <nl> + BSONObj ( ) , <nl> + 1 ) ; <nl> <nl> if ( ! findChunkRangeStatus . isOK ( ) ) { <nl> return findChunkRangeStatus . getStatus ( ) ; <nl> Status ShardingCatalogManagerImpl : : assignKeyRangeToZone ( OperationContext * txn , <nl> <nl> const auto & fullShardKeyRange = fullShardKeyStatus . getValue ( ) ; <nl> <nl> - auto zoneExistStatus = <nl> - configServer - > exhaustiveFindOnConfig ( txn , <nl> - kConfigPrimarySelector , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( ShardType : : ConfigNS ) , <nl> - BSON ( ShardType : : tags ( ) < < zoneName ) , <nl> - BSONObj ( ) , <nl> - 1 ) ; <nl> + auto zoneExistStatus = configServer - > exhaustiveFind ( txn , <nl> + kConfigPrimarySelector , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( ShardType : : ConfigNS ) , <nl> + BSON ( ShardType : : tags ( ) < < zoneName ) , <nl> + BSONObj ( ) , <nl> + 1 ) ; <nl> <nl> if ( ! zoneExistStatus . isOK ( ) ) { <nl> return zoneExistStatus . getStatus ( ) ; <nl> mmm a / src / mongo / s / catalog / sharding_catalog_merge_chunks_test . cpp <nl> ppp b / src / mongo / s / catalog / sharding_catalog_merge_chunks_test . cpp <nl> TEST_F ( MergeChunkTest , MergeExistingChunksCorrectlyShouldSucceed ) { <nl> " shard0000 " ) ) ; <nl> <nl> auto findResponse = uassertStatusOK ( <nl> - getConfigShard ( ) - > exhaustiveFindOnConfig ( operationContext ( ) , <nl> - ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( ChunkType : : ConfigNS ) , <nl> - BSON ( ChunkType : : ns ( ) < < " TestDB . TestColl " ) , <nl> - BSON ( ChunkType : : DEPRECATED_lastmod < < - 1 ) , <nl> - boost : : none ) ) ; <nl> + getConfigShard ( ) - > exhaustiveFind ( operationContext ( ) , <nl> + ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( ChunkType : : ConfigNS ) , <nl> + BSON ( ChunkType : : ns ( ) < < " TestDB . TestColl " ) , <nl> + BSON ( ChunkType : : DEPRECATED_lastmod < < - 1 ) , <nl> + boost : : none ) ) ; <nl> <nl> const auto & chunksVector = findResponse . docs ; <nl> <nl> TEST_F ( MergeChunkTest , MergeSeveralChunksCorrectlyShouldSucceed ) { <nl> " shard0000 " ) ) ; <nl> <nl> auto findResponse = uassertStatusOK ( <nl> - getConfigShard ( ) - > exhaustiveFindOnConfig ( operationContext ( ) , <nl> - ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( ChunkType : : ConfigNS ) , <nl> - BSON ( ChunkType : : ns ( ) < < " TestDB . TestColl " ) , <nl> - BSON ( ChunkType : : DEPRECATED_lastmod < < - 1 ) , <nl> - boost : : none ) ) ; <nl> + getConfigShard ( ) - > exhaustiveFind ( operationContext ( ) , <nl> + ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( ChunkType : : ConfigNS ) , <nl> + BSON ( ChunkType : : ns ( ) < < " TestDB . TestColl " ) , <nl> + BSON ( ChunkType : : DEPRECATED_lastmod < < - 1 ) , <nl> + boost : : none ) ) ; <nl> <nl> const auto & chunksVector = findResponse . docs ; <nl> <nl> TEST_F ( MergeChunkTest , NewMergeShouldClaimHighestVersion ) { <nl> " shard0000 " ) ) ; <nl> <nl> auto findResponse = uassertStatusOK ( <nl> - getConfigShard ( ) - > exhaustiveFindOnConfig ( operationContext ( ) , <nl> - ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( ChunkType : : ConfigNS ) , <nl> - BSON ( ChunkType : : ns ( ) < < " TestDB . TestColl " ) , <nl> - BSON ( ChunkType : : DEPRECATED_lastmod < < - 1 ) , <nl> - boost : : none ) ) ; <nl> + getConfigShard ( ) - > exhaustiveFind ( operationContext ( ) , <nl> + ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( ChunkType : : ConfigNS ) , <nl> + BSON ( ChunkType : : ns ( ) < < " TestDB . TestColl " ) , <nl> + BSON ( ChunkType : : DEPRECATED_lastmod < < - 1 ) , <nl> + boost : : none ) ) ; <nl> <nl> const auto & chunksVector = findResponse . docs ; <nl> <nl> TEST_F ( MergeChunkTest , MergeLeavesOtherChunksAlone ) { <nl> " shard0000 " ) ) ; <nl> <nl> auto findResponse = uassertStatusOK ( <nl> - getConfigShard ( ) - > exhaustiveFindOnConfig ( operationContext ( ) , <nl> - ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( ChunkType : : ConfigNS ) , <nl> - BSON ( ChunkType : : ns ( ) < < " TestDB . TestColl " ) , <nl> - BSON ( ChunkType : : DEPRECATED_lastmod < < - 1 ) , <nl> - boost : : none ) ) ; <nl> + getConfigShard ( ) - > exhaustiveFind ( operationContext ( ) , <nl> + ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( ChunkType : : ConfigNS ) , <nl> + BSON ( ChunkType : : ns ( ) < < " TestDB . TestColl " ) , <nl> + BSON ( ChunkType : : DEPRECATED_lastmod < < - 1 ) , <nl> + boost : : none ) ) ; <nl> <nl> const auto & chunksVector = findResponse . docs ; <nl> <nl> TEST_F ( MergeChunkTest , MergeAlreadyHappenedFailsPrecondition ) { <nl> <nl> / / Verify that no change to config . chunks happened . <nl> auto findResponse = uassertStatusOK ( <nl> - getConfigShard ( ) - > exhaustiveFindOnConfig ( operationContext ( ) , <nl> - ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> - repl : : ReadConcernLevel : : kLocalReadConcern , <nl> - NamespaceString ( ChunkType : : ConfigNS ) , <nl> - BSON ( ChunkType : : ns ( ) < < " TestDB . TestColl " ) , <nl> - BSON ( ChunkType : : DEPRECATED_lastmod < < - 1 ) , <nl> - boost : : none ) ) ; <nl> + getConfigShard ( ) - > exhaustiveFind ( operationContext ( ) , <nl> + ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + repl : : ReadConcernLevel : : kLocalReadConcern , <nl> + NamespaceString ( ChunkType : : ConfigNS ) , <nl> + BSON ( ChunkType : : ns ( ) < < " TestDB . TestColl " ) , <nl> + BSON ( ChunkType : : DEPRECATED_lastmod < < - 1 ) , <nl> + boost : : none ) ) ; <nl> <nl> const auto & chunksVector = findResponse . docs ; <nl> <nl> mmm a / src / mongo / s / client / shard . cpp <nl> ppp b / src / mongo / s / client / shard . cpp <nl> Status Shard : : CommandResponse : : processBatchWriteResponse ( <nl> return status ; <nl> } <nl> <nl> - const Milliseconds Shard : : kDefaultConfigCommandTimeout = Seconds { 30 } ; <nl> + const Milliseconds Shard : : kDefaultCommandTimeout = Seconds { 30 } ; <nl> <nl> bool Shard : : shouldErrorBePropagated ( ErrorCodes : : Error code ) { <nl> return std : : find ( RemoteCommandRetryScheduler : : kAllRetriableErrors . begin ( ) , <nl> StatusWith < Shard : : CommandResponse > Shard : : runCommandWithFixedRetryAttempts ( <nl> MONGO_UNREACHABLE ; <nl> } <nl> <nl> - BatchedCommandResponse Shard : : runBatchWriteCommandOnConfig ( <nl> - OperationContext * txn , const BatchedCommandRequest & batchRequest , RetryPolicy retryPolicy ) { <nl> - invariant ( isConfig ( ) ) ; <nl> - <nl> + BatchedCommandResponse Shard : : runBatchWriteCommand ( OperationContext * txn , <nl> + const BatchedCommandRequest & batchRequest , <nl> + RetryPolicy retryPolicy ) { <nl> const std : : string dbname = batchRequest . getNS ( ) . db ( ) . toString ( ) ; <nl> invariant ( batchRequest . sizeWriteOps ( ) = = 1 ) ; <nl> <nl> BatchedCommandResponse Shard : : runBatchWriteCommandOnConfig ( <nl> auto response = _runCommand ( txn , <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> dbname , <nl> - kDefaultConfigCommandTimeout , <nl> + kDefaultCommandTimeout , <nl> cmdObj ) ; <nl> <nl> BatchedCommandResponse batchResponse ; <nl> BatchedCommandResponse Shard : : runBatchWriteCommandOnConfig ( <nl> MONGO_UNREACHABLE ; <nl> } <nl> <nl> - StatusWith < Shard : : QueryResponse > Shard : : exhaustiveFindOnConfig ( <nl> + StatusWith < Shard : : QueryResponse > Shard : : exhaustiveFind ( <nl> OperationContext * txn , <nl> const ReadPreferenceSetting & readPref , <nl> const repl : : ReadConcernLevel & readConcernLevel , <nl> StatusWith < Shard : : QueryResponse > Shard : : exhaustiveFindOnConfig ( <nl> const BSONObj & query , <nl> const BSONObj & sort , <nl> const boost : : optional < long long > limit ) { <nl> - / / Do not allow exhaustive finds to be run against regular shards . <nl> - invariant ( isConfig ( ) ) ; <nl> - <nl> for ( int retry = 1 ; retry < = kOnErrorNumRetries ; retry + + ) { <nl> - auto result = <nl> - _exhaustiveFindOnConfig ( txn , readPref , readConcernLevel , nss , query , sort , limit ) ; <nl> + auto result = _exhaustiveFind ( txn , readPref , readConcernLevel , nss , query , sort , limit ) ; <nl> <nl> if ( retry < kOnErrorNumRetries & & <nl> isRetriableError ( result . getStatus ( ) . code ( ) , RetryPolicy : : kIdempotent ) ) { <nl> mmm a / src / mongo / s / client / shard . h <nl> ppp b / src / mongo / s / client / shard . h <nl> class Shard { <nl> RetryPolicy retryPolicy ) ; <nl> <nl> / * * <nl> - * Same as the other variant of runCommand , but allows the operation timeout to be overriden . <nl> + * Same as the other variant of runCommand , but allows the operation timeout to be overridden . <nl> * Runs for the lesser of the remaining time on the operation context or the specified maxTimeMS <nl> * override . <nl> * / <nl> class Shard { <nl> RetryPolicy retryPolicy ) ; <nl> <nl> / * * <nl> - * Expects a single - entry batch wrtie command and runs it on the config server ' s primary using <nl> + * Expects a single - entry batch write command and runs it with PrimaryOnly read preference using <nl> * the specified retry policy . <nl> * / <nl> - BatchedCommandResponse runBatchWriteCommandOnConfig ( OperationContext * txn , <nl> - const BatchedCommandRequest & batchRequest , <nl> - RetryPolicy retryPolicy ) ; <nl> + BatchedCommandResponse runBatchWriteCommand ( OperationContext * txn , <nl> + const BatchedCommandRequest & batchRequest , <nl> + RetryPolicy retryPolicy ) ; <nl> <nl> / * * <nl> * Warning : This method exhausts the cursor and pulls all data into memory . <nl> class Shard { <nl> * ShardRemote instances expect " readConcernLevel " to always be kMajorityReadConcern , whereas <nl> * ShardLocal instances expect either kLocalReadConcern or kMajorityReadConcern . <nl> * / <nl> - StatusWith < QueryResponse > exhaustiveFindOnConfig ( OperationContext * txn , <nl> - const ReadPreferenceSetting & readPref , <nl> - const repl : : ReadConcernLevel & readConcernLevel , <nl> - const NamespaceString & nss , <nl> - const BSONObj & query , <nl> - const BSONObj & sort , <nl> - const boost : : optional < long long > limit ) ; <nl> + StatusWith < QueryResponse > exhaustiveFind ( OperationContext * txn , <nl> + const ReadPreferenceSetting & readPref , <nl> + const repl : : ReadConcernLevel & readConcernLevel , <nl> + const NamespaceString & nss , <nl> + const BSONObj & query , <nl> + const BSONObj & sort , <nl> + const boost : : optional < long long > limit ) ; <nl> / * * <nl> - * Builds an index on a config server collection . <nl> + * Builds an index on a collection . <nl> * Creates the collection if it doesn ' t yet exist . Does not error if the index already exists , <nl> * so long as the options are the same . <nl> * NOTE : Currently only supported for LocalShard . <nl> * / <nl> - virtual Status createIndexOnConfig ( OperationContext * txn , <nl> - const NamespaceString & ns , <nl> - const BSONObj & keys , <nl> - bool unique ) = 0 ; <nl> + virtual Status createIndex ( OperationContext * txn , <nl> + const NamespaceString & ns , <nl> + const BSONObj & keys , <nl> + bool unique ) = 0 ; <nl> <nl> - / / This timeout will be used by default in operations against the config server , unless <nl> - / / explicitly overridden <nl> - static const Milliseconds kDefaultConfigCommandTimeout ; <nl> + / / This timeout will be used by default in remote operations unless explicitly overridden . <nl> + static const Milliseconds kDefaultCommandTimeout ; <nl> <nl> / * * <nl> * Returns false if the error is a retriable error and / or causes a replset monitor update . These <nl> * errors , if from a remote call , should not be further propagated back to another server <nl> - * because that server will interpret them as orignating on this server rather than the one this <nl> - * server called . <nl> + * because that server will interpret them as originating on this server rather than the one <nl> + * this server called . <nl> * / <nl> static bool shouldErrorBePropagated ( ErrorCodes : : Error code ) ; <nl> <nl> class Shard { <nl> Milliseconds maxTimeMSOverride , <nl> const BSONObj & cmdObj ) = 0 ; <nl> <nl> - virtual StatusWith < QueryResponse > _exhaustiveFindOnConfig ( <nl> + virtual StatusWith < QueryResponse > _exhaustiveFind ( <nl> OperationContext * txn , <nl> const ReadPreferenceSetting & readPref , <nl> const repl : : ReadConcernLevel & readConcernLevel , <nl> mmm a / src / mongo / s / client / shard_local . cpp <nl> ppp b / src / mongo / s / client / shard_local . cpp <nl> <nl> <nl> namespace mongo { <nl> <nl> - ShardLocal : : ShardLocal ( const ShardId & id ) : Shard ( id ) { <nl> - / / Currently ShardLocal only works for config servers . If we ever start using ShardLocal on <nl> - / / shards we ' ll need to consider how to handle shards . <nl> - invariant ( serverGlobalParams . clusterRole = = ClusterRole : : ConfigServer ) ; <nl> - } <nl> + ShardLocal : : ShardLocal ( const ShardId & id ) : Shard ( id ) { } <nl> <nl> const ConnectionString ShardLocal : : getConnString ( ) const { <nl> auto replCoord = repl : : getGlobalReplicationCoordinator ( ) ; <nl> Shard : : HostWithResponse ShardLocal : : _runCommand ( OperationContext * txn , <nl> } <nl> } <nl> <nl> - StatusWith < Shard : : QueryResponse > ShardLocal : : _exhaustiveFindOnConfig ( <nl> + StatusWith < Shard : : QueryResponse > ShardLocal : : _exhaustiveFind ( <nl> OperationContext * txn , <nl> const ReadPreferenceSetting & readPref , <nl> const repl : : ReadConcernLevel & readConcernLevel , <nl> StatusWith < Shard : : QueryResponse > ShardLocal : : _exhaustiveFindOnConfig ( <nl> } <nl> } <nl> <nl> - Status ShardLocal : : createIndexOnConfig ( OperationContext * txn , <nl> - const NamespaceString & ns , <nl> - const BSONObj & keys , <nl> - bool unique ) { <nl> + Status ShardLocal : : createIndex ( OperationContext * txn , <nl> + const NamespaceString & ns , <nl> + const BSONObj & keys , <nl> + bool unique ) { <nl> invariant ( ns . db ( ) = = " config " | | ns . db ( ) = = " admin " ) ; <nl> <nl> try { <nl> mmm a / src / mongo / s / client / shard_local . h <nl> ppp b / src / mongo / s / client / shard_local . h <nl> class ShardLocal : public Shard { <nl> <nl> bool isRetriableError ( ErrorCodes : : Error code , RetryPolicy options ) final ; <nl> <nl> - Status createIndexOnConfig ( OperationContext * txn , <nl> - const NamespaceString & ns , <nl> - const BSONObj & keys , <nl> - bool unique ) override ; <nl> + Status createIndex ( OperationContext * txn , <nl> + const NamespaceString & ns , <nl> + const BSONObj & keys , <nl> + bool unique ) override ; <nl> <nl> private : <nl> Shard : : HostWithResponse _runCommand ( OperationContext * txn , <nl> class ShardLocal : public Shard { <nl> Milliseconds maxTimeMSOverrideUnused , <nl> const BSONObj & cmdObj ) final ; <nl> <nl> - StatusWith < Shard : : QueryResponse > _exhaustiveFindOnConfig ( <nl> - OperationContext * txn , <nl> - const ReadPreferenceSetting & readPref , <nl> - const repl : : ReadConcernLevel & readConcernLevel , <nl> - const NamespaceString & nss , <nl> - const BSONObj & query , <nl> - const BSONObj & sort , <nl> - boost : : optional < long long > limit ) final ; <nl> + StatusWith < Shard : : QueryResponse > _exhaustiveFind ( OperationContext * txn , <nl> + const ReadPreferenceSetting & readPref , <nl> + const repl : : ReadConcernLevel & readConcernLevel , <nl> + const NamespaceString & nss , <nl> + const BSONObj & query , <nl> + const BSONObj & sort , <nl> + boost : : optional < long long > limit ) final ; <nl> <nl> / * * <nl> * Checks if an OpTime was set on the current Client ( ie if the current operation performed a <nl> class ShardLocal : public Shard { <nl> stdx : : mutex _mutex ; <nl> <nl> / / Stores the optime that was generated by the last operation to perform a write that was run <nl> - / / through _runCommand . Used in _exhaustiveFindOnConfig for waiting for that optime to be <nl> - / / committed so that readConcern majority reads will read the writes that were performed without <nl> - / / a w : majority write concern . <nl> + / / through _runCommand . Used in _exhaustiveFind for waiting for that optime to be committed so <nl> + / / that readConcern majority reads will read the writes that were performed without a w : majority <nl> + / / write concern . <nl> repl : : OpTime _lastOpTime { } ; <nl> } ; <nl> <nl> mmm a / src / mongo / s / client / shard_local_test . cpp <nl> ppp b / src / mongo / s / client / shard_local_test . cpp <nl> void ShardLocalTest : : setUp ( ) { <nl> Client : : initThreadIfNotAlready ( ) ; <nl> _txn = getGlobalServiceContext ( ) - > makeOperationContext ( & cc ( ) ) ; <nl> serverGlobalParams . clusterRole = ClusterRole : : ConfigServer ; <nl> - _shardLocal = stdx : : make_unique < ShardLocal > ( ShardId ( " config " ) ) ; <nl> + _shardLocal = stdx : : make_unique < ShardLocal > ( ShardId ( " shardId " ) ) ; <nl> const repl : : ReplSettings replSettings = { } ; <nl> repl : : setGlobalReplicationCoordinator ( <nl> new repl : : ReplicationCoordinatorMock ( _txn - > getServiceContext ( ) , replSettings ) ) ; <nl> StatusWith < Shard : : QueryResponse > ShardLocalTest : : runFindQuery ( NamespaceString ns <nl> BSONObj query , <nl> BSONObj sort , <nl> boost : : optional < long long > limit ) { <nl> - return _shardLocal - > exhaustiveFindOnConfig ( _txn . get ( ) , <nl> - ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> - repl : : ReadConcernLevel : : kMajorityReadConcern , <nl> - nss , <nl> - query , <nl> - sort , <nl> - limit ) ; <nl> + return _shardLocal - > exhaustiveFind ( _txn . get ( ) , <nl> + ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> + repl : : ReadConcernLevel : : kMajorityReadConcern , <nl> + nss , <nl> + query , <nl> + sort , <nl> + limit ) ; <nl> } <nl> <nl> TEST_F ( ShardLocalTest , RunCommand ) { <nl> TEST_F ( ShardLocalTest , CreateIndex ) { <nl> <nl> ASSERT_EQUALS ( ErrorCodes : : NamespaceNotFound , getIndexes ( nss ) . getStatus ( ) ) ; <nl> <nl> - Status status = <nl> - _shardLocal - > createIndexOnConfig ( _txn . get ( ) , nss , BSON ( " a " < < 1 < < " b " < < 1 ) , true ) ; <nl> + Status status = _shardLocal - > createIndex ( _txn . get ( ) , nss , BSON ( " a " < < 1 < < " b " < < 1 ) , true ) ; <nl> / / Creating the index should implicitly create the collection <nl> ASSERT_OK ( status ) ; <nl> <nl> TEST_F ( ShardLocalTest , CreateIndex ) { <nl> ASSERT_EQ ( 2U , indexes . size ( ) ) ; <nl> <nl> / / Making an identical index should be a no - op . <nl> - status = _shardLocal - > createIndexOnConfig ( _txn . get ( ) , nss , BSON ( " a " < < 1 < < " b " < < 1 ) , true ) ; <nl> + status = _shardLocal - > createIndex ( _txn . get ( ) , nss , BSON ( " a " < < 1 < < " b " < < 1 ) , true ) ; <nl> ASSERT_OK ( status ) ; <nl> indexes = unittest : : assertGet ( getIndexes ( nss ) ) ; <nl> ASSERT_EQ ( 2U , indexes . size ( ) ) ; <nl> <nl> / / Trying to make the same index as non - unique should fail . <nl> - status = _shardLocal - > createIndexOnConfig ( _txn . get ( ) , nss , BSON ( " a " < < 1 < < " b " < < 1 ) , false ) ; <nl> + status = _shardLocal - > createIndex ( _txn . get ( ) , nss , BSON ( " a " < < 1 < < " b " < < 1 ) , false ) ; <nl> ASSERT_EQUALS ( ErrorCodes : : IndexOptionsConflict , status ) ; <nl> indexes = unittest : : assertGet ( getIndexes ( nss ) ) ; <nl> ASSERT_EQ ( 2U , indexes . size ( ) ) ; <nl> mmm a / src / mongo / s / client / shard_remote . cpp <nl> ppp b / src / mongo / s / client / shard_remote . cpp <nl> Shard : : HostWithResponse ShardRemote : : _runCommand ( OperationContext * txn , <nl> std : : move ( writeConcernStatus ) ) ) ; <nl> } <nl> <nl> - StatusWith < Shard : : QueryResponse > ShardRemote : : _exhaustiveFindOnConfig ( <nl> + StatusWith < Shard : : QueryResponse > ShardRemote : : _exhaustiveFind ( <nl> OperationContext * txn , <nl> const ReadPreferenceSetting & readPref , <nl> const repl : : ReadConcernLevel & readConcernLevel , <nl> StatusWith < Shard : : QueryResponse > ShardRemote : : _exhaustiveFindOnConfig ( <nl> } <nl> <nl> const Milliseconds maxTimeMS = <nl> - std : : min ( txn - > getRemainingMaxTimeMillis ( ) , kDefaultConfigCommandTimeout ) ; <nl> + std : : min ( txn - > getRemainingMaxTimeMillis ( ) , kDefaultCommandTimeout ) ; <nl> <nl> BSONObjBuilder findCmdBuilder ; <nl> <nl> StatusWith < Shard : : QueryResponse > ShardRemote : : _exhaustiveFindOnConfig ( <nl> return response ; <nl> } <nl> <nl> - Status ShardRemote : : createIndexOnConfig ( OperationContext * txn , <nl> - const NamespaceString & ns , <nl> - const BSONObj & keys , <nl> - bool unique ) { <nl> + Status ShardRemote : : createIndex ( OperationContext * txn , <nl> + const NamespaceString & ns , <nl> + const BSONObj & keys , <nl> + bool unique ) { <nl> MONGO_UNREACHABLE ; <nl> } <nl> <nl> mmm a / src / mongo / s / client / shard_remote . h <nl> ppp b / src / mongo / s / client / shard_remote . h <nl> class ShardRemote : public Shard { <nl> <nl> bool isRetriableError ( ErrorCodes : : Error code , RetryPolicy options ) final ; <nl> <nl> - Status createIndexOnConfig ( OperationContext * txn , <nl> - const NamespaceString & ns , <nl> - const BSONObj & keys , <nl> - bool unique ) override ; <nl> + Status createIndex ( OperationContext * txn , <nl> + const NamespaceString & ns , <nl> + const BSONObj & keys , <nl> + bool unique ) override ; <nl> <nl> private : <nl> / * * <nl> class ShardRemote : public Shard { <nl> Milliseconds maxTimeMSOverride , <nl> const BSONObj & cmdObj ) final ; <nl> <nl> - StatusWith < QueryResponse > _exhaustiveFindOnConfig ( <nl> - OperationContext * txn , <nl> - const ReadPreferenceSetting & readPref , <nl> - const repl : : ReadConcernLevel & readConcernLevel , <nl> - const NamespaceString & nss , <nl> - const BSONObj & query , <nl> - const BSONObj & sort , <nl> - boost : : optional < long long > limit ) final ; <nl> + StatusWith < QueryResponse > _exhaustiveFind ( OperationContext * txn , <nl> + const ReadPreferenceSetting & readPref , <nl> + const repl : : ReadConcernLevel & readConcernLevel , <nl> + const NamespaceString & nss , <nl> + const BSONObj & query , <nl> + const BSONObj & sort , <nl> + boost : : optional < long long > limit ) final ; <nl> <nl> / * * <nl> * Connection string for the shard at the creation time . <nl> mmm a / src / mongo / s / config_server_test_fixture . cpp <nl> ppp b / src / mongo / s / config_server_test_fixture . cpp <nl> Status ConfigServerTestFixture : : insertToConfigCollection ( OperationContext * txn , <nl> kReadPref , <nl> ns . db ( ) . toString ( ) , <nl> request . toBSON ( ) , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kNoRetry ) ; <nl> <nl> BatchedCommandResponse batchResponse ; <nl> StatusWith < BSONObj > ConfigServerTestFixture : : findOneOnConfigCollection ( Operation <nl> auto config = getConfigShard ( ) ; <nl> invariant ( config ) ; <nl> <nl> - auto findStatus = config - > exhaustiveFindOnConfig ( <nl> + auto findStatus = config - > exhaustiveFind ( <nl> txn , kReadPref , repl : : ReadConcernLevel : : kMajorityReadConcern , ns , filter , BSONObj ( ) , 1 ) ; <nl> if ( ! findStatus . isOK ( ) ) { <nl> return findStatus . getStatus ( ) ; <nl> StatusWith < std : : vector < BSONObj > > ConfigServerTestFixture : : getIndexes ( OperationCo <nl> ReadPreferenceSetting { ReadPreference : : PrimaryOnly } , <nl> ns . db ( ) . toString ( ) , <nl> BSON ( " listIndexes " < < ns . coll ( ) . toString ( ) ) , <nl> - Shard : : kDefaultConfigCommandTimeout , <nl> + Shard : : kDefaultCommandTimeout , <nl> Shard : : RetryPolicy : : kIdempotent ) ; <nl> if ( ! response . isOK ( ) ) { <nl> return response . getStatus ( ) ; <nl>
|
SERVER - 27860 remove invariants to prevent ShardLocal running on shards and remove " - OnConfig " function name suffixes
|
mongodb/mongo
|
489cd07d2a3711286debae56f28416d7ba290648
|
2017-02-10T20:17:10Z
|
mmm a / docs / api / crash - reporter . md <nl> ppp b / docs / api / crash - reporter . md <nl> The ` crashReporter ` module has the following methods : <nl> Default is ` true ` . <nl> * ` ignoreSystemCrashHandler ` Boolean ( optional ) - Default is ` false ` . <nl> * ` extra ` Object ( optional ) - An object you can define that will be sent along with the <nl> - report . Only string properties are sent correctly , Nested objects are not <nl> + report . Only string properties are sent correctly . Nested objects are not <nl> supported . <nl> <nl> You are required to call this method before using any other ` crashReporter ` APIs <nl> and in each process ( main / renderer ) from which you want to collect crash reports . <nl> You can pass different options to ` crashReporter . start ` when calling from different processes . <nl> <nl> - * * Note * * Child processes created via the ` child_process ` module will not have access to the Electron modules . <nl> + * * Note * * Child processes created via the ` child_process ` module will not have access to the Electron modules . <nl> Therefore , to collect crash reports from them , use ` process . crashReporter . start ` instead . Pass the same options as above <nl> along with an additional one called ` crashesDirectory ` that should point to a directory to store the crash <nl> reports temporarily . You can test this out by calling ` process . crash ( ) ` to crash the child process . <nl>
|
Correct , - > . typo
|
electron/electron
|
cfe3ae234b2d820b971ec28b9dc299f59bf95cdd
|
2017-02-14T17:37:09Z
|
mmm a / project / cmake / CMakeLists . txt <nl> ppp b / project / cmake / CMakeLists . txt <nl> set ( INCLUDES $ { CORE_SOURCE_DIR } <nl> $ { CORE_SOURCE_DIR } / xbmc <nl> $ { CORE_SOURCE_DIR } / xbmc / $ { PLATFORM_DIR } <nl> $ { CORE_SOURCE_DIR } / xbmc / cores / VideoPlayer <nl> - $ { CORE_SOURCE_DIR } / tools / depends / native / libsquish - native / src <nl> $ { CMAKE_BINARY_DIR } / $ { CORE_BUILD_DIR } ) <nl> <nl> find_package ( PkgConfig ) <nl> if ( CMAKE_CROSSCOMPILING ) <nl> message ( STATUS " CMAKE_CROSSCOMPILING : $ { CMAKE_CROSSCOMPILING } " ) <nl> set ( PKG_CONFIG_FOUND TRUE ) <nl> endif ( ) <nl> - core_require_dep ( Squish ) <nl> endif ( ) <nl> <nl> find_package ( Threads REQUIRED ) <nl> deleted file mode 100644 <nl> index b1b1ed0046a8 . . 000000000000 <nl> mmm a / project / cmake / modules / FindSquish . cmake <nl> ppp / dev / null <nl> <nl> - # - Try to find SQUISH <nl> - # Once done this will define <nl> - # <nl> - # SQUISH - system has libuuid <nl> - # SQUISH_INCLUDE_DIRS - the libuuid include directory <nl> - # SQUISH_LIBRARIES - The libuuid libraries <nl> - <nl> - find_package ( PkgConfig ) <nl> - if ( PKG_CONFIG_FOUND ) <nl> - pkg_check_modules ( SQUISH squish ) <nl> - else ( ) <nl> - find_path ( SQUISH_INCLUDE_DIRS squish . h ) <nl> - find_library ( SQUISH_LIBRARIES squish ) <nl> - endif ( ) <nl> - <nl> - include ( FindPackageHandleStandardArgs ) <nl> - find_package_handle_standard_args ( SQUISH DEFAULT_MSG SQUISH_INCLUDE_DIRS SQUISH_LIBRARIES ) <nl> - <nl> - mark_as_advanced ( SQUISH_INCLUDE_DIRS SQUISH_LIBRARIES ) <nl> mmm a / project / cmake / treedata / common / externals . txt <nl> ppp b / project / cmake / treedata / common / externals . txt <nl> <nl> xbmc / contrib / kissfft kissfft <nl> - tools / depends / native / libsquish - native squish <nl> lib / libUPnP upnp <nl> lib / libexif exif <nl> mmm a / tools / depends / native / TexturePacker / CMakeLists . txt <nl> ppp b / tools / depends / native / TexturePacker / CMakeLists . txt <nl> target_include_directories ( TexturePacker <nl> $ { GIF_INCLUDE_DIR } <nl> $ { CORE_SOURCE_DIR } / xbmc <nl> $ { CORE_SOURCE_DIR } / xbmc / $ { PLATFORM_DIR } <nl> - $ { CORE_SOURCE_DIR } / tools / depends / native / libsquish - native / src <nl> $ { CORE_SOURCE_DIR } / lib <nl> $ { CMAKE_CURRENT_SOURCE_DIR } / src <nl> $ { CMAKE_CURRENT_SOURCE_DIR } / src / decoder ) <nl> target_link_libraries ( TexturePacker <nl> - PRIVATE $ { SYSTEM_LDFLAGS } squish <nl> + PRIVATE $ { SYSTEM_LDFLAGS } <nl> $ { GIF_LIBRARIES } <nl> $ { PNG_LIBRARIES } <nl> $ { JPEG_LIBRARIES } <nl> deleted file mode 100644 <nl> index 1a5589f19b19 . . 000000000000 <nl> mmm a / tools / depends / native / libsquish - native / CMakeLists . txt <nl> ppp / dev / null <nl> <nl> - if ( CMAKE_CROSSCOMPILING ) <nl> - return ( ) <nl> - endif ( ) <nl> - <nl> - set ( SOURCES src / alpha . cpp <nl> - src / clusterfit . cpp <nl> - src / colourblock . cpp <nl> - src / colourfit . cpp <nl> - src / colourset . cpp <nl> - src / maths . cpp <nl> - src / rangefit . cpp <nl> - src / singlecolourfit . cpp <nl> - src / squish . cpp ) <nl> - <nl> - include_directories ( $ { CMAKE_CURRENT_SOURCE_DIR } / src ) <nl> - <nl> - find_package ( SSE ) <nl> - if ( SSE2_FOUND ) <nl> - add_definitions ( - DSQUISH_USE_SSE = 2 ) <nl> - elseif ( SSE_FOUND ) <nl> - add_definitions ( - DSQUISH_USE_SSE = 1 ) <nl> - endif ( ) <nl> - <nl> - # Always compile release - it ' s insanely slow in debug <nl> - set ( CMAKE_CXX_FLAGS " $ { CMAKE_CXX_FLAGS } - O2 " ) <nl> - add_definitions ( - DNDEBUG ) <nl> - <nl> - if ( SQUISH_NATIVE ) <nl> - core_add_library ( squish - native NO_MAIN_DEPENDS ) <nl> - else ( ) <nl> - if ( NOT BOOTSTRAP_IN_TREE ) <nl> - core_add_library ( squish ) <nl> - else ( ) <nl> - set ( core_DEPENDS squish - native $ { core_DEPENDS } CACHE STRING " " FORCE ) <nl> - endif ( ) <nl> - endif ( ) <nl>
|
[ cmake ] remove squish dependency
|
xbmc/xbmc
|
b778286cedc0998c223ef925c1465b2d52a9fa29
|
2016-02-13T14:17:28Z
|
mmm a / src / addrman . cpp <nl> ppp b / src / addrman . cpp <nl> using namespace std ; <nl> <nl> int CAddrInfo : : GetTriedBucket ( const uint256 & nKey ) const <nl> { <nl> - CDataStream ss1 ( SER_GETHASH , 0 ) ; <nl> - std : : vector < unsigned char > vchKey = GetKey ( ) ; <nl> - ss1 < < nKey < < vchKey ; <nl> - uint64_t hash1 = Hash ( ss1 . begin ( ) , ss1 . end ( ) ) . GetCheapHash ( ) ; <nl> - <nl> - CDataStream ss2 ( SER_GETHASH , 0 ) ; <nl> - std : : vector < unsigned char > vchGroupKey = GetGroup ( ) ; <nl> - ss2 < < nKey < < vchGroupKey < < ( hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP ) ; <nl> - uint64_t hash2 = Hash ( ss2 . begin ( ) , ss2 . end ( ) ) . GetCheapHash ( ) ; <nl> + uint64_t hash1 = ( CHashWriter ( SER_GETHASH , 0 ) < < nKey < < GetKey ( ) ) . GetHash ( ) . GetCheapHash ( ) ; <nl> + uint64_t hash2 = ( CHashWriter ( SER_GETHASH , 0 ) < < nKey < < GetGroup ( ) < < ( hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP ) ) . GetHash ( ) . GetCheapHash ( ) ; <nl> return hash2 % ADDRMAN_TRIED_BUCKET_COUNT ; <nl> } <nl> <nl> int CAddrInfo : : GetNewBucket ( const uint256 & nKey , const CNetAddr & src ) const <nl> { <nl> - CDataStream ss1 ( SER_GETHASH , 0 ) ; <nl> - std : : vector < unsigned char > vchGroupKey = GetGroup ( ) ; <nl> std : : vector < unsigned char > vchSourceGroupKey = src . GetGroup ( ) ; <nl> - ss1 < < nKey < < vchGroupKey < < vchSourceGroupKey ; <nl> - uint64_t hash1 = Hash ( ss1 . begin ( ) , ss1 . end ( ) ) . GetCheapHash ( ) ; <nl> - <nl> - CDataStream ss2 ( SER_GETHASH , 0 ) ; <nl> - ss2 < < nKey < < vchSourceGroupKey < < ( hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP ) ; <nl> - uint64_t hash2 = Hash ( ss2 . begin ( ) , ss2 . end ( ) ) . GetCheapHash ( ) ; <nl> + uint64_t hash1 = ( CHashWriter ( SER_GETHASH , 0 ) < < nKey < < GetGroup ( ) < < vchSourceGroupKey ) . GetHash ( ) . GetCheapHash ( ) ; <nl> + uint64_t hash2 = ( CHashWriter ( SER_GETHASH , 0 ) < < nKey < < vchSourceGroupKey < < ( hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP ) ) . GetHash ( ) . GetCheapHash ( ) ; <nl> return hash2 % ADDRMAN_NEW_BUCKET_COUNT ; <nl> } <nl> <nl> int CAddrInfo : : GetBucketPosition ( const uint256 & nKey , bool fNew , int nBucket ) const <nl> { <nl> - CDataStream ss1 ( SER_GETHASH , 0 ) ; <nl> - std : : vector < unsigned char > vchKey = GetKey ( ) ; <nl> - ss1 < < nKey < < ( fNew ? ' N ' : ' K ' ) < < nBucket < < vchKey ; <nl> - uint64_t hash1 = Hash ( ss1 . begin ( ) , ss1 . end ( ) ) . GetCheapHash ( ) ; <nl> + uint64_t hash1 = ( CHashWriter ( SER_GETHASH , 0 ) < < nKey < < ( fNew ? ' N ' : ' K ' ) < < nBucket < < GetKey ( ) ) . GetHash ( ) . GetCheapHash ( ) ; <nl> return hash1 % ADDRMAN_BUCKET_SIZE ; <nl> } <nl> <nl>
|
Simplify hashing code
|
bitcoin/bitcoin
|
a8ff7c62edc63c7c94bc91c30b80995539ed7477
|
2015-03-24T00:23:40Z
|
mmm a / tests / cpp - tests / Classes / ExtensionsTest / CocoStudioComponentsTest / SceneController . cpp <nl> ppp b / tests / cpp - tests / Classes / ExtensionsTest / CocoStudioComponentsTest / SceneController . cpp <nl> void SceneController : : spriteMoveFinished ( Node * sender ) <nl> auto gameOverScene = GameOverScene : : create ( ) ; <nl> gameOverScene - > getLayer ( ) - > getLabel ( ) - > setString ( " You Lose : [ " ) ; <nl> <nl> - Director : : getInstance ( ) - > replaceScene ( gameOverScene ) ; <nl> + director - > replaceScene ( gameOverScene ) ; <nl> } <nl> else if ( sprite - > getTag ( ) = = 3 ) <nl> { <nl> void SceneController : : increaseKillCount ( ) <nl> auto director = Director : : getInstance ( ) ; <nl> auto gameOverScene = GameOverScene : : create ( ) ; <nl> gameOverScene - > getLayer ( ) - > getLabel ( ) - > setString ( " You Win ! " ) ; <nl> - Director : : getInstance ( ) - > replaceScene ( gameOverScene ) ; <nl> + director - > replaceScene ( gameOverScene ) ; <nl> } <nl> } <nl>
|
Merge pull request from ricardoquesada / cpp_compiles_on_mac
|
cocos2d/cocos2d-x
|
b409f20fcd55b51c343bd3546be5179ab6c8807c
|
2015-04-09T22:41:54Z
|
mmm a / tensorflow / core / kernels / avgpooling_op . cc <nl> ppp b / tensorflow / core / kernels / avgpooling_op . cc <nl> limitations under the License . <nl> # if GOOGLE_CUDA <nl> # include " tensorflow / core / kernels / maxpooling_op_gpu . h " <nl> # include " tensorflow / core / kernels / pooling_ops_common_gpu . h " <nl> - # include " tensorflow / core / util / use_cudnn . h " <nl> # endif / / GOOGLE_CUDA <nl> <nl> namespace tensorflow { <nl> class AvgPoolingOp < GPUDevice , T > : public UnaryOp < T > { <nl> <nl> TensorShape output_shape = params . forward_output_shape ( ) ; <nl> <nl> - if ( internal : : AvgPoolUseCudnn ( ) | | data_format_ = = FORMAT_NCHW ) { <nl> + if ( data_format_ = = FORMAT_NCHW ) { <nl> DnnPoolingOp < T > : : Compute ( <nl> context , perftools : : gputools : : dnn : : PoolingMode : : kAverage , ksize_ , <nl> stride_ , padding_ , data_format_ , tensor_in , output_shape ) ; <nl> mmm a / tensorflow / core / util / use_cudnn . cc <nl> ppp b / tensorflow / core / util / use_cudnn . cc <nl> bool CudnnUseAutotune ( ) { <nl> return value ; <nl> } <nl> <nl> - namespace internal { <nl> - <nl> - bool AvgPoolUseCudnn ( ) { <nl> - bool value ; <nl> - Status status = ReadBoolFromEnvVar ( " TF_AVGPOOL_USE_CUDNN " , false , & value ) ; <nl> - if ( ! status . ok ( ) ) { <nl> - LOG ( ERROR ) < < status . error_message ( ) ; <nl> - } <nl> - return value ; <nl> - } <nl> - <nl> - } / / namespace internal <nl> } / / namespace tensorflow <nl> mmm a / tensorflow / core / util / use_cudnn . h <nl> ppp b / tensorflow / core / util / use_cudnn . h <nl> namespace tensorflow { <nl> bool CanUseCudnn ( ) ; <nl> bool CudnnUseAutotune ( ) ; <nl> <nl> - namespace internal { <nl> - <nl> - / / This function is for transition only . And it may go away at any time . <nl> - bool AvgPoolUseCudnn ( ) ; <nl> - <nl> - } / / namespace internal <nl> } / / namespace tensorflow <nl> <nl> # endif / / TENSORFLOW_UTIL_USE_CUDNN_H_ <nl>
|
Use Cudnn for avgpool by default .
|
tensorflow/tensorflow
|
9cc6f652ed860335ebc23cbe66841eb0172b080a
|
2017-05-22T23:07:15Z
|
mmm a / dbms / src / Formats / ProtobufReader . cpp <nl> ppp b / dbms / src / Formats / ProtobufReader . cpp <nl> namespace <nl> <nl> void unknownFormat ( ) <nl> { <nl> - throw Exception ( " Protobuf messages are corrupted or doesn ' t match the provided schema . Please note that Protobuf stream is length - delimited : every message is prefixed by its length in varint . " , ErrorCodes : : UNKNOWN_PROTOBUF_FORMAT ) ; <nl> + throw Exception ( " Protobuf messages are corrupted or don ' t match the provided schema . Please note that Protobuf stream is length - delimited : every message is prefixed by its length in varint . " , ErrorCodes : : UNKNOWN_PROTOBUF_FORMAT ) ; <nl> } <nl> } <nl> <nl>
|
Fixed typo
|
ClickHouse/ClickHouse
|
b0b369b30f04a5026d1da5c7d3fd5998d6de1fe4
|
2019-04-18T19:46:59Z
|
mmm a / src / core / lib / transport / transport . cc <nl> ppp b / src / core / lib / transport / transport . cc <nl> <nl> # include " src / core / lib / gpr / alloc . h " <nl> # include " src / core / lib / gpr / string . h " <nl> # include " src / core / lib / iomgr / executor . h " <nl> + # include " src / core / lib / iomgr / iomgr . h " <nl> # include " src / core / lib / slice / slice_internal . h " <nl> # include " src / core / lib / slice / slice_string_helpers . h " <nl> # include " src / core / lib / transport / transport_impl . h " <nl> void grpc_stream_unref ( grpc_stream_refcount * refcount , const char * reason ) { <nl> void grpc_stream_unref ( grpc_stream_refcount * refcount ) { <nl> # endif <nl> if ( gpr_unref ( & refcount - > refs ) ) { <nl> - if ( grpc_core : : ExecCtx : : Get ( ) - > flags ( ) & <nl> - GRPC_EXEC_CTX_FLAG_THREAD_RESOURCE_LOOP ) { <nl> + if ( ! grpc_iomgr_is_any_background_poller_thread ( ) & & <nl> + ( grpc_core : : ExecCtx : : Get ( ) - > flags ( ) & <nl> + GRPC_EXEC_CTX_FLAG_THREAD_RESOURCE_LOOP ) ) { <nl> / * Ick . <nl> The thread we ' re running on MAY be owned ( indirectly ) by a call - stack . <nl> If that ' s the case , destroying the call - stack MAY try to destroy the <nl>
|
Condition another executor offload on stream destruction
|
grpc/grpc
|
7b7d52e4cc0ccd7c1dc76afe9c9387f32edf399e
|
2019-01-23T19:42:45Z
|
mmm a / src / Storages / MergeTree / BackgroundProcessingPool . cpp <nl> ppp b / src / Storages / MergeTree / BackgroundProcessingPool . cpp <nl> void BackgroundProcessingPool : : workLoopFunc ( ) <nl> <nl> if ( task_result = = TaskResult : : SUCCESS ) <nl> task - > count_no_work_done = 0 ; <nl> - else <nl> + else if ( task_result = = TaskResult : : ERROR ) <nl> + + task - > count_no_work_done ; <nl> + / / / NOTHING_TO_DO should not increment count_no_work_done <nl> + / / / otherwise error after period of inactivity ( lot of NOTHING_TO_DO ) <nl> + / / / leads to 5 - 10 min replication hang <nl> <nl> / / / If task has done work , it could be executed again immediately . <nl> / / / If not , add delay before next run . <nl>
|
Merge pull request from filimonov / background - pool - count_no_work_done - bug
|
ClickHouse/ClickHouse
|
f366b366aea3fc0b2c640c39b7c780f6ce18b511
|
2020-10-15T13:11:57Z
|
mmm a / README . md <nl> ppp b / README . md <nl> How you can contribute ? See this small guide . <nl> <nl> * Use the directory structure of the repository . <nl> * Please describe your pull requests . <nl> - * Don ' t use * * bits / stdc + + . h * * because this is quite Linux specific and slow down the compiler process . <nl> - * Put in comments in your code . <nl> - * Avoid * * struct * * uses instead the * * class * * keyword . <nl> - * Add some test cases in the main - function . <nl> \ No newline at end of file <nl> + * Don ' t use * * bits / stdc + + . h * * because this is quite Linux specific and slows down the compiler process . <nl> + * Put comments in your code . <nl> + * Avoid * * struct * * . Instead use the * * class * * keyword . <nl> + * Add some test cases in the main - function . <nl>
|
Merge pull request from khanna98 / master
|
TheAlgorithms/C-Plus-Plus
|
87ba9d5fabcc7f669c5d2c95c01bb2459c364a6b
|
2019-02-09T08:06:41Z
|
mmm a / . cicd / generate - pipeline . sh <nl> ppp b / . cicd / generate - pipeline . sh <nl> done <nl> # set build source whether triggered or not <nl> if [ [ ! - z $ { BUILDKITE_TRIGGERED_FROM_BUILD_ID } ] ] ; then <nl> export BUILD_SOURCE = " - - build \ $ BUILDKITE_TRIGGERED_FROM_BUILD_ID " <nl> - LINUX_CONCURRENCY_GROUP = " eos - trigger - linux - $ { BUILDKITE_BUILD_NUMBER } " <nl> + LINUX_CONCURRENCY_GROUP = " eos - trigger - linux " <nl> MAC_CONCURRENCY_GROUP = " eos - trigger - mac " <nl> fi <nl> export BUILD_SOURCE = $ { BUILD_SOURCE : mmmbuild \ $ BUILDKITE_BUILD_ID } <nl>
|
Only one concurrency group for Linux .
|
EOSIO/eos
|
7618963982bc13372451109c3a5055052c9ab0f4
|
2019-09-13T15:26:53Z
|
mmm a / editor / plugins / script_editor_plugin . cpp <nl> ppp b / editor / plugins / script_editor_plugin . cpp <nl> void ScriptEditor : : _members_overview_selected ( int p_idx ) { <nl> if ( ! se ) { <nl> return ; <nl> } <nl> - / / Go to the member ' s line and reset the cursor column . We can ' t just change scroll_position <nl> - / / directly , since code might be folded . <nl> + / / Go to the member ' s line and reset the cursor column . We can ' t change scroll_position <nl> + / / directly until we have gone to the line first , since code might be folded . <nl> se - > goto_line ( members_overview - > get_item_metadata ( p_idx ) ) ; <nl> Dictionary state = se - > get_edit_state ( ) ; <nl> state [ " column " ] = 0 ; <nl> + state [ " scroll_position " ] = members_overview - > get_item_metadata ( p_idx ) ; <nl> se - > set_edit_state ( state ) ; <nl> } <nl> <nl>
|
Fixed members overview not scrolling to correct line
|
godotengine/godot
|
4d92c5e1c306b483d30004fe04fbef1ad46f7f7f
|
2018-02-09T17:35:28Z
|
mmm a / scene / resources / particles_material . cpp <nl> ppp b / scene / resources / particles_material . cpp <nl> void ParticlesMaterial : : _update_shader ( ) { <nl> / / do none <nl> } break ; <nl> case EMISSION_SHAPE_SPHERE : { <nl> - code + = " TRANSFORM [ 3 ] . xyz = normalize ( vec3 ( rand_from_seed ( alt_seed ) * 2 . 0 - 1 . 0 , rand_from_seed ( alt_seed ) * 2 . 0 - 1 . 0 , rand_from_seed ( alt_seed ) * 2 . 0 - 1 . 0 ) ) * emission_sphere_radius ; \ n " ; <nl> + code + = " float s = rand_from_seed ( alt_seed ) * 2 . 0 - 1 . 0 ; \ n " ; <nl> + code + = " float t = rand_from_seed ( alt_seed ) * 2 . 0 * pi ; \ n " ; <nl> + code + = " float radius = emission_sphere_radius * sqrt ( 1 . 0 - s * s ) ; \ n " ; <nl> + code + = " TRANSFORM [ 3 ] . xyz = vec3 ( radius * cos ( t ) , radius * sin ( t ) , emission_sphere_radius * s ) ; \ n " ; <nl> } break ; <nl> case EMISSION_SHAPE_BOX : { <nl> code + = " TRANSFORM [ 3 ] . xyz = vec3 ( rand_from_seed ( alt_seed ) * 2 . 0 - 1 . 0 , rand_from_seed ( alt_seed ) * 2 . 0 - 1 . 0 , rand_from_seed ( alt_seed ) * 2 . 0 - 1 . 0 ) * emission_box_extents ; \ n " ; <nl>
|
particles : Return uniform density spheres .
|
godotengine/godot
|
5fc8691176f97e9fdeb609012b0061fbb4de8eb4
|
2019-07-06T18:05:43Z
|
mmm a / android / filament - android / src / main / cpp / nativewindow / Darwin . mm <nl> ppp b / android / filament - android / src / main / cpp / nativewindow / Darwin . mm <nl> <nl> <nl> # import < Cocoa / Cocoa . h > <nl> <nl> + # pragma clang diagnostic push <nl> + # pragma ide diagnostic ignored " NotReleasedValue " <nl> extern " C " { <nl> void * getNativeWindow ( JNIEnv * env , jclass klass , jobject surface ) { <nl> void * win = nullptr ; <nl> <nl> view . wantsLayer = true ; <nl> [ jawldsip setLayer : view . layer ] ; <nl> <nl> - win = ( void * ) view ; <nl> + win = ( void * ) view ; <nl> releaseDrawingSurface ( ds , dsi ) ; <nl> return win ; <nl> } <nl> <nl> jlong createNativeSurface ( jint width , jint height ) { <nl> NSView * view = [ [ NSView alloc ] initWithFrame : NSMakeRect ( 0 , 0 , width , height ) ] ; <nl> view . wantsLayer = true ; <nl> - return ( jlong ) view ; <nl> + return ( jlong ) view ; <nl> } <nl> <nl> void destroyNativeSurface ( jlong surface ) { <nl> void destroyNativeSurface ( jlong surface ) { <nl> } <nl> <nl> } <nl> + # pragma clang diagnostic pop <nl> mmm a / android / filament - android / src / main / cpp / nativewindow / JAWTUtils . cpp <nl> ppp b / android / filament - android / src / main / cpp / nativewindow / JAWTUtils . cpp <nl> static std : : vector < int > jawtVersions = { <nl> 0x00010009 , <nl> } ; <nl> <nl> - bool acquireDrawingSurface ( JNIEnv * env , jobject surface , JAWT_DrawingSurface * * ods , <nl> - JAWT_DrawingSurfaceInfo * * odsi ) { <nl> + # pragma clang diagnostic push <nl> + # pragma clang diagnostic ignored " - Wuninitialized " <nl> + bool acquireDrawingSurface ( JNIEnv * env , jobject surface , <nl> + JAWT_DrawingSurface * * ods , JAWT_DrawingSurfaceInfo * * odsi ) { <nl> + <nl> JAWT awt ; <nl> - JAWT_DrawingSurface * ds = nullptr ; <nl> - JAWT_DrawingSurfaceInfo * dsi = nullptr ; <nl> + JAWT_DrawingSurface * ds = nullptr ; <nl> + JAWT_DrawingSurfaceInfo * dsi = nullptr ; <nl> <nl> / / Search for a valid AWT <nl> - jboolean foundJawt = false ; <nl> - for ( int jawtVersion : jawtVersions ) { <nl> + jboolean foundJawt = JNI_FALSE ; <nl> + for ( int jawtVersion : jawtVersions ) { <nl> awt . version = jawtVersion ; <nl> foundJawt = JAWT_GetAWT ( env , & awt ) ; <nl> if ( foundJawt = = JNI_TRUE ) { <nl> + # ifndef NDEBUG <nl> printf ( " Found valid AWT v % 08x . \ n " , jawtVersion ) ; <nl> + # endif <nl> break ; <nl> } else { <nl> + # ifndef NDEBUG <nl> printf ( " AWT v % 08x not present . \ n " , jawtVersion ) ; <nl> + # endif <nl> } <nl> } <nl> + # ifndef NDEBUG <nl> fflush ( stdout ) ; <nl> + # endif <nl> <nl> if ( foundJawt = = JNI_FALSE ) { <nl> printf ( " AWT Not found \ n " ) ; <nl> fflush ( stdout ) ; <nl> - return 0 ; <nl> + return false ; <nl> } <nl> <nl> / / Get the drawing surface <nl> ds = awt . GetDrawingSurface ( env , surface ) ; <nl> - if ( ds = = NULL ) { <nl> + if ( ds = = nullptr ) { <nl> + # ifndef NDEBUG <nl> printf ( " NULL drawing surface \ n " ) ; <nl> fflush ( stdout ) ; <nl> - return 0 ; <nl> + # endif <nl> + return false ; <nl> } <nl> <nl> / / Lock the drawing <nl> jint lock = ds - > Lock ( ds ) ; <nl> if ( ( lock & JAWT_LOCK_ERROR ) ! = 0 ) { <nl> + # ifndef NDEBUG <nl> printf ( " Error locking surface \ n " ) ; <nl> fflush ( stdout ) ; <nl> + # endif <nl> awt . FreeDrawingSurface ( ds ) ; <nl> - return 0 ; <nl> + return false ; <nl> } <nl> <nl> / / Get the drawing surface info <nl> dsi = ds - > GetDrawingSurfaceInfo ( ds ) ; <nl> - if ( dsi = = NULL ) { <nl> + if ( dsi = = nullptr ) { <nl> + # ifndef NDEBUG <nl> printf ( " Error getting surface info \ n " ) ; <nl> fflush ( stdout ) ; <nl> + # endif <nl> + <nl> ds - > Unlock ( ds ) ; <nl> awt . FreeDrawingSurface ( ds ) ; <nl> - return 0 ; <nl> + return false ; <nl> } <nl> <nl> * odsi = dsi ; <nl> * ods = ds ; <nl> - return 1 ; <nl> + <nl> + return true ; <nl> } <nl> + # pragma clang diagnostic pop <nl> <nl> - void releaseDrawingSurface ( JAWT_DrawingSurface * ds , JAWT_DrawingSurfaceInfo * dsi ) { <nl> + void releaseDrawingSurface ( JAWT_DrawingSurface * ds , JAWT_DrawingSurfaceInfo * dsi ) { <nl> / / Free the drawing surface info <nl> ds - > FreeDrawingSurfaceInfo ( dsi ) ; <nl> / / Unlock the drawing surface <nl> mmm a / android / filament - android / src / main / cpp / nativewindow / JAWTUtils . h <nl> ppp b / android / filament - android / src / main / cpp / nativewindow / JAWTUtils . h <nl> <nl> # include < jawt . h > <nl> <nl> extern " C " { <nl> - bool acquireDrawingSurface ( JNIEnv * env , jobject obj , JAWT_DrawingSurface * * ds , <nl> - JAWT_DrawingSurfaceInfo * * dsi ) ; <nl> + bool acquireDrawingSurface ( JNIEnv * env , jobject surface , JAWT_DrawingSurface * * ods , <nl> + JAWT_DrawingSurfaceInfo * * odsi ) ; <nl> void releaseDrawingSurface ( JAWT_DrawingSurface * ds , JAWT_DrawingSurfaceInfo * dsi ) ; <nl> } <nl> mmm a / android / filament - android / src / main / cpp / nativewindow / Linux . cpp <nl> ppp b / android / filament - android / src / main / cpp / nativewindow / Linux . cpp <nl> <nl> # include < GL / glx . h > <nl> <nl> extern " C " { <nl> - void * getNativeWindow ( JNIEnv * env , jclass , jobject surface ) { <nl> - void * win = nullptr ; <nl> - JAWT_DrawingSurface * ds = nullptr ; <nl> - JAWT_DrawingSurfaceInfo * dsi = nullptr ; <nl> + void * getNativeWindow ( JNIEnv * env , jclass , jobject surface ) { <nl> + void * win = nullptr ; <nl> + JAWT_DrawingSurface * ds = nullptr ; <nl> + JAWT_DrawingSurfaceInfo * dsi = nullptr ; <nl> <nl> if ( ! acquireDrawingSurface ( env , surface , & ds , & dsi ) ) { <nl> return win ; <nl> } <nl> - JAWT_X11DrawingSurfaceInfo * dsi_x11 = ( JAWT_X11DrawingSurfaceInfo * ) dsi - > platformInfo ; <nl> + JAWT_X11DrawingSurfaceInfo * dsi_x11 = ( JAWT_X11DrawingSurfaceInfo * ) dsi - > platformInfo ; <nl> <nl> - win = ( void * ) dsi_x11 - > drawable ; <nl> + win = ( void * ) dsi_x11 - > drawable ; <nl> releaseDrawingSurface ( ds , dsi ) ; <nl> return win ; <nl> } <nl> jlong createNativeSurface ( jint width , jint height ) { <nl> XFlush ( display ) ; <nl> <nl> / / Camouflage the pbuffer as a window which are both XID anyway . <nl> - return ( jlong ) window ; <nl> + return ( jlong ) window ; <nl> } <nl> <nl> void destroyNativeSurface ( jlong surface ) { <nl> void destroyNativeSurface ( jlong surface ) { <nl> } <nl> <nl> } <nl> - <nl> mmm a / android / filament - android / src / main / cpp / nativewindow / Win32 . cpp <nl> ppp b / android / filament - android / src / main / cpp / nativewindow / Win32 . cpp <nl> void chooseAndSetPixelFormat ( HDC dc ) { <nl> SetPixelFormat ( dc , pixelFormat , & pfd ) ; <nl> } <nl> <nl> - void * getNativeWindow ( JNIEnv * env , jclass , jobject surface ) { <nl> - void * win = nullptr ; <nl> - JAWT_DrawingSurface * ds = nullptr ; <nl> - JAWT_DrawingSurfaceInfo * dsi = nullptr ; <nl> + void * getNativeWindow ( JNIEnv * env , jclass , jobject surface ) { <nl> + void * win = nullptr ; <nl> + JAWT_DrawingSurface * ds = nullptr ; <nl> + JAWT_DrawingSurfaceInfo * dsi = nullptr ; <nl> + <nl> if ( ! acquireDrawingSurface ( env , surface , & ds , & dsi ) ) { <nl> return win ; <nl> } <nl> - JAWT_Win32DrawingSurfaceInfo * dsi_win32 = ( JAWT_Win32DrawingSurfaceInfo * ) dsi - > platformInfo ; <nl> + <nl> + JAWT_Win32DrawingSurfaceInfo * dsi_win32 = ( JAWT_Win32DrawingSurfaceInfo * ) dsi - > platformInfo ; <nl> HDC dc = dsi_win32 - > hdc ; <nl> chooseAndSetPixelFormat ( dsi_win32 - > hdc ) ; <nl> - win = ( void * ) dsi_win32 - > hdc ; <nl> + <nl> + win = ( void * ) dsi_win32 - > hdc ; <nl> releaseDrawingSurface ( ds , dsi ) ; <nl> + <nl> return win ; <nl> } <nl> <nl> jlong createNativeSurface ( jint width , jint height ) { <nl> <nl> HWND window = CreateWindowA ( " STATIC " , " dummy " , 0 , 0 , 0 , width , height , NULL , NULL , NULL , NULL ) ; <nl> SetWindowLong ( window , GWL_STYLE , 0 ) ; / / remove all window styles <nl> + <nl> HDC dc = GetDC ( window ) ; <nl> chooseAndSetPixelFormat ( dc ) ; <nl> - return ( jlong ) dc ; <nl> + <nl> + return ( jlong ) dc ; <nl> } <nl> <nl> void destroyNativeSurface ( jlong surface ) { <nl> - HDC dc = ( HDC ) surface ; <nl> + HDC dc = ( HDC ) surface ; <nl> HWND window = WindowFromDC ( dc ) ; <nl> ReleaseDC ( window , dc ) ; <nl> DestroyWindow ( window ) ; <nl> mmm a / libs / filameshio / include / filameshio / MeshIO . h <nl> ppp b / libs / filameshio / include / filameshio / MeshIO . h <nl> namespace filament { <nl> class MaterialInstance ; <nl> } <nl> <nl> + / * * <nl> + * This API can be used to read meshes stored in the " filamesh " format produced <nl> + * by the command line tool of the same name . This file format is documented in <nl> + * " docs / filamesh . md " in the Filament distribution . <nl> + * / <nl> class MeshIO { <nl> public : <nl> using Callback = void ( * ) ( void * buffer , size_t size , void * user ) ; <nl> class MeshIO { <nl> filament : : IndexBuffer * indexBuffer = nullptr ; <nl> } ; <nl> <nl> + / * * <nl> + * Loads a filamesh renderable from the specified file . The material registry <nl> + * can be used to provide named materials . If a material found in the filamesh <nl> + * file cannot be matched to a material in the registry , a default material is <nl> + * used instead . The default material can be overridden by adding a material <nl> + * named " DefaultMaterial " to the registry . <nl> + * / <nl> static Mesh loadMeshFromFile ( filament : : Engine * engine , <nl> const utils : : Path & path , <nl> const MaterialRegistry & materials ) ; <nl> <nl> - static Mesh loadMeshFromBuffer ( filament : : Engine * engine , <nl> + / * * <nl> + * Loads a filamesh renderable from an in - memory buffer . The material registry <nl> + * can be used to provide named materials . If a material found in the filamesh <nl> + * file cannot be matched to a material in the registry , a default material is <nl> + * used instead . The default material can be overridden by adding a material <nl> + * named " DefaultMaterial " to the registry . <nl> + * / <nl> + static Mesh loadMeshFromBuffer ( filament : : Engine * engine , <nl> void const * data , Callback destructor , void * user , <nl> const MaterialRegistry & materials ) ; <nl> <nl> - static Mesh loadMeshFromBuffer ( filament : : Engine * engine , <nl> + / * * <nl> + * Loads a filamesh renderable from the specified file . The material registry <nl> + * can be used to provide named materials . All the primitives of the decoded <nl> + * renderable are assigned the specified default material . <nl> + * / <nl> + static Mesh loadMeshFromBuffer ( filament : : Engine * engine , <nl> void const * data , Callback destructor , void * user , <nl> filament : : MaterialInstance * defaultMaterial ) ; <nl> } ; <nl>
|
Cleanup and documentation ( )
|
google/filament
|
4e3a88bbab7fbfb53e818c4abec26070e6cac89d
|
2018-11-01T23:36:52Z
|
mmm a / libraries / chainbase <nl> ppp b / libraries / chainbase <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 664b4ae2136fa4b67c5b3b8f23ed3dfe95e44b66 <nl> + Subproject commit 759ca20e908b60e54eed463d0b2889f6e2108e71 <nl>
|
Merge pull request from EOSIO / fix_heap_shrinkage_18x
|
EOSIO/eos
|
6f6ecb273921ae4df3f35cea72a4292f1ab821f3
|
2019-11-25T15:41:05Z
|
mmm a / modules / planning / common / path / path_data . cc <nl> ppp b / modules / planning / common / path / path_data . cc <nl> bool PathData : : LeftTrimWithRefS ( const double ref_s , const double ref_l ) { <nl> <nl> bool PathData : : UpdateFrenetFramePath ( const ReferenceLine * reference_line ) { <nl> reference_line_ = reference_line ; <nl> - const DiscretizedPath & discretized_path = discretized_path_ ; <nl> - bool success = SetDiscretizedPath ( discretized_path ) ; <nl> - if ( ! success ) { <nl> - return false ; <nl> - } <nl> - return true ; <nl> + return SetDiscretizedPath ( discretized_path_ ) ; <nl> } <nl> <nl> } / / namespace planning <nl> mmm a / modules / planning / scenarios / side_pass / side_pass_scenario . cc <nl> ppp b / modules / planning / scenarios / side_pass / side_pass_scenario . cc <nl> void SidePassScenario : : RegisterStages ( ) { <nl> } ) ; <nl> } <nl> <nl> - SidePassScenario : : SidePassScenario ( <nl> - const ScenarioConfig & config , const ScenarioContext * scenario_context ) <nl> - : Scenario ( config , scenario_context ) { <nl> - side_pass_context_ . scenario_config_ . CopyFrom ( config . side_pass_config ( ) ) ; <nl> - } <nl> + SidePassScenario : : SidePassScenario ( const ScenarioConfig & config , <nl> + const ScenarioContext * scenario_context ) <nl> + : Scenario ( config , scenario_context ) { <nl> + side_pass_context_ . scenario_config_ . CopyFrom ( config . side_pass_config ( ) ) ; <nl> + } <nl> <nl> std : : unique_ptr < Stage > SidePassScenario : : CreateStage ( <nl> const ScenarioConfig : : StageConfig & stage_config ) { <nl> bool SidePassScenario : : HasBlockingObstacle ( const Frame & frame ) { <nl> reference_line . GetLaneWidth ( obstacle - > PerceptionSLBoundary ( ) . end_s ( ) , <nl> & lane_left_width_at_end_s , <nl> & lane_right_width_at_end_s ) ; <nl> - double lane_width = std : : min ( <nl> - lane_left_width_at_start_s + lane_right_width_at_start_s , <nl> - lane_left_width_at_end_s + lane_right_width_at_end_s ) ; <nl> + double lane_width = <nl> + std : : min ( lane_left_width_at_start_s + lane_right_width_at_start_s , <nl> + lane_left_width_at_end_s + lane_right_width_at_end_s ) ; <nl> const double adc_width = <nl> VehicleConfigHelper : : GetConfig ( ) . vehicle_param ( ) . width ( ) ; <nl> - double driving_width = lane_width - adc_width - <nl> - FLAGS_static_decision_nudge_l_buffer ; <nl> - ADEBUG < < " lane_width [ " < < lane_width <nl> - < < " ] driving_width [ " < < driving_width < < " ] " ; <nl> - if ( driving_width > kLThreshold ) { <nl> + double driving_width = <nl> + lane_width - adc_width - FLAGS_static_decision_nudge_l_buffer ; <nl> + ADEBUG < < " lane_width [ " < < lane_width < < " ] driving_width [ " < < driving_width <nl> + < < " ] " ; <nl> + if ( driving_width < kLThreshold ) { <nl> continue ; <nl> } <nl> <nl> mmm a / modules / planning / scenarios / side_pass / side_pass_stop_on_wait_point . cc <nl> ppp b / modules / planning / scenarios / side_pass / side_pass_stop_on_wait_point . cc <nl> Stage : : StageStatus SidePassStopOnWaitPoint : : Process ( <nl> return Stage : : ERROR ; <nl> } <nl> <nl> + for ( const auto & p : <nl> + GetContext ( ) - > path_data_ . discretized_path ( ) . path_points ( ) ) { <nl> + ADEBUG < < p . ShortDebugString ( ) ; <nl> + } <nl> + <nl> PathPoint first_path_point = <nl> GetContext ( ) - > path_data_ . discretized_path ( ) . path_points ( ) . front ( ) ; <nl> <nl> Stage : : StageStatus SidePassStopOnWaitPoint : : Process ( <nl> auto & rfl_info = frame - > mutable_reference_line_info ( ) - > front ( ) ; <nl> * ( rfl_info . mutable_path_data ( ) ) = GetContext ( ) - > path_data_ ; <nl> * ( rfl_info . mutable_speed_data ( ) ) = <nl> - SpeedProfileGenerator : : GenerateFallbackSpeedProfile ( ) ; <nl> + SpeedProfileGenerator : : GenerateFallbackSpeedProfile ( ) ; <nl> + <nl> rfl_info . set_trajectory_type ( ADCTrajectory : : NORMAL ) ; <nl> DiscretizedTrajectory trajectory ; <nl> if ( ! rfl_info . CombinePathAndSpeedProfile ( <nl> Stage : : StageStatus SidePassStopOnWaitPoint : : Process ( <nl> SpeedProfileGenerator : : GenerateFixedDistanceCreepProfile ( <nl> move_forward_distance , kSidePassCreepSpeed ) ; <nl> <nl> + for ( const auto & sd : rfl_info . mutable_speed_data ( ) - > speed_vector ( ) ) { <nl> + ADEBUG < < sd . ShortDebugString ( ) ; <nl> + } <nl> + <nl> / / ( 2 ) combine path and speed . <nl> * ( rfl_info . mutable_path_data ( ) ) = GetContext ( ) - > path_data_ ; <nl> <nl> mmm a / modules / planning / toolkits / deciders / side_pass_path_decider . cc <nl> ppp b / modules / planning / toolkits / deciders / side_pass_path_decider . cc <nl> using apollo : : common : : util : : MakePointENU ; <nl> using apollo : : hdmap : : HDMapUtil ; <nl> <nl> constexpr double kRoadBuffer = 0 . 2 ; <nl> - constexpr double kObstacleBuffer = 0 . 1 ; <nl> - constexpr double kPlanDistAfterObs = 5 . 0 ; <nl> + constexpr double kObstacleLBuffer = 0 . 2 ; <nl> + constexpr double kObstacleSBuffer = 0 . 5 ; <nl> constexpr double kSidePassPathLength = 50 . 0 ; <nl> <nl> SidePassPathDecider : : SidePassPathDecider ( const TaskConfig & config ) <nl> SidePassPathDecider : : GetPathBoundaries ( <nl> std : : vector < std : : tuple < double , double , double > > lateral_bounds ; <nl> <nl> constexpr double kLargeBoundary = 10 . 0 ; <nl> - constexpr double s_increment = 1 . 0 ; <nl> for ( double curr_s = adc_frenet_frame_point_ . s ( ) ; <nl> curr_s < std : : min ( adc_frenet_frame_point_ . s ( ) + kSidePassPathLength , <nl> reference_line . Length ( ) ) ; <nl> - curr_s + = s_increment ) { <nl> + curr_s + = <nl> + Decider : : config_ . side_pass_path_decider_config ( ) . path_resolution ( ) ) { <nl> std : : tuple < double , double , double > lateral_bound = std : : make_tuple ( <nl> curr_s - adc_frenet_frame_point_ . s ( ) , - kLargeBoundary , kLargeBoundary ) ; <nl> <nl> SidePassPathDecider : : GetPathBoundaries ( <nl> } <nl> <nl> for ( const auto * obstacle : indexed_obstacles . Items ( ) ) { <nl> + if ( obstacle - > IsVirtual ( ) ) { <nl> + continue ; <nl> + } <nl> const auto obs_sl = obstacle - > PerceptionSLBoundary ( ) ; <nl> - AINFO < < obstacle - > Perception ( ) . ShortDebugString ( ) ; <nl> + ADEBUG < < obs_sl . ShortDebugString ( ) ; <nl> + <nl> / / not overlap with obstacle <nl> - if ( curr_s < obs_sl . start_s ( ) | | curr_s > obs_sl . end_s ( ) ) { <nl> + if ( curr_s < obs_sl . start_s ( ) - kObstacleSBuffer | | <nl> + curr_s > obs_sl . end_s ( ) + kObstacleSBuffer ) { <nl> continue ; <nl> } <nl> - <nl> / / not within lateral range <nl> if ( obs_sl . start_l ( ) > std : : get < 2 > ( lateral_bound ) | | <nl> obs_sl . end_l ( ) < std : : get < 1 > ( lateral_bound ) ) { <nl> SidePassPathDecider : : GetPathBoundaries ( <nl> if ( std : : get < 2 > ( lateral_bound ) - obs_sl . end_l ( ) > <nl> obs_sl . start_l ( ) - std : : get < 1 > ( lateral_bound ) ) { <nl> const double lower_bound = FLAGS_static_decision_nudge_l_buffer + <nl> - kObstacleBuffer + obs_sl . end_l ( ) ; <nl> + kObstacleLBuffer + obs_sl . end_l ( ) ; <nl> if ( std : : get < 2 > ( lateral_bound ) - lower_bound - 2 . 0 * adc_half_width - <nl> FLAGS_static_decision_nudge_l_buffer - kRoadBuffer > = <nl> 0 . 0 ) { <nl> - std : : get < 1 > ( lateral_bound ) = lower_bound ; <nl> + std : : get < 1 > ( lateral_bound ) = lower_bound + adc_half_width ; <nl> } <nl> } else { <nl> const double upper_bound = - FLAGS_static_decision_nudge_l_buffer - <nl> - kObstacleBuffer + obs_sl . start_l ( ) ; <nl> + kObstacleLBuffer + obs_sl . start_l ( ) ; <nl> if ( upper_bound - std : : get < 1 > ( lateral_bound ) - 2 . 0 * adc_half_width - <nl> FLAGS_static_decision_nudge_l_buffer - kRoadBuffer > = <nl> 0 . 0 ) { <nl> - std : : get < 2 > ( lateral_bound ) = upper_bound ; <nl> + std : : get < 2 > ( lateral_bound ) = upper_bound - adc_half_width ; <nl> } <nl> } <nl> } <nl>
|
Planning : bugfix in sidepass .
|
ApolloAuto/apollo
|
1351f34919d6d7ccc27d6983477bb39d9edfe877
|
2018-12-13T23:19:46Z
|
mmm a / include / swift / AST / Decl . h <nl> ppp b / include / swift / AST / Decl . h <nl> class alignas ( 1 < < DeclAlignInBits ) Decl { <nl> IsPropertyWrapperBackingProperty : 1 <nl> ) ; <nl> <nl> - SWIFT_INLINE_BITFIELD ( ParamDecl , VarDecl , 1 + 2 + 1 + NumDefaultArgumentKindBits , <nl> + SWIFT_INLINE_BITFIELD ( ParamDecl , VarDecl , 1 + 2 + NumDefaultArgumentKindBits , <nl> / / / Whether we ' ve computed the specifier yet . <nl> SpecifierComputed : 1 , <nl> <nl> class alignas ( 1 < < DeclAlignInBits ) Decl { <nl> / / / the storage semantics of the value e . g . mutability . <nl> Specifier : 2 , <nl> <nl> - / / / True if the type is implicitly specified in the source , but this has an <nl> - / / / apparently valid typeRepr . This is used in accessors , which look like : <nl> - / / / set ( value ) { <nl> - / / / but need to get the typeRepr from the property as a whole so Sema can <nl> - / / / resolve the type . <nl> - IsTypeLocImplicit : 1 , <nl> - <nl> / / / Information about a symbolic default argument , like # file . <nl> defaultArgumentKind : NumDefaultArgumentKindBits <nl> ) ; <nl> class ParamDecl : public VarDecl { <nl> SourceLoc getParameterNameLoc ( ) const { return ParameterNameLoc ; } <nl> <nl> SourceLoc getSpecifierLoc ( ) const { return SpecifierLoc ; } <nl> - <nl> - bool isTypeLocImplicit ( ) const { return Bits . ParamDecl . IsTypeLocImplicit ; } <nl> - void setIsTypeLocImplicit ( bool val ) { Bits . ParamDecl . IsTypeLocImplicit = val ; } <nl> - <nl> + <nl> DefaultArgumentKind getDefaultArgumentKind ( ) const { <nl> return static_cast < DefaultArgumentKind > ( Bits . ParamDecl . defaultArgumentKind ) ; <nl> } <nl> mmm a / lib / AST / ASTPrinter . cpp <nl> ppp b / lib / AST / ASTPrinter . cpp <nl> void PrintAST : : visitVarDecl ( VarDecl * decl ) { <nl> if ( decl - > hasInterfaceType ( ) ) { <nl> Printer < < " : " ; <nl> TypeLoc tyLoc ; <nl> - if ( auto * repr = tyLoc . getTypeRepr ( ) ) <nl> + if ( auto * repr = decl - > getTypeRepr ( ) ) <nl> tyLoc = TypeLoc ( repr , decl - > getInterfaceType ( ) ) ; <nl> else <nl> tyLoc = TypeLoc : : withoutLoc ( decl - > getInterfaceType ( ) ) ; <nl> mmm a / lib / AST / ASTWalker . cpp <nl> ppp b / lib / AST / ASTWalker . cpp <nl> class Traversal : public ASTVisitor < Traversal , Expr * , Stmt * , <nl> <nl> / / Don ' t walk into the type if the decl is implicit , or if the type is <nl> / / implicit . <nl> - if ( ! P - > isImplicit ( ) & & ! P - > isTypeLocImplicit ( ) ) { <nl> + if ( ! P - > isImplicit ( ) ) { <nl> if ( auto * repr = P - > getTypeRepr ( ) ) { <nl> if ( doIt ( repr ) ) { <nl> return true ; <nl> mmm a / lib / AST / Decl . cpp <nl> ppp b / lib / AST / Decl . cpp <nl> ParamDecl : : ParamDecl ( SourceLoc specifierLoc , <nl> ArgumentName ( argumentName ) , ParameterNameLoc ( parameterNameLoc ) , <nl> ArgumentNameLoc ( argumentNameLoc ) , SpecifierLoc ( specifierLoc ) { <nl> Bits . ParamDecl . SpecifierComputed = false ; <nl> - Bits . ParamDecl . IsTypeLocImplicit = false ; <nl> Bits . ParamDecl . defaultArgumentKind = <nl> static_cast < unsigned > ( DefaultArgumentKind : : None ) ; <nl> } <nl> ParamDecl * ParamDecl : : cloneWithoutType ( const ASTContext & Ctx , ParamDecl * PD ) { <nl> PD - > getArgumentNameLoc ( ) , PD - > getParameterName ( ) , PD - > getDeclContext ( ) ) ; <nl> Clone - > DefaultValueAndFlags . setPointerAndInt ( <nl> nullptr , PD - > DefaultValueAndFlags . getInt ( ) ) ; <nl> - Clone - > Bits . ParamDecl . IsTypeLocImplicit = <nl> - PD - > Bits . ParamDecl . IsTypeLocImplicit ; <nl> Clone - > Bits . ParamDecl . defaultArgumentKind = <nl> PD - > Bits . ParamDecl . defaultArgumentKind ; <nl> if ( auto * repr = PD - > getTypeRepr ( ) ) <nl> - Clone - > setTypeRepr ( repr - > clone ( PD - > getASTContext ( ) ) ) ; <nl> + Clone - > setTypeRepr ( repr - > clone ( Ctx ) ) ; <nl> <nl> Clone - > setSpecifier ( PD - > getSpecifier ( ) ) ; <nl> Clone - > setImplicitlyUnwrappedOptional ( PD - > isImplicitlyUnwrappedOptional ( ) ) ; <nl> SourceRange ParamDecl : : getSourceRange ( ) const { <nl> / / If the typeloc has a valid location , use it to end the range . <nl> if ( auto typeRepr = getTypeRepr ( ) ) { <nl> auto endLoc = typeRepr - > getEndLoc ( ) ; <nl> - if ( endLoc . isValid ( ) & & ! isTypeLocImplicit ( ) ) <nl> + if ( endLoc . isValid ( ) ) <nl> return SourceRange ( startLoc , endLoc ) ; <nl> } <nl> <nl> mmm a / lib / Parse / ParseDecl . cpp <nl> ppp b / lib / Parse / ParseDecl . cpp <nl> static ParamDecl * createSetterAccessorArgument ( SourceLoc nameLoc , <nl> if ( isNameImplicit ) <nl> result - > setImplicit ( ) ; <nl> <nl> - / / AST Walker shouldn ' t go into the type recursively . <nl> - result - > setIsTypeLocImplicit ( true ) ; <nl> - <nl> return result ; <nl> } <nl> <nl> mmm a / test / Constraints / closures . swift <nl> ppp b / test / Constraints / closures . swift <nl> struct rdar30347997 { <nl> struct rdar43866352 < Options > { <nl> func foo ( ) { <nl> let callback : ( inout Options ) - > Void <nl> - callback = { ( options : Options ) in } / / expected - error { { cannot assign value of type ' ( inout Options ) - > ( ) ' to type ' ( inout _ ) - > Void ' } } <nl> + callback = { ( options : Options ) in } / / expected - error { { cannot assign value of type ' ( Options ) - > ( ) ' to type ' ( inout Options ) - > Void ' } } <nl> } <nl> } <nl> <nl>
|
Delete the IsTypeLocImplicit Bit
|
apple/swift
|
660f66d7c0d45577b9a56686d2136b662d59e4c3
|
2019-10-11T20:41:19Z
|
mmm a / tensorflow / contrib / distributions / BUILD <nl> ppp b / tensorflow / contrib / distributions / BUILD <nl> cuda_py_tests ( <nl> <nl> cuda_py_tests ( <nl> name = " transformed_distribution_test " , <nl> - size = " small " , <nl> + size = " medium " , <nl> srcs = [ " python / kernel_tests / transformed_distribution_test . py " ] , <nl> additional_deps = [ <nl> " : distributions_py " , <nl>
|
Bump the size of transformed_distribution_test , as it is flakily timing out .
|
tensorflow/tensorflow
|
befeb83a1310ff66459b018d436dffc8cfc60879
|
2016-09-09T05:30:50Z
|
mmm a / selfdrive / modeld / modeld <nl> ppp b / selfdrive / modeld / modeld <nl> <nl> if [ - d / system ] ; then <nl> export LD_LIBRARY_PATH = " / data / pythonpath / phonelibs / snpe / aarch64 / : $ LD_LIBRARY_PATH " <nl> else <nl> - export LD_LIBRARY_PATH = " / data / pythonpath / phonelibs / snpe / larch64 : $ HOME / openpilot / phonelibs / snpe / x86_64 - linux - clang : $ LD_LIBRARY_PATH " <nl> + export LD_LIBRARY_PATH = " / usr / lib / aarch64 - linux - gnu : / data / pythonpath / phonelibs / snpe / larch64 : $ HOME / openpilot / phonelibs / snpe / x86_64 - linux - clang : $ LD_LIBRARY_PATH " <nl> fi <nl> exec . / _modeld <nl> <nl>
|
make sure snpe can find libopencl
|
commaai/openpilot
|
3517d4580224d6d74ea91d46bc4fe081c8e02a2f
|
2020-08-27T11:35:52Z
|
mmm a / src / compiler / graph - visualizer . cc <nl> ppp b / src / compiler / graph - visualizer . cc <nl> std : : ostream & operator < < ( std : : ostream & os , const InstructionBlockAsJSON & b ) { <nl> const InstructionSequence * code = b . code_ ; <nl> os < < " { " ; <nl> os < < " \ " id \ " : " < < block - > rpo_number ( ) < < " , " ; <nl> - os < < " \ " deferred \ " : " < < block - > IsDeferred ( ) < < " , " ; <nl> + os < < " \ " deferred \ " : " < < ( block - > IsDeferred ( ) ? " true " : " false " ) ; <nl> + os < < " , " ; <nl> os < < " \ " loop_header \ " : " < < block - > IsLoopHeader ( ) < < " , " ; <nl> if ( block - > IsLoopHeader ( ) ) { <nl> os < < " \ " loop_end \ " : " < < block - > loop_end ( ) < < " , " ; <nl> mmm a / tools / turbolizer / src / sequence - view . ts <nl> ppp b / tools / turbolizer / src / sequence - view . ts <nl> export class SequenceView extends TextView { <nl> } <nl> <nl> const sequenceBlock = createElement ( " div " , " schedule - block " ) ; <nl> + sequenceBlock . classList . toggle ( " deferred " , block . deferred ) ; <nl> <nl> const blockId = createElement ( " div " , [ " block - id " , " com " , " clickable " ] , block . id ) ; <nl> blockId . onclick = mkBlockLinkHandler ( block . id ) ; <nl>
|
[ turbolizer ] Show whether a block is deferred in sequence view
|
v8/v8
|
a402686eb680ba83ddeaa0dc985c869af96a891d
|
2019-03-18T17:07:08Z
|
mmm a / xbmc / lib / libjsonrpc / FileItemHandler . cpp <nl> ppp b / xbmc / lib / libjsonrpc / FileItemHandler . cpp <nl> void CFileItemHandler : : HandleFileItemList ( const char * id , bool allowFile , const <nl> const Value param = parameterObject . isObject ( ) ? parameterObject : Value ( objectValue ) ; <nl> <nl> unsigned int size = ( unsigned int ) items . Size ( ) ; <nl> - unsigned int start = param . get ( " start " , 0 ) . asUInt ( ) ; <nl> - unsigned int end = param . get ( " end " , size ) . asUInt ( ) ; <nl> - end = end > size ? size : end ; <nl> + unsigned int start = ( unsigned int ) std : : max ( 0 , param . get ( " start " , 0 ) . asInt ( ) ) ; <nl> + unsigned int end = std : : min ( size , param . get ( " end " , size ) . asUInt ( ) ) ; <nl> <nl> Sort ( items , param ) ; <nl> <nl>
|
fixed : Ticket - Negative start / stop value in a JSON request crashes XBMC .
|
xbmc/xbmc
|
05c0d993a7c25740f4b2b899fed87321a6a2f84b
|
2010-08-29T06:20:34Z
|
mmm a / include / swift / AST / PrintOptions . h <nl> ppp b / include / swift / AST / PrintOptions . h <nl> struct PrintOptions { <nl> return result ; <nl> } <nl> <nl> + / / / Retrieve the print options that are suitable to print interface for a <nl> + / / / swift file . <nl> + static PrintOptions printSwiftFileInterface ( ) { <nl> + PrintOptions result = printInterface ( ) ; <nl> + result . AccessibilityFilter = Accessibility : : Internal ; <nl> + result . EmptyLineBetweenMembers = true ; <nl> + return result ; <nl> + } <nl> + <nl> / / / Retrieve the set of options suitable for interface generation for <nl> / / / documentation purposes . <nl> static PrintOptions printDocInterface ( ) { <nl> mmm a / lib / IDE / ModuleInterfacePrinting . cpp <nl> ppp b / lib / IDE / ModuleInterfacePrinting . cpp <nl> void swift : : ide : : printSubmoduleInterface ( <nl> } <nl> <nl> static SourceLoc getDeclStartPosition ( SourceFile & File ) { <nl> - llvm : : Optional < SourceLoc > Winner ; <nl> SourceManager & SM = File . getASTContext ( ) . SourceMgr ; <nl> + SourceLoc Winner ; <nl> + <nl> + auto tryUpdateStart = [ & ] ( SourceLoc Loc ) - > bool { <nl> + if ( Loc . isInvalid ( ) ) <nl> + return false ; <nl> + if ( Winner . isInvalid ( ) ) { <nl> + Winner = Loc ; <nl> + return true ; <nl> + } <nl> + if ( SM . isBeforeInBuffer ( Loc , Winner ) ) { <nl> + Winner = Loc ; <nl> + return true ; <nl> + } <nl> + return false ; <nl> + } ; <nl> + <nl> for ( auto D : File . Decls ) { <nl> - auto Start = ! D - > getRawComment ( ) . isEmpty ( ) & & <nl> - SM . isBeforeInBuffer ( D - > getRawComment ( ) . Comments [ 0 ] . Range . getStart ( ) , <nl> - D - > getSourceRange ( ) . Start ) ? <nl> - D - > getRawComment ( ) . Comments [ 0 ] . Range . getStart ( ) : <nl> - D - > getSourceRange ( ) . Start ; <nl> - <nl> - if ( Winner . hasValue ( ) ) { <nl> - if ( SM . isBeforeInBuffer ( Start , Winner . getValue ( ) ) ) { <nl> - Winner = Start ; <nl> - } <nl> - } else { <nl> - Winner = Start ; <nl> + if ( tryUpdateStart ( D - > getStartLoc ( ) ) ) { <nl> + tryUpdateStart ( D - > getAttrs ( ) . getStartLoc ( ) ) ; <nl> + auto RawComment = D - > getRawComment ( ) ; <nl> + if ( ! RawComment . isEmpty ( ) ) <nl> + tryUpdateStart ( RawComment . Comments . front ( ) . Range . getStart ( ) ) ; <nl> } <nl> } <nl> - return Winner . hasValue ( ) ? Winner . getValue ( ) : SourceLoc ( ) ; <nl> + <nl> + return Winner ; <nl> } <nl> <nl> static void printUntilFirstDeclStarts ( SourceFile & File , ASTPrinter & Printer ) { <nl> if ( ! File . getBufferID ( ) . hasValue ( ) ) <nl> return ; <nl> - auto DeclStartLoc = getDeclStartPosition ( File ) ; <nl> + auto BufferID = * File . getBufferID ( ) ; <nl> + <nl> auto & SM = File . getASTContext ( ) . SourceMgr ; <nl> - auto Tokens = swift : : tokenize ( File . getASTContext ( ) . LangOpts , SM , <nl> - File . getBufferID ( ) . getValue ( ) ) ; <nl> + CharSourceRange TextRange = SM . getRangeForBuffer ( BufferID ) ; <nl> <nl> - for ( auto It = Tokens . begin ( ) ; It < Tokens . end ( ) & & <nl> - ( DeclStartLoc . isInvalid ( ) | | SM . isBeforeInBuffer ( It - > getLoc ( ) , <nl> - DeclStartLoc ) ) ; + + It ) { <nl> - Printer < < It - > getText ( ) ; <nl> + auto DeclStartLoc = getDeclStartPosition ( File ) ; <nl> + if ( DeclStartLoc . isValid ( ) ) { <nl> + TextRange = CharSourceRange ( SM , TextRange . getStart ( ) , DeclStartLoc ) ; <nl> } <nl> + <nl> + Printer < < SM . extractText ( TextRange , BufferID ) ; <nl> } <nl> <nl> void swift : : ide : : printSwiftSourceInterface ( SourceFile & File , <nl> new file mode 100644 <nl> index 000000000000 . . 33ea15a2f964 <nl> mmm / dev / null <nl> ppp b / test / IDE / print_source_file_interface_1 . swift <nl> <nl> + / / Copyright ( c ) 452 Attila the Hun . All rights reserved . <nl> + / / Blah Blah . <nl> + <nl> + / / More blah blah . <nl> + <nl> + public class MyClass { <nl> + func doit ( x : Int ) { } <nl> + } <nl> + <nl> + / / RUN : % target - swift - ide - test - print - swift - file - interface - source - filename % s > % t . out <nl> + / / RUN : diff - u % s . result % t . out <nl> new file mode 100644 <nl> index 000000000000 . . 5b5cbeb46feb <nl> mmm / dev / null <nl> ppp b / test / IDE / print_source_file_interface_1 . swift . result <nl> <nl> + / / Copyright ( c ) 452 Attila the Hun . All rights reserved . <nl> + / / Blah Blah . <nl> + <nl> + / / More blah blah . <nl> + <nl> + <nl> + public class MyClass { <nl> + <nl> + internal func doit ( x : Int ) <nl> + } <nl> new file mode 100644 <nl> index 000000000000 . . ec99750b7045 <nl> mmm / dev / null <nl> ppp b / test / IDE / print_source_file_interface_2 . swift <nl> <nl> + / * <nl> + Copyright ( c ) 452 Attila the Hun . All rights reserved . <nl> + * / <nl> + / * Blah Blah * / <nl> + <nl> + / * More Blah Blah * / <nl> + <nl> + public class MyClass { <nl> + func doit ( x : Int ) { } <nl> + } <nl> + <nl> + / / RUN : % target - swift - ide - test - print - swift - file - interface - source - filename % s > % t . out <nl> + / / RUN : diff - u % s . result % t . out <nl> new file mode 100644 <nl> index 000000000000 . . 44e79ac98df2 <nl> mmm / dev / null <nl> ppp b / test / IDE / print_source_file_interface_2 . swift . result <nl> <nl> + / * <nl> + Copyright ( c ) 452 Attila the Hun . All rights reserved . <nl> + * / <nl> + / * Blah Blah * / <nl> + <nl> + / * More Blah Blah * / <nl> + <nl> + <nl> + public class MyClass { <nl> + <nl> + internal func doit ( x : Int ) <nl> + } <nl> mmm a / tools / swift - ide - test / swift - ide - test . cpp <nl> ppp b / tools / swift - ide - test / swift - ide - test . cpp <nl> enum class ActionType { <nl> PrintASTTypeChecked , <nl> PrintModule , <nl> PrintHeader , <nl> + PrintSwiftFileInterface , <nl> PrintTypes , <nl> PrintComments , <nl> PrintModuleComments , <nl> Action ( llvm : : cl : : desc ( " Mode : " ) , llvm : : cl : : init ( ActionType : : None ) , <nl> " print - module " , " Print visible declarations in a module " ) , <nl> clEnumValN ( ActionType : : PrintHeader , <nl> " print - header " , " Print visible declarations in a header file " ) , <nl> + clEnumValN ( ActionType : : PrintSwiftFileInterface , <nl> + " print - swift - file - interface " , " Print interface of a swift file " ) , <nl> clEnumValN ( ActionType : : PrintTypes , <nl> " print - types " , " Print types of all subexpressions and declarations in the AST " ) , <nl> clEnumValN ( ActionType : : PrintComments , <nl> static int doPrintHeaders ( const CompilerInvocation & InitInvok , <nl> return ExitCode ; <nl> } <nl> <nl> + static int doPrintSwiftFileInterface ( const CompilerInvocation & InitInvok , <nl> + StringRef SourceFilename , <nl> + bool AnnotatePrint ) { <nl> + CompilerInvocation Invocation ( InitInvok ) ; <nl> + Invocation . addInputFilename ( SourceFilename ) ; <nl> + Invocation . getFrontendOptions ( ) . PrimaryInput = 0 ; <nl> + Invocation . getLangOptions ( ) . AttachCommentsToDecls = true ; <nl> + CompilerInstance CI ; <nl> + / / Display diagnostics to stderr . <nl> + PrintingDiagnosticConsumer PrintDiags ; <nl> + CI . addDiagnosticConsumer ( & PrintDiags ) ; <nl> + if ( CI . setup ( Invocation ) ) <nl> + return 1 ; <nl> + CI . performSema ( ) ; <nl> + <nl> + std : : unique_ptr < ASTPrinter > Printer ; <nl> + if ( AnnotatePrint ) <nl> + Printer . reset ( new AnnotatingPrinter ( llvm : : outs ( ) ) ) ; <nl> + else <nl> + Printer . reset ( new StreamPrinter ( llvm : : outs ( ) ) ) ; <nl> + <nl> + PrintOptions Options = PrintOptions : : printSwiftFileInterface ( ) ; <nl> + printSwiftSourceInterface ( * CI . getPrimarySourceFile ( ) , * Printer , Options ) ; <nl> + <nl> + return 0 ; <nl> + } <nl> + <nl> namespace { <nl> class ASTTypePrinter : public ASTWalker { <nl> raw_ostream & OS ; <nl> int main ( int argc , char * argv [ ] ) { <nl> break ; <nl> } <nl> <nl> + case ActionType : : PrintSwiftFileInterface : { <nl> + ExitCode = doPrintSwiftFileInterface ( <nl> + InitInvok , options : : SourceFilename , <nl> + options : : AnnotatePrint ) ; <nl> + break ; <nl> + } <nl> + <nl> case ActionType : : PrintTypes : <nl> ExitCode = doPrintTypes ( InitInvok , options : : SourceFilename , <nl> options : : FullyQualifiedTypes ) ; <nl>
|
[ IDE ] Fix the ' preamble ' top - comment printing when printing the swift source interface .
|
apple/swift
|
0bb52f0621ede3dfdc418ca9367691715bb1214f
|
2015-08-02T20:46:38Z
|
mmm a / modules / dnn / src / op_inf_engine . hpp <nl> ppp b / modules / dnn / src / op_inf_engine . hpp <nl> <nl> # pragma GCC diagnostic ignored " - Wsuggest - override " <nl> # endif <nl> <nl> - # if defined ( __GNUC__ ) & & INF_ENGINE_VER_MAJOR_LE ( INF_ENGINE_RELEASE_2019R1 ) <nl> + / / # define INFERENCE_ENGINE_DEPRECATED / / turn off deprecation warnings from IE <nl> + / / there is no way to suppress warnigns from IE only at this moment , so we are forced to suppress warnings globally <nl> + # if defined ( __GNUC__ ) <nl> + # pragma GCC diagnostic ignored " - Wdeprecated - declarations " <nl> + # endif <nl> + # ifdef _MSC_VER <nl> + # pragma warning ( disable : 4996 ) / / was declared deprecated <nl> + # endif <nl> + <nl> + # if defined ( __GNUC__ ) <nl> # pragma GCC visibility push ( default ) <nl> # endif <nl> <nl> <nl> <nl> # include < ie_builders . hpp > <nl> <nl> - # if defined ( __GNUC__ ) & & INF_ENGINE_VER_MAJOR_LE ( INF_ENGINE_RELEASE_2019R1 ) <nl> + # if defined ( __GNUC__ ) <nl> # pragma GCC visibility pop <nl> # endif <nl> <nl>
|
Merge pull request from alalek : dnn_ie_compilation
|
opencv/opencv
|
8937e8756e571908f813027e25e5fb6e88532bb4
|
2019-06-27T21:34:41Z
|
mmm a / . gitignore <nl> ppp b / . gitignore <nl> linux - coverage - build <nl> linux - build <nl> win32 - build <nl> qa / pull - tester / tests_config . py <nl> + qa / pull - tester / tests_config . ini <nl> qa / cache / * <nl> <nl> ! src / leveldb * / Makefile <nl> mmm a / qa / README . md <nl> ppp b / qa / README . md <nl> Run the regression test suite with <nl> <nl> Run all possible tests with <nl> <nl> - qa / pull - tester / rpc - tests . py - extended <nl> + qa / pull - tester / rpc - tests . py - - extended <nl> <nl> By default , tests will be run in parallel . To specify how many jobs to run , <nl> - append ` - parallel = n ` ( default n = 4 ) . <nl> + append ` - - jobs = n ` ( default n = 4 ) . <nl> <nl> - If you want to create a basic coverage report for the rpc test suite , append ` - - coverage ` . <nl> + If you want to create a basic coverage report for the RPC test suite , append ` - - coverage ` . <nl> <nl> Possible options , which apply to each individual test run : <nl> <nl> killall bitcoind <nl> Writing tests <nl> = = = = = = = = = = = = = <nl> You are encouraged to write tests for new or existing features . <nl> - Further information about the test framework and individual rpc <nl> + Further information about the test framework and individual RPC <nl> tests is found in [ qa / rpc - tests ] ( / qa / rpc - tests ) . <nl>
|
Merge : RPC doc fix - ups .
|
bitcoin/bitcoin
|
5628c70f2a44567695e5331fe2293c5b7f35b629
|
2017-02-21T23:05:22Z
|
mmm a / src / Databases / DatabaseAtomic . cpp <nl> ppp b / src / Databases / DatabaseAtomic . cpp <nl> void DatabaseAtomic : : dropTable ( const Context & , const String & table_name , bool <nl> table_name_to_path . erase ( table_name ) ; <nl> } <nl> tryRemoveSymlink ( table_name ) ; <nl> + / / / Remove the inner table ( if any ) to avoid deadlock <nl> + / / / ( due to attemp to execute DROP from the worker thread ) <nl> + if ( auto * mv = dynamic_cast < StorageMaterializedView * > ( table . get ( ) ) ) <nl> + mv - > dropInnerTable ( no_delay ) ; <nl> / / / Notify DatabaseCatalog that table was dropped . It will remove table data in background . <nl> / / / Cleanup is performed outside of database to allow easily DROP DATABASE without waiting for cleanup to complete . <nl> DatabaseCatalog : : instance ( ) . enqueueDroppedTableCleanup ( table - > getStorageID ( ) , table , table_metadata_path_drop , no_delay ) ; <nl> mmm a / src / Storages / StorageMaterializedView . cpp <nl> ppp b / src / Storages / StorageMaterializedView . cpp <nl> BlockOutputStreamPtr StorageMaterializedView : : write ( const ASTPtr & query , const <nl> } <nl> <nl> <nl> - static void executeDropQuery ( ASTDropQuery : : Kind kind , Context & global_context , const StorageID & target_table_id ) <nl> + static void executeDropQuery ( ASTDropQuery : : Kind kind , Context & global_context , const StorageID & target_table_id , bool no_delay ) <nl> { <nl> if ( DatabaseCatalog : : instance ( ) . tryGetTable ( target_table_id , global_context ) ) <nl> { <nl> static void executeDropQuery ( ASTDropQuery : : Kind kind , Context & global_context , <nl> drop_query - > database = target_table_id . database_name ; <nl> drop_query - > table = target_table_id . table_name ; <nl> drop_query - > kind = kind ; <nl> - drop_query - > no_delay = true ; <nl> + drop_query - > no_delay = no_delay ; <nl> ASTPtr ast_drop_query = drop_query ; <nl> InterpreterDropQuery drop_interpreter ( ast_drop_query , global_context ) ; <nl> drop_interpreter . execute ( ) ; <nl> void StorageMaterializedView : : drop ( ) <nl> if ( ! select_query . select_table_id . empty ( ) ) <nl> DatabaseCatalog : : instance ( ) . removeDependency ( select_query . select_table_id , table_id ) ; <nl> <nl> + dropInnerTable ( true ) ; <nl> + } <nl> + <nl> + void StorageMaterializedView : : dropInnerTable ( bool no_delay ) <nl> + { <nl> if ( has_inner_table & & tryGetTargetTable ( ) ) <nl> - executeDropQuery ( ASTDropQuery : : Kind : : Drop , global_context , target_table_id ) ; <nl> + executeDropQuery ( ASTDropQuery : : Kind : : Drop , global_context , target_table_id , no_delay ) ; <nl> + has_inner_table = false ; <nl> } <nl> <nl> void StorageMaterializedView : : truncate ( const ASTPtr & , const StorageMetadataPtr & , const Context & , TableExclusiveLockHolder & ) <nl> { <nl> if ( has_inner_table ) <nl> - executeDropQuery ( ASTDropQuery : : Kind : : Truncate , global_context , target_table_id ) ; <nl> + executeDropQuery ( ASTDropQuery : : Kind : : Truncate , global_context , target_table_id , true ) ; <nl> } <nl> <nl> void StorageMaterializedView : : checkStatementCanBeForwarded ( ) const <nl> mmm a / src / Storages / StorageMaterializedView . h <nl> ppp b / src / Storages / StorageMaterializedView . h <nl> class StorageMaterializedView final : public ext : : shared_ptr_helper < StorageMater <nl> BlockOutputStreamPtr write ( const ASTPtr & query , const StorageMetadataPtr & / * metadata_snapshot * / , const Context & context ) override ; <nl> <nl> void drop ( ) override ; <nl> + void dropInnerTable ( bool no_delay ) ; <nl> <nl> void truncate ( const ASTPtr & , const StorageMetadataPtr & , const Context & , TableExclusiveLockHolder & ) override ; <nl> <nl>
|
Fix drop of materialized view with inner table in Atomic database
|
ClickHouse/ClickHouse
|
d16adddb417f55a4caeccd59b4fbf8d489356b19
|
2020-10-12T18:46:07Z
|
mmm a / include / fmt / format . h <nl> ppp b / include / fmt / format . h <nl> template < typename Handler , typename Char > struct id_adapter { <nl> Handler & handler ; <nl> } ; <nl> <nl> - template < typename Char , typename Handler > <nl> - FMT_CONSTEXPR_DECL FMT_INLINE const Char * parse_replacement_field ( <nl> - const Char * begin , const Char * end , Handler & & handler ) { <nl> - + + begin ; <nl> - if ( begin = = end ) return handler . on_error ( " invalid format string " ) , end ; <nl> - if ( static_cast < char > ( * begin ) = = ' } ' ) { <nl> - handler . on_arg_id ( ) ; <nl> - handler . on_replacement_field ( begin ) ; <nl> - } else if ( * begin = = ' { ' ) { <nl> - handler . on_text ( begin , begin + 1 ) ; <nl> - } else { <nl> - begin = parse_arg_id ( begin , end , id_adapter < Handler , Char > { handler } ) ; <nl> - Char c = begin ! = end ? * begin : Char ( ) ; <nl> - if ( c = = ' } ' ) { <nl> - handler . on_replacement_field ( begin ) ; <nl> - } else if ( c = = ' : ' ) { <nl> - begin = handler . on_format_specs ( begin + 1 , end ) ; <nl> - if ( begin = = end | | * begin ! = ' } ' ) <nl> - return handler . on_error ( " unknown format specifier " ) , end ; <nl> - } else { <nl> - return handler . on_error ( " missing ' } ' in format string " ) , end ; <nl> - } <nl> - } <nl> - return begin + 1 ; <nl> - } <nl> - <nl> template < bool IS_CONSTEXPR , typename Char , typename Handler > <nl> FMT_CONSTEXPR void parse_format_string ( basic_string_view < Char > format_str , <nl> Handler & & handler ) { <nl> - auto begin = format_str . data ( ) ; <nl> - auto end = begin + format_str . size ( ) ; <nl> - if ( end - begin < 32 ) { <nl> - / / Use a simple loop instead of memchr for small strings . <nl> - const Char * p = begin ; <nl> - while ( p ! = end ) { <nl> - auto c = * p + + ; <nl> - if ( c = = ' { ' ) { <nl> - handler . on_text ( begin , p - 1 ) ; <nl> - begin = p = parse_replacement_field ( p - 1 , end , handler ) ; <nl> - } else if ( c = = ' } ' ) { <nl> - if ( p = = end | | * p ! = ' } ' ) <nl> - return handler . on_error ( " unmatched ' } ' in format string " ) ; <nl> - handler . on_text ( begin , p ) ; <nl> - begin = + + p ; <nl> - } <nl> - } <nl> - handler . on_text ( begin , end ) ; <nl> - return ; <nl> - } <nl> struct writer { <nl> FMT_CONSTEXPR void operator ( ) ( const Char * begin , const Char * end ) { <nl> - if ( begin + 1 > = end ) { <nl> - if ( begin = = end ) return ; <nl> - if ( * begin = = ' } ' ) <nl> - return handler_ . on_error ( " unmatched ' } ' in format string " ) ; <nl> - return handler_ . on_text ( begin , begin + 1 ) ; <nl> - } <nl> + if ( begin = = end ) return ; <nl> for ( ; ; ) { <nl> const Char * p = nullptr ; <nl> if ( ! find < IS_CONSTEXPR > ( begin , end , ' } ' , p ) ) <nl> FMT_CONSTEXPR void parse_format_string ( basic_string_view < Char > format_str , <nl> } <nl> Handler & handler_ ; <nl> } write { handler } ; <nl> + auto begin = format_str . data ( ) ; <nl> + auto end = begin + format_str . size ( ) ; <nl> while ( begin ! = end ) { <nl> / / Doing two passes with memchr ( one for ' { ' and another for ' } ' ) is up to <nl> / / 2 . 5x faster than the naive one - pass implementation on big format strings . <nl> FMT_CONSTEXPR void parse_format_string ( basic_string_view < Char > format_str , <nl> if ( * begin ! = ' { ' & & ! find < IS_CONSTEXPR > ( begin + 1 , end , ' { ' , p ) ) <nl> return write ( begin , end ) ; <nl> write ( begin , p ) ; <nl> - begin = parse_replacement_field ( p , end , handler ) ; <nl> + + + p ; <nl> + if ( p = = end ) return handler . on_error ( " invalid format string " ) ; <nl> + if ( static_cast < char > ( * p ) = = ' } ' ) { <nl> + handler . on_arg_id ( ) ; <nl> + handler . on_replacement_field ( p ) ; <nl> + } else if ( * p = = ' { ' ) { <nl> + handler . on_text ( p , p + 1 ) ; <nl> + } else { <nl> + p = parse_arg_id ( p , end , id_adapter < Handler , Char > { handler } ) ; <nl> + Char c = p ! = end ? * p : Char ( ) ; <nl> + if ( c = = ' } ' ) { <nl> + handler . on_replacement_field ( p ) ; <nl> + } else if ( c = = ' : ' ) { <nl> + p = handler . on_format_specs ( p + 1 , end ) ; <nl> + if ( p = = end | | * p ! = ' } ' ) <nl> + return handler . on_error ( " unknown format specifier " ) ; <nl> + } else { <nl> + return handler . on_error ( " missing ' } ' in format string " ) ; <nl> + } <nl> + } <nl> + begin = p + 1 ; <nl> } <nl> } <nl> <nl>
|
Temporarily revert parsing changes
|
fmtlib/fmt
|
bc1b89da26300c31c8653acc376fc2d9f6bc8189
|
2020-05-22T22:39:33Z
|
mmm a / tensorflow / compiler / tests / BUILD <nl> ppp b / tensorflow / compiler / tests / BUILD <nl> tf_xla_py_test ( <nl> name = " slice_ops_test " , <nl> size = " small " , <nl> srcs = [ " slice_ops_test . py " ] , <nl> - # TODO ( b / 62962492 ) : Test fails with assertion error . <nl> - tags = [ <nl> - " manual " , <nl> - " notap " , <nl> - ] , <nl> deps = [ <nl> " : xla_test " , <nl> " / / tensorflow / python : array_ops " , <nl>
|
[ TF : XLA ] Re - enable strided slice tests that now pass .
|
tensorflow/tensorflow
|
1be36dd6d675998842824f69285f146b95615042
|
2017-10-10T04:05:18Z
|
mmm a / tensorflow / lite / micro / kernels / cmsis - nn / softmax . cc <nl> ppp b / tensorflow / lite / micro / kernels / cmsis - nn / softmax . cc <nl> limitations under the License . <nl> # include " tensorflow / lite / micro / kernels / kernel_util . h " <nl> <nl> namespace tflite { <nl> - namespace ops { <nl> - namespace micro { <nl> - namespace activations { <nl> namespace { <nl> <nl> TfLiteStatus CalculateSoftmaxParams ( TfLiteContext * context , <nl> TfLiteStatus CalculateSoftmaxParams ( TfLiteContext * context , <nl> return kTfLiteOk ; <nl> } <nl> <nl> - } / / namespace <nl> - <nl> void * SoftmaxInit ( TfLiteContext * context , const char * buffer , size_t length ) { <nl> TFLITE_DCHECK ( context - > AllocatePersistentBuffer ! = nullptr ) ; <nl> return context - > AllocatePersistentBuffer ( context , sizeof ( SoftmaxParams ) ) ; <nl> TfLiteStatus SoftmaxEval ( TfLiteContext * context , TfLiteNode * node ) { <nl> } <nl> } <nl> <nl> - } / / namespace activations <nl> + } / / namespace <nl> <nl> TfLiteRegistration Register_SOFTMAX ( ) { <nl> - return { / * init = * / activations : : SoftmaxInit , <nl> + return { / * init = * / SoftmaxInit , <nl> / * free = * / nullptr , <nl> - / * prepare = * / activations : : SoftmaxPrepare , <nl> - / * invoke = * / activations : : SoftmaxEval , <nl> + / * prepare = * / SoftmaxPrepare , <nl> + / * invoke = * / SoftmaxEval , <nl> / * profiling_string = * / nullptr , <nl> / * builtin_code = * / 0 , <nl> / * custom_name = * / nullptr , <nl> / * version = * / 0 } ; <nl> } <nl> <nl> - } / / namespace micro <nl> - } / / namespace ops <nl> } / / namespace tflite <nl> mmm a / tensorflow / lite / micro / kernels / micro_ops . h <nl> ppp b / tensorflow / lite / micro / kernels / micro_ops . h <nl> TfLiteRegistration Register_CONV_2D ( ) ; <nl> TfLiteRegistration Register_DEPTHWISE_CONV_2D ( ) ; <nl> TfLiteRegistration Register_QUANTIZE ( ) ; <nl> TfLiteRegistration Register_SHAPE ( ) ; <nl> + TfLiteRegistration Register_SOFTMAX ( ) ; <nl> <nl> namespace ops { <nl> namespace micro { <nl> TfLiteRegistration Register_RESIZE_NEAREST_NEIGHBOR ( ) ; <nl> TfLiteRegistration Register_ROUND ( ) ; <nl> TfLiteRegistration Register_RSQRT ( ) ; <nl> TfLiteRegistration Register_SIN ( ) ; <nl> - TfLiteRegistration Register_SOFTMAX ( ) ; <nl> TfLiteRegistration Register_SPLIT ( ) ; <nl> TfLiteRegistration Register_SPLIT_V ( ) ; <nl> TfLiteRegistration Register_SQRT ( ) ; <nl> mmm a / tensorflow / lite / micro / kernels / softmax . cc <nl> ppp b / tensorflow / lite / micro / kernels / softmax . cc <nl> limitations under the License . <nl> # include " tensorflow / lite / micro / kernels / kernel_util . h " <nl> <nl> namespace tflite { <nl> - namespace ops { <nl> - namespace micro { <nl> - namespace activations { <nl> namespace { <nl> <nl> / / Softmax parameter data that persists in user_data <nl> TfLiteStatus CalculateSoftmaxParams ( TfLiteContext * context , <nl> return kTfLiteOk ; <nl> } <nl> <nl> - } / / namespace <nl> - <nl> / / Takes a tensor and performs softmax along the last dimension . <nl> void SoftmaxFloat ( const TfLiteEvalTensor * input , TfLiteEvalTensor * output , <nl> const SoftmaxParams & op_data ) { <nl> TfLiteStatus SoftmaxEval ( TfLiteContext * context , TfLiteNode * node ) { <nl> return kTfLiteError ; <nl> } <nl> } <nl> - } / / namespace activations <nl> + } / / namespace <nl> <nl> TfLiteRegistration Register_SOFTMAX ( ) { <nl> - return { / * init = * / activations : : SoftmaxInit , <nl> + return { / * init = * / SoftmaxInit , <nl> / * free = * / nullptr , <nl> - / * prepare = * / activations : : SoftmaxPrepare , <nl> - / * invoke = * / activations : : SoftmaxEval , <nl> + / * prepare = * / SoftmaxPrepare , <nl> + / * invoke = * / SoftmaxEval , <nl> / * profiling_string = * / nullptr , <nl> / * builtin_code = * / 0 , <nl> / * custom_name = * / nullptr , <nl> / * version = * / 0 } ; <nl> } <nl> <nl> - } / / namespace micro <nl> - } / / namespace ops <nl> } / / namespace tflite <nl> mmm a / tensorflow / lite / micro / kernels / softmax_test . cc <nl> ppp b / tensorflow / lite / micro / kernels / softmax_test . cc <nl> void ValidateSoftmaxGoldens ( TfLiteTensor * tensors , const int tensor_count , <nl> int outputs_array_data [ ] = { 1 , 1 } ; <nl> TfLiteIntArray * outputs_array = IntArrayFromInts ( outputs_array_data ) ; <nl> <nl> - const TfLiteRegistration registration = <nl> - tflite : : ops : : micro : : Register_SOFTMAX ( ) ; <nl> + const TfLiteRegistration registration = Register_SOFTMAX ( ) ; <nl> micro : : KernelRunner runner ( registration , tensors , tensor_count , inputs_array , <nl> outputs_array , & builtin_data , <nl> micro_test : : reporter ) ; <nl> mmm a / tensorflow / lite / micro / kernels / xtensa_hifimini / softmax . cc <nl> ppp b / tensorflow / lite / micro / kernels / xtensa_hifimini / softmax . cc <nl> limitations under the License . <nl> # include " tensorflow / lite / micro / kernels / kernel_util . h " <nl> <nl> namespace tflite { <nl> - namespace ops { <nl> - namespace micro { <nl> - namespace activations { <nl> namespace { <nl> <nl> struct OpData { <nl> TfLiteStatus Softmax ( OpData op_data , const RuntimeShape & input_shape , <nl> return kTfLiteOk ; <nl> } <nl> <nl> - } / / namespace <nl> - <nl> TfLiteStatus CalculateSoftmaxOpData ( TfLiteContext * context , <nl> const TfLiteTensor * input , <nl> TfLiteTensor * output , <nl> TfLiteStatus SoftmaxEval ( TfLiteContext * context , TfLiteNode * node ) { <nl> return kTfLiteError ; <nl> } <nl> } <nl> - } / / namespace activations <nl> + <nl> + } / / namespace <nl> <nl> TfLiteRegistration Register_SOFTMAX ( ) { <nl> - return { / * init = * / activations : : SoftmaxInit , <nl> + return { / * init = * / SoftmaxInit , <nl> / * free = * / nullptr , <nl> - / * prepare = * / activations : : SoftmaxPrepare , <nl> - / * invoke = * / activations : : SoftmaxEval , <nl> + / * prepare = * / SoftmaxPrepare , <nl> + / * invoke = * / SoftmaxEval , <nl> / * profiling_string = * / nullptr , <nl> / * builtin_code = * / 0 , <nl> / * custom_name = * / nullptr , <nl> / * version = * / 0 } ; <nl> } <nl> <nl> - } / / namespace micro <nl> - } / / namespace ops <nl> } / / namespace tflite <nl> mmm a / tensorflow / lite / micro / micro_mutable_op_resolver . h <nl> ppp b / tensorflow / lite / micro / micro_mutable_op_resolver . h <nl> class MicroMutableOpResolver : public MicroOpResolver { <nl> } <nl> <nl> TfLiteStatus AddSoftmax ( ) { <nl> - return AddBuiltin ( BuiltinOperator_SOFTMAX , <nl> - tflite : : ops : : micro : : Register_SOFTMAX ( ) , ParseSoftmax ) ; <nl> + return AddBuiltin ( BuiltinOperator_SOFTMAX , Register_SOFTMAX ( ) , <nl> + ParseSoftmax ) ; <nl> } <nl> <nl> TfLiteStatus AddSplit ( ) { <nl>
|
Switch TFLM softmax kernels to flat namespace .
|
tensorflow/tensorflow
|
24d00f249d343e45be78d9df3d1fb9fc8c2d26e6
|
2020-10-07T21:32:58Z
|
mmm a / arangod / Aql / CalculationExecutor . h <nl> ppp b / arangod / Aql / CalculationExecutor . h <nl> class CalculationExecutor { <nl> * / <nl> inline std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> private : <nl> / / specialized implementations <nl> mmm a / arangod / Aql / ConstrainedSortExecutor . cpp <nl> ppp b / arangod / Aql / ConstrainedSortExecutor . cpp <nl> std : : pair < ExecutionState , NoStats > ConstrainedSortExecutor : : produceRow ( OutputAql <nl> } <nl> return { ExecutionState : : HASMORE , NoStats { } } ; <nl> } <nl> + <nl> + std : : pair < ExecutionState , size_t > ConstrainedSortExecutor : : expectedNumberOfRows ( size_t ) const { <nl> + / / This block cannot support atMost <nl> + size_t rowsLeft = 0 ; <nl> + if ( _state ! = ExecutionState : : DONE ) { <nl> + ExecutionState state ; <nl> + size_t expectedRows ; <nl> + std : : tie ( state , expectedRows ) = <nl> + _fetcher . preFetchNumberOfRows ( ExecutionBlock : : DefaultBatchSize ( ) ) ; <nl> + if ( state = = ExecutionState : : WAITING ) { <nl> + TRI_ASSERT ( expectedRows = = 0 ) ; <nl> + return { state , 0 } ; <nl> + } <nl> + / / Return the minimum of upstream + limit <nl> + rowsLeft = ( std : : min ) ( expectedRows , _infos . _limit ) ; <nl> + } else { <nl> + / / We have exactly the following rows available : <nl> + rowsLeft = _rows . size ( ) - _returnNext ; <nl> + } <nl> + if ( rowsLeft > 0 ) { <nl> + return { ExecutionState : : HASMORE , rowsLeft } ; <nl> + } <nl> + return { ExecutionState : : DONE , rowsLeft } ; <nl> + } <nl> mmm a / arangod / Aql / ConstrainedSortExecutor . h <nl> ppp b / arangod / Aql / ConstrainedSortExecutor . h <nl> class ConstrainedSortExecutor { <nl> struct Properties { <nl> static const bool preservesOrder = false ; <nl> static const bool allowsBlockPassthrough = false ; <nl> - static const bool inputSizeRestrictsOutputSize = false ; <nl> + static const bool inputSizeRestrictsOutputSize = true ; <nl> } ; <nl> using Fetcher = SingleRowFetcher < Properties : : allowsBlockPassthrough > ; <nl> using Infos = SortExecutorInfos ; <nl> class ConstrainedSortExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + / * * <nl> + * @ brief This Executor knows how many rows it will produce and most by itself <nl> + * It also knows that it could produce less if the upstream only has fewer rows . <nl> + * / <nl> + std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const ; <nl> <nl> private : <nl> bool compareInput ( uint32_t const & rosPos , InputAqlItemRow & row ) const ; <nl> mmm a / arangod / Aql / CountCollectExecutor . h <nl> ppp b / arangod / Aql / CountCollectExecutor . h <nl> class CountCollectExecutor { <nl> struct Properties { <nl> static const bool preservesOrder = false ; <nl> static const bool allowsBlockPassthrough = false ; <nl> - static const bool inputSizeRestrictsOutputSize = false ; <nl> + static const bool inputSizeRestrictsOutputSize = true ; <nl> } ; <nl> using Fetcher = SingleRowFetcher < Properties : : allowsBlockPassthrough > ; <nl> using Infos = CountCollectExecutorInfos ; <nl> class CountCollectExecutor { <nl> void incrCount ( ) noexcept { _count + + ; } ; <nl> uint64_t getCount ( ) noexcept { return _count ; } ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const { <nl> + if ( _state = = ExecutionState : : DONE ) { <nl> + return { ExecutionState : : DONE , 0 } ; <nl> + } <nl> + return { ExecutionState : : HASMORE , 1 } ; <nl> + } <nl> <nl> private : <nl> Infos const & infos ( ) const noexcept { return _infos ; } ; <nl> mmm a / arangod / Aql / DistinctCollectExecutor . cpp <nl> ppp b / arangod / Aql / DistinctCollectExecutor . cpp <nl> DistinctCollectExecutorInfos : : DistinctCollectExecutorInfos ( <nl> transaction : : Methods * trxPtr ) <nl> : ExecutorInfos ( std : : make_shared < std : : unordered_set < RegisterId > > ( readableInputRegisters ) , <nl> std : : make_shared < std : : unordered_set < RegisterId > > ( writeableInputRegisters ) , <nl> - nrInputRegisters , nrOutputRegisters , std : : move ( registersToClear ) , std : : move ( registersToKeep ) ) , <nl> + nrInputRegisters , nrOutputRegisters , <nl> + std : : move ( registersToClear ) , std : : move ( registersToKeep ) ) , <nl> _groupRegisters ( groupRegisters ) , <nl> _trxPtr ( trxPtr ) { <nl> TRI_ASSERT ( ! _groupRegisters . empty ( ) ) ; <nl> } <nl> <nl> DistinctCollectExecutor : : DistinctCollectExecutor ( Fetcher & fetcher , Infos & infos ) <nl> - : _infos ( infos ) , _fetcher ( fetcher ) , <nl> - _seen ( 1024 , <nl> - AqlValueGroupHash ( _infos . getTransaction ( ) , _infos . getGroupRegisters ( ) . size ( ) ) , <nl> - AqlValueGroupEqual ( _infos . getTransaction ( ) ) ) { <nl> - } <nl> + : _infos ( infos ) , <nl> + _fetcher ( fetcher ) , <nl> + _seen ( 1024 , <nl> + AqlValueGroupHash ( _infos . getTransaction ( ) , <nl> + _infos . getGroupRegisters ( ) . size ( ) ) , <nl> + AqlValueGroupEqual ( _infos . getTransaction ( ) ) ) { } <nl> <nl> DistinctCollectExecutor : : ~ DistinctCollectExecutor ( ) { <nl> / / destroy all AqlValues captured <nl> std : : pair < ExecutionState , NoStats > DistinctCollectExecutor : : produceRow ( OutputAql <nl> return { ExecutionState : : HASMORE , stats } ; <nl> } <nl> } <nl> + <nl> + std : : pair < ExecutionState , size_t > DistinctCollectExecutor : : expectedNumberOfRows ( size_t atMost ) const { <nl> + / / This block cannot know how many elements will be returned exactly . <nl> + / / but it is upper bounded by the input . <nl> + return _fetcher . preFetchNumberOfRows ( atMost ) ; <nl> + } <nl> mmm a / arangod / Aql / DistinctCollectExecutor . h <nl> ppp b / arangod / Aql / DistinctCollectExecutor . h <nl> class DistinctCollectExecutor { <nl> struct Properties { <nl> static const bool preservesOrder = false ; <nl> static const bool allowsBlockPassthrough = false ; <nl> - static const bool inputSizeRestrictsOutputSize = false ; <nl> + static const bool inputSizeRestrictsOutputSize = true ; <nl> } ; <nl> using Fetcher = SingleRowFetcher < Properties : : allowsBlockPassthrough > ; <nl> using Infos = DistinctCollectExecutorInfos ; <nl> class DistinctCollectExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const ; <nl> <nl> private : <nl> Infos const & infos ( ) const noexcept { return _infos ; } ; <nl> mmm a / arangod / Aql / EnumerateCollectionExecutor . h <nl> ppp b / arangod / Aql / EnumerateCollectionExecutor . h <nl> class EnumerateCollectionExecutor { <nl> static const bool preservesOrder = true ; <nl> static const bool allowsBlockPassthrough = false ; <nl> / * With some more modifications this could be turned to true . Actually the <nl> - output of this block is input * itemsInList * / <nl> + output of this block is input * itemsInCollection * / <nl> static const bool inputSizeRestrictsOutputSize = false ; <nl> } ; <nl> using Fetcher = SingleRowFetcher < Properties : : allowsBlockPassthrough > ; <nl> class EnumerateCollectionExecutor { <nl> void setProducingFunction ( DocumentProducingFunction const & documentProducer ) { <nl> _documentProducer = documentProducer ; <nl> } ; <nl> - <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> private : <nl> bool waitForSatellites ( ExecutionEngine * engine , Collection const * collection ) const ; <nl> mmm a / arangod / Aql / EnumerateListExecutor . cpp <nl> ppp b / arangod / Aql / EnumerateListExecutor . cpp <nl> using namespace arangodb ; <nl> using namespace arangodb : : aql ; <nl> <nl> EnumerateListExecutorInfos : : EnumerateListExecutorInfos ( <nl> - RegisterId inputRegister , RegisterId outputRegister , RegisterId nrInputRegisters , <nl> - RegisterId nrOutputRegisters , <nl> - / / cppcheck - suppress passedByValue <nl> + RegisterId inputRegister , RegisterId outputRegister , <nl> + RegisterId nrInputRegisters , RegisterId nrOutputRegisters , <nl> + / / cppcheck - suppress passedByValue <nl> std : : unordered_set < RegisterId > registersToClear , <nl> - / / cppcheck - suppress passedByValue <nl> + / / cppcheck - suppress passedByValue <nl> std : : unordered_set < RegisterId > registersToKeep ) <nl> : ExecutorInfos ( make_shared_unordered_set ( { inputRegister } ) , <nl> make_shared_unordered_set ( { outputRegister } ) , <nl> mmm a / arangod / Aql / EnumerateListExecutor . h <nl> ppp b / arangod / Aql / EnumerateListExecutor . h <nl> class EnumerateListExecutor { <nl> struct Properties { <nl> static const bool preservesOrder = true ; <nl> static const bool allowsBlockPassthrough = false ; <nl> - / * With some more modifications this could be turned to true . Actually the <nl> - output of this block is input * itemsInList * / <nl> static const bool inputSizeRestrictsOutputSize = false ; <nl> } ; <nl> using Fetcher = SingleRowFetcher < Properties : : allowsBlockPassthrough > ; <nl> class EnumerateListExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> private : <nl> AqlValue getAqlValue ( AqlValue const & inVarReg , size_t const & pos , bool & mustDestroy ) ; <nl> mmm a / arangod / Aql / ExecutionBlockImpl . cpp <nl> ppp b / arangod / Aql / ExecutionBlockImpl . cpp <nl> <nl> # include " Aql / CountCollectExecutor . h " <nl> # include " Aql / DistinctCollectExecutor . h " <nl> # include " Aql / EnumerateCollectionExecutor . h " <nl> - # include " Aql / ModificationExecutor . h " <nl> - # include " Aql / ModificationExecutorTraits . h " <nl> # include " Aql / EnumerateListExecutor . h " <nl> # include " Aql / FilterExecutor . h " <nl> # include " Aql / IResearchViewExecutor . h " <nl> <nl> # include " Aql / IdExecutor . h " <nl> # include " Aql / IndexExecutor . h " <nl> # include " Aql / LimitExecutor . h " <nl> + # include " Aql / ModificationExecutor . h " <nl> + # include " Aql / ModificationExecutorTraits . h " <nl> # include " Aql / NoResultsExecutor . h " <nl> # include " Aql / ReturnExecutor . h " <nl> # include " Aql / ShortestPathExecutor . h " <nl> + # include " Aql / SingleRemoteModificationExecutor . h " <nl> # include " Aql / SortExecutor . h " <nl> # include " Aql / SortRegister . h " <nl> - # include " Aql / SingleRemoteModificationExecutor . h " <nl> # include " Aql / SortedCollectExecutor . h " <nl> # include " Aql / SortingGatherExecutor . h " <nl> # include " Aql / SubqueryExecutor . h " <nl> ExecutionBlockImpl < Executor > : : requestWrappedBlock ( size_t nrItems , RegisterId nrR <nl> / / The SortExecutor should refetch a block to save memory in case if only few elements to sort <nl> ExecutionState state ; <nl> size_t expectedRows = 0 ; <nl> - std : : tie ( state , expectedRows ) = _rowFetcher . preFetchNumberOfRows ( nrItems ) ; <nl> + / / Note : this might trigger a prefetch on the rowFetcher ! <nl> + std : : tie ( state , expectedRows ) = _executor . expectedNumberOfRows ( nrItems ) ; <nl> if ( state = = ExecutionState : : WAITING ) { <nl> - TRI_ASSERT ( expectedRows = = 0 ) ; <nl> - return { state , nullptr } ; <nl> + return { state , 0 } ; <nl> } <nl> - expectedRows + = _executor . numberOfRowsInFlight ( ) ; <nl> nrItems = ( std : : min ) ( expectedRows , nrItems ) ; <nl> if ( nrItems = = 0 ) { <nl> TRI_ASSERT ( state = = ExecutionState : : DONE ) ; <nl> mmm a / arangod / Aql / FilterExecutor . cpp <nl> ppp b / arangod / Aql / FilterExecutor . cpp <nl> std : : pair < ExecutionState , FilterStats > FilterExecutor : : produceRow ( OutputAqlItemR <nl> TRI_ASSERT ( state = = ExecutionState : : HASMORE ) ; <nl> } <nl> } <nl> + <nl> + <nl> + std : : pair < ExecutionState , size_t > FilterExecutor : : expectedNumberOfRows ( size_t atMost ) const { <nl> + / / This block cannot know how many elements will be returned exactly . <nl> + / / but it is upper bounded by the input . <nl> + return _fetcher . preFetchNumberOfRows ( atMost ) ; <nl> + } <nl> + <nl> mmm a / arangod / Aql / FilterExecutor . h <nl> ppp b / arangod / Aql / FilterExecutor . h <nl> class FilterExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const ; <nl> <nl> private : <nl> Infos & _infos ; <nl> mmm a / arangod / Aql / HashedCollectExecutor . cpp <nl> ppp b / arangod / Aql / HashedCollectExecutor . cpp <nl> HashedCollectExecutorInfos : : HashedCollectExecutorInfos ( <nl> std : : unordered_set < RegisterId > registersToKeep , <nl> std : : unordered_set < RegisterId > & & readableInputRegisters , <nl> std : : unordered_set < RegisterId > & & writeableOutputRegisters , <nl> - std : : vector < std : : pair < RegisterId , RegisterId > > & & groupRegisters , RegisterId collectRegister , <nl> - std : : vector < std : : string > & & aggregateTypes , <nl> + std : : vector < std : : pair < RegisterId , RegisterId > > & & groupRegisters , <nl> + RegisterId collectRegister , std : : vector < std : : string > & & aggregateTypes , <nl> std : : vector < std : : pair < RegisterId , RegisterId > > & & aggregateRegisters , <nl> transaction : : Methods * trxPtr , bool count ) <nl> : ExecutorInfos ( std : : make_shared < std : : unordered_set < RegisterId > > ( readableInputRegisters ) , <nl> HashedCollectExecutor : : createAggregatorFactories ( HashedCollectExecutor : : Infos co <nl> <nl> / / initialize aggregators <nl> for ( auto const & r : infos . getAggregateTypes ( ) ) { <nl> - aggregatorFactories . emplace_back ( <nl> - Aggregator : : factoryFromTypeString ( r ) ) ; <nl> + aggregatorFactories . emplace_back ( Aggregator : : factoryFromTypeString ( r ) ) ; <nl> } <nl> } <nl> <nl> HashedCollectExecutor : : HashedCollectExecutor ( Fetcher & fetcher , Infos & infos ) <nl> _infos . getGroupRegisters ( ) . size ( ) ) , <nl> AqlValueGroupEqual ( _infos . getTransaction ( ) ) ) , <nl> _isInitialized ( false ) , <nl> - _aggregatorFactories ( ) { <nl> + _aggregatorFactories ( ) , <nl> + _returnedGroups ( 0 ) { <nl> _aggregatorFactories = createAggregatorFactories ( _infos ) ; <nl> } ; <nl> <nl> std : : pair < ExecutionState , NoStats > HashedCollectExecutor : : produceRow ( OutputAqlIt <nl> / / produce output <nl> if ( _currentGroup ! = _allGroups . end ( ) ) { <nl> writeCurrentGroupToOutput ( output ) ; <nl> - + + _currentGroup ; <nl> + _currentGroup + + ; <nl> + _returnedGroups + + ; <nl> + TRI_ASSERT ( _returnedGroups < = _allGroups . size ( ) ) ; <nl> } <nl> <nl> ExecutionState state = _currentGroup ! = _allGroups . end ( ) ? ExecutionState : : HASMORE <nl> HashedCollectExecutor : : buildNewGroup ( InputAqlItemRow & input , size_t n ) { <nl> / / _allGroups . additionally , . second is true iff a new group was emplaced . <nl> decltype ( HashedCollectExecutor : : _allGroups ) : : iterator HashedCollectExecutor : : findOrEmplaceGroup ( <nl> InputAqlItemRow & input ) { <nl> - GroupKeyType groupValues ; / / TODO store groupValues locally <nl> + GroupKeyType groupValues ; / / TODO store groupValues locally <nl> size_t const n = _infos . getGroupRegisters ( ) . size ( ) ; <nl> groupValues . reserve ( n ) ; <nl> <nl> decltype ( HashedCollectExecutor : : _allGroups ) : : iterator HashedCollectExecutor : : fin <nl> <nl> return emplaceResult . first ; <nl> } ; <nl> + <nl> + std : : pair < ExecutionState , size_t > HashedCollectExecutor : : expectedNumberOfRows ( size_t atMost ) const { <nl> + size_t rowsLeft = 0 ; <nl> + if ( ! _isInitialized ) { <nl> + ExecutionState state ; <nl> + std : : tie ( state , rowsLeft ) = _fetcher . preFetchNumberOfRows ( atMost ) ; <nl> + if ( state = = ExecutionState : : WAITING ) { <nl> + TRI_ASSERT ( rowsLeft = = 0 ) ; <nl> + return { state , 0 } ; <nl> + } <nl> + / / Overestimate , we have not grouped ! <nl> + } else { <nl> + / / This fetcher nows how exactly many rows are left <nl> + / / as it knows how many groups is has created and not returned . <nl> + rowsLeft = _allGroups . size ( ) - _returnedGroups ; <nl> + } <nl> + if ( rowsLeft > 0 ) { <nl> + return { ExecutionState : : HASMORE , rowsLeft } ; <nl> + } <nl> + return { ExecutionState : : DONE , rowsLeft } ; <nl> + } <nl> \ No newline at end of file <nl> mmm a / arangod / Aql / HashedCollectExecutor . h <nl> ppp b / arangod / Aql / HashedCollectExecutor . h <nl> class HashedCollectExecutor { <nl> static const bool allowsBlockPassthrough = false ; <nl> / / TODO This should be true , but the current implementation in <nl> / / ExecutionBlockImpl and the fetchers does not work with this . <nl> - static const bool inputSizeRestrictsOutputSize = false ; <nl> + / / It will however always only overfetch if activated , never underfetch <nl> + static const bool inputSizeRestrictsOutputSize = true ; <nl> } ; <nl> using Fetcher = SingleRowFetcher < Properties : : allowsBlockPassthrough > ; <nl> using Infos = HashedCollectExecutorInfos ; <nl> class HashedCollectExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + / * * <nl> + * @ brief This Executor does not know how many distinct rows will be fetched <nl> + * from upstream , it can only report how many it has found by itself , plus <nl> + * it knows that it can only create as many new rows as pulled from upstream . <nl> + * So it will overestimate . <nl> + * / <nl> + std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const ; <nl> <nl> private : <nl> using AggregateValuesType = std : : vector < std : : unique_ptr < Aggregator > > ; <nl> class HashedCollectExecutor { <nl> bool _isInitialized ; / / init ( ) was called successfully ( e . g . it returned DONE ) <nl> <nl> std : : vector < std : : function < std : : unique_ptr < Aggregator > ( transaction : : Methods * ) > const * > _aggregatorFactories ; <nl> + <nl> + size_t _returnedGroups ; <nl> } ; <nl> <nl> } / / namespace aql <nl> mmm a / arangod / Aql / IResearchViewExecutor . cpp <nl> ppp b / arangod / Aql / IResearchViewExecutor . cpp <nl> bool IResearchViewExecutor < ordered > : : writeRow ( ReadContext & ctx , IndexReadBufferE <nl> LocalDocumentId const & documentId = _indexReadBuffer . getId ( bufferEntry ) ; <nl> TRI_ASSERT ( documentId . isSet ( ) ) ; <nl> <nl> - std : : shared_ptr < arangodb : : LogicalCollection > const & collection = _indexReadBuffer . getCollection ( ) ; <nl> + std : : shared_ptr < arangodb : : LogicalCollection > const & collection = <nl> + _indexReadBuffer . getCollection ( ) ; <nl> TRI_ASSERT ( collection ! = nullptr ) ; <nl> <nl> / / read document from underlying storage engine , if we got an id <nl> void IResearchViewExecutor < ordered > : : reset ( ) { <nl> } <nl> } <nl> <nl> - template < bool ordered > <nl> - size_t IResearchViewExecutor < ordered > : : numberOfRowsInFlight ( ) const { <nl> - / / not implemented <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION ( TRI_ERROR_INTERNAL ) ; <nl> - } <nl> - <nl> template class : : arangodb : : aql : : IResearchViewExecutor < false > ; <nl> template class : : arangodb : : aql : : IResearchViewExecutor < true > ; <nl> mmm a / arangod / Aql / IResearchViewExecutor . h <nl> ppp b / arangod / Aql / IResearchViewExecutor . h <nl> class IResearchViewExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - / / not implemented ! <nl> - size_t numberOfRowsInFlight ( ) const ; <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> private : <nl> class ReadContext { <nl> class IResearchViewExecutor { <nl> IndexIterator : : DocumentCallback const callback ; <nl> } ; / / ReadContext <nl> <nl> - <nl> class IndexReadBuffer ; <nl> class IndexReadBufferEntry { <nl> friend class IndexReadBuffer ; <nl> class IResearchViewExecutor { <nl> _scoreBuffer . emplace_back ( AqlValueHintDouble { scoreValue } ) ; <nl> } <nl> <nl> - inline void pushScoreNone ( ) { <nl> - _scoreBuffer . emplace_back ( ) ; <nl> - } <nl> + inline void pushScoreNone ( ) { _scoreBuffer . emplace_back ( ) ; } <nl> <nl> inline void setCollectionAndReset ( std : : shared_ptr < arangodb : : LogicalCollection > & & collection ) { <nl> / / Should only be called after everything was consumed <nl> mmm a / arangod / Aql / IdExecutor . h <nl> ppp b / arangod / Aql / IdExecutor . h <nl> class IdExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const { <nl> + / / This is passthrough ! <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> private : <nl> Fetcher & _fetcher ; <nl> mmm a / arangod / Aql / IndexExecutor . h <nl> ppp b / arangod / Aql / IndexExecutor . h <nl> class IndexExecutor { <nl> _documentProducer = std : : move ( documentProducer ) ; <nl> } <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> private : <nl> bool advanceCursor ( ) ; <nl> mmm a / arangod / Aql / LimitExecutor . cpp <nl> ppp b / arangod / Aql / LimitExecutor . cpp <nl> std : : pair < ExecutionState , LimitStats > LimitExecutor : : produceRow ( OutputAqlItemRow <nl> <nl> return { ExecutionState : : DONE , stats } ; <nl> } <nl> + <nl> + std : : pair < ExecutionState , size_t > LimitExecutor : : expectedNumberOfRows ( size_t atMost ) const { <nl> + switch ( currentState ( ) ) { <nl> + case LimitState : : LIMIT_REACHED : <nl> + / / We are done with our rows ! <nl> + return { ExecutionState : : DONE , 0 } ; <nl> + case LimitState : : COUNTING : <nl> + / / We are actually done with our rows , <nl> + / / BUt we need to make sure that we get asked more <nl> + return { ExecutionState : : DONE , 1 } ; <nl> + case LimitState : : RETURNING_LAST_ROW : <nl> + case LimitState : : SKIPPING : <nl> + case LimitState : : RETURNING : { <nl> + auto res = _fetcher . preFetchNumberOfRows ( maxRowsLeftToFetch ( ) ) ; <nl> + if ( res . first = = ExecutionState : : WAITING ) { <nl> + return res ; <nl> + } <nl> + / / Note on fullCount we might get more lines from upstream then required . <nl> + size_t leftOver = ( std : : min ) ( infos ( ) . getLimitPlusOffset ( ) - _counter , res . second ) ; <nl> + if ( _infos . isFullCountEnabled ( ) & & leftOver < atMost ) { <nl> + / / Add one for the fullcount . <nl> + leftOver + + ; <nl> + } <nl> + if ( leftOver > 0 ) { <nl> + return { ExecutionState : : HASMORE , leftOver } ; <nl> + } <nl> + return { ExecutionState : : DONE , 0 } ; <nl> + } <nl> + } <nl> + } <nl> \ No newline at end of file <nl> mmm a / arangod / Aql / LimitExecutor . h <nl> ppp b / arangod / Aql / LimitExecutor . h <nl> class LimitExecutor { <nl> static const bool preservesOrder = true ; <nl> static const bool allowsBlockPassthrough = false ; <nl> / * This could be set to true after some investigation / fixes * / <nl> - static const bool inputSizeRestrictsOutputSize = false ; <nl> + static const bool inputSizeRestrictsOutputSize = true ; <nl> } ; <nl> using Fetcher = SingleRowFetcher < Properties : : allowsBlockPassthrough > ; <nl> using Infos = LimitExecutorInfos ; <nl> class LimitExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const ; <nl> <nl> private : <nl> Infos const & infos ( ) const noexcept { return _infos ; } ; <nl> class LimitExecutor { <nl> Infos const & _infos ; <nl> Fetcher & _fetcher ; <nl> / / Number of input lines seen <nl> - uint64_t _counter = 0 ; <nl> + size_t _counter = 0 ; <nl> } ; <nl> <nl> } / / namespace aql <nl> mmm a / arangod / Aql / ModificationExecutor . h <nl> ppp b / arangod / Aql / ModificationExecutor . h <nl> class ModificationExecutor : public ModificationExecutorBase < FetcherType > { <nl> * This executor immedieately returns every actually consumed row <nl> * All other rows belong to the fetcher . <nl> * / <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> private : <nl> Modifier _modifier ; <nl> mmm a / arangod / Aql / NoResultsExecutor . h <nl> ppp b / arangod / Aql / NoResultsExecutor . h <nl> namespace aql { <nl> <nl> template < bool > <nl> class SingleRowFetcher ; <nl> - class AqlItemMatrix ; <nl> class ExecutorInfos ; <nl> class NoStats ; <nl> class OutputAqlItemRow ; <nl> - struct SortRegister ; <nl> <nl> class NoResultsExecutor { <nl> public : <nl> struct Properties { <nl> static const bool preservesOrder = true ; <nl> static const bool allowsBlockPassthrough = false ; <nl> - static const bool inputSizeRestrictsOutputSize = false ; <nl> + static const bool inputSizeRestrictsOutputSize = true ; <nl> } ; <nl> using Fetcher = SingleRowFetcher < Properties : : allowsBlockPassthrough > ; <nl> using Infos = ExecutorInfos ; <nl> class NoResultsExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> + / / Well nevermind the input , but we will always return 0 rows here . <nl> + return { ExecutionState : : DONE , 0 } ; <nl> + } <nl> } ; <nl> } / / namespace aql <nl> } / / namespace arangodb <nl> mmm a / arangod / Aql / ReturnExecutor . h <nl> ppp b / arangod / Aql / ReturnExecutor . h <nl> class ReturnExecutor { <nl> } <nl> return { state , stats } ; <nl> } <nl> - <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> private : <nl> ReturnExecutorInfos & _infos ; <nl> mmm a / arangod / Aql / ShortestPathExecutor . h <nl> ppp b / arangod / Aql / ShortestPathExecutor . h <nl> class ShortestPathExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> private : <nl> / * * <nl> mmm a / arangod / Aql / SingleRemoteModificationExecutor . h <nl> ppp b / arangod / Aql / SingleRemoteModificationExecutor . h <nl> struct SingleRemoteModificationExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> protected : <nl> bool doSingleRemoteModificationOperation ( InputAqlItemRow & , OutputAqlItemRow & , Stats & ) ; <nl> mmm a / arangod / Aql / SortExecutor . cpp <nl> ppp b / arangod / Aql / SortExecutor . cpp <nl> void SortExecutor : : doSorting ( ) { <nl> std : : sort ( _sortedIndexes . begin ( ) , _sortedIndexes . end ( ) , ourLessThan ) ; <nl> } <nl> } <nl> + <nl> + std : : pair < ExecutionState , size_t > SortExecutor : : expectedNumberOfRows ( size_t atMost ) const { <nl> + if ( _input = = nullptr ) { <nl> + / / This executor does not know anything yet . <nl> + / / Just take whatever is presented from upstream . <nl> + / / This will return WAITING a couple of times <nl> + return _fetcher . preFetchNumberOfRows ( atMost ) ; <nl> + } <nl> + TRI_ASSERT ( _returnNext < = _sortedIndexes . size ( ) ) ; <nl> + size_t rowsLeft = _sortedIndexes . size ( ) - _returnNext ; <nl> + if ( rowsLeft > 0 ) { <nl> + return { ExecutionState : : HASMORE , rowsLeft } ; <nl> + } <nl> + return { ExecutionState : : DONE , rowsLeft } ; <nl> + } <nl> \ No newline at end of file <nl> mmm a / arangod / Aql / SortExecutor . h <nl> ppp b / arangod / Aql / SortExecutor . h <nl> class SortExecutor { <nl> * if something was written output . hasValue ( ) = = true <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + <nl> + std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const ; <nl> <nl> private : <nl> void doSorting ( ) ; <nl> mmm a / arangod / Aql / SortedCollectExecutor . cpp <nl> ppp b / arangod / Aql / SortedCollectExecutor . cpp <nl> std : : pair < ExecutionState , NoStats > SortedCollectExecutor : : produceRow ( OutputAqlIt <nl> } <nl> } <nl> } <nl> + <nl> + std : : pair < ExecutionState , size_t > SortedCollectExecutor : : expectedNumberOfRows ( size_t atMost ) const { <nl> + if ( ! _fetcherDone ) { <nl> + ExecutionState state ; <nl> + size_t expectedRows ; <nl> + std : : tie ( state , expectedRows ) = _fetcher . preFetchNumberOfRows ( atMost ) ; <nl> + if ( state = = ExecutionState : : WAITING ) { <nl> + TRI_ASSERT ( expectedRows = = 0 ) ; <nl> + return { state , 0 } ; <nl> + } <nl> + return { ExecutionState : : HASMORE , expectedRows + 1 } ; <nl> + } <nl> + / / The fetcher will NOT send anything any more <nl> + / / We will at most return the current oepn group <nl> + if ( _currentGroup . isValid ( ) ) { <nl> + return { ExecutionState : : HASMORE , 1 } ; <nl> + } <nl> + return { ExecutionState : : DONE , 0 } ; <nl> + } <nl> \ No newline at end of file <nl> mmm a / arangod / Aql / SortedCollectExecutor . h <nl> ppp b / arangod / Aql / SortedCollectExecutor . h <nl> class SortedCollectExecutor { <nl> static const bool allowsBlockPassthrough = false ; <nl> / / TODO This should be true , but the current implementation in <nl> / / ExecutionBlockImpl and the fetchers does not work with this . <nl> - / / It will however always overfetch if activated <nl> - static const bool inputSizeRestrictsOutputSize = false ; <nl> + / / It will however always only overfetch if activated , never underfetch <nl> + static const bool inputSizeRestrictsOutputSize = true ; <nl> } ; <nl> using Fetcher = SingleRowFetcher < Properties : : allowsBlockPassthrough > ; <nl> using Infos = SortedCollectExecutorInfos ; <nl> class SortedCollectExecutor { <nl> * it will produce exactly . It can however only <nl> * overestimate never underestimate . <nl> * / <nl> - inline size_t numberOfRowsInFlight ( ) const { <nl> - / / We always need to be prepared for 1 more row . <nl> - / / On empty input we can produce 1 row . <nl> - / / Otherwise we will have an open group ! <nl> - return 1 ; <nl> - } <nl> + std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const ; <nl> <nl> private : <nl> Infos const & infos ( ) const noexcept { return _infos ; } ; <nl> mmm a / arangod / Aql / SortingGatherExecutor . cpp <nl> ppp b / arangod / Aql / SortingGatherExecutor . cpp <nl> ExecutionState SortingGatherExecutor : : init ( ) { <nl> } <nl> _strategy - > prepare ( _inputRows ) ; <nl> return ExecutionState : : HASMORE ; <nl> + } <nl> + <nl> + std : : pair < ExecutionState , size_t > SortingGatherExecutor : : expectedNumberOfRows ( size_t atMost ) const { <nl> + ExecutionState state ; <nl> + size_t expectedNumberOfRows ; <nl> + std : : tie ( state , expectedNumberOfRows ) = _fetcher . preFetchNumberOfRows ( atMost ) ; <nl> + if ( state = = ExecutionState : : WAITING ) { <nl> + return { state , 0 } ; <nl> + } <nl> + if ( expectedNumberOfRows > = atMost ) { <nl> + / / We do not care , we have more than atMost anyways . <nl> + return { state , expectedNumberOfRows } ; <nl> + } <nl> + / / Now we need to figure out a more precise state <nl> + for ( auto const & inRow : _inputRows ) { <nl> + if ( inRow . state = = ExecutionState : : HASMORE ) { <nl> + / / This block is not fully fetched , we do NOT know how many rows <nl> + / / will be in the next batch , overestimate ! <nl> + return { ExecutionState : : HASMORE , atMost } ; <nl> + } <nl> + if ( inRow . row . isInitialized ( ) ) { <nl> + / / This dependency is in owned by this Executor <nl> + expectedNumberOfRows + + ; <nl> + } <nl> + } <nl> + if ( expectedNumberOfRows = = 0 ) { <nl> + return { ExecutionState : : DONE , 0 } ; <nl> + } <nl> + return { ExecutionState : : HASMORE , expectedNumberOfRows } ; <nl> } <nl> \ No newline at end of file <nl> mmm a / arangod / Aql / SortingGatherExecutor . h <nl> ppp b / arangod / Aql / SortingGatherExecutor . h <nl> class SortingGatherExecutor { <nl> <nl> void adjustNrDone ( size_t dependency ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { <nl> - / / For every not - done dependency we have one row in the buffers . <nl> - / / Initially _numberDependencies is = = 0 and _nrDone = = 0 as well . <nl> - / / This is due to the fact that dependencies are built AFTER this node <nl> - / / and the number is yet unknown . <nl> - return _numberDependencies - _nrDone ; <nl> - } <nl> + std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const ; <nl> <nl> private : <nl> ExecutionState init ( ) ; <nl> mmm a / arangod / Aql / SubqueryExecutor . h <nl> ppp b / arangod / Aql / SubqueryExecutor . h <nl> class SubqueryExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - / * * <nl> - * @ brief This executor is working on at most one input row at a time <nl> - * And it gurantees to produce eactly 1 output for every one input row . <nl> - * / <nl> - inline size_t numberOfRowsInFlight ( ) const { <nl> - if ( _input ) { <nl> - return 1 ; <nl> - } else { <nl> - return 0 ; <nl> - } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> + / / Passthrough does not need to implement this ! <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> } <nl> <nl> private : <nl> mmm a / arangod / Aql / TraversalExecutor . h <nl> ppp b / arangod / Aql / TraversalExecutor . h <nl> class TraversalExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> private : <nl> / * * <nl> mmm a / tests / Aql / TestEmptyExecutorHelper . h <nl> ppp b / tests / Aql / TestEmptyExecutorHelper . h <nl> class TestEmptyExecutorHelper { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> public : <nl> Infos & _infos ; <nl> mmm a / tests / Aql / TestExecutorHelper . h <nl> ppp b / tests / Aql / TestExecutorHelper . h <nl> class TestExecutorHelper { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRow ( OutputAqlItemRow & output ) ; <nl> <nl> - inline size_t numberOfRowsInFlight ( ) const { return 0 ; } <nl> + inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> + TRI_ASSERT ( false ) ; <nl> + THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> + TRI_ERROR_INTERNAL , <nl> + " Logic_error , prefetching number fo rows not supported " ) ; <nl> + } <nl> <nl> public : <nl> Infos & _infos ; <nl>
|
Bug fix / collect prefetch ( )
|
arangodb/arangodb
|
d2287b1b23589ba344ef2ad3f7a5a8f6b1b3a001
|
2019-04-11T15:33:26Z
|
mmm a / Marlin / Configuration . h <nl> ppp b / Marlin / Configuration . h <nl> Here are some standard links for getting your machine calibrated : <nl> / / example_configurations / SCARA directory . <nl> / / <nl> <nl> + / / @ section info <nl> + <nl> / / User - specified version info of this build to display in [ Pronterface , etc ] terminal window during <nl> / / startup . Implementation of an idea by Prof Braino to inform user that any changes made to this <nl> / / build by the user have been successfully uploaded into firmware . <nl> Here are some standard links for getting your machine calibrated : <nl> # define STRING_SPLASH_LINE1 " v " STRING_VERSION / / will be shown during bootup in line 1 <nl> / / # define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H / / will be shown during bootup in line2 <nl> <nl> + / / @ section machine <nl> + <nl> / / SERIAL_PORT selects which serial port should be used for communication with the host . <nl> / / This allows the connection of wireless adapters ( for instance ) to non - default port pins . <nl> / / Serial port 0 is still used by the Arduino bootloader regardless of this setting . <nl> + / / : [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ] <nl> # define SERIAL_PORT 0 <nl> <nl> / / This determines the communication speed of the printer <nl> + / / : [ 2400 , 9600 , 19200 , 38400 , 57600 , 115200 , 250000 ] <nl> # define BAUDRATE 250000 <nl> <nl> / / This enables the serial port associated to the Bluetooth interface <nl> Here are some standard links for getting your machine calibrated : <nl> / / # define MACHINE_UUID " 00000000 - 0000 - 0000 - 0000 - 000000000000 " <nl> <nl> / / This defines the number of extruders <nl> + / / : [ 1 , 2 , 3 , 4 ] <nl> # define EXTRUDERS 1 <nl> <nl> / / Offset of the extruders ( uncomment if using more than one and relying on firmware to position when changing ) . <nl> Here are some standard links for getting your machine calibrated : <nl> / / / / The following define selects which power supply you have . Please choose the one that matches your setup <nl> / / 1 = ATX <nl> / / 2 = X - Box 360 203Watts ( the blue wire connected to PS_ON and the red wire to VCC ) <nl> + / / : { 1 : ' ATX ' , 2 : ' X - Box 360 ' } <nl> <nl> # define POWER_SUPPLY 1 <nl> <nl> / / Define this to have the electronics keep the power supply off on startup . If you don ' t know what this is leave it . <nl> / / # define PS_DEFAULT_OFF <nl> <nl> + / / @ section temperature <nl> + <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Thermal Settings = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> Here are some standard links for getting your machine calibrated : <nl> / / FIND YOUR OWN : " M303 E - 1 C8 S90 " to run autotune on the bed at 90 degreesC for 8 cycles . <nl> # endif / / PIDTEMPBED <nl> <nl> + / / @ section extruder <nl> <nl> / / this prevents dangerous Extruder moves , i . e . if the temperature is under the limit <nl> / / can be software - disabled for whatever purposes by <nl> your extruder heater takes 2 minutes to hit the target on heating . <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Mechanical Settings = = = = = = = = = = = = = = = = = = = = = = = = = <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> <nl> + / / @ section machine <nl> + <nl> / / Uncomment this option to enable CoreXY kinematics <nl> / / # define COREXY <nl> <nl> / / Enable this option for Toshiba steppers <nl> / / # define CONFIG_STEPPERS_TOSHIBA <nl> <nl> + / / @ section homing <nl> + <nl> / / coarse Endstop Settings <nl> # define ENDSTOPPULLUPS / / Comment this out ( using / / at the start of the line ) to disable the endstop pullup resistors <nl> <nl> const bool Z_MAX_ENDSTOP_INVERTING = false ; / / set to true to invert the logic o <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic of the endstop . <nl> / / # define DISABLE_MAX_ENDSTOPS <nl> / / # define DISABLE_MIN_ENDSTOPS <nl> + <nl> + / / @ section machine <nl> / / If you want to enable the Z Probe pin , but disable its use , uncomment the line below . <nl> / / This only affects a Z Probe Endstop if you have separate Z min endstop as well and have <nl> / / activated Z_PROBE_ENDSTOP below . If you are using the Z Min endstop on your Z Probe , <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic <nl> / / # define DISABLE_Z_PROBE_ENDSTOP <nl> <nl> / / For Inverting Stepper Enable Pins ( Active Low ) use 0 , Non Inverting ( Active High ) use 1 <nl> + / / : { 0 : ' Low ' , 1 : ' High ' } <nl> # define X_ENABLE_ON 0 <nl> # define Y_ENABLE_ON 0 <nl> # define Z_ENABLE_ON 0 <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic <nl> # define DISABLE_X false <nl> # define DISABLE_Y false <nl> # define DISABLE_Z false <nl> + <nl> + / / @ section extruder <nl> + <nl> # define DISABLE_E false / / For all extruders <nl> # define DISABLE_INACTIVE_EXTRUDER true / / disable only inactive extruders and keep active extruder enabled <nl> <nl> + / / @ section machine <nl> + <nl> / / Invert the stepper direction . Change ( or reverse the motor connector ) if an axis goes the wrong way . <nl> # define INVERT_X_DIR false <nl> # define INVERT_Y_DIR false <nl> # define INVERT_Z_DIR false <nl> + <nl> + / / @ section extruder <nl> + <nl> + / / For direct drive extruder v9 set to true , for geared extruder set to false . <nl> # define INVERT_E0_DIR false <nl> # define INVERT_E1_DIR false <nl> # define INVERT_E2_DIR false <nl> # define INVERT_E3_DIR false <nl> <nl> + / / @ section homing <nl> + <nl> / / ENDSTOP SETTINGS : <nl> / / Sets direction of endstops when homing ; 1 = MAX , - 1 = MIN <nl> + / / : [ - 1 , 1 ] <nl> # define X_HOME_DIR - 1 <nl> # define Y_HOME_DIR - 1 <nl> # define Z_HOME_DIR - 1 <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic <nl> # define min_software_endstops true / / If true , axis won ' t move to coordinates less than HOME_POS . <nl> # define max_software_endstops true / / If true , axis won ' t move to coordinates greater than the defined lengths below . <nl> <nl> + / / @ section machine <nl> + <nl> / / Travel limits after homing ( units are in mm ) <nl> # define X_MIN_POS 0 <nl> # define Y_MIN_POS 0 <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Bed Auto Leveling = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> <nl> + / / @ section bedlevel <nl> + <nl> / / # define ENABLE_AUTO_BED_LEVELING / / Delete the comment to enable ( remove / / at the start of the line ) <nl> # define Z_PROBE_REPEATABILITY_TEST / / If not commented out , Z - Probe Repeatability test will be included if Auto Bed Leveling is Enabled . <nl> <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic <nl> # endif / / ENABLE_AUTO_BED_LEVELING <nl> <nl> <nl> + / / @ section homing <nl> + <nl> / / The position of the homing switches <nl> / / # define MANUAL_HOME_POSITIONS / / If defined , MANUAL_ * _HOME_POS below will be used <nl> / / # define BED_CENTER_AT_0_0 / / If defined , the center of the bed is at ( X = 0 , Y = 0 ) <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic <nl> / / # define MANUAL_Z_HOME_POS 402 / / For delta : Distance between nozzle and print surface after homing . <nl> # endif <nl> <nl> + / / @ section movement <nl> + <nl> / * * <nl> * MOVEMENT SETTINGS <nl> * / <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Additional Features = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> <nl> + / / @ section more <nl> + <nl> / / Custom M code points <nl> # define CUSTOM_M_CODES <nl> # ifdef CUSTOM_M_CODES <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic <nl> # endif <nl> # endif <nl> <nl> + / / @ section extras <nl> <nl> / / EEPROM <nl> / / The microcontroller can store settings in the EEPROM , e . g . max velocity . . . <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic <nl> / / please keep turned on if you can . <nl> / / # define EEPROM_CHITCHAT <nl> <nl> + / / @ section temperature <nl> + <nl> / / Preheat Constants <nl> # define PLA_PREHEAT_HOTEND_TEMP 180 <nl> # define PLA_PREHEAT_HPB_TEMP 70 <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic <nl> # define ABS_PREHEAT_FAN_SPEED 0 / / Insert Value between 0 and 255 <nl> <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = LCD and SD support = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + / / @ section lcd <nl> <nl> / / Define your display language below . Replace ( en ) with your language code and uncomment . <nl> / / en , pl , fr , de , es , ru , it , pt , pt - br , fi , an , nl , ca , eu , kana , kana_utf8 , test <nl> const bool Z_PROBE_ENDSTOP_INVERTING = false ; / / set to true to invert the logic <nl> <nl> / / # define SAV_3DLCD <nl> <nl> + / / @ section extras <nl> + <nl> / / Increase the FAN pwm frequency . Removes the PWM noise but increases heating in the FET / Arduino <nl> / / # define FAST_PWM_FAN <nl> <nl> mmm a / Marlin / Configuration_adv . h <nl> ppp b / Marlin / Configuration_adv . h <nl> <nl> <nl> # include " Conditionals . h " <nl> <nl> + / / @ section temperature <nl> + <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Thermal Settings = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> <nl> / / The M105 command return , besides traditional information , the ADC value read from temperature sensors . <nl> / / # define SHOW_TEMP_ADC_VALUES <nl> <nl> + / / @ section extruder <nl> + <nl> / / extruder run - out prevention . <nl> / / if the machine is idle , and the temperature over MINTEMP , every couple of SECONDS some filament is extruded <nl> / / # define EXTRUDER_RUNOUT_PREVENT <nl> <nl> # define EXTRUDER_RUNOUT_SPEED 1500 . / / extrusion speed <nl> # define EXTRUDER_RUNOUT_EXTRUDE 100 <nl> <nl> + / / @ section temperature <nl> + <nl> / / These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements . <nl> / / The measured temperature is defined as " actualTemp = ( measuredTemp * TEMP_SENSOR_AD595_GAIN ) + TEMP_SENSOR_AD595_OFFSET " <nl> # define TEMP_SENSOR_AD595_OFFSET 0 . 0 <nl> <nl> / / before setting a PWM value . ( Does not work with software PWM for fan on Sanguinololu ) <nl> / / # define FAN_KICKSTART_TIME 100 <nl> <nl> + / / @ section extruder <nl> + <nl> / / Extruder cooling fans <nl> / / Configure fan pin outputs to automatically turn on / off when the associated <nl> / / extruder temperature is above / below EXTRUDER_AUTO_FAN_TEMPERATURE . <nl> <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Mechanical Settings = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> <nl> + / / @ section homing <nl> + <nl> # define ENDSTOPS_ONLY_FOR_HOMING / / If defined the endstops will only be used for homing <nl> <nl> + / / @ section extras <nl> + <nl> / / # define Z_LATE_ENABLE / / Enable Z the last moment . Needed if your Z driver overheats . <nl> <nl> / / A single Z stepper driver is usually used to drive 2 stepper motors . <nl> <nl> <nl> # endif / / DUAL_X_CARRIAGE <nl> <nl> + / / @ section homing <nl> + <nl> / / homing hits the endstop , then retracts by this distance , before it tries to slowly bump again : <nl> # define X_HOME_BUMP_MM 5 <nl> # define Y_HOME_BUMP_MM 5 <nl> <nl> # define HOMING_BUMP_DIVISOR { 2 , 2 , 4 } / / Re - Bump Speed Divisor ( Divides the Homing Feedrate ) <nl> / / # define QUICK_HOME / / if this is defined , if both x and y are to be homed , a diagonal move will be performed initially . <nl> <nl> + / / @ section machine <nl> + <nl> # define AXIS_RELATIVE_MODES { false , false , false , false } <nl> <nl> + / / @ section machine <nl> + <nl> / / By default pololu step drivers require an active high signal . However , some high power drivers require an active low signal as step . <nl> # define INVERT_X_STEP_PIN false <nl> # define INVERT_Y_STEP_PIN false <nl> <nl> # define DEFAULT_MINIMUMFEEDRATE 0 . 0 / / minimum feedrate <nl> # define DEFAULT_MINTRAVELFEEDRATE 0 . 0 <nl> <nl> + / / @ section lcd <nl> + <nl> # ifdef ULTIPANEL <nl> # define MANUAL_FEEDRATE { 50 * 60 , 50 * 60 , 4 * 60 , 60 } / / Feedrates for manual moves along X , Y , Z , E from panel <nl> # define ULTIPANEL_FEEDMULTIPLY / / Comment to disable setting feedrate multiplier via encoder <nl> # endif <nl> <nl> + / / @ section extras <nl> + <nl> / / minimum time in microseconds that a movement needs to take if the buffer is emptied . <nl> # define DEFAULT_MINSEGMENTTIME 20000 <nl> <nl> <nl> / / # define CHDK 4 / / Pin for triggering CHDK to take a picture see how to use it here http : / / captain - slow . dk / 2014 / 03 / 09 / 3d - printing - timelapses / <nl> # define CHDK_DELAY 50 / / How long in ms the pin should stay HIGH before going LOW again <nl> <nl> + / / @ section lcd <nl> + <nl> # ifdef SDSUPPORT <nl> <nl> / / If you are using a RAMPS board or cheap E - bay purchased boards that do not detect when an SD card is inserted <nl> <nl> <nl> # endif / / SDSUPPORT <nl> <nl> + / / @ section more <nl> + <nl> / / The hardware watchdog should reset the microcontroller disabling all outputs , in case the firmware gets stuck and doesn ' t do temperature regulation . <nl> / / # define USE_WATCHDOG <nl> <nl> <nl> <nl> const unsigned int dropsegments = 5 ; / / everything with less than this number of steps will be ignored as move and joined with the next movement <nl> <nl> + / / @ section temperature <nl> + <nl> / / Control heater 0 and heater 1 in parallel . <nl> / / # define HEATERS_PARALLEL <nl> <nl> const unsigned int dropsegments = 5 ; / / everything with less than this number of st <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Buffers = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> <nl> + / / @ section hidden <nl> + <nl> / / The number of linear motions that can be in the plan at any give time . <nl> / / THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 , i . g . 8 , 16 , 32 because shifts and ors are used to do the ring - buffering . <nl> # ifdef SDSUPPORT <nl> const unsigned int dropsegments = 5 ; / / everything with less than this number of st <nl> # define BLOCK_BUFFER_SIZE 16 / / maximize block buffer <nl> # endif <nl> <nl> + / / @ section more <nl> <nl> / / The ASCII buffer for receiving from the serial : <nl> # define MAX_CMD_SIZE 96 <nl> # define BUFSIZE 4 <nl> <nl> + / / @ section extras <nl> <nl> / / Firmware based and LCD controlled retract <nl> / / M207 and M208 can be used to define parameters for the retraction . <nl>
|
Incorporate @ section headers from configurator
|
MarlinFirmware/Marlin
|
46474cf2f2cc1f762ff10a2ab908d3d54f803841
|
2015-04-06T03:39:40Z
|
mmm a / lib / Transforms / DialectConversion . cpp <nl> ppp b / lib / Transforms / DialectConversion . cpp <nl> OperationLegalizer : : legalizePattern ( Operation * op , RewritePattern * pattern , <nl> rewriterImpl . deadOps . insert ( replacedOp ) ; <nl> } <nl> assert ( replacedRoot & & " expected pattern to replace the root operation " ) ; <nl> + ( void ) replacedRoot ; <nl> <nl> / / Recursively legalize each of the new operations . <nl> for ( unsigned i = curState . numCreatedOperations , <nl>
|
Fix " set - but - unused " warning in DialectConversion
|
tensorflow/tensorflow
|
2c97c05db35be7b794f0025b51f6f4eca8b466be
|
2019-10-23T21:32:13Z
|
mmm a / tensorflow / contrib / data / kernels / csv_dataset_op . cc <nl> ppp b / tensorflow / contrib / data / kernels / csv_dataset_op . cc <nl> class CSVDatasetOp : public DatasetOpKernel { <nl> OP_REQUIRES_OK ( ctx , <nl> ctx - > input_list ( " record_defaults " , & record_defaults_list ) ) ; <nl> for ( int i = 0 ; i < record_defaults_list . size ( ) ; + + i ) { <nl> + OP_REQUIRES ( ctx , record_defaults_list [ i ] . dims ( ) < = 1 , <nl> + errors : : InvalidArgument ( <nl> + " Each record default should be at most rank 1 " ) ) ; <nl> OP_REQUIRES ( ctx , record_defaults_list [ i ] . NumElements ( ) < 2 , <nl> errors : : InvalidArgument ( <nl> " There should only be 1 default per field but field " , i , <nl> mmm a / tensorflow / contrib / data / ops / dataset_ops . cc <nl> ppp b / tensorflow / contrib / data / ops / dataset_ops . cc <nl> REGISTER_OP ( " CSVDataset " ) <nl> TF_RETURN_IF_ERROR ( c - > WithRank ( c - > input ( 7 ) , 1 , & unused ) ) ; <nl> / / ` record_defaults ` must be lists of scalars <nl> for ( size_t i = 8 ; i < c - > num_inputs ( ) ; + + i ) { <nl> - TF_RETURN_IF_ERROR ( c - > WithRank ( c - > input ( i ) , 1 , & unused ) ) ; <nl> + shape_inference : : ShapeHandle v ; <nl> + TF_RETURN_IF_ERROR ( c - > WithRankAtMost ( c - > input ( i ) , 1 , & v ) ) ; <nl> + if ( c - > Rank ( c - > input ( i ) ) = = 1 & & c - > Value ( c - > Dim ( v , 0 ) ) > 1 ) { <nl> + return errors : : InvalidArgument ( <nl> + " Shape of a default must be a length - 0 or length - 1 vector , or a " <nl> + " scalar . " ) ; <nl> + } <nl> } <nl> return shape_inference : : ScalarShape ( c ) ; <nl> } ) ; <nl> mmm a / tensorflow / contrib / data / python / kernel_tests / BUILD <nl> ppp b / tensorflow / contrib / data / python / kernel_tests / BUILD <nl> py_test ( <nl> " / / tensorflow / python : constant_op " , <nl> " / / tensorflow / python : dtypes " , <nl> " / / tensorflow / python : errors " , <nl> - " / / tensorflow / python : framework_ops " , <nl> + " / / tensorflow / python : framework_test_lib " , <nl> " / / tensorflow / python : parsing_ops " , <nl> " / / tensorflow / python : platform " , <nl> " / / tensorflow / python : platform_test " , <nl> " / / tensorflow / python : session " , <nl> " / / tensorflow / python / data / ops : readers " , <nl> + " / / tensorflow / python / eager : context " , <nl> " / / third_party / py / numpy " , <nl> ] , <nl> ) <nl> mmm a / tensorflow / contrib / data / python / kernel_tests / csv_dataset_op_test . py <nl> ppp b / tensorflow / contrib / data / python / kernel_tests / csv_dataset_op_test . py <nl> <nl> from tensorflow . contrib . data . python . ops import readers <nl> from tensorflow . python . client import session <nl> from tensorflow . python . data . ops import readers as core_readers <nl> + from tensorflow . python . eager import context <nl> from tensorflow . python . framework import constant_op <nl> from tensorflow . python . framework import dtypes <nl> from tensorflow . python . framework import errors <nl> - from tensorflow . python . framework import ops <nl> + from tensorflow . python . framework import test_util <nl> from tensorflow . python . ops import parsing_ops <nl> from tensorflow . python . platform import gfile <nl> from tensorflow . python . platform import googletest <nl> from tensorflow . python . platform import test <nl> <nl> <nl> + @ test_util . run_all_in_graph_and_eager_modes <nl> class CsvDatasetOpTest ( test . TestCase ) : <nl> <nl> - def _assert_datasets_equal ( self , g , ds1 , ds2 ) : <nl> + def _get_next ( self , dataset ) : <nl> + # Returns a no argument function whose result is fed to self . evaluate to <nl> + # yield the next element <nl> + it = dataset . make_one_shot_iterator ( ) <nl> + if context . executing_eagerly ( ) : <nl> + return it . get_next <nl> + else : <nl> + get_next = it . get_next ( ) <nl> + return lambda : get_next <nl> + <nl> + def _assert_datasets_equal ( self , ds1 , ds2 ) : <nl> assert ds1 . output_shapes = = ds2 . output_shapes , ( ' output_shapes differ : % s , ' <nl> ' % s ' ) % ( ds1 . output_shapes , <nl> ds2 . output_shapes ) <nl> assert ds1 . output_types = = ds2 . output_types <nl> assert ds1 . output_classes = = ds2 . output_classes <nl> - next1 = ds1 . make_one_shot_iterator ( ) . get_next ( ) <nl> - next2 = ds2 . make_one_shot_iterator ( ) . get_next ( ) <nl> - with self . session ( graph = g ) as sess : <nl> - # Run through datasets and check that outputs match , or errors match . <nl> - while True : <nl> - try : <nl> - op1 = sess . run ( next1 ) <nl> - except ( errors . OutOfRangeError , ValueError ) as e : <nl> - # If op1 throws an exception , check that op2 throws same exception . <nl> - with self . assertRaises ( type ( e ) ) : <nl> - sess . run ( next2 ) <nl> - break <nl> - op2 = sess . run ( next2 ) <nl> - self . assertAllEqual ( op1 , op2 ) <nl> + next1 = self . _get_next ( ds1 ) <nl> + next2 = self . _get_next ( ds2 ) <nl> + # Run through datasets and check that outputs match , or errors match . <nl> + while True : <nl> + try : <nl> + op1 = self . evaluate ( next1 ( ) ) <nl> + except ( errors . OutOfRangeError , ValueError ) as e : <nl> + # If op1 throws an exception , check that op2 throws same exception . <nl> + with self . assertRaises ( type ( e ) ) : <nl> + self . evaluate ( next2 ( ) ) <nl> + break <nl> + op2 = self . evaluate ( next2 ( ) ) <nl> + self . assertAllEqual ( op1 , op2 ) <nl> <nl> def _setup_files ( self , inputs , linebreak = ' \ n ' , compression_type = None ) : <nl> filenames = [ ] <nl> def _make_test_datasets ( self , inputs , * * kwargs ) : <nl> <nl> def _test_by_comparison ( self , inputs , * * kwargs ) : <nl> " " " Checks that CsvDataset is equiv to TextLineDataset - > map ( decode_csv ) . " " " <nl> - with ops . Graph ( ) . as_default ( ) as g : <nl> - dataset_actual , dataset_expected = self . _make_test_datasets ( <nl> - inputs , * * kwargs ) <nl> - self . _assert_datasets_equal ( g , dataset_actual , dataset_expected ) <nl> + dataset_actual , dataset_expected = self . _make_test_datasets ( <nl> + inputs , * * kwargs ) <nl> + self . _assert_datasets_equal ( dataset_actual , dataset_expected ) <nl> <nl> def _verify_output_or_err ( self , <nl> - sess , <nl> dataset , <nl> expected_output = None , <nl> expected_err_re = None ) : <nl> - nxt = dataset . make_one_shot_iterator ( ) . get_next ( ) <nl> if expected_err_re is None : <nl> # Verify that output is expected , without errors <nl> + nxt = self . _get_next ( dataset ) <nl> expected_output = [ [ <nl> v . encode ( ' utf - 8 ' ) if isinstance ( v , str ) else v for v in op <nl> ] for op in expected_output ] <nl> for value in expected_output : <nl> - op = sess . run ( nxt ) <nl> + op = self . evaluate ( nxt ( ) ) <nl> self . assertAllEqual ( op , value ) <nl> with self . assertRaises ( errors . OutOfRangeError ) : <nl> - sess . run ( nxt ) <nl> + self . evaluate ( nxt ( ) ) <nl> else : <nl> # Verify that OpError is produced as expected <nl> with self . assertRaisesOpError ( expected_err_re ) : <nl> + nxt = self . _get_next ( dataset ) <nl> while True : <nl> try : <nl> - sess . run ( nxt ) <nl> + self . evaluate ( nxt ( ) ) <nl> except errors . OutOfRangeError : <nl> break <nl> <nl> def _test_dataset ( <nl> # Convert str type because py3 tf strings are bytestrings <nl> filenames = self . _setup_files ( inputs , linebreak , compression_type ) <nl> kwargs [ ' compression_type ' ] = compression_type <nl> - with ops . Graph ( ) . as_default ( ) as g : <nl> - with self . session ( graph = g ) as sess : <nl> - dataset = readers . CsvDataset ( filenames , * * kwargs ) <nl> - self . _verify_output_or_err ( sess , dataset , expected_output , <nl> - expected_err_re ) <nl> + dataset = readers . CsvDataset ( filenames , * * kwargs ) <nl> + self . _verify_output_or_err ( dataset , expected_output , expected_err_re ) <nl> <nl> def testCsvDataset_requiredFields ( self ) : <nl> record_defaults = [ [ ] ] * 4 <nl> def testCsvDataset_ignoreErrWithUnescapedQuotes ( self ) : <nl> record_defaults = [ [ ' ' ] ] * 3 <nl> inputs = [ [ ' 1 , " 2 " 3 " , 4 ' , ' 1 , " 2 " 3 " , 4 " , 5 , 5 ' , ' a , b , " c " d " ' , ' e , f , g ' ] ] <nl> filenames = self . _setup_files ( inputs ) <nl> - with ops . Graph ( ) . as_default ( ) as g : <nl> - with self . session ( graph = g ) as sess : <nl> - dataset = readers . CsvDataset ( filenames , record_defaults = record_defaults ) <nl> - dataset = dataset . apply ( error_ops . ignore_errors ( ) ) <nl> - self . _verify_output_or_err ( sess , dataset , [ [ ' e ' , ' f ' , ' g ' ] ] ) <nl> + dataset = readers . CsvDataset ( filenames , record_defaults = record_defaults ) <nl> + dataset = dataset . apply ( error_ops . ignore_errors ( ) ) <nl> + self . _verify_output_or_err ( dataset , [ [ ' e ' , ' f ' , ' g ' ] ] ) <nl> <nl> def testCsvDataset_ignoreErrWithUnquotedQuotes ( self ) : <nl> record_defaults = [ [ ' ' ] ] * 3 <nl> inputs = [ [ ' 1 , 2 " 3 , 4 ' , ' a , b , c " d ' , ' 9 , 8 " 7 , 6 , 5 ' , ' e , f , g ' ] ] <nl> filenames = self . _setup_files ( inputs ) <nl> - with ops . Graph ( ) . as_default ( ) as g : <nl> - with self . session ( graph = g ) as sess : <nl> - dataset = readers . CsvDataset ( filenames , record_defaults = record_defaults ) <nl> - dataset = dataset . apply ( error_ops . ignore_errors ( ) ) <nl> - self . _verify_output_or_err ( sess , dataset , [ [ ' e ' , ' f ' , ' g ' ] ] ) <nl> + dataset = readers . CsvDataset ( filenames , record_defaults = record_defaults ) <nl> + dataset = dataset . apply ( error_ops . ignore_errors ( ) ) <nl> + self . _verify_output_or_err ( dataset , [ [ ' e ' , ' f ' , ' g ' ] ] ) <nl> <nl> def testCsvDataset_withNoQuoteDelimAndUnquotedQuotes ( self ) : <nl> record_defaults = [ [ ' ' ] ] * 3 <nl> def testCsvDataset_withChainedOps ( self ) : <nl> inputs = [ [ ' 1 , , 3 , 4 ' , ' 5 , 6 , , 8 ' ] ] <nl> ds_actual , ds_expected = self . _make_test_datasets ( <nl> inputs , record_defaults = record_defaults ) <nl> - with ops . Graph ( ) . as_default ( ) as g : <nl> - self . _assert_datasets_equal ( g , <nl> - ds_actual . repeat ( 5 ) . prefetch ( 1 ) , <nl> - ds_expected . repeat ( 5 ) . prefetch ( 1 ) ) <nl> + self . _assert_datasets_equal ( <nl> + ds_actual . repeat ( 5 ) . prefetch ( 1 ) , <nl> + ds_expected . repeat ( 5 ) . prefetch ( 1 ) ) <nl> <nl> def testCsvDataset_withTypeDefaults ( self ) : <nl> # Testing using dtypes as record_defaults for required fields <nl> def testMakeCsvDataset_fieldOrder ( self ) : <nl> ] ] <nl> file_path = self . _setup_files ( data ) <nl> <nl> - with ops . Graph ( ) . as_default ( ) as g : <nl> - ds = readers . make_csv_dataset ( <nl> - file_path , batch_size = 1 , shuffle = False , num_epochs = 1 ) <nl> - next_batch = ds . make_one_shot_iterator ( ) . get_next ( ) <nl> + ds = readers . make_csv_dataset ( <nl> + file_path , batch_size = 1 , shuffle = False , num_epochs = 1 ) <nl> + nxt = self . _get_next ( ds ) <nl> <nl> - with self . session ( graph = g ) as sess : <nl> - result = list ( sess . run ( next_batch ) . values ( ) ) <nl> + result = list ( self . evaluate ( nxt ( ) ) . values ( ) ) <nl> <nl> self . assertEqual ( result , sorted ( result ) ) <nl> <nl> def testCsvDataset_withZlibCompressionType ( self ) : <nl> compression_type = ' ZLIB ' , <nl> record_defaults = record_defaults ) <nl> <nl> + def testCsvDataset_withScalarDefaults ( self ) : <nl> + record_defaults = [ constant_op . constant ( 0 , dtype = dtypes . int64 ) ] * 4 <nl> + inputs = [ [ ' , , , ' , ' 1 , 1 , 1 , ' , ' , 2 , 2 , 2 ' ] ] <nl> + self . _test_dataset ( <nl> + inputs , [ [ 0 , 0 , 0 , 0 ] , [ 1 , 1 , 1 , 0 ] , [ 0 , 2 , 2 , 2 ] ] , <nl> + record_defaults = record_defaults ) <nl> + <nl> + def testCsvDataset_with2DDefaults ( self ) : <nl> + record_defaults = [ constant_op . constant ( [ [ 0 ] ] , dtype = dtypes . int64 ) ] * 4 <nl> + inputs = [ [ ' , , , ' , ' 1 , 1 , 1 , ' , ' , 2 , 2 , 2 ' ] ] <nl> + <nl> + if context . executing_eagerly ( ) : <nl> + err_spec = errors . InvalidArgumentError , ( <nl> + ' Each record default should be at ' <nl> + ' most rank 1 . ' ) <nl> + else : <nl> + err_spec = ValueError , ' Shape must be at most rank 1 but is rank 2 ' <nl> + <nl> + with self . assertRaisesWithPredicateMatch ( * err_spec ) : <nl> + self . _test_dataset ( <nl> + inputs , [ [ 0 , 0 , 0 , 0 ] , [ 1 , 1 , 1 , 0 ] , [ 0 , 2 , 2 , 2 ] ] , <nl> + record_defaults = record_defaults ) <nl> + <nl> <nl> class CsvDatasetBenchmark ( test . Benchmark ) : <nl> " " " Benchmarks for the various ways of creating a dataset from CSV files . <nl> mmm a / tensorflow / core / api_def / base_api / api_def_DecodeCSV . pbtxt <nl> ppp b / tensorflow / core / api_def / base_api / api_def_DecodeCSV . pbtxt <nl> END <nl> name : " record_defaults " <nl> description : < < END <nl> One tensor per column of the input record , with either a <nl> - scalar default value for that column or empty if the column is required . <nl> + scalar default value for that column or an empty vector if the column is <nl> + required . <nl> END <nl> } <nl> out_arg { <nl> mmm a / tensorflow / core / kernels / decode_csv_op . cc <nl> ppp b / tensorflow / core / kernels / decode_csv_op . cc <nl> class DecodeCSVOp : public OpKernel { <nl> OP_REQUIRES_OK ( ctx , ctx - > input_list ( " record_defaults " , & record_defaults ) ) ; <nl> <nl> for ( int i = 0 ; i < record_defaults . size ( ) ; + + i ) { <nl> + OP_REQUIRES ( ctx , record_defaults [ i ] . dims ( ) < = 1 , <nl> + errors : : InvalidArgument ( <nl> + " Each record default should be at most rank 1 " ) ) ; <nl> OP_REQUIRES ( ctx , record_defaults [ i ] . NumElements ( ) < 2 , <nl> errors : : InvalidArgument ( <nl> " There should only be 1 default per field but field " , i , <nl> mmm a / tensorflow / core / ops / parsing_ops . cc <nl> ppp b / tensorflow / core / ops / parsing_ops . cc <nl> REGISTER_OP ( " DecodeCSV " ) <nl> / / Validate the record_defaults inputs . <nl> for ( int i = 1 ; i < c - > num_inputs ( ) ; + + i ) { <nl> ShapeHandle v ; <nl> - TF_RETURN_IF_ERROR ( c - > WithRank ( c - > input ( i ) , 1 , & v ) ) ; <nl> - if ( c - > Value ( c - > Dim ( v , 0 ) ) > 1 ) { <nl> + TF_RETURN_IF_ERROR ( c - > WithRankAtMost ( c - > input ( i ) , 1 , & v ) ) ; <nl> + if ( c - > Rank ( c - > input ( i ) ) = = 1 & & c - > Value ( c - > Dim ( v , 0 ) ) > 1 ) { <nl> return errors : : InvalidArgument ( <nl> - " Shape of a default must be a length - 0 or length - 1 vector " ) ; <nl> + " Shape of a default must be a length - 0 or length - 1 vector , or a " <nl> + " scalar . " ) ; <nl> } <nl> } <nl> <nl> mmm a / tensorflow / core / ops / parsing_ops_test . cc <nl> ppp b / tensorflow / core / ops / parsing_ops_test . cc <nl> TEST ( ParsingOpsTest , DecodeCSV_ShapeFn ) { <nl> INFER_OK ( op , " [ 1 , 2 , ? , 4 ] ; ? ; ? " , " in0 ; in0 " ) ; <nl> INFER_OK ( op , " [ 1 , 2 , ? , 4 ] ; [ ? ] ; [ ? ] " , " in0 ; in0 " ) ; <nl> <nl> + / / Scalar defaults are ok <nl> + INFER_OK ( op , " ? ; ? ; [ ] " , " in0 ; in0 " ) ; <nl> + <nl> / / Check errors in the record_defaults inputs . <nl> - INFER_ERROR ( " must be rank 1 " , op , " ? ; ? ; [ ] " ) ; <nl> - INFER_ERROR ( " must be rank 1 " , op , " ? ; [ ] ; ? " ) ; <nl> + INFER_ERROR ( " must be at most rank 1 but is rank 2 " , op , " ? ; ? ; [ 1 , 2 ] " ) ; <nl> + INFER_ERROR ( " must be at most rank 1 but is rank 2 " , op , " ? ; [ 3 , 4 ] ; ? " ) ; <nl> INFER_ERROR ( " Shape of a default must be " , op , " ? ; ? ; [ 2 ] " ) ; <nl> INFER_ERROR ( " Shape of a default must be " , op , " ? ; [ 2 ] ; ? " ) ; <nl> } <nl> mmm a / tensorflow / python / kernel_tests / BUILD <nl> ppp b / tensorflow / python / kernel_tests / BUILD <nl> tf_py_test ( <nl> srcs = [ " decode_csv_op_test . py " ] , <nl> additional_deps = [ <nl> " / / third_party / py / numpy " , <nl> + " / / tensorflow / python / eager : context " , <nl> " / / tensorflow / python : client_testlib " , <nl> + " / / tensorflow / python : errors " , <nl> + " / / tensorflow / python : framework_test_lib " , <nl> " / / tensorflow / python : parsing_ops " , <nl> ] , <nl> ) <nl> mmm a / tensorflow / python / kernel_tests / decode_csv_op_test . py <nl> ppp b / tensorflow / python / kernel_tests / decode_csv_op_test . py <nl> <nl> <nl> import numpy as np <nl> <nl> + from tensorflow . python . eager import context <nl> + from tensorflow . python . framework import errors <nl> + from tensorflow . python . framework import test_util <nl> from tensorflow . python . ops import parsing_ops <nl> from tensorflow . python . platform import test <nl> <nl> <nl> + @ test_util . run_all_in_graph_and_eager_modes <nl> class DecodeCSVOpTest ( test . TestCase ) : <nl> <nl> def _test ( self , args , expected_out = None , expected_err_re = None ) : <nl> - with self . cached_session ( ) as sess : <nl> + if expected_err_re is None : <nl> decode = parsing_ops . decode_csv ( * * args ) <nl> - <nl> - if expected_err_re is None : <nl> - out = sess . run ( decode ) <nl> - <nl> - for i , field in enumerate ( out ) : <nl> - if field . dtype = = np . float32 or field . dtype = = np . float64 : <nl> - self . assertAllClose ( field , expected_out [ i ] ) <nl> - else : <nl> - self . assertAllEqual ( field , expected_out [ i ] ) <nl> - <nl> - else : <nl> - with self . assertRaisesOpError ( expected_err_re ) : <nl> - sess . run ( decode ) <nl> + out = self . evaluate ( decode ) <nl> + <nl> + for i , field in enumerate ( out ) : <nl> + if field . dtype = = np . float32 or field . dtype = = np . float64 : <nl> + self . assertAllClose ( field , expected_out [ i ] ) <nl> + else : <nl> + self . assertAllEqual ( field , expected_out [ i ] ) <nl> + else : <nl> + with self . assertRaisesOpError ( expected_err_re ) : <nl> + decode = parsing_ops . decode_csv ( * * args ) <nl> + self . evaluate ( decode ) <nl> <nl> def testSimple ( self ) : <nl> args = { <nl> def testSimple ( self ) : <nl> <nl> self . _test ( args , expected_out ) <nl> <nl> + def testSimpleWithScalarDefaults ( self ) : <nl> + args = { <nl> + " records " : [ " 1 , 4 " , " 2 , 5 " , " 3 , 6 " ] , <nl> + " record_defaults " : [ 1 , 2 ] , <nl> + } <nl> + <nl> + expected_out = [ [ 1 , 2 , 3 ] , [ 4 , 5 , 6 ] ] <nl> + <nl> + self . _test ( args , expected_out ) <nl> + <nl> + def testSimpleWith2DDefaults ( self ) : <nl> + args = { <nl> + " records " : [ " 1 " , " 2 " , " 3 " ] , <nl> + " record_defaults " : [ [ [ 0 ] ] ] , <nl> + } <nl> + <nl> + if context . executing_eagerly ( ) : <nl> + err_spec = errors . InvalidArgumentError , ( <nl> + " Each record default should be at " <nl> + " most rank 1 . " ) <nl> + else : <nl> + err_spec = ValueError , " Shape must be at most rank 1 but is rank 2 " <nl> + with self . assertRaisesWithPredicateMatch ( * err_spec ) : <nl> + self . _test ( args ) <nl> + <nl> def testSimpleNoQuoteDelimiter ( self ) : <nl> args = { <nl> " records " : [ " 1 " , " 2 " , ' " 3 " ' ] , <nl> mmm a / tensorflow / python / ops / parsing_ops . py <nl> ppp b / tensorflow / python / ops / parsing_ops . py <nl> def decode_csv ( records , <nl> record_defaults : A list of ` Tensor ` objects with specific types . <nl> Acceptable types are ` float32 ` , ` float64 ` , ` int32 ` , ` int64 ` , ` string ` . <nl> One tensor per column of the input record , with either a <nl> - scalar default value for that column or empty if the column is required . <nl> + scalar default value for that column or an empty vector if the column is <nl> + required . <nl> field_delim : An optional ` string ` . Defaults to ` " , " ` . <nl> char delimiter to separate fields in a record . <nl> use_quote_delim : An optional ` bool ` . Defaults to ` True ` . <nl>
|
Consistency in record_default shapes for tf . contrib . data . CsvDataset & tf . decode_csv :
|
tensorflow/tensorflow
|
d3458112ad5a1612ec6c77f7de4a0e0ec801e882
|
2018-09-13T21:26:13Z
|
mmm a / R - package / demo / create_sparse_matrix . R <nl> ppp b / R - package / demo / create_sparse_matrix . R <nl> bst < - xgboost ( data = sparse_matrix , label = output_vector , max . depth = 3 , <nl> xgb . dump ( bst , ' xgb . model . dump ' , with . stats = T ) <nl> <nl> # sparse_matrix @ Dimnames [ [ 2 ] ] represents the column names of the sparse matrix . <nl> - importance = xgb . importance ( sparse_matrix @ Dimnames [ [ 2 ] ] , ' xgb . model . dump ' ) <nl> + importance < - xgb . importance ( sparse_matrix @ Dimnames [ [ 2 ] ] , ' xgb . model . dump ' ) <nl> print ( importance ) <nl> # According to the matrix below , the most important feature in this dataset to predict if the treatment will work is having received a Placebo or not . <nl>
|
change assignation sign
|
dmlc/xgboost
|
c3d8f21df339564e5b43bb5f42c41d12c46d8eec
|
2014-12-30T23:52:53Z
|
mmm a / src / embind / embind . js <nl> ppp b / src / embind / embind . js <nl> <nl> / * global Module * / <nl> / * global _malloc , _free , _memcpy * / <nl> / * global FUNCTION_TABLE , HEAP8 , HEAPU8 , HEAP16 , HEAPU16 , HEAP32 , HEAPU32 * / <nl> - / * global Pointer_stringify * / <nl> + / * global readLatin1String * / <nl> / * global __emval_register , _emval_handle_array , __emval_decref * / <nl> / * global ___getTypeName * / <nl> <nl> function whenDependentTypesAreResolved ( myTypes , dependentTypes , getTypeConverter <nl> } <nl> } <nl> <nl> + var __charCodes = [ ] ; <nl> + <nl> + function readLatin1String ( ptr ) { <nl> + if ( __charCodes . length = = = 0 ) { <nl> + for ( var charCodeI = 0 ; charCodeI < 127 ; charCodeI + + ) { <nl> + __charCodes . push ( String . fromCharCode ( charCodeI ) ) ; <nl> + } <nl> + } <nl> + <nl> + var ret = " " ; <nl> + var c = ptr ; <nl> + while ( HEAPU8 [ c ] ) { <nl> + ret + = __charCodes [ HEAPU8 [ c + + ] ] ; <nl> + } <nl> + return ret ; <nl> + } <nl> + <nl> function getTypeName ( type ) { <nl> var ptr = ___getTypeName ( type ) ; <nl> - var rv = Pointer_stringify ( ptr ) ; <nl> + var rv = readLatin1String ( ptr ) ; <nl> _free ( ptr ) ; <nl> return rv ; <nl> } <nl> function requireRegisteredType ( rawType , humanName ) { <nl> } <nl> <nl> function __embind_register_void ( rawType , name ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> registerType ( rawType , { <nl> name : name , <nl> fromWireType : function ( ) { <nl> function __embind_register_void ( rawType , name ) { <nl> } <nl> <nl> function __embind_register_bool ( rawType , name , trueValue , falseValue ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> registerType ( rawType , { <nl> name : name , <nl> fromWireType : function ( wt ) { <nl> function __embind_register_bool ( rawType , name , trueValue , falseValue ) { <nl> / / When converting a number from JS to C + + side , the valid range of the number is <nl> / / [ minRange , maxRange ] , inclusive . <nl> function __embind_register_integer ( primitiveType , name , minRange , maxRange ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> if ( maxRange = = = - 1 ) { / / LLVM doesn ' t have signed and unsigned 32 - bit types , so u32 literals come out as ' i32 - 1 ' . Always treat those as max u32 . <nl> maxRange = 4294967295 ; <nl> } <nl> function __embind_register_integer ( primitiveType , name , minRange , maxRange ) { <nl> } <nl> <nl> function __embind_register_float ( rawType , name ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> registerType ( rawType , { <nl> name : name , <nl> fromWireType : function ( value ) { <nl> function __embind_register_float ( rawType , name ) { <nl> } <nl> <nl> function __embind_register_std_string ( rawType , name ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> registerType ( rawType , { <nl> name : name , <nl> fromWireType : function ( value ) { <nl> function __embind_register_std_string ( rawType , name ) { <nl> } <nl> <nl> function __embind_register_std_wstring ( rawType , charSize , name ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> var HEAP , shift ; <nl> if ( charSize = = = 2 ) { <nl> HEAP = HEAPU16 ; <nl> function __embind_register_std_wstring ( rawType , charSize , name ) { <nl> } <nl> <nl> function __embind_register_emval ( rawType , name ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> registerType ( rawType , { <nl> name : name , <nl> fromWireType : function ( handle ) { <nl> function makeInvoker ( name , argCount , argTypes , invoker , fn ) { <nl> <nl> function __embind_register_function ( name , argCount , rawArgTypesAddr , rawInvoker , fn ) { <nl> var argTypes = heap32VectorToArray ( argCount , rawArgTypesAddr ) ; <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> rawInvoker = FUNCTION_TABLE [ rawInvoker ] ; <nl> <nl> exposePublicSymbol ( name , function ( ) { <nl> var tupleRegistrations = { } ; <nl> <nl> function __embind_register_tuple ( rawType , name , rawConstructor , rawDestructor ) { <nl> tupleRegistrations [ rawType ] = { <nl> - name : Pointer_stringify ( name ) , <nl> + name : readLatin1String ( name ) , <nl> rawConstructor : FUNCTION_TABLE [ rawConstructor ] , <nl> rawDestructor : FUNCTION_TABLE [ rawDestructor ] , <nl> elements : [ ] , <nl> function __embind_register_struct ( <nl> rawDestructor <nl> ) { <nl> structRegistrations [ rawType ] = { <nl> - name : Pointer_stringify ( name ) , <nl> + name : readLatin1String ( name ) , <nl> rawConstructor : FUNCTION_TABLE [ rawConstructor ] , <nl> rawDestructor : FUNCTION_TABLE [ rawDestructor ] , <nl> fields : [ ] , <nl> function __embind_register_struct_field ( <nl> setterContext <nl> ) { <nl> structRegistrations [ structType ] . fields . push ( { <nl> - fieldName : Pointer_stringify ( fieldName ) , <nl> + fieldName : readLatin1String ( fieldName ) , <nl> getterReturnType : getterReturnType , <nl> getter : FUNCTION_TABLE [ getter ] , <nl> getterContext : getterContext , <nl> function __embind_register_class ( <nl> name , <nl> rawDestructor <nl> ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> rawDestructor = FUNCTION_TABLE [ rawDestructor ] ; <nl> getActualType = FUNCTION_TABLE [ getActualType ] ; <nl> upcast = FUNCTION_TABLE [ upcast ] ; <nl> function __embind_register_class_function ( <nl> context <nl> ) { <nl> var rawArgTypes = heap32VectorToArray ( argCount , rawArgTypesAddr ) ; <nl> - methodName = Pointer_stringify ( methodName ) ; <nl> + methodName = readLatin1String ( methodName ) ; <nl> rawInvoker = FUNCTION_TABLE [ rawInvoker ] ; <nl> <nl> whenDependentTypesAreResolved ( [ ] , [ rawClassType ] , function ( classType ) { <nl> function __embind_register_class_class_function ( <nl> fn <nl> ) { <nl> var rawArgTypes = heap32VectorToArray ( argCount , rawArgTypesAddr ) ; <nl> - methodName = Pointer_stringify ( methodName ) ; <nl> + methodName = readLatin1String ( methodName ) ; <nl> rawInvoker = FUNCTION_TABLE [ rawInvoker ] ; <nl> whenDependentTypesAreResolved ( [ ] , [ rawClassType ] , function ( classType ) { <nl> classType = classType [ 0 ] ; <nl> function __embind_register_class_property ( <nl> setter , <nl> setterContext <nl> ) { <nl> - fieldName = Pointer_stringify ( fieldName ) ; <nl> + fieldName = readLatin1String ( fieldName ) ; <nl> getter = FUNCTION_TABLE [ getter ] ; <nl> setter = FUNCTION_TABLE [ setter ] ; <nl> <nl> function __embind_register_smart_ptr ( <nl> rawShare , <nl> rawDestructor <nl> ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> rawGetPointee = FUNCTION_TABLE [ rawGetPointee ] ; <nl> rawConstructor = FUNCTION_TABLE [ rawConstructor ] ; <nl> rawShare = FUNCTION_TABLE [ rawShare ] ; <nl> function __embind_register_enum ( <nl> rawType , <nl> name <nl> ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> <nl> function constructor ( ) { <nl> } <nl> function __embind_register_enum_value ( <nl> enumValue <nl> ) { <nl> var enumType = requireRegisteredType ( rawEnumType , ' enum ' ) ; <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> <nl> var Enum = enumType . constructor ; <nl> <nl> function __embind_register_interface ( <nl> rawConstructor , <nl> rawDestructor <nl> ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> rawConstructor = FUNCTION_TABLE [ rawConstructor ] ; <nl> rawDestructor = FUNCTION_TABLE [ rawDestructor ] ; <nl> <nl> function __embind_register_interface ( <nl> } <nl> <nl> function __embind_register_constant ( name , type , value ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> whenDependentTypesAreResolved ( [ ] , [ type ] , function ( type ) { <nl> type = type [ 0 ] ; <nl> Module [ name ] = type . fromWireType ( value ) ; <nl> mmm a / src / embind / emval . js <nl> ppp b / src / embind / emval . js <nl> <nl> / * global Module * / <nl> / * global HEAP32 * / <nl> - / * global Pointer_stringify , writeStringToMemory * / <nl> + / * global readLatin1String , writeStringToMemory * / <nl> / * global requireRegisteredType * / <nl> <nl> var _emval_handle_array = [ ] ; <nl> function __emval_null ( ) { <nl> } <nl> <nl> function __emval_new_cstring ( v ) { <nl> - return __emval_register ( Pointer_stringify ( v ) ) ; <nl> + return __emval_register ( readLatin1String ( v ) ) ; <nl> } <nl> <nl> function __emval_take_value ( type , v ) { <nl> function __emval_new ( handle , argCount , argTypes ) { <nl> var global = ( function ( ) { return Function ; } ) ( ) ( ' return this ' ) ( ) ; <nl> <nl> function __emval_get_global ( name ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> return __emval_register ( global [ name ] ) ; <nl> } <nl> <nl> function __emval_get_module_property ( name ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> return __emval_register ( Module [ name ] ) ; <nl> } <nl> <nl> function __emval_call ( handle , argCount , argTypes ) { <nl> } <nl> <nl> function __emval_call_method ( handle , name , argCount , argTypes ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> <nl> var args = parseParameters ( <nl> argCount , <nl> function __emval_call_method ( handle , name , argCount , argTypes ) { <nl> } <nl> <nl> function __emval_call_void_method ( handle , name , argCount , argTypes ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> <nl> var args = parseParameters ( <nl> argCount , <nl> function __emval_call_void_method ( handle , name , argCount , argTypes ) { <nl> } <nl> <nl> function __emval_has_function ( handle , name ) { <nl> - name = Pointer_stringify ( name ) ; <nl> + name = readLatin1String ( name ) ; <nl> return _emval_handle_array [ handle ] . value [ name ] instanceof Function ; <nl> } <nl>
|
Replace Pointer_stringify ( ) with something simpler and faster . The " String . fromCharCode " can be a performance bottleneck if called a lot , like 50 , 000 times per second . Depending on application it can be necessary . A better solution is not converting from HEAP at all , but it requires more work .
|
emscripten-core/emscripten
|
a9539326b89fec17dfe7fb4315eb5d256a1afcf6
|
2013-04-18T17:08:12Z
|
mmm a / js / node / VERSIONS <nl> ppp b / js / node / VERSIONS <nl> assert : 0 . 11 . 0 <nl> buffer : 0 . 11 . 0 ( SlowBuffer ) <nl> child_process : not supported <nl> events : 0 . 10 . 25 <nl> + http : not supported <nl> + https : not supported <nl> net : compatibility <nl> path : 0 . 11 . 0 ( process ) <nl> punycode : 0 . 11 . 0 <nl> new file mode 100644 <nl> index 00000000000 . . e7db8a921f6 <nl> mmm / dev / null <nl> ppp b / js / node / http . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + / / not supported <nl> new file mode 100644 <nl> index 00000000000 . . e7db8a921f6 <nl> mmm / dev / null <nl> ppp b / js / node / https . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + / / not supported <nl>
|
Added http , https stubs
|
arangodb/arangodb
|
ca793a3f5daec986670598345f4818b8926b233b
|
2015-09-24T11:46:12Z
|
mmm a / js / apps / system / _admin / aardvark / APP / frontend / js / graphViewer / graph / zoomManager . js <nl> ppp b / js / apps / system / _admin / aardvark / APP / frontend / js / graphViewer / graph / zoomManager . js <nl> function ZoomManager ( width , height , svg , g , nodeShaper , edgeShaper , config , limi <nl> <nl> } , <nl> mouseMoveHandle = function ( ) { <nl> + / * <nl> var focus = d3 . mouse ( this ) ; <nl> focus [ 0 ] - = currentTranslation [ 0 ] ; <nl> focus [ 0 ] / = currentZoom ; <nl> function ZoomManager ( width , height , svg , g , nodeShaper , edgeShaper , config , limi <nl> focus [ 1 ] / = currentZoom ; <nl> fisheye . focus ( focus ) ; <nl> nodeShaper . updateNodes ( ) ; <nl> - edgeShaper . updateEdges ( ) ; <nl> + edgeShaper . updateEdges ( ) ; * / <nl> } ; <nl> <nl> <nl>
|
gv disabled zoom
|
arangodb/arangodb
|
d56d09c5fb36869e6a9024491778e40d6d00f03a
|
2015-12-15T14:47:33Z
|
mmm a / xbmc / FileSystem / CMythSession . cpp <nl> ppp b / xbmc / FileSystem / CMythSession . cpp <nl> CStdString CCMythSession : : GetValue ( char * str ) <nl> return result ; <nl> } <nl> <nl> + CDateTime CCMythSession : : GetLocalTime ( time_t time ) <nl> + { <nl> + / / TODO : Should this method or something similar be added to one of the * Utils classes ? <nl> + CDateTime result ; <nl> + <nl> + tm * local = localtime ( & time ) ; / / Conversion to local time <nl> + / * <nl> + * Microsoft implementation of localtime returns NULL if on or before epoch . <nl> + * http : / / msdn . microsoft . com / en - us / library / bf12f0hc ( VS . 80 ) . aspx <nl> + * / <nl> + if ( local ) <nl> + result = * local ; <nl> + else <nl> + result = time ; / / Use the original time as close enough . <nl> + <nl> + return result ; <nl> + } <nl> + <nl> bool CCMythSession : : UpdateItem ( CFileItem & item , cmyth_proginfo_t info ) <nl> { <nl> if ( ! info ) <nl> mmm a / xbmc / FileSystem / CMythSession . h <nl> ppp b / xbmc / FileSystem / CMythSession . h <nl> class CCMythSession <nl> <nl> CDateTime GetValue ( cmyth_timestamp_t t ) ; <nl> CStdString GetValue ( char * str ) ; <nl> + CDateTime GetLocalTime ( time_t time ) ; <nl> + <nl> private : <nl> CCMythSession ( const CURL & url ) ; <nl> ~ CCMythSession ( ) ; <nl>
|
Added helper method for getting the local time correctly .
|
xbmc/xbmc
|
bcf97edd1817f3622423f155c31aaff6d6fd6f2a
|
2010-02-27T21:48:48Z
|
mmm a / include / envoy / grpc / BUILD <nl> ppp b / include / envoy / grpc / BUILD <nl> envoy_cc_library ( <nl> ] , <nl> ) <nl> <nl> - envoy_cc_library ( <nl> - name = " rpc_channel_interface " , <nl> - hdrs = [ " rpc_channel . h " ] , <nl> - deps = [ <nl> - " / / include / envoy / common : optional " , <nl> - " / / include / envoy / http : header_map_interface " , <nl> - " / / include / envoy / tracing : http_tracer_interface " , <nl> - " / / source / common / protobuf " , <nl> - ] , <nl> - ) <nl> - <nl> envoy_cc_library ( <nl> name = " status " , <nl> hdrs = [ " status . h " ] , <nl> deleted file mode 100644 <nl> index 62920a61d76 . . 00000000000 <nl> mmm a / include / envoy / grpc / rpc_channel . h <nl> ppp / dev / null <nl> <nl> - # pragma once <nl> - <nl> - # include < chrono > <nl> - # include < cstdint > <nl> - # include < memory > <nl> - # include < string > <nl> - <nl> - # include " envoy / common / optional . h " <nl> - # include " envoy / common / pure . h " <nl> - # include " envoy / http / header_map . h " <nl> - <nl> - # include " common / protobuf / protobuf . h " <nl> - <nl> - namespace Envoy { <nl> - namespace Grpc { <nl> - <nl> - / * * <nl> - * Callbacks for an individual grpc request . <nl> - * / <nl> - class RpcChannelCallbacks { <nl> - public : <nl> - virtual ~ RpcChannelCallbacks ( ) { } <nl> - <nl> - / * * <nl> - * Called before the channel dispatches an HTTP / 2 request . This can be used to customize the <nl> - * transport headers for the RPC . <nl> - * / <nl> - virtual void onPreRequestCustomizeHeaders ( Http : : HeaderMap & headers ) PURE ; <nl> - <nl> - / * * <nl> - * Called when the request has succeeded and the response object is populated . <nl> - * / <nl> - virtual void onSuccess ( ) PURE ; <nl> - <nl> - / * * <nl> - * Called when the request has failed . The response object has not been populated . <nl> - * @ param grpc_status supplies the grpc_status for the error , if available . <nl> - * @ param message supplies additional error information if available . <nl> - * / <nl> - virtual void onFailure ( const Optional < uint64_t > & grpc_status , const std : : string & message ) PURE ; <nl> - } ; <nl> - <nl> - / * * <nl> - * A single active grpc request arbiter . This interface derives from <nl> - * Protobuf : : RpcChannel . When mocking , CallMethod ( ) can be overriden to accept <nl> - * the response message and the mock constructor can accept a RequestCallbacks <nl> - * object . An RpcChannel should be passed to the constructor of an RPC stub <nl> - * generated via protoc using the " option cc_generic_services = true ; " option . <nl> - * It can be used for multiple service calls , but not concurrently . <nl> - * DEPRECATED : See https : / / github . com / envoyproxy / envoy / issues / 1102 <nl> - * / <nl> - class RpcChannel : public Protobuf : : RpcChannel { <nl> - public : <nl> - virtual ~ RpcChannel ( ) { } <nl> - <nl> - / * * <nl> - * Cancel an inflight RPC . The Request can be used again to make another call if desired . <nl> - * / <nl> - virtual void cancel ( ) PURE ; <nl> - } ; <nl> - <nl> - typedef std : : unique_ptr < RpcChannel > RpcChannelPtr ; <nl> - <nl> - / * * <nl> - * Interface for creating new RPC channels . <nl> - * / <nl> - class RpcChannelFactory { <nl> - public : <nl> - virtual ~ RpcChannelFactory ( ) { } <nl> - <nl> - / * * <nl> - * Create a new RPC channel given a set of callbacks . <nl> - * / <nl> - virtual RpcChannelPtr create ( RpcChannelCallbacks & callbacks , <nl> - const Optional < std : : chrono : : milliseconds > & timeout ) PURE ; <nl> - } ; <nl> - <nl> - } / / namespace Grpc <nl> - } / / namespace Envoy <nl> mmm a / source / common / grpc / BUILD <nl> ppp b / source / common / grpc / BUILD <nl> envoy_cc_library ( <nl> ] , <nl> ) <nl> <nl> - envoy_cc_library ( <nl> - name = " rpc_channel_lib " , <nl> - srcs = [ " rpc_channel_impl . cc " ] , <nl> - hdrs = [ " rpc_channel_impl . h " ] , <nl> - deps = [ <nl> - " : common_lib " , <nl> - " / / include / envoy / grpc : rpc_channel_interface " , <nl> - " / / include / envoy / upstream : cluster_manager_interface " , <nl> - " / / source / common / buffer : zero_copy_input_stream_lib " , <nl> - " / / source / common / common : assert_lib " , <nl> - " / / source / common / common : enum_to_int " , <nl> - " / / source / common / common : utility_lib " , <nl> - " / / source / common / http : headers_lib " , <nl> - " / / source / common / http : message_lib " , <nl> - " / / source / common / http : utility_lib " , <nl> - " / / source / common / protobuf " , <nl> - ] , <nl> - ) <nl> - <nl> envoy_cc_library ( <nl> name = " transcoder_input_stream_lib " , <nl> srcs = [ " transcoder_input_stream_impl . cc " ] , <nl> deleted file mode 100644 <nl> index e6efd5a511e . . 00000000000 <nl> mmm a / source / common / grpc / rpc_channel_impl . cc <nl> ppp / dev / null <nl> <nl> - # include " common / grpc / rpc_channel_impl . h " <nl> - <nl> - # include < cstdint > <nl> - # include < string > <nl> - <nl> - # include " common / buffer / zero_copy_input_stream_impl . h " <nl> - # include " common / common / enum_to_int . h " <nl> - # include " common / common / utility . h " <nl> - # include " common / grpc / common . h " <nl> - # include " common / http / headers . h " <nl> - # include " common / http / message_impl . h " <nl> - # include " common / http / utility . h " <nl> - # include " common / protobuf / protobuf . h " <nl> - <nl> - namespace Envoy { <nl> - namespace Grpc { <nl> - <nl> - void RpcChannelImpl : : cancel ( ) { <nl> - http_request_ - > cancel ( ) ; <nl> - onComplete ( ) ; <nl> - } <nl> - <nl> - void RpcChannelImpl : : CallMethod ( const Protobuf : : MethodDescriptor * method , Protobuf : : RpcController * , <nl> - const Protobuf : : Message * grpc_request , <nl> - Protobuf : : Message * grpc_response , Protobuf : : Closure * ) { <nl> - ASSERT ( ! http_request_ & & ! grpc_method_ & & ! grpc_response_ ) ; <nl> - grpc_method_ = method ; <nl> - grpc_response_ = grpc_response ; <nl> - <nl> - / / For proto3 messages this should always return true . <nl> - ASSERT ( grpc_request - > IsInitialized ( ) ) ; <nl> - <nl> - / / This should be caught in configuration , and a request will fail normally anyway , but assert <nl> - / / here for clarity . <nl> - ASSERT ( cluster_ - > features ( ) & Upstream : : ClusterInfo : : Features : : HTTP2 ) ; <nl> - <nl> - Http : : MessagePtr message = <nl> - Common : : prepareHeaders ( cluster_ - > name ( ) , method - > service ( ) - > full_name ( ) , method - > name ( ) ) ; <nl> - message - > body ( ) = Common : : serializeBody ( * grpc_request ) ; <nl> - <nl> - callbacks_ . onPreRequestCustomizeHeaders ( message - > headers ( ) ) ; <nl> - http_request_ = <nl> - cm_ . httpAsyncClientForCluster ( cluster_ - > name ( ) ) . send ( std : : move ( message ) , * this , timeout_ ) ; <nl> - } <nl> - <nl> - void RpcChannelImpl : : incStat ( bool success ) { <nl> - Common : : chargeStat ( * cluster_ , grpc_method_ - > service ( ) - > full_name ( ) , grpc_method_ - > name ( ) , <nl> - success ) ; <nl> - } <nl> - <nl> - void RpcChannelImpl : : onSuccess ( Http : : MessagePtr & & http_response ) { <nl> - try { <nl> - Common : : validateResponse ( * http_response ) ; <nl> - <nl> - / / A gRPC response contains a 5 byte header . Currently we only support unary responses so we <nl> - / / ignore the header . @ see serializeBody ( ) . <nl> - if ( ! http_response - > body ( ) | | ( http_response - > body ( ) - > length ( ) < 5 ) ) { <nl> - throw Exception ( Optional < uint64_t > ( ) , " bad serialized body " ) ; <nl> - } <nl> - <nl> - http_response - > body ( ) - > drain ( 5 ) ; <nl> - Buffer : : ZeroCopyInputStreamImpl stream ( std : : move ( http_response - > body ( ) ) ) ; <nl> - if ( ! grpc_response_ - > ParseFromZeroCopyStream ( & stream ) ) { <nl> - throw Exception ( Optional < uint64_t > ( ) , " bad serialized body " ) ; <nl> - } <nl> - <nl> - callbacks_ . onSuccess ( ) ; <nl> - incStat ( true ) ; <nl> - onComplete ( ) ; <nl> - } catch ( const Exception & e ) { <nl> - onFailureWorker ( e . grpc_status_ , e . what ( ) ) ; <nl> - } <nl> - } <nl> - <nl> - void RpcChannelImpl : : onFailureWorker ( const Optional < uint64_t > & grpc_status , <nl> - const std : : string & message ) { <nl> - callbacks_ . onFailure ( grpc_status , message ) ; <nl> - incStat ( false ) ; <nl> - onComplete ( ) ; <nl> - } <nl> - <nl> - void RpcChannelImpl : : onFailure ( Http : : AsyncClient : : FailureReason reason ) { <nl> - switch ( reason ) { <nl> - case Http : : AsyncClient : : FailureReason : : Reset : <nl> - onFailureWorker ( Optional < uint64_t > ( ) , " stream reset " ) ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - void RpcChannelImpl : : onComplete ( ) { <nl> - http_request_ = nullptr ; <nl> - grpc_method_ = nullptr ; <nl> - grpc_response_ = nullptr ; <nl> - } <nl> - <nl> - } / / namespace Grpc <nl> - } / / namespace Envoy <nl> deleted file mode 100644 <nl> index 865d16a14dc . . 00000000000 <nl> mmm a / source / common / grpc / rpc_channel_impl . h <nl> ppp / dev / null <nl> <nl> - # pragma once <nl> - <nl> - # include < chrono > <nl> - # include < cstdint > <nl> - # include < string > <nl> - <nl> - # include " envoy / grpc / rpc_channel . h " <nl> - # include " envoy / upstream / cluster_manager . h " <nl> - <nl> - # include " common / common / assert . h " <nl> - # include " common / protobuf / protobuf . h " <nl> - <nl> - namespace Envoy { <nl> - namespace Grpc { <nl> - <nl> - / * * <nl> - * Concrete implementation of RpcChannel . This is not the most optimal interface but it ' s the <nl> - * best thing that works with the protoc generated generic rpc code . A code generator plugin <nl> - * would be optimal but that is total overkill . <nl> - * <nl> - * How to use : <nl> - * 1 ) Add " option cc_generic_services = true ; " to proto definition . <nl> - * 2 ) Use the generated " Stub " service wrapper and pass an RpcChannelImpl to the constructor . <nl> - * 3 ) The service wrapper can be used to make a call for a single RPC . It can then be reused <nl> - * to make another call . If parallel calls need to be made , higher level interfaces will be <nl> - * needed . <nl> - * 4 ) Inflight RPCs can be safely cancelled using cancel ( ) . <nl> - * 5 ) See GrpcRequestImplTest for an example . <nl> - * DEPRECATED : See https : / / github . com / envoyproxy / envoy / issues / 1102 <nl> - * / <nl> - class RpcChannelImpl : public RpcChannel , public Http : : AsyncClient : : Callbacks { <nl> - public : <nl> - RpcChannelImpl ( Upstream : : ClusterManager & cm , const std : : string & cluster , <nl> - RpcChannelCallbacks & callbacks , const Optional < std : : chrono : : milliseconds > & timeout ) <nl> - : cm_ ( cm ) , cluster_ ( cm . get ( cluster ) - > info ( ) ) , callbacks_ ( callbacks ) , timeout_ ( timeout ) { } <nl> - <nl> - ~ RpcChannelImpl ( ) { ASSERT ( ! http_request_ & & ! grpc_method_ & & ! grpc_response_ ) ; } <nl> - <nl> - static Buffer : : InstancePtr serializeBody ( const Protobuf : : Message & message ) ; <nl> - <nl> - / / Grpc : : RpcChannel <nl> - void cancel ( ) override ; <nl> - <nl> - / / Protobuf : : RpcChannel <nl> - void CallMethod ( const Protobuf : : MethodDescriptor * method , Protobuf : : RpcController * controller , <nl> - const Protobuf : : Message * grpc_request , Protobuf : : Message * grpc_response , <nl> - Protobuf : : Closure * done_callback ) override ; <nl> - <nl> - private : <nl> - void incStat ( bool success ) ; <nl> - void onComplete ( ) ; <nl> - void onFailureWorker ( const Optional < uint64_t > & grpc_status , const std : : string & message ) ; <nl> - void onSuccessWorker ( Http : : Message & http_response ) ; <nl> - <nl> - / / Http : : AsyncClient : : Callbacks <nl> - void onSuccess ( Http : : MessagePtr & & http_response ) override ; <nl> - void onFailure ( Http : : AsyncClient : : FailureReason reason ) override ; <nl> - <nl> - Upstream : : ClusterManager & cm_ ; <nl> - Upstream : : ClusterInfoConstSharedPtr cluster_ ; <nl> - Http : : AsyncClient : : Request * http_request_ { } ; <nl> - const Protobuf : : MethodDescriptor * grpc_method_ { } ; <nl> - Protobuf : : Message * grpc_response_ { } ; <nl> - RpcChannelCallbacks & callbacks_ ; <nl> - Optional < std : : chrono : : milliseconds > timeout_ ; <nl> - } ; <nl> - <nl> - } / / namespace Grpc <nl> - } / / namespace Envoy <nl> mmm a / test / common / grpc / BUILD <nl> ppp b / test / common / grpc / BUILD <nl> envoy_cc_test ( <nl> ] , <nl> ) <nl> <nl> - envoy_cc_test ( <nl> - name = " rpc_channel_impl_test " , <nl> - srcs = [ " rpc_channel_impl_test . cc " ] , <nl> - deps = [ <nl> - " / / source / common / grpc : common_lib " , <nl> - " / / source / common / grpc : rpc_channel_lib " , <nl> - " / / source / common / http : message_lib " , <nl> - " / / test / mocks / grpc : grpc_mocks " , <nl> - " / / test / mocks / upstream : upstream_mocks " , <nl> - " / / test / proto : helloworld_proto " , <nl> - " / / test / test_common : utility_lib " , <nl> - ] , <nl> - ) <nl> - <nl> envoy_cc_test ( <nl> name = " transcoder_input_stream_test " , <nl> srcs = [ " transcoder_input_stream_test . cc " ] , <nl> deleted file mode 100644 <nl> index 496a6a58a76 . . 00000000000 <nl> mmm a / test / common / grpc / rpc_channel_impl_test . cc <nl> ppp / dev / null <nl> <nl> - # include < chrono > <nl> - # include < cstdint > <nl> - # include < string > <nl> - <nl> - # include " common / grpc / common . h " <nl> - # include " common / grpc / rpc_channel_impl . h " <nl> - # include " common / http / message_impl . h " <nl> - <nl> - # include " test / mocks / grpc / mocks . h " <nl> - # include " test / mocks / upstream / mocks . h " <nl> - # include " test / proto / helloworld . pb . h " <nl> - # include " test / test_common / printers . h " <nl> - # include " test / test_common / utility . h " <nl> - <nl> - # include " gmock / gmock . h " <nl> - # include " gtest / gtest . h " <nl> - <nl> - using testing : : Invoke ; <nl> - using testing : : Return ; <nl> - using testing : : _ ; <nl> - <nl> - namespace Envoy { <nl> - namespace Grpc { <nl> - <nl> - class GrpcRequestImplTest : public testing : : Test { <nl> - public : <nl> - GrpcRequestImplTest ( ) : http_async_client_request_ ( & cm_ . async_client_ ) { <nl> - ON_CALL ( * cm_ . thread_local_cluster_ . cluster_ . info_ , features ( ) ) <nl> - . WillByDefault ( Return ( Upstream : : ClusterInfo : : Features : : HTTP2 ) ) ; <nl> - } <nl> - <nl> - void expectNormalRequest ( <nl> - const Optional < std : : chrono : : milliseconds > timeout = Optional < std : : chrono : : milliseconds > ( ) ) { <nl> - EXPECT_CALL ( cm_ , httpAsyncClientForCluster ( " fake_cluster " ) ) <nl> - . WillOnce ( ReturnRef ( cm_ . async_client_ ) ) ; <nl> - EXPECT_CALL ( cm_ . async_client_ , send_ ( _ , _ , timeout ) ) <nl> - . WillOnce ( Invoke ( [ & ] ( Http : : MessagePtr & request , Http : : AsyncClient : : Callbacks & callbacks , <nl> - Optional < std : : chrono : : milliseconds > ) - > Http : : AsyncClient : : Request * { <nl> - http_request_ = std : : move ( request ) ; <nl> - http_callbacks_ = & callbacks ; <nl> - return & http_async_client_request_ ; <nl> - } ) ) ; <nl> - } <nl> - <nl> - NiceMock < Upstream : : MockClusterManager > cm_ ; <nl> - MockRpcChannelCallbacks grpc_callbacks_ ; <nl> - RpcChannelImpl grpc_request_ { cm_ , " fake_cluster " , grpc_callbacks_ , <nl> - Optional < std : : chrono : : milliseconds > ( ) } ; <nl> - helloworld : : Greeter : : Stub service_ { & grpc_request_ } ; <nl> - Http : : MockAsyncClientRequest http_async_client_request_ ; <nl> - Http : : MessagePtr http_request_ ; <nl> - Http : : AsyncClient : : Callbacks * http_callbacks_ { } ; <nl> - } ; <nl> - <nl> - TEST_F ( GrpcRequestImplTest , NoError ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - Http : : LowerCaseString header_key ( " foo " ) ; <nl> - std : : string header_value ( " bar " ) ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) <nl> - . WillOnce ( Invoke ( [ & ] ( Http : : HeaderMap & headers ) - > void { <nl> - headers . addReference ( header_key , header_value ) ; <nl> - } ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - Http : : TestHeaderMapImpl expected_request_headers { { " : method " , " POST " } , <nl> - { " : path " , " / helloworld . Greeter / SayHello " } , <nl> - { " : authority " , " fake_cluster " } , <nl> - { " content - type " , " application / grpc " } , <nl> - { " te " , " trailers " } , <nl> - { " foo " , " bar " } } ; <nl> - <nl> - EXPECT_THAT ( http_request_ - > headers ( ) , HeaderMapEqualRef ( & expected_request_headers ) ) ; <nl> - <nl> - Http : : MessagePtr response_http_message ( new Http : : ResponseMessageImpl ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " : status " , " 200 " } } } ) ) ; <nl> - helloworld : : HelloReply inner_response ; <nl> - inner_response . set_message ( " hello a name " ) ; <nl> - response_http_message - > body ( ) = Common : : serializeBody ( inner_response ) ; <nl> - response_http_message - > trailers ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " grpc - status " , " 0 " } } } ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onSuccess ( ) ) ; <nl> - http_callbacks_ - > onSuccess ( std : : move ( response_http_message ) ) ; <nl> - EXPECT_EQ ( response . SerializeAsString ( ) , inner_response . SerializeAsString ( ) ) ; <nl> - EXPECT_EQ ( 1UL , cm_ . thread_local_cluster_ . cluster_ . info_ - > stats_store_ <nl> - . counter ( " grpc . helloworld . Greeter . SayHello . success " ) <nl> - . value ( ) ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , Non200Response ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - Http : : MessagePtr response_http_message ( new Http : : ResponseMessageImpl ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " : status " , " 503 " } } } ) ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onFailure ( Optional < uint64_t > ( ) , " non - 200 response code " ) ) ; <nl> - http_callbacks_ - > onSuccess ( std : : move ( response_http_message ) ) ; <nl> - EXPECT_EQ ( 1UL , cm_ . thread_local_cluster_ . cluster_ . info_ - > stats_store_ <nl> - . counter ( " grpc . helloworld . Greeter . SayHello . failure " ) <nl> - . value ( ) ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , NoResponseTrailers ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - Http : : MessagePtr response_http_message ( new Http : : ResponseMessageImpl ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " : status " , " 200 " } } } ) ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onFailure ( Optional < uint64_t > ( ) , " no response trailers " ) ) ; <nl> - http_callbacks_ - > onSuccess ( std : : move ( response_http_message ) ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , BadGrpcStatusInHeaderOnlyResponse ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - Http : : MessagePtr response_http_message ( new Http : : ResponseMessageImpl ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " : status " , " 200 " } , { " grpc - status " , " foo " } } } ) ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onFailure ( Optional < uint64_t > ( ) , " bad grpc - status header " ) ) ; <nl> - http_callbacks_ - > onSuccess ( std : : move ( response_http_message ) ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , HeaderOnlyFailure ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - Http : : MessagePtr response_http_message ( <nl> - new Http : : ResponseMessageImpl ( Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { <nl> - { " : status " , " 200 " } , { " grpc - status " , " 3 " } , { " grpc - message " , " hello " } } } ) ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onFailure ( Optional < uint64_t > ( 3 ) , " hello " ) ) ; <nl> - http_callbacks_ - > onSuccess ( std : : move ( response_http_message ) ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , BadGrpcStatusInResponse ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - Http : : MessagePtr response_http_message ( new Http : : ResponseMessageImpl ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " : status " , " 200 " } } } ) ) ; <nl> - response_http_message - > trailers ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " grpc - status " , " " } } } ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onFailure ( Optional < uint64_t > ( ) , " bad grpc - status trailer " ) ) ; <nl> - http_callbacks_ - > onSuccess ( std : : move ( response_http_message ) ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , GrpcStatusNonZeroInResponse ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - Http : : MessagePtr response_http_message ( new Http : : ResponseMessageImpl ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " : status " , " 200 " } } } ) ) ; <nl> - response_http_message - > trailers ( Http : : HeaderMapPtr { <nl> - new Http : : TestHeaderMapImpl { { " grpc - status " , " 1 " } , { " grpc - message " , " hello " } } } ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onFailure ( Optional < uint64_t > ( 1 ) , " hello " ) ) ; <nl> - http_callbacks_ - > onSuccess ( std : : move ( response_http_message ) ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , ShortBodyInResponse ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - Http : : MessagePtr response_http_message ( new Http : : ResponseMessageImpl ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " : status " , " 200 " } } } ) ) ; <nl> - response_http_message - > body ( ) . reset ( new Buffer : : OwnedImpl ( " aaa " ) ) ; <nl> - response_http_message - > trailers ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " grpc - status " , " 0 " } } } ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onFailure ( Optional < uint64_t > ( ) , " bad serialized body " ) ) ; <nl> - http_callbacks_ - > onSuccess ( std : : move ( response_http_message ) ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , EmptyBodyInResponse ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - Http : : MessagePtr response_http_message ( new Http : : ResponseMessageImpl ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " : status " , " 200 " } } } ) ) ; <nl> - helloworld : : HelloReply empty_response ; <nl> - response_http_message - > body ( ) = Common : : serializeBody ( empty_response ) ; <nl> - EXPECT_EQ ( response_http_message - > body ( ) - > length ( ) , 5 ) ; <nl> - response_http_message - > trailers ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " grpc - status " , " 0 " } } } ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onSuccess ( ) ) ; <nl> - http_callbacks_ - > onSuccess ( std : : move ( response_http_message ) ) ; <nl> - EXPECT_EQ ( response . SerializeAsString ( ) , empty_response . SerializeAsString ( ) ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , BadMessageInResponse ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - Http : : MessagePtr response_http_message ( new Http : : ResponseMessageImpl ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " : status " , " 200 " } } } ) ) ; <nl> - response_http_message - > body ( ) . reset ( new Buffer : : OwnedImpl ( " aaaaaaaa " ) ) ; <nl> - response_http_message - > trailers ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " grpc - status " , " 0 " } } } ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onFailure ( Optional < uint64_t > ( ) , " bad serialized body " ) ) ; <nl> - http_callbacks_ - > onSuccess ( std : : move ( response_http_message ) ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , HttpAsyncRequestFailure ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onFailure ( Optional < uint64_t > ( ) , " stream reset " ) ) ; <nl> - http_callbacks_ - > onFailure ( Http : : AsyncClient : : FailureReason : : Reset ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , NoHttpAsyncRequest ) { <nl> - EXPECT_CALL ( cm_ , httpAsyncClientForCluster ( " fake_cluster " ) ) <nl> - . WillOnce ( ReturnRef ( cm_ . async_client_ ) ) ; <nl> - EXPECT_CALL ( cm_ . async_client_ , send_ ( _ , _ , _ ) ) <nl> - . WillOnce ( <nl> - Invoke ( [ & ] ( Http : : MessagePtr & , Http : : AsyncClient : : Callbacks & callbacks , <nl> - const Optional < std : : chrono : : milliseconds > & ) - > Http : : AsyncClient : : Request * { <nl> - callbacks . onSuccess ( Http : : MessagePtr { new Http : : ResponseMessageImpl ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " : status " , " 503 " } } } ) } ) ; <nl> - return nullptr ; <nl> - } ) ) ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onFailure ( Optional < uint64_t > ( ) , " non - 200 response code " ) ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , Cancel ) { <nl> - expectNormalRequest ( ) ; <nl> - <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_ . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - EXPECT_CALL ( http_async_client_request_ , cancel ( ) ) ; <nl> - grpc_request_ . cancel ( ) ; <nl> - } <nl> - <nl> - TEST_F ( GrpcRequestImplTest , RequestTimeoutSet ) { <nl> - const Optional < std : : chrono : : milliseconds > timeout ( std : : chrono : : milliseconds ( 100 ) ) ; <nl> - RpcChannelImpl grpc_request_timeout { cm_ , " fake_cluster " , grpc_callbacks_ , timeout } ; <nl> - helloworld : : Greeter : : Stub service_timeout { & grpc_request_timeout } ; <nl> - expectNormalRequest ( timeout ) ; <nl> - helloworld : : HelloRequest request ; <nl> - request . set_name ( " a name " ) ; <nl> - helloworld : : HelloReply response ; <nl> - EXPECT_CALL ( grpc_callbacks_ , onPreRequestCustomizeHeaders ( _ ) ) ; <nl> - service_timeout . SayHello ( nullptr , & request , & response , nullptr ) ; <nl> - <nl> - Http : : MessagePtr response_http_message ( new Http : : ResponseMessageImpl ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " : status " , " 200 " } } } ) ) ; <nl> - helloworld : : HelloReply inner_response ; <nl> - inner_response . set_message ( " hello a name " ) ; <nl> - <nl> - response_http_message - > body ( ) = Common : : serializeBody ( inner_response ) ; <nl> - response_http_message - > trailers ( <nl> - Http : : HeaderMapPtr { new Http : : TestHeaderMapImpl { { " grpc - status " , " 0 " } } } ) ; <nl> - <nl> - EXPECT_CALL ( grpc_callbacks_ , onSuccess ( ) ) ; <nl> - http_callbacks_ - > onSuccess ( std : : move ( response_http_message ) ) ; <nl> - } <nl> - <nl> - } / / namespace Grpc <nl> - } / / namespace Envoy <nl> mmm a / test / mocks / grpc / BUILD <nl> ppp b / test / mocks / grpc / BUILD <nl> envoy_cc_mock ( <nl> hdrs = [ " mocks . h " ] , <nl> deps = [ <nl> " / / include / envoy / grpc : async_client_interface " , <nl> - " / / include / envoy / grpc : rpc_channel_interface " , <nl> ] , <nl> ) <nl> mmm a / test / mocks / grpc / mocks . cc <nl> ppp b / test / mocks / grpc / mocks . cc <nl> namespace Grpc { <nl> MockAsyncRequest : : MockAsyncRequest ( ) { } <nl> MockAsyncRequest : : ~ MockAsyncRequest ( ) { } <nl> <nl> - MockRpcChannelCallbacks : : MockRpcChannelCallbacks ( ) { } <nl> - MockRpcChannelCallbacks : : ~ MockRpcChannelCallbacks ( ) { } <nl> - <nl> - MockRpcChannel : : MockRpcChannel ( ) { } <nl> - MockRpcChannel : : ~ MockRpcChannel ( ) { } <nl> - <nl> } / / namespace Grpc <nl> } / / namespace Envoy <nl> mmm a / test / mocks / grpc / mocks . h <nl> ppp b / test / mocks / grpc / mocks . h <nl> <nl> # include < string > <nl> <nl> # include " envoy / grpc / async_client . h " <nl> - # include " envoy / grpc / rpc_channel . h " <nl> <nl> # include " gmock / gmock . h " <nl> <nl> class MockAsyncClient : public AsyncClient < RequestType , ResponseType > { <nl> AsyncStreamCallbacks < ResponseType > & callbacks ) ) ; <nl> } ; <nl> <nl> - class MockRpcChannelCallbacks : public RpcChannelCallbacks { <nl> - public : <nl> - MockRpcChannelCallbacks ( ) ; <nl> - ~ MockRpcChannelCallbacks ( ) ; <nl> - <nl> - MOCK_METHOD1 ( onPreRequestCustomizeHeaders , void ( Http : : HeaderMap & headers ) ) ; <nl> - MOCK_METHOD0 ( onSuccess , void ( ) ) ; <nl> - MOCK_METHOD2 ( onFailure , void ( const Optional < uint64_t > & grpc_status , const std : : string & message ) ) ; <nl> - } ; <nl> - <nl> - class MockRpcChannel : public RpcChannel { <nl> - public : <nl> - MockRpcChannel ( ) ; <nl> - ~ MockRpcChannel ( ) ; <nl> - <nl> - MOCK_METHOD0 ( cancel , void ( ) ) ; <nl> - MOCK_METHOD5 ( CallMethod , <nl> - void ( const Protobuf : : MethodDescriptor * method , Protobuf : : RpcController * controller , <nl> - const Protobuf : : Message * request , Protobuf : : Message * response , <nl> - Protobuf : : Closure * done ) ) ; <nl> - } ; <nl> - <nl> } / / namespace Grpc <nl> } / / namespace Envoy <nl>
|
cleanup : remove gRPC rpc channel ( )
|
envoyproxy/envoy
|
368638f93900c0fa96e5c853236e0051832f47e8
|
2017-10-19T22:46:14Z
|
mmm a / xbmc / android / jni / Context . h <nl> ppp b / xbmc / android / jni / Context . h <nl> <nl> # include " JNIBase . h " <nl> # include " BroadcastReceiver . h " <nl> <nl> - class ANativeActivity ; <nl> + struct ANativeActivity ; <nl> class CJNIIntent ; <nl> class CJNIPackageManager ; <nl> class CJNIBroadcastReceiver ; <nl>
|
Again , ANativeActivity is a struct , not a class
|
xbmc/xbmc
|
0195a725cad6d4f2976ed1ae9dcf85b86d14dc7b
|
2013-09-19T03:51:44Z
|
mmm a / src / library_glfw . js <nl> ppp b / src / library_glfw . js <nl> <nl> * <nl> * Authors : <nl> * - Éloi Rivard < eloi . rivard @ gmail . com > <nl> + * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> var LibraryGLFW = { <nl> var LibraryGLFW = { <nl> } , <nl> <nl> / * Video mode functions * / <nl> - glfwGetVideoModes : function ( list , maxcount ) { throw " glfwGetVideoModes is not implemented yet . " ; } , <nl> + glfwGetVideoModes : function ( list , maxcount ) { throw " glfwGetVideoModes is not implemented . " ; } , <nl> <nl> - glfwGetDesktopMode : function ( mode ) { throw " glfwGetDesktopMode is not implemented yet . " ; } , <nl> + glfwGetDesktopMode : function ( mode ) { throw " glfwGetDesktopMode is not implemented . " ; } , <nl> <nl> / * Input handling * / <nl> glfwPollEvents : function ( ) { } , <nl> <nl> - glfwWaitEvents : function ( ) { throw " glfwWaitEvents is not implemented yet . " ; } , <nl> + glfwWaitEvents : function ( ) { } , <nl> <nl> glfwGetKey : function ( key ) { <nl> return GLFW . keys [ key ] ; <nl> var LibraryGLFW = { <nl> setValue ( ypos , GLFW . lastY , ' i32 ' ) ; <nl> } , <nl> <nl> - glfwSetMousePos : function ( xpos , ypos ) { throw " glfwSetMousePos is not implemented yet . " ; } , <nl> + / / I believe it is not possible to move the mouse with javascript <nl> + glfwSetMousePos : function ( xpos , ypos ) { } , <nl> <nl> glfwGetMouseWheel : function ( ) { <nl> return GLFW . wheelPos ; <nl> var LibraryGLFW = { <nl> } , <nl> <nl> / * Joystick input * / <nl> - glfwGetJoystickParam : function ( joy , param ) { throw " glfwGetJoystickParam is not implemented yet . " ; } , <nl> + glfwGetJoystickParam : function ( joy , param ) { throw " glfwGetJoystickParam is not implemented . " ; } , <nl> <nl> - glfwGetJoystickPos : function ( joy , pos , numaxes ) { throw " glfwGetJoystickPos is not implemented yet . " ; } , <nl> + glfwGetJoystickPos : function ( joy , pos , numaxes ) { throw " glfwGetJoystickPos is not implemented . " ; } , <nl> <nl> - glfwGetJoystickButtons : function ( joy , buttons , numbuttons ) { throw " glfwGetJoystickButtons is not implemented yet . " ; } , <nl> + glfwGetJoystickButtons : function ( joy , buttons , numbuttons ) { throw " glfwGetJoystickButtons is not implemented . " ; } , <nl> <nl> / * Time * / <nl> glfwGetTime : function ( ) { <nl> var LibraryGLFW = { <nl> return 0 ; <nl> } , <nl> <nl> - glfwDestroyThread : function ( ID ) { throw " glfwDestroyThread is not implemented yet . " ; } , <nl> + glfwDestroyThread : function ( ID ) { } , <nl> <nl> glfwWaitThread : function ( ID , waitmode ) { } , <nl> <nl> var LibraryGLFW = { <nl> return 0 ; <nl> } , <nl> <nl> - glfwCreateMutex : function ( ) { throw " glfwCreateMutex is not implemented yet . " ; } , <nl> + glfwCreateMutex : function ( ) { throw " glfwCreateMutex is not implemented . " ; } , <nl> <nl> - glfwDestroyMutex : function ( mutex ) { throw " glfwDestroyMutex is not implemented yet . " ; } , <nl> + glfwDestroyMutex : function ( mutex ) { throw " glfwDestroyMutex is not implemented . " ; } , <nl> <nl> - glfwLockMutex : function ( mutex ) { throw " glfwLockMutex is not implemented yet . " ; } , <nl> + glfwLockMutex : function ( mutex ) { throw " glfwLockMutex is not implemented . " ; } , <nl> <nl> - glfwUnlockMutex : function ( mutex ) { throw " glfwUnlockMutex is not implemented yet . " ; } , <nl> + glfwUnlockMutex : function ( mutex ) { throw " glfwUnlockMutex is not implemented . " ; } , <nl> <nl> - glfwCreateCond : function ( ) { throw " glfwCreateCond is not implemented yet . " ; } , <nl> + glfwCreateCond : function ( ) { throw " glfwCreateCond is not implemented . " ; } , <nl> <nl> - glfwDestroyCond : function ( cond ) { throw " glfwDestroyCond is not implemented yet . " ; } , <nl> + glfwDestroyCond : function ( cond ) { throw " glfwDestroyCond is not implemented . " ; } , <nl> <nl> - glfwWaitCond : function ( cond , mutex , timeout ) { throw " glfwWaitCond is not implemented yet . " ; } , <nl> + glfwWaitCond : function ( cond , mutex , timeout ) { throw " glfwWaitCond is not implemented . " ; } , <nl> <nl> - glfwSignalCond : function ( cond ) { throw " glfwSignalCond is not implemented yet . " ; } , <nl> + glfwSignalCond : function ( cond ) { throw " glfwSignalCond is not implemented . " ; } , <nl> <nl> - glfwBroadcastCond : function ( cond ) { throw " glfwBroadcastCond is not implemented yet . " ; } , <nl> + glfwBroadcastCond : function ( cond ) { throw " glfwBroadcastCond is not implemented . " ; } , <nl> <nl> glfwGetNumberOfProcessors : function ( ) { <nl> / / Threads are disabled anyway … <nl> var LibraryGLFW = { <nl> } , <nl> <nl> / * Image / texture I / O support * / <nl> - glfwReadImage : function ( name , img , flags ) { throw " glfwReadImage is not implemented yet . " ; } , <nl> + glfwReadImage : function ( name , img , flags ) { throw " glfwReadImage is not implemented . " ; } , <nl> <nl> - glfwReadMemoryImage : function ( data , size , img , flags ) { throw " glfwReadMemoryImage is not implemented yet . " ; } , <nl> + glfwReadMemoryImage : function ( data , size , img , flags ) { throw " glfwReadMemoryImage is not implemented . " ; } , <nl> <nl> - glfwFreeImage : function ( img ) { throw " glfwFreeImage is not implemented yet . " ; } , <nl> + glfwFreeImage : function ( img ) { throw " glfwFreeImage is not implemented . " ; } , <nl> <nl> - glfwLoadTexture2D : function ( name , flags ) { throw " glfwLoadTexture2D is not implemented yet . " ; } , <nl> + glfwLoadTexture2D : function ( name , flags ) { throw " glfwLoadTexture2D is not implemented . " ; } , <nl> <nl> - glfwLoadMemoryTexture2D : function ( data , size , flags ) { throw " glfwLoadMemoryTexture2D is not implemented yet . " ; } , <nl> + glfwLoadMemoryTexture2D : function ( data , size , flags ) { throw " glfwLoadMemoryTexture2D is not implemented . " ; } , <nl> <nl> - glfwLoadTextureImage2D : function ( img , flags ) { throw " glfwLoadTextureImage2D is not implemented yet . " ; } , <nl> + glfwLoadTextureImage2D : function ( img , flags ) { throw " glfwLoadTextureImage2D is not implemented . " ; } , <nl> } ; <nl> <nl> autoAddDeps ( LibraryGLFW , ' $ GLFW ' ) ; <nl>
|
* Disabled setMousePos in library_glfw .
|
emscripten-core/emscripten
|
f65172d9f2fc779b9b0207d8769a10d530a7a5b7
|
2013-04-04T09:17:36Z
|
mmm a / src / yuzu / main . cpp <nl> ppp b / src / yuzu / main . cpp <nl> void GMainWindow : : BootGame ( const QString & filename ) { <nl> } <nl> <nl> setWindowTitle ( QString ( " yuzu % 1 | % 4 | % 2 - % 3 " ) <nl> - . arg ( Common : : g_build_name , Common : : g_scm_branch , Common : : g_scm_desc , <nl> + . arg ( Common : : g_build_fullname , Common : : g_scm_branch , Common : : g_scm_desc , <nl> QString : : fromStdString ( title_name ) ) ) ; <nl> <nl> render_window - > show ( ) ; <nl> void GMainWindow : : ShutdownGame ( ) { <nl> game_list - > show ( ) ; <nl> game_list - > setFilterFocus ( ) ; <nl> setWindowTitle ( QString ( " yuzu % 1 | % 2 - % 3 " ) <nl> - . arg ( Common : : g_build_name , Common : : g_scm_branch , Common : : g_scm_desc ) ) ; <nl> + . arg ( Common : : g_build_fullname , Common : : g_scm_branch , Common : : g_scm_desc ) ) ; <nl> <nl> / / Disable status bar updates <nl> status_bar_update_timer . stop ( ) ; <nl>
|
Merge pull request from zhaowenlan1779 / patch - 1
|
yuzu-emu/yuzu
|
deff28d3c0f0af291946fe55f3f63af1cf83b0b1
|
2018-09-08T20:03:25Z
|
mmm a / folly / container / detail / F14Policy . h <nl> ppp b / folly / container / detail / F14Policy . h <nl> class VectorContainerPolicy : public BasePolicy < <nl> template < typename Table , typename . . . Args > <nl> void constructValueAtItem ( Table & & table , Item * itemAddr , Args & & . . . args ) { <nl> Alloc & a = this - > alloc ( ) ; <nl> - std : : size_t size = table . size ( ) ; <nl> - FOLLY_SAFE_DCHECK ( size < std : : numeric_limits < InternalSizeType > : : max ( ) , " " ) ; <nl> - * itemAddr = static_cast < InternalSizeType > ( size ) ; <nl> + auto size = static_cast < InternalSizeType > ( table . size ( ) ) ; <nl> + FOLLY_SAFE_DCHECK ( <nl> + table . size ( ) < std : : numeric_limits < InternalSizeType > : : max ( ) , " " ) ; <nl> + * itemAddr = size ; <nl> auto dst = std : : addressof ( values_ [ size ] ) ; <nl> / / TODO ( T31574848 ) : clean up assume - s used to optimize placement new <nl> assume ( dst ! = nullptr ) ; <nl> class VectorContainerPolicy : public BasePolicy < <nl> / / because the item and tag are already set in the table before <nl> / / calling constructValueAtItem , so if there is a tag collision <nl> / / find may evaluate values_ [ size ] during the search . <nl> - auto i = tlsMinstdRand ( size + 1 ) ; <nl> + auto i = static_cast < InternalSizeType > ( tlsMinstdRand ( size + 1 ) ) ; <nl> if ( i ! = size ) { <nl> auto & lhsItem = * itemAddr ; <nl> auto rhsIter = table . find ( <nl>
|
Fix - Wshorten - 64 - to - 32 compile warning treated as error
|
facebook/folly
|
c31d13303ff79fc160411ead147b354a56da9821
|
2019-11-14T08:06:49Z
|
mmm a / xbmc / cores / VideoPlayer / DVDDemuxers / DVDDemux . cpp <nl> ppp b / xbmc / cores / VideoPlayer / DVDDemuxers / DVDDemux . cpp <nl> std : : string CDemuxStreamAudio : : GetStreamType ( ) <nl> case AV_CODEC_ID_FLAC : <nl> strInfo = " FLAC " ; <nl> break ; <nl> + case AV_CODEC_ID_OPUS : <nl> + strInfo = " Opus " ; <nl> + break ; <nl> case AV_CODEC_ID_VORBIS : <nl> strInfo = " Vorbis " ; <nl> break ; <nl>
|
Merge pull request from alanswanson / master
|
xbmc/xbmc
|
08fa24aaddfec75e241da808b80f4b0e52104ecd
|
2018-08-06T13:19:51Z
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.