« Return to Thread: CUDA and MinGW compilation trouble

Re: CUDA and MinGW compilation trouble

by bART Janssens-2 :: Rate this Message:

Reply to Author | View in Thread

On Fri, May 2, 2008 at 5:31 AM, Timothy M. Shead <tshead@...> wrote:
>  > 1. Put all functions that use CUDA in a .h/.c file, declaring them
>  > using __declspec(dllexport) in the .h file.
>  This would need to be conditional based on the platform, que no?

Yes, we need to wrap it in a macro that evaluates to nothing on
non-win32 platforms.

>  > For a more elegant solution, I suggest putting the cuda library of
>  > step 2 in a subdir of k3dsdk, i.e. k3dsdk/cuda. That way, any modules
>  > that want to use CUDA can simply include it in the
>  > TARGET_LINK_LIBRARIES command. I think this has to be a C library,
>  > otherwise the exported symbols are mangled in a way MinGW can't read.
>  >
>  How could this be part of the SDK?  These are the plugin-specific
>  implementations we're talking-about, right?

Well, I was thinking we could put generic methods in this lib, such as:
bitmap_to_device(const k3d bitmap, pointer to device memory)
bitmap_add_constant(pointer  to device memory, const scalar)
bitmap_to_host(const pointer to device memory, k3d bitmap)

Later on, we can add some operations for meshes, like point linear
transformation and so on.

This would mean we only need one k3dsdk-cuda.dll on windows. The
alternative (win32 only) would be to have one dll that has to be in
the search path for each module, often duplicating a lot of code. This
is purely a consequence of MinGW not being able to link in the objects
generated by nvcc, or compile its C output.

The advantage, even on linux, is that operations to move K-3D
structures to and from the device only need to be defined once.

regards,

--
Bart

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

 « Return to Thread: CUDA and MinGW compilation trouble