Skip to content

ahban/compilecuda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository provides a matlab script to help you compile cuda source files.

Requirments

Your kernel functions and functions used to invoke kernel functions must placed into cu files. You mexFunction must defined in a cpp file.

Usage

 compilecuda('file1.cpp file2.cu file3.cu')

Example

We provide an example in the path of test

 cd test  
 addpath ..  
 compilecuda('test_mex.cpp test_gpu.cu')

Matlab NVCC

I also provide a function named nvcc. You can use it like a normal command prompt. For the example above.

cd test
addpath ..
nvcc -O2 -c -w -arch sm_30  test_gpu.cu
mex -O  test_mex.cpp test_gpu.obj -lcudart -L/the/path/of/cudart/lib

IF you think this script is useful for you, please leave me a star. Thanks~~

About

compile cuda source files in Matlab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published