Changes in / [00f5fde:1959528]


Ignore:
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/locks.hfa

    r00f5fde r1959528  
    3131                // previous thread to acquire the lock
    3232                void* prev_thrd;
    33                 // keep track of number of times we had to spin, just in case the number is unexpectedly huge
    34                 size_t spin_count;
    3533        #endif
    3634};
     
    5048        static inline void ?{}( __spinlock_t & this ) {
    5149                this.lock = 0;
    52                 #ifdef __CFA_DEBUG__
    53                         this.spin_count = 0;
    54                 #endif
    5550        }
    5651
     
    7772                for ( unsigned int i = 1;; i += 1 ) {
    7873                        if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break;
    79                         #ifdef __CFA_DEBUG__
    80                                 this.spin_count++;
    81                         #endif
    8274                        #ifndef NOEXPBACK
    8375                                // exponential spin
  • libcfa/src/concurrency/io.cfa

    r00f5fde r1959528  
    548548                        /* paranoid */ verify( proc == __cfaabi_tls.this_processor );
    549549                        /* paranoid */ verify( ! __preemption_enabled() );
    550 
    551                         return true;
    552550                }
    553551        #endif
  • libcfa/src/concurrency/kernel.cfa

    r00f5fde r1959528  
    554554        /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd->canary );
    555555
     556        const bool local = thrd->state != Start;
    556557        if (thrd->preempted == __NO_PREEMPTION) thrd->state = Ready;
    557558
     
    736737
    737738        // Check if there is a sleeping processor
    738         // int fd = __atomic_load_n(&this->procs.fd, __ATOMIC_SEQ_CST);
    739         int fd = 0;
    740         if( __atomic_load_n(&this->procs.fd, __ATOMIC_SEQ_CST) != 0 ) {
    741                 fd = __atomic_exchange_n(&this->procs.fd, 0, __ATOMIC_RELAXED);
    742         }
     739        int fd = __atomic_load_n(&this->procs.fd, __ATOMIC_SEQ_CST);
    743740
    744741        // If no one is sleeping, we are done
  • libcfa/src/concurrency/ready_queue.cfa

    r00f5fde r1959528  
    681681        // Actually pop the list
    682682        struct thread$ * thrd;
    683         #if defined(USE_WORK_STEALING) || defined(USE_CPU_WORK_STEALING)
    684                 unsigned long long tsc_before = ts(lane);
    685         #endif
     683        unsigned long long tsc_before = ts(lane);
    686684        unsigned long long tsv;
    687685        [thrd, tsv] = pop(lane);
  • libcfa/src/concurrency/thread.cfa

    r00f5fde r1959528  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jan 12 18:46:48 2022
    13 // Update Count     : 36
     12// Last Modified On : Wed Jan 12 18:28:18 2022
     13// Update Count     : 35
    1414//
    1515
     
    197197} // LCG
    198198
    199 void set_seed( uint32_t seed ) {
    200         active_thread()->random_state = __global_random_seed = seed;
    201         GENERATOR( active_thread()->random_state );
    202 } // set_seed
     199void set_seed( uint32_t seed ) { active_thread()->random_state = seed; __global_random_seed = seed; }
    203200uint32_t prng( void ) { return GENERATOR( active_thread()->random_state ); } // [0,UINT_MAX]
    204201
  • libcfa/src/device/cpu.cfa

    r00f5fde r1959528  
    427427                        unsigned c = pairings[i].cpu;
    428428                        unsigned llc_id = pairings[i].id;
     429                        unsigned width = maps[llc_id].raw->width;
    429430                        unsigned start = maps[llc_id].start;
    430                         entries[c].count = maps[llc_id].raw->width;
     431                        unsigned self  = start + (maps[llc_id].count++);
     432                        entries[c].count = width;
    431433                        entries[c].start = start;
    432                         entries[c].self  = start + (maps[llc_id].count++);
    433                         entries[c].cache = llc_id;
     434                        entries[c].self  = self;
    434435                }
    435436
  • libcfa/src/device/cpu.hfa

    r00f5fde r1959528  
    1616#include <stddef.h>
    1717
    18 // Map from cpu entry to a structure detailling cpus with common topologies
    19 // Note that the cpu-groups are contiguous so the indexing is different from
    20 // the cpu indexing
    2118struct cpu_map_entry_t {
    22         // Where this particular cpu is in the group
    2319        unsigned self;
    24 
    25         // Starting index of the cpus with the same topology
    2620        unsigned start;
    27 
    28         // Number of cpus with the same topology
    2921        unsigned count;
    30 
    31         // Index of the cache this entry describes
    32         unsigned cache;
    3322};
    3423
  • libcfa/src/startup.cfa

    r00f5fde r1959528  
    1010// Created On       : Tue Jul 24 16:21:57 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jan 12 18:51:24 2022
    13 // Update Count     : 51
     12// Last Modified On : Wed Jan 12 16:25:37 2022
     13// Update Count     : 49
    1414//
    1515
     
    2020#include "bits/defs.hfa"
    2121
    22 extern uint32_t __global_random_seed, __global_random_state;
     22extern uint32_t __global_random_seed;
    2323
    2424extern "C" {
     
    5151        void __cfaabi_core_startup( void ) __attribute__(( constructor( STARTUP_PRIORITY_CORE ) ));
    5252        void __cfaabi_core_startup( void ) {
    53                 __global_random_state = __global_random_seed = rdtscl();
     53                __global_random_seed = rdtscl();
    5454                __cfaabi_interpose_startup();
    5555                __cfaabi_device_startup();
  • libcfa/src/stdlib.cfa

    r00f5fde r1959528  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jan 12 18:52:41 2022
    13 // Update Count     : 582
     12// Last Modified On : Wed Jan 12 16:25:36 2022
     13// Update Count     : 578
    1414//
    1515
     
    242242} // LCG
    243243
    244 uint32_t __global_random_seed;                                                  // sequential/concurrent
    245 uint32_t __global_random_state;                                                 // sequential only
     244uint32_t __global_random_seed;
    246245
    247246void set_seed( PRNG & prng, uint32_t seed_ ) with( prng ) { state = seed = seed_; GENERATOR( state ); } // set seed
    248247uint32_t prng( PRNG & prng ) with( prng ) { callcnt += 1; return GENERATOR( state ); }
    249248
    250 void set_seed( uint32_t seed ) { __global_random_seed = seed; GENERATOR( __global_random_state ); }
     249void set_seed( uint32_t seed ) {
     250        active_thread()->random_state = __global_random_seed = seed;
     251        GENERATOR( active_thread()->random_state );
     252} // set_seed
    251253uint32_t get_seed() { return __global_random_seed; }
    252 uint32_t prng( void ) { return GENERATOR( __global_random_state ); } // [0,UINT_MAX]
     254uint32_t prng( void ) { return GENERATOR( active_thread()->random_state ); } // [0,UINT_MAX]
    253255
    254256//---------------------------------------
  • libcfa/src/stdlib.hfa

    r00f5fde r1959528  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jan 12 18:56:13 2022
    13 // Update Count     : 621
     12// Last Modified On : Wed Jan 12 09:09:48 2022
     13// Update Count     : 620
    1414//
    1515
     
    437437
    438438void set_seed( uint32_t seed_ ) OPTIONAL_THREAD;
    439 uint32_t get_seed() __attribute__(( warn_unused_result ));
     439uint32_t get_seed() __attribute__(( warn_unused_result )) OPTIONAL_THREAD;
    440440uint32_t prng( void ) __attribute__(( warn_unused_result )) OPTIONAL_THREAD; // [0,UINT_MAX]
    441441static inline {
  • tools/jenkins/setup.sh.in

    r00f5fde r1959528  
    4848                regex1='/([[:alpha:][:digit:]@/_.-]+)'
    4949                regex2='(libcfa[[:alpha:][:digit:].]+) => not found'
    50                 regex3='linux-vdso.so.1|linux-gate.so.1'
     50                regex3='linux-vdso.so.1'
    5151                if [[ $line =~ $regex1 ]]; then
    5252                        retsysdeps+=(${BASH_REMATCH[1]})
Note: See TracChangeset for help on using the changeset viewer.