Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Creating a Timer Language

Name: Anonymous 2008-02-14 20:05

Hey /prog, research student here, working on a language to describe a timer for functions.  I'm creating an example of what the timer language will look like for a given specification.  It's got some pseudo-C, pseudo-scripting ideas, since the timer will be processed into C from this input.  This is far from complete, but suggestions and discussion are welcome.


typedecl TYPE (int *);

define VECTOR(n) ((int *) calloc (n * sizeof(int)));    //makes a vector of n-elements

ROUTINE = void ATL_UDOT(const int N, const TYPE *X, const int incX, const TYPE *Y, const int incY, TYPE *dotc);

ARGS = {
    N = 100..999;
    X = VECTOR(N),          //init. starts at N=100, updates upon each iteration 
        for 0..N-1 do X[_]=rand();
    flushcache(1024*1024);  //flushes 1024*1024 bytes (1MB) from the cache
    incX = 10;  
    Y = VECTOR(N),
        for 0..N-1 do Y[_]=rand();
    flushcache(1024*1024);
    incY = 10;
    dotc = VECTOR(2);
};

Name: Anonymous 2008-02-14 20:43

                                              Needs more FORCED INDENATION.

Name: Anonymous 2008-02-14 20:44

                                              INDENTATION, too.

Name: Anonymous 2008-02-14 20:50

are you insane?

Name: Anonymous 2008-02-14 22:46

OP here

>>2>>3
It's indented for readability.  You could just as easily write the entire script on one line, but that should only be done in the most simple cases.

>>4
A serious inquiry?  I might be.  While my classmates are busy jacking off to security and software engineering, I'm the only white guy interested in compilers/code optimization.  Anyway, no I'm not insane regarding this little code.  I'll post updates on it as I continue work.  I have until tuesday to have a fully-fleshed example script, and I need to have started implementing the language using my professor's own custom language.

Name: Anonymous 2008-02-15 0:45

>>5
I've always wondered why compilers are a "black thing".

Name: Anonymous 2008-02-15 4:14

wats a timar lang????/////////

Also, write a functional language instead of this forced indentation crap.

Name: Anonymous 2008-02-15 5:14

>>5-6
I'm confused - what does race have to do with compilers? I never noticed this before.

Name: Anonymous 2008-02-15 5:18

>>8
deadlocks.

Name: Anonymous 2008-02-15 6:22

>>9
i lol'd

Name: Anonymous 2008-02-15 6:25

Haha, shit, this thread is pig amusing.

Name: Anonymous 2008-02-15 8:36

>>8
My cs dept. is divided between some whites, some hispanics, lots of asians, lots of indians, and like 2-3 black dudes.  I checked out the grad-level compiler course here and its like all asian

Name: Anonymous 2008-02-18 17:36

OP back, I've made stuff a bit clearer and added some stuff


typedecl TYPE (int *);

//defines a C-style #define statement
define VECTOR(n) ((int *) calloc (n * sizeof(int)));    //makes a vector of n-elements

/*  ROUTINE is a global code object, representing the C routine that will
    be used in the timing   */
ROUTINE = void ATL_UDOT(const int N, const TYPE *X, const int incX, const TYPE *Y, const int incY, TYPE *dotc);

/*  ARGS is a function to be passed to the timer to initialize various
    arguments for ROUTINE   */

ARGS = {
    /*  A variable can be defined with a range.
        The beginning and ending indices are kept track of, as well as the
        current position within the range the variable actually represents
        (so, if you execute ATL_UDOT(N, ...) forty times, N would contain
        140 as its current position.    */
    N = 100..999;

    /*  X can be initialized many different ways, but this is specific for
        ATL_UDOT, since it is vector dot product, it makes sense to treat X
        and Y as vector-like */
    X = VECTOR(N);          //init. starts at N=100, updates upon each iteration
        for 0..N-1 do X[_]=rand(int);

    /*  flushcache(X) :
            defined elsewhere, will flush X bytes from the cache */
    flushcache(1024*1024);

    incX = 10;
    Y = VECTOR(N),
        for 0..N-1 do Y[_]=N;   //you can put any ints you want into the vector
    flushcache(1024*1024);
    incY = 10;

    //you can hardcode simple data values in as well
    dotc = VECTOR(2);
    dotc[0]=0;
    dotc[1]=0;
};

nrep = 10;

/*  execTimer(argument set, repetitions per function call, custom flag string):
        executes the timer as described by the ROUTINE global definition and
        the ARGS globally defined set.  Each call to ROUTINE uses variables
        defined in ARGS (which are updated upon each iteration if they have a
        range).  If nrep is greater than 1, each call is repeated with the
        same ARGS and based on if the "w" or "c" flags are set, will take
        the average over the iterations or the lowest time among them.
        Various flags may be set.  In this case, I am using wall-time and
        outputting verbose information on the timings.  Additional flags
        may be defined as needed.       */
execTimer(ROUTINE, ARGS, nrep, "wv");

Name: Anonymous 2008-02-18 18:18

What's a timer language for anyway?

Name: Anonymous 2008-02-18 18:44

>>14
timing

Name: Anonymous 2008-02-18 20:37

>>12
asians = indians

Name: Anonymous 2008-02-19 5:20

>>16
indians are a subset of indians

Name: Anonymous 2008-02-19 6:03

>>17
Indians is an instance of Indians

Name: Anonymous 2008-02-19 6:10

Indians' not Indians

Name: Anonymous 2008-02-19 6:17

>>19
YOU HAVE BEEN CAUGHT TROLLING

Name: Anonymous 2008-02-19 7:30

>>20
no!

Name: Anonymous 2008-02-19 8:06

Indians' Not inDIANS.

Name: Anonymous 2008-02-19 16:29

>>20
YOU HAVE BEEN CAUGHT losing the game

Name: Anonymous 2008-02-19 19:00

>>14-23

Stop dicking up my thread, fags.

Anyway, looks like my write-up was good enough for a starting point.  We'll be implementing the base version in another language, however.  Once we get that going, we'll write the parser for it.

Name: Anonymous 2008-02-19 19:05

>>24
Stop dicking up my thread, fags.
Welcome to /prog/.

Name: Anonymous 2008-02-20 6:29

>>24
Explain what a timer language is for, please.

Name: Anonymous 2008-02-20 14:22

>>26
timing

Name: Anonymous 2008-02-20 14:43

>>27
Stop dicking up my thread, fags.

Name: Anonymous 2008-02-20 14:47

>>28
Stop fagging up my thread, dicks.

Name: Anonymous 2008-02-20 14:50

>>28-29
Stop threading up my dick, fags.

Name: Anonymous 2008-02-20 17:35

>>26

Okay, basically, if you have a function, and you wish to optimize it, you'll need to time the unoptimized function and the optimized function to be able to check if there is a performance increase.  such a timer requires user specification, and to generalize that purpose for portability to all platforms, i'm writing a language which will represent the timer.  coupled with that, i'm writing a parser in POET which will accept a file written in Timer language and generate the equivalent, pre-optimized C code, thus creating an optimized timer that will give you accurate results.

Name: Anonymous 2009-02-25 6:32


Write about and how   So first I   asked myself what   topic should it   be about I   realized I had   another turn I   decided to pass   the time writing   a filksong This   meant I was   beautiful So come   dance this silence   down through the   barrio Yeah we   stare at the   New Amsterdam staring.

Name: Anonymous 2009-03-06 7:45

definition also be good   might not If   you funroll loops!

Name: Anonymous 2009-03-06 10:02

The Sussman answered Mu.

Name: Trollbot9000 2009-07-01 7:53

flags are set will?

Name: Anonymous 2010-11-15 17:26

Name: Anonymous 2011-02-04 15:20

Name: Anonymous 2013-01-19 0:01

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

Don't change these.
Name: Email:
Entire Thread Thread List