Skip to content

Instantly share code, notes, and snippets.

@engie
engie / gist:2439312
Created April 21, 2012 19:55
SSE intrinsic matrix * vector product
const double* b_p = &(B.data()[0]);
double* w_p = &(W.data()[0]);
for( uint32 i = 0; i < rows; i++ ) //For each row
{
double* w_p_row = w_p;
typedef double v2df __attribute__ ((vector_size (16))); //Create a type to store a pair of accumulators
v2df sum = { 0, 0 };
//Process two pairs at a time
@engie
engie / gist:2439256
Created April 21, 2012 19:39
Pointer Matrix*Vector implementation
const double* b_p = &(B.data()[0]);
double* w_p = &(W.data()[0]);
uint32 rows = B.size1();
uint32 cols = B.size2();
for( uint32 i = 0; i < rows; i++ ) //For each row
{
myX[i] = 0;
double* w_p_row = w_p;
@engie
engie / gist:2439238
Created April 21, 2012 19:35
Initial matrix*vector implementation
//B is a uBLAS matrix
//W is a uBLAS vector
//myX is the output
for( uint32 i = 0; i < B.size1(); i++ ) //For each row
{
myX[i] = 0;
for( uint32 j = 0; j < B.size2(); j++ ) //For each col
{
@engie
engie / gist:1855783
Created February 17, 2012 22:24
Crashing Firefox
Version
-------
[~ (master)↑⚡]$ /usr/lib/firefox-10.0.1/firefox --version
Mozilla Firefox 10.0.1
[~ (master)↑⚡]$ md5sum /usr/lib/firefox-10.0.1/firefox
3fd647a371dfb5e244fa5446e12bd45a /usr/lib/firefox-10.0.1/firefox
[~ (master)↑⚡]$ cat /etc/issue
Ubuntu 11.10 \n \l
[~ (master)↑⚡]$ dpkg -s firefox
Package: firefox
@engie
engie / gist:1197339
Created September 6, 2011 11:44
TaksGraph
import time
from Queue import Queue
from concurrent import futures
import topsort
def taskA():
print "Starting task A - sleeping 2s"
time.sleep( 2 )
print "Finished task A"
@engie
engie / gist:968920
Created May 12, 2011 16:50
Possible problem with busybox sh handling of pipes
/tmp $ cat spawnShortPipeSleep.sh
#!/bin/sh
sleep 5 | logger -t ZZZZZ &
Running this under bash:
/tmp $ bash --version
GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)
Running this under bash returns immediately:
@engie
engie / minimalcfg.cmd
Created April 5, 2011 09:50
TConf generated config file from linux platform
/* Do *not* directly modify this file. It was */
/* generated by the Configuration Tool; any */
/* changes risk being overwritten. */
/* INPUT minimal.cdb */
/* MODULE PARAMETERS */
-u _FXN_F_nop
GBL_USERINITFXN = _FXN_F_nop;
@engie
engie / minimal_test.map
Created April 5, 2011 09:50
Map file created by cl6x on linux
******************************************************************************
TMS320C6x Linker Unix v6.1.19
******************************************************************************
>> Linked Tue Apr 5 10:46:29 2011
OUTPUT FILE NAME: </home/stephen.english/ise/production/build/linux/Tms_None_Heed_Emit_Off_32bit/applications/embedded/minimal_test/minimal_test.out>
ENTRY POINT SYMBOL: "_c_int00" address: c00779e0
MEMORY CONFIGURATION
@engie
engie / minimal_test.map
Created April 5, 2011 09:35
Map file created by code composer in debug mode
******************************************************************************
TMS320C6x Linker PC v6.1.19
******************************************************************************
>> Linked Tue Apr 05 10:32:09 2011
OUTPUT FILE NAME: <minimal_test.out>
ENTRY POINT SYMBOL: "_c_int00" address: c00779e0
MEMORY CONFIGURATION
@engie
engie / minimalcfg.cmd
Created April 5, 2011 09:34
Debug release tconf generated linker command file
/* Do *not* directly modify this file. It was */
/* generated by the Configuration Tool; any */
/* changes risk being overwritten. */
/* INPUT minimal.cdb */
/* MODULE PARAMETERS */
-u _FXN_F_nop
GBL_USERINITFXN = _FXN_F_nop;