1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-25 17:44:23 +00:00

Clean up some things idk

This commit is contained in:
Stefano Pigozzi 2022-11-30 15:09:26 +01:00
parent 165bf67262
commit 40affe04f5
2 changed files with 14 additions and 20 deletions

View file

@ -18,28 +18,18 @@ run_benchmarks() {
for dataset in MINI_DATASET SMALL_DATASET STANDARD_DATASET LARGE_DATASET EXTRALARGE_DATASET for dataset in MINI_DATASET SMALL_DATASET STANDARD_DATASET LARGE_DATASET EXTRALARGE_DATASET
do do
for c in $(seq 0 15) for c in $(seq 0 3)
do do
cxxflags="-D$dataset" cxxflags="-D$dataset"
if (( $c & 1 )) if (( $c & 1 ))
then then
cxxflags="$cxxflags -DTOGGLE_INIT_ARRAY_1" cxxflags="$cxxflags -DPOLYBENCH_INCLUDE_INIT"
fi fi
if (( $c & 2 )) if (( $c & 2 ))
then then
cxxflags="$cxxflags -DTOGGLE_INIT_ARRAY_2" cxxflags="$cxxflags -DPOLYBENCH_USE_CUDA"
fi
if (( $c & 4 ))
then
cxxflags="$cxxflags -DTOGGLE_KERNEL_ATAX_1"
fi
if (( $c & 8 ))
then
cxxflags="$cxxflags -DTOGGLE_KERNEL_ATAX_2"
fi fi
echo "Flags: $cxxflags" echo "Flags: $cxxflags"

View file

@ -126,26 +126,30 @@ __host__ int main(int argc, char** argv)
A[x] = new DATA_TYPE[NY] {}; A[x] = new DATA_TYPE[NY] {};
} }
DATA_TYPE* x = new DATA_TYPE[NY] {}; // X[NY]
DATA_TYPE* y = new DATA_TYPE[NX] {}; DATA_TYPE* X = new DATA_TYPE[NY] {};
// Y[NX]
DATA_TYPE* Y = new DATA_TYPE[NX] {};
#ifdef POLYBENCH_INCLUDE_INIT #ifdef POLYBENCH_INCLUDE_INIT
polybench_start_instruments; polybench_start_instruments;
#endif #endif
init_array(A, x, y); init_array(A, X, Y);
#ifndef POLYBENCH_INCLUDE_INIT #ifndef POLYBENCH_INCLUDE_INIT
polybench_start_instruments; polybench_start_instruments;
#endif #endif
kernel_atax(A, x, y); kernel_atax(A, X, Y);
polybench_stop_instruments; polybench_stop_instruments;
polybench_print_instruments; polybench_print_instruments;
/* Prevent dead-code elimination. All live-out data must be printed by the function call in argument. */ polybench_prevent_dce(
polybench_prevent_dce(print_array(y)); print_array(Y)
);
#else #else