discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: cuda compiler


From: Nicola Pero
Subject: RE: cuda compiler
Date: Thu, 15 May 2008 10:49:22 +0200 (CEST)

You need:

 * a rule to compile your CUDA files into C files (you can presumably put this 
in a cuda.make files that you then include just after include 
$(GNUSTEP_MAKEFILES)/common.make) Eg, here is an untested example (I never
used this compiler, I'm just guessing, you may need to edit the command line) --

NVCC=nvcc

%.cu.c : %.cu
        $(ECHO_COMPILING)$(NVCC) %< -cuda -o $@$(END_ECHO)

 * to make sure the files are compiled at all, add the *generated* C files to
the list of Foo_C_FILES.  Make will realize it needs the C files to compile, 
find the rule to generate them and use it to generate them before later 
compiling
them.

Full (untested) example is then --

cuda.make
------------
NVCC=nvcc

%.cu.c : %.cu
        $(ECHO_COMPILING)$(NVCC) %< -cuda -o $@$(END_ECHO)
------------

GNUmakefile
------------
include $(GNUSTEP_MAKEFILES)/common.make
include cuda.make

APP_NAME = Foo

Foo_OBJC_FILES = Foo.m
Foo_C_FILES = kernel.cu.c

include $(GNUSTEP_MAKEFILES)/application.make
------------

Let me know if that works for you or if you have any problems (or if it wasn't
what you were trying to do!) :-)

Thanks

PS: Thinking about it, you may want to add also a 'clean' rule that removes 
the generated '.cu.c' files --

after-clean::
        -rm kernel.cu.c

I suppose you could be more clever and keep the list of CUDA files in a separate
variable etc. to make it more general - anyway just try to get the basics 
working
first ;-)

-----Original Message-----
From: Thomas Gamper <icicle@cg.tuwien.ac.at>
Sent: Thursday, 15 May, 2008 10:21
To: discuss-gnustep@gnu.org
Subject: cuda compiler

Hi!

I am doing some heavy numbercrunching in confunction with Foundations 
NSThreads and Distributed Objects. Additionally I would like to use CUDA 
( http://www.nvidia.com/object/cuda_home.html ). CUDA has its own 
compiler, and I would like to integrate that one in GNUstep make to make 
development of a combined GNUstep and CUDA application easier:

-----
include $(GNUSTEP_MAKEFILES)/common.make

APP_NAME = Foo

Foo_OBJC_FILES = Foo.m
Foo_CUDA_FILES = kernel.cu

include $(GNUSTEP_MAKEFILES)/application.make
-----

Can anybody give me some hints? :)

Thanks
TOM


_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep






reply via email to

[Prev in Thread] Current Thread [Next in Thread]