1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-22 16:14:24 +00:00

Gate CUDA usage behind the POLYBENCH_USE_CUDA flag

This commit is contained in:
Steffo 2022-11-29 17:47:34 +01:00 committed by GitHub
parent f7cbdba3a2
commit b526108132
Signed by: github
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,6 +108,8 @@ __host__ static void kernel_atax(DATA_TYPE** A, DATA_TYPE* X, DATA_TYPE* Y)
*/
__host__ int main(int argc, char** argv)
{
#ifndef POLYBENCH_USE_CUDA
// A[NX][NY]
DATA_TYPE** A = new DATA_TYPE*[NX] {};
for(unsigned int x = 0; x < NX; x++)
@ -136,5 +138,11 @@ __host__ int main(int argc, char** argv)
/* Prevent dead-code elimination. All live-out data must be printed by the function call in argument. */
polybench_prevent_dce(print_array(y));
#else
#endif
return 0;
}