Skip to content

Commit 1a1ec92

Browse files
committed
first go at commenting
Also there were some interesting macro problems in FixedPoint which should be resolved now.
1 parent 2248d3a commit 1a1ec92

19 files changed

+272
-181
lines changed

src/auxiliary/Benchmarking.sac

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
/* Interface module
2-
*
3-
* void start( Interval& interval);
4-
* void end( Interval& interval);
5-
* void benchThis();
6-
* void printResult( Interval& interval);
7-
* void benchThis();
8-
* Interval getInterval( string interval_name, int interval_number);
9-
* Interval getInterval( int interval_number);
10-
* Interval getInterval( int interval_number);
11-
* void destroyInterval( Interval interval);
1+
/**
2+
* @file
3+
* @defgroup bench Benchmarking Interface
4+
*
5+
* @{
126
*/
137

148
module Benchmarking;
@@ -23,3 +17,5 @@ import C99Benchmarking: all;
2317
#ifdef SAC_BACKEND_MUTC
2418
import MutcBenchmarking: all;
2519
#endif /* SAC_BACKEND_MUTC */
20+
21+
/** @} */

src/auxiliary/C99Benchmarking.sac

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
/* C99 Benchmarking Module
1+
/**
2+
* @file
3+
* @defgroup bench99 C99 Benchmarking
24
*
35
* Measures time Intervals in an arbitrary time unit as doubles.
46
*
57
* Use getInterval to construct a benchmarking interval object and start and
68
* end to measure each interval. Take care when start and stop are evaluated
7-
* since this will affect the windows that is measured. The function benchThis
8-
* simply affects the benchmarking object and can be used in inhibit code
9-
* movement. The function printResult dumps the measurement information in a
9+
* since this will affect the windows that is measured. The function benchThis
10+
* simply affects the benchmarking object and can be used in inhibit code
11+
* movement. The function printResult dumps the measurement information in a
1012
* unibench friendly format.
1113
*
1214
* When benchmarking funtions the pragma "noinline" should be specified after
1315
* the function body to inhibit any inlining optimisations.
16+
*
17+
* @{
1418
*/
1519
class C99Benchmarking;
1620
external classtype;
@@ -428,7 +432,7 @@ void printResults( StringArray::stringArray names, double[.] results)
428432
printf( "### end descriptions\n");
429433
}
430434

431-
/*
435+
/**
432436
* This function simply affects TheBenchmarkObject and nothing else.
433437
* Use it to inhibit code movement. The most common use for benchThis
434438
* is to call it within a function body of a function body that should be
@@ -450,3 +454,4 @@ external void benchDestroyInterval( Interval interval);
450454
#pragma linksign [1]
451455

452456
#endif /* SAC_BACKEND_C99/CUDA */
457+
/** @} */

src/auxiliary/Hiding.sac

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
/*****************************************************************************
1+
/**
2+
* @file
3+
* @defgroup hiding Hiding
24
*
3-
* file: Hiding.sac
5+
* @brief This module is for hiding type information.
46
*
5-
* description:
7+
* It is commonly used for static inputs and is intentioned for benchmarking.
68
*
7-
* This module is for hiding type information.
8-
* It is commonly used for static inputs and is intentioned for benchmarking.
9+
* Some functions take a single argument and hide the value, shape or
10+
* dimensionality information of the input. Others in addition take an
11+
* integer. This allows for calls to inlined kernel functions in a loop
12+
* where where the call must be repeated N times for benchmarking.
913
*
10-
* Some functions take a single argument and hide the value, shape or
11-
* dimensionality information of the input. Others in addition take an
12-
* integer. This allows for calls to inlined kernel functions in a loop
13-
* where where the call must be repeated N times for benchmarking.
14-
* Here is an example:
15-
* for( i=0 ; i < N ; i}}) {
16-
* res[[i]] = kernel( hideValue( ip1, i), hideValue( ip2, i), ...);
17-
* }
18-
* The above code computes kernel N times even if kernel is inlined.
14+
* Here is an example:
15+
* ~~~~
16+
* for( i=0 ; i < N ; i}}) {
17+
* res[[i]] = kernel( hideValue( ip1, i), hideValue( ip2, i), ...);
18+
* }
19+
* ~~~~
20+
* The above code computes kernel N times even if kernel is inlined.
1921
*
20-
*****************************************************************************/
21-
22+
* @{
23+
*/
2224
module Hiding;
2325

2426
export all;
@@ -42,7 +44,7 @@ inline \
4244
TYPE[*] hideValue( int i, TYPE[*] in) \
4345
{ \
4446
return( _hideValue_SxA_( i, in)); \
45-
}
47+
}
4648
HIDEVALUE( int)
4749
HIDEVALUE( char)
4850
HIDEVALUE( float)
@@ -96,4 +98,4 @@ HIDEDIMENSIONALITY( char)
9698
HIDEDIMENSIONALITY( float)
9799
HIDEDIMENSIONALITY( double)
98100
HIDEDIMENSIONALITY( bool)
99-
101+
/** @} */

src/auxiliary/Interval.sac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1+
/**
2+
* @file
3+
* @defgroup interval Interval Object
4+
* @brief This module provides the Interval classtype
5+
*
6+
* @{
7+
*/
18
class Interval;
29
external classtype;
310

411
export {Interval};
12+
/** @} */

src/classes/auxiliary/Counter.sac

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/** <!-- ****************************************************************** -->
2-
* @file Counter.sac
3-
*
1+
/**
2+
* @file
3+
* @defgroup counter Counter
44
* @brief A simple class to maintain a global counter
55
*
6-
* @date $Id$
7-
******************************************************************************/
6+
* @{
7+
*/
88
class Counter;
99

1010
classtype int;
@@ -13,75 +13,75 @@ use ScalarArith : {+};
1313

1414
export all;
1515

16-
/** <!-- ****************************************************************** -->
16+
/**
1717
* @brief Creates a new counter with initial value 0.
18-
*
18+
*
1919
* @return created counter object
20-
******************************************************************************/
20+
*/
2121
Counter newCounter()
2222
{
2323
return( to_Counter( 0));
2424
}
2525

26-
/** <!-- ****************************************************************** -->
26+
/**
2727
* @brief Creates a new counter with initial value v.
28-
*
28+
*
2929
* @param v initial value for new counter
30-
*
3130
* @return created counter object
32-
******************************************************************************/
31+
*/
3332
Counter newCounter( int v)
3433
{
3534
return( to_Counter( v));
3635
}
3736

38-
/** <!-- ****************************************************************** -->
37+
/**
3938
* @brief Returns the current value of the counter
40-
*
39+
*
4140
* @param cnt counter object
42-
*
4341
* @return counter object's value
44-
******************************************************************************/
42+
*/
4543
int valueOf( Counter &cnt)
4644
{
4745
val = from_Counter( cnt);
4846
cnt = to_Counter( val);
4947
return( val);
5048
}
5149

52-
/** <!-- ****************************************************************** -->
50+
/**
5351
* @brief Increments the counter by one.
54-
*
52+
*
5553
* @param cnt the counter object to update
56-
******************************************************************************/
54+
*/
5755
void increment( Counter &cnt)
5856
{
5957
val = from_Counter( cnt);
6058
cnt = to_Counter( val + 1);
6159
}
6260

63-
/** <!-- ****************************************************************** -->
61+
/**
6462
* @brief Increments the counter by the value of the second argument.
6563
*
6664
* @param cnt the counter object to update
67-
******************************************************************************/
65+
* @param x value to increment by
66+
*/
6867
void incrementBy( Counter &cnt, int x)
6968
{
7069
val = from_Counter( cnt);
7170
cnt = to_Counter( val + x);
7271
}
7372

74-
/** <!-- ****************************************************************** -->
73+
/**
7574
* @brief Returns the current value of the counter object and
7675
* increments the counter object by one
77-
*
76+
*
7877
* @param cnt counter object to inspect and modify
79-
*
8078
* @return value of counter object before updating
81-
******************************************************************************/
79+
*/
8280
int next( Counter &cnt)
8381
{
8482
val = valueOf( cnt);
8583
increment( cnt);
8684
return( val);
8785
}
86+
87+
/** @} */

src/classes/random/Rand48.sac

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
/**
2+
* @file
3+
* @defgroup rand48 Rand48
4+
*
5+
* Class Rand48 provides a pseudo-random number generator which uses the
6+
* linear congruential algorithm and 48-bit integer arithmetic.
7+
*
8+
* @{
9+
*/
110
class Rand48;
211

3-
4-
/*
5-
* Class Rand48 provides a pseudo-random number generator which uses the
6-
* linear congruential algorithm and 48-bit integer
7-
* arithmetic.
8-
*/
9-
10-
1112
external classtype;
1213

1314
export all;
@@ -20,39 +21,45 @@ external Rand48 randGen();
2021
#pragma linkobj "src/Rand48/Rand48.o"
2122

2223

24+
/**
25+
* @brief Initialize RandomGen to produce a new sequence of pseudo-random
26+
* numbers.
27+
* @param SEED value for seed
28+
*/
2329
external void srandom(long SEED);
2430
#pragma effect Rand48::RandomGen
2531
#pragma linkname "srand48"
2632
#pragma linkobj "src/Rand48/Rand48.o"
2733

28-
/*
29-
* Initialize RandomGen to produce a new sequence of pseudo-random
30-
* numbers.
31-
*/
32-
33-
34+
/**
35+
* @brief Use RandomGen to generate a new pseudo-random integer in the range
36+
* MIN to MAX.
37+
*
38+
* @param MIN lowest point on range
39+
* @param MAX highest point on range
40+
* @return pseudo-random value
41+
*/
3442
external int random(int MIN, int MAX);
3543
#pragma linksign [0,1,2]
3644
#pragma effect Rand48::RandomGen
3745
#pragma linkname "SACrand48"
3846
#pragma linkobj "src/Rand48/Rand48.o"
3947

40-
/*
41-
* Use RandomGen to generate a new pseudo-random integer in the range
42-
* MIN to MAX.
43-
*/
44-
45-
48+
/**
49+
* brief Use RandomGen to generate a new pseudo-random double precision
50+
* floating-point number in the interval [MIN, MAX).
51+
*
52+
* @param MIN lowest point on range
53+
* @param MAX highest point on range
54+
* @return pseudo-random value
55+
*/
4656
external double random(double MIN, double MAX);
4757
#pragma linksign [0,1,2]
4858
#pragma effect Rand48::RandomGen
4959
#pragma linkname "SACdrand48"
5060
#pragma linkobj "src/Rand48/Rand48.o"
5161

52-
/*
53-
* Use RandomGen to generate a new pseudo-random double precision
54-
* floating-point number in the interval [MIN, MAX).
55-
*/
62+
5663

5764
int[*] random( int[.] shp, int MIN, int MAX)
5865
{
@@ -69,4 +76,4 @@ double[*] random( int[.] shp, double MIN, double MAX)
6976
} : genarray( shp, 0d );
7077
return( res);
7178
}
72-
79+
/** @} */

src/numerical/ComplexMath.sac

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* @file
3+
* @defgroup complexmath ComplexMath
4+
*
5+
* @{
6+
*/
17
module ComplexMath;
28

39
export all;
@@ -163,9 +169,4 @@ inline complex sqrt(complex X)
163169
ScalarArith::* ((double[2])X)[[1]])))]);
164170
}
165171

166-
167-
168-
169-
170-
171-
172+
/** @} */

0 commit comments

Comments
 (0)