From ce2e0eff009653e207df34f83fa6259a39f6fe84 Mon Sep 17 00:00:00 2001 From: AlexeyAB Date: Tue, 5 Feb 2019 00:36:17 +0300 Subject: [PATCH] DEBUG=1 fixed --- Makefile | 3 ++- src/cuda.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 17c96cd3..d06e6ace 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,8 @@ COMMON= -Iinclude/ CFLAGS=-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC ifeq ($(DEBUG), 1) -OPTS= -O0 -g +#OPTS= -O0 -g +#OPTS= -Og -g COMMON+= -DDEBUG CFLAGS+= -DDEBUG else diff --git a/src/cuda.c b/src/cuda.c index 028b1c04..85c8a299 100644 --- a/src/cuda.c +++ b/src/cuda.c @@ -13,7 +13,7 @@ void cuda_set_device(int n) { gpu_index = n; cudaError_t status = cudaSetDevice(n); - CHECK_CUDA(status); + if(status != cudaSuccess) CHECK_CUDA(status); } int cuda_get_device()