__global__ void cgeMatrixInverse_kernel(cuFloatComplex *invA , cuFloatComplex *A , int N , cuFloatComplex *Work)
{
int i;
int idx = blockDim.x * blockIdx.x + threadIdx.x;
cuFloatComplex * ThreadWorkSpace;
ThreadWorkSpace = Work + idx*cgeMatrixInverse_WorkSpace()*N*N;
for(i=0;i<N*N;i++) A[ i + idx*N*N ] = A[i];
A[ idx*N*N ] = make_cuFloatComplex( (float) idx , 1./sqrtf(2));
cgeMatrixInverse(invA + idx*N*N , A + idx*N*N , N , ThreadWorkSpace);
}
_______________________
and my makefile is
# edit the path of your working directory
BASE_PATH = /home/rcabrera/Documents/source/c/inverseCUDA
#
CUDA_PATH = /usr/local/cuda
CC = gcc
NVCC := $(CUDA_PATH)/bin/nvcc
CUDA_INCLUDE_PATH = /usr/local/cuda/include
CUDA_LIB_PATH := $(CUDA_PATH)/lib64
CUDA_LIBS = -lcuda -lcudart
a.out: main.cu cuinverse_kernel.cu cumatrixtools.h
$(NVCC) -I$(CUDA_INCLUDE_PATH) -L$(CUDA_LIB_PATH) $(CUDA_LIBS) -lm main.cu -o a.out
# $(NVCC) -deviceemu -I$(CUDA_INCLUDE_PATH) -L$(CUDA_LIB_PATH) $(CUDA_LIBS) -lm main.cu -o a.out
clean :
rm -f a.out
No comments:
Post a Comment