0

I have created a simple example for CUDA and Mathlink based on the website here:

http://hpc.nomad-labs.com/archives/3

When I attempt to install the function in Mathematica using "Install[...]", Mathematica never finishes the installation of that function. I created and tested a simple C function that I am able to install in Mathematica without a function.

The error seems to occur when I link in the CUDA libraries even if I don't have a CUDA function in the file.

To clarify, I don't want to use the package CUDALink. I want to load the CUDA function as a C function in Mathematica. I have a working version of my program using CUDALink but I can't control the stack and heap size with CUDALink. By creating a C program and using the command "Install[...]", I have control over stack size and heap size.

Am I missing something here?

I am using Ubuntu 12.04 with CUDA 4.2.

Does anyone have a working example of CUDA and Mathlink in Mathematica 8.0?

talonmies
  • 70,661
  • 34
  • 192
  • 269

1 Answers1

0

First, you need to install CUDAResource. Download the proper LINUX paclet from here. Subsequently, open mathematica and install the paclet using following mathematica command:

CUDAResourcesInstall["/path/to/CUDAResources-Lin64-8.0.4.1.paclet", Update->True]

Then, run the following command to import the CUDA utilities at the command line of mathematica:

Needs["CUDALink`"]

Now follow this manual to compile your code or this one to see the list of available built-in utilities.

lashgar
  • 5,184
  • 3
  • 37
  • 45
  • Thanks for your response. I am actually trying to load the CUDA function without using CUDALink. The reason for this is that CUDALink does not let you control the stack size, heap size, etc. By compiling the CUDA function into a C function, I can control everything. – user1837601 Nov 20 '12 at 17:53