Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.
/ mkmf-cu Public archive

A gem to build Ruby extensions written in C/C++ with NVIDIA CUDA.

License

Notifications You must be signed in to change notification settings

ruby-accel/mkmf-cu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About mkmf-cu

mkmf-cu is a gem to build Ruby extensions written in C/C++ with NVIDIA CUDA. It consists of a simple wrapper command for nvcc and a monkey patch for mkmf.

How to use it.

Instead of require "mkmf", just

require "mkmf-cu"

How does it work?

By requiring "mkmf-cu", compiler commands defined in mkmf will be replaced with mkmf-cu-nvcc, a command included in this gem.

When mkmf-cu-nvcc is called with arguments for gcc or clang, it convert them to ones suitable for nvcc and execute nvcc with them.

For example,

mkmf-cu-nvcc -I. -fno-common -pipe -Os -O2 -Wall -o culib.o -c culib.cu

will execute

nvcc -I. -O2 -o culib.o -c culib.cu --compiler-options -fno-common --compiler-options -Wall

Example

Notice

When the suffix of the name of a file containing CUDA code is not .cu, you must add the option "-x cu" to $CFLAGS or $CXXFLAGS in extconf.rb.

About

A gem to build Ruby extensions written in C/C++ with NVIDIA CUDA.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages