I am new to CUDA and have come across a error in compiling my makfile.
# Compilers
NVCC = /usr/local/cuda/bin/nvcc
CXX = /usr/bin/g++
LINK = $(CXX) -fPIC
# Flags
COMMONFLAGS = -O2
NVCCFLAGS = --compiler-options -fno-strict-aliasing
CXXFLAGS = -fno-strict-aliasing
CFLAGS = -g -fno-strict-aliasing
# Paths
INCLUDES = -I. -I/usr/local/cuda/include
LIBS = -L/usr/local/cuda/lib64 -lcufft
# Program-specific
TARGET= testCUDAMUL
#SRC = testCUDAMUL.cpp baseconverter.cu
OBJS = testCUDAMUL.cpp.o baseconverter.cu.o
LINKLINE = $(LINK) -o $(TARGET) $(OBJS) $(LIB)
# Build Rules
.SUFFIXES: .cu .cpp .c .o
%.c.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
%.cu.o: %.cu
$(NVCC) $(NVCCFLAGS) $(INCLUDES) -c $< -o $@
%.cpp.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
$(TARGET): $(OBJS) Makefile
$(LINKLINE)
clean:
rm -f $(OBJ) $(TARGET)
baseconverter.cu
#include <stdlib.h>
#include <stdio.h>
#include <vector>
__global__ void hextobinkernel(std::vector<unsigned char> dest, std::vector<
unsigned char> source) {...}
//! @param binary data to convert to dec
extern "C" std::vector<unsigned char> hextodec(const std::vector<unsigned char> &hexrep) {...}
Error
expected constructor, destructor, or type conversion before ‘void’ baseconverter.cu /testCUDAMUL line 16 C/C++ Problem