Re: IDL linking with CUDA [message #61703] |
Sat, 26 July 2008 09:47 |
galmar
Messages: 1 Registered: July 2008
|
Junior Member |
|
|
On Jul 25, 9:46 pm, "hotplainr...@gmail.com" <hotplainr...@gmail.com>
wrote:
> Hi guys,
>
> I'd like to link CUDA and IDL so that I can program some matrix mults
> and radon transform, filtering etc.
>
> Things done:
> 1. I've checked out CALL_EXTERN() and IDL System Routine.
> 2.
>
> Any tips on how do I go about it?
>
> Zaki
I've linked CUDA with IDL (and GDL) using LINKIMAGE.
Essentially I write a C or C++ routine that wraps the CUDA routines
and then within IDL/GDL
call the LINKIMAGE procedure followed by the routine call.
Here are my Makefile entries for the GDL example:
CXX = g++
CXXFLAGS = -fPIC
NVCC = nvcc -Xcompiler "-m32" -Xcompiler "-fPIC" -deviceemu
LD = ld
INCLUDE = -I.
INC_CUDA = -I/CUDADIR/cuda/include -I/CUDADIR/NVIDIA_CUDA_SDK/common/
inc
LDFLAGS_CUDA = -lcuda -lcudart -lGL -lGLU -lcutil_PIC
LIB_CUDA = -L/GCCDIR/install/4.2.0/lib -L/CUDADIR/NVIDIA_CUDA_SDK/lib -
L/CUDADIR/NVIDIA_CUDA_SDK/common/lib
indx.so: indx.cpp indx.cu
${CXX} ${CXXFLAGS} -o indx.o -c indx.cpp
${NVCC} -o indx.cu_o -c indx.cu ${INCLUDE} ${INC_CUDA}
g++ -fPIC -shared -o indx.so indx.o indx.cu_o ${LIB_CUDA} $
{LDFLAGS_CUDA}
Here's the linkimage call within IDL/GDL:
linkimage,'indx','./indx.so',0,'indx'
I place the C++ wrapper entries in "indx.cpp" and the CUDA kernel in
"indx.cu"
I can provide more detailed information if you like.
Joel
|
|
|
Re: IDL linking with CUDA [message #61706 is a reply to message #61703] |
Fri, 25 July 2008 19:26  |
pook41
Messages: 16 Registered: January 2007
|
Junior Member |
|
|
On Jul 26, 10:46 am, "hotplainr...@gmail.com" <hotplainr...@gmail.com>
wrote:
> Hi guys,
>
> I'd like to link CUDA and IDL so that I can program some matrix mults
> and radon transform, filtering etc.
>
> Things done:
> 1. I've checked out CALL_EXTERN() and IDL System Routine.
> 2.
>
> Any tips on how do I go about it?
>
> Zaki
Search this group for GPULIB
Andrew
|
|
|