mirror of
https://github.com/RRZE-HPC/OSACA.git
synced 2026-01-04 18:20:09 +01:00
Validation (#71)
Validating of OSACA predictions for IVB, SKX, ZEN1, ZEN2, A64FX and TX2 with different kernels. build_and_run.py contains the configuration used at RRZE's testcluster and UR's qpace4, Analysis.ipynb contains the analysis script and results. Raw data from measurements (122MB) will be attached to next OSACA release. For now, find the raw data here: https://hawo.net/~sijuhamm/d/UPIhBOtz/validation-data.tar.gz The analysis report can be viewed at https://nbviewer.jupyter.org/github/RRZE-HPC/OSACA/blob/validation/validation/Analysis.ipynb Quite a few changes on OSACA included: Feature: register change tracking via semantic understanding of operations Feature: recording LCD latency along path and exposing this to frontend Feature: support for memory reference aliases Feature: store throughput scaling (similar to load throughput scaling) Fix: model importer works with latest uops.info export Fix: immediate type tracking on ARM now preserves type in internal representaion Removed unused KerncraftAPI
This commit is contained in:
80
validation/kernels/striad.c
Normal file
80
validation/kernels/striad.c
Normal file
@@ -0,0 +1,80 @@
|
||||
#ifdef MAIN
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <likwid.h>
|
||||
#endif
|
||||
|
||||
#define DTYPE double
|
||||
|
||||
void dummy(void *);
|
||||
|
||||
void kernel(DTYPE* a, DTYPE* b, DTYPE* c, DTYPE* d, const int repeat, const int cur_elements)
|
||||
#ifndef MAIN
|
||||
{
|
||||
for(int r=0; r < repeat; r++) {
|
||||
for(int i=0; i<cur_elements; i++) {
|
||||
a[i] = b[i] + c[i] * d[i];
|
||||
}
|
||||
dummy((void*)a);
|
||||
}
|
||||
}
|
||||
#else
|
||||
;
|
||||
int main(int argc, char *argv[]) {
|
||||
if(argc < 2) {
|
||||
printf("Usage: %s (repeat elements)...\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
const int tests = (argc-1) / 2;
|
||||
int repeats[tests];
|
||||
int elements[tests];
|
||||
int maxelements = 0;
|
||||
for(int t=0; t<tests; t++) {
|
||||
repeats[t] = atoi(argv[1+t*2]);
|
||||
elements[t] = atoi(argv[2+t*2]);
|
||||
if(maxelements < elements[t]) {
|
||||
maxelements = elements[t];
|
||||
}
|
||||
}
|
||||
printf("kernel: triad\n");
|
||||
printf("elementsize: %lu\n", sizeof(DTYPE));
|
||||
|
||||
//SETUP
|
||||
DTYPE* a = malloc(maxelements*sizeof(DTYPE));
|
||||
DTYPE* b = malloc(maxelements*sizeof(DTYPE));
|
||||
DTYPE* c = malloc(maxelements*sizeof(DTYPE));
|
||||
DTYPE* d = malloc(maxelements*sizeof(DTYPE));
|
||||
for(int i=0; i<maxelements; i++) {
|
||||
a[i] = i;
|
||||
b[i] = maxelements-i;
|
||||
c[i] = 12.34;
|
||||
d[i] = 12.34;
|
||||
}
|
||||
|
||||
likwid_markerInit();
|
||||
|
||||
char cur_region_name[128];
|
||||
for(int t=0; t<tests; t++) {
|
||||
const int cur_elements = elements[t];
|
||||
const int cur_repeats = repeats[t];
|
||||
sprintf(cur_region_name, "triad_%i_%i", cur_repeats, cur_elements);
|
||||
likwid_markerRegisterRegion(cur_region_name);
|
||||
printf("%s:iterations: %i\n", cur_region_name, cur_elements);
|
||||
printf("%s:repetitions: %i\n", cur_region_name, cur_repeats);
|
||||
|
||||
for(int warmup = 1; warmup >= 0; --warmup) {
|
||||
int repeat = 2;
|
||||
if(warmup == 0) {
|
||||
repeat = cur_repeats;
|
||||
likwid_markerStartRegion(cur_region_name);
|
||||
}
|
||||
|
||||
kernel(a, b, c, d, repeat, cur_elements);
|
||||
}
|
||||
likwid_markerStopRegion(cur_region_name);
|
||||
}
|
||||
likwid_markerClose();
|
||||
free(a);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user