Fix makefile cuda
This commit is contained in:
parent
35c028dbeb
commit
5d765ed3e0
7 changed files with 5 additions and 3 deletions
|
|
@ -3,7 +3,7 @@ CC = g++
|
|||
NVCC = nvcc
|
||||
|
||||
# Compiler flags
|
||||
CFLAGS = -Wall -Wextra -std=c++11
|
||||
CFLAGS = -Wall -Wextra -std=c++11 -I/usr/local/cuda/include
|
||||
NVCCFLAGS = -std=c++11
|
||||
|
||||
# Directories
|
||||
|
|
@ -19,7 +19,7 @@ CU_OBJS = $(patsubst $(SRCDIR)/%.cu, $(BUILDDIR)/%.cu.o, $(CU_SRCS))
|
|||
|
||||
# CUDA flags and libraries
|
||||
CUDAFLAGS = -arch=sm_75
|
||||
CUDALIBS = -L/usr/local/cuda-10.2/lib64/ -lcudart -lcuda
|
||||
CUDALIBS = -L/usr/local/cuda -lcudart -lcuda
|
||||
|
||||
# Rule to build the target
|
||||
$(TARGET): $(OBJS) $(CU_OBJS)
|
||||
|
|
|
|||
BIN
build/cuda.cu.o
BIN
build/cuda.cu.o
Binary file not shown.
Binary file not shown.
BIN
build/tensor.o
BIN
build/tensor.o
Binary file not shown.
|
|
@ -100,7 +100,8 @@ extern "C" {
|
|||
tensor->device = device;
|
||||
}
|
||||
#else
|
||||
printf("Warning: CUDA is not available. Cannot perform GPU operations.\n");
|
||||
fprintf(stderr, "ERROR: CUDA is not available. Cannot perform GPU operations.\n");
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -206,6 +206,7 @@ class Tensor:
|
|||
result_data = Tensor()
|
||||
result_data.tensor = result_tensor_ptr
|
||||
result_data.shape = self.shape.copy()
|
||||
result_data.device = self.device
|
||||
result_data.ndim = 2
|
||||
|
||||
return result_data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue