diff --git a/TPs/TP3/CODE/ONGPU/Makefile b/TPs/TP3/CODE/ONGPU/Makefile index 645485d0a4969d2113063ffe05db79d7182c7c3c..76dd3a13d868d01fc5218a2ea6c702ab4c921ac3 100755 --- a/TPs/TP3/CODE/ONGPU/Makefile +++ b/TPs/TP3/CODE/ONGPU/Makefile @@ -1,8 +1,8 @@ -CC=clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 +CC=clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_61 CFLAGS=-O3 -Wall LDFLAGS=-lm -lrt -EXEC=dgemm.exe +EXEC=ongpu SRC=$(wildcard *.c) OBJ=$(SRC:.c=.o) diff --git a/TPs/TP3/CODE/ONGPU/ongpu.c b/TPs/TP3/CODE/ONGPU/ongpu.c index 8a9260c7fac585f62364f7848207ff274679c730..901ab15978b8401e87db2677f19c4a8b5a2df1e7 100755 --- a/TPs/TP3/CODE/ONGPU/ongpu.c +++ b/TPs/TP3/CODE/ONGPU/ongpu.c @@ -3,19 +3,19 @@ int main() { - int runningOnGPU = 0; - fprintf(stderr, "OpenMP Version: %d\n", _OPENMP); - /* Test if GPU is available using OpenMP4.5 */ + int runningOnGPU = 0; + fprintf(stderr, "OpenMP Version: %d\n", _OPENMP); + /* Test if GPU is available using OpenMP4.5 */ #pragma omp target map(from:runningOnGPU) - { - if (omp_is_initial_device() == 0) - runningOnGPU = 1; - } - /* If still running on CPU, GPU must not be available */ - if (runningOnGPU) - printf("### Able to use the GPU! ### \n"); - else - printf("### Unable to use the GPU, using CPU! ###\n"); + { + if (omp_is_initial_device() == 0) + runningOnGPU = 1; + } + /* If still running on CPU, GPU must not be available */ + if (runningOnGPU) + printf("### Able to use the GPU! ### \n"); + else + printf("### Unable to use the GPU, using CPU! ###\n"); - return 0; + return 0; }