- Commit
- 45fe249a132b03b316a5ed97805749f53d28924c
- Parent
- f529d36ef76eacfbad8d463b547b3b8a8db9be7e
- Author
- Pablo <pablo-pie@riseup.net>
- Date
Formatted the comments
Educational material on the SciPy implementation of numerical linear algebra algorithms
Formatted the comments
2 files changed, 10 insertions, 10 deletions
Status | Name | Changes | Insertions | Deletions |
Modified | getrf/benchmarks/src/main.c | 2 files changed | 9 | 9 |
Modified | getrf/benchmarks/src/perf.h | 2 files changed | 1 | 1 |
diff --git a/getrf/benchmarks/src/main.c b/getrf/benchmarks/src/main.c @@ -32,7 +32,7 @@ ProgressBar progress = { typedef struct { double *ref_data; - // Input parameters for dgetrf + // input parameters for dgetrf double *data; int32_t ipiv[MAX_N]; int n, m, lda, info; @@ -54,9 +54,9 @@ extern void dgetrf2_(int *m, int *n, double *A, int *lda, int *ipiv, int *info); PerfResult thread_run_benchmark(Thread *thread, size_t n) { - // Reinitializes the values in the .data array: this avoids progressively - // moving larger values to the beginning of the array, which would decrise - // decrease the number of row interchanges required for computations + // reinitializes the values in the .data array: this avoids progressively + // moving larger values to the beginning of the array, which would decrease + // the number of row interchanges required for computations memcpy(thread->data, thread->ref_data, sizeof(double)*n*n); thread->n = n; thread->m = n; thread->lda = n; @@ -70,7 +70,7 @@ void *thread_benchmark(void *arg) { Thread *thread = (Thread*) arg; - // We need to lock the running thread to some CPU so that we can mask + // we need to lock the running thread to some CPU so that we can mask // perf_event_open with this specific CPU cpu_set_t set; CPU_ZERO(&set); @@ -80,7 +80,7 @@ void *thread_benchmark(void *arg) thread->id); } - // Computations are distributed evenly across threads + // computations are distributed evenly across threads for (size_t n = 1 + thread->id*STEP; n < MAX_N; n += STEP*N_THREADS) { PerfResult result = thread_run_benchmark(thread, n); size_t i = (n - 1)/STEP; @@ -102,7 +102,7 @@ Benchmarker benchmarker_new(double *ref_data) { Benchmarker bench = {0}; - // This array will live for the entire duration of the program, + // this array will live for the entire duration of the program, // so we might as well leak it 🤡 double *data = malloc(sizeof(double)*MAX_N*MAX_N*N_THREADS); if (data == NULL) { @@ -167,7 +167,7 @@ int main(int argc, char **argv) // ======================================================================== printf("INFO: Initializing random input data... "); - // This array will live for the entire duration of the program, + // this array will live for the entire duration of the program, // so we might as well leak it 🤡 double *ref_data = malloc(sizeof(double)*MAX_N*MAX_N); if (ref_data == NULL) { @@ -175,7 +175,7 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } - // Pseudorandom data given by the logistic map + // pseudorandom data given by the logistic map double acc = LOGISTICS_INITIAL_CONDITION; for (size_t i = 0; i < MAX_N*MAX_N; i++) { ref_data[i] = acc;
diff --git a/getrf/benchmarks/src/perf.h b/getrf/benchmarks/src/perf.h @@ -15,7 +15,7 @@ #include <assert.h> enum { - // Here we use L1-dcache-loads & L1-dcache-loads-misses instead of + // here we use L1-dcache-loads & L1-dcache-loads-misses instead of // cache-misses & cache-references because the L1 data cache is the only // CPU-specific cache accessible to perf: the LD cache is shared between // cores