1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-29 03:24:22 +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
do
for c in $(seq 0 15)
for c in $(seq 0 3)
do
cxxflags="-D$dataset"
if (( $c & 1 ))
then
cxxflags="$cxxflags -DTOGGLE_INIT_ARRAY_1"
cxxflags="$cxxflags -DPOLYBENCH_INCLUDE_INIT"
fi
if (( $c & 2 ))
then
cxxflags="$cxxflags -DTOGGLE_INIT_ARRAY_2"
fi
if (( $c & 4 ))
then
cxxflags="$cxxflags -DTOGGLE_KERNEL_ATAX_1"
fi
if (( $c & 8 ))
then
cxxflags="$cxxflags -DTOGGLE_KERNEL_ATAX_2"
cxxflags="$cxxflags -DPOLYBENCH_USE_CUDA"
fi
echo "Flags: $cxxflags"

View file

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