Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Jamroot
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ else if [ os.name ] = MACOSX
toolset-choices += darwin ;
}

# nvcc toolsets
if [ os.name ] = NT
{
toolset-choices += nvcc-9.2 ;
}
else if [ os.name ] = CYGWIN
{
toolset-choices += nvcc-9.2 ;
}
else if [ os.name ] = LINUX
{
toolset-choices += nvcc-9.1 ;
}
else if [ os.name ] = MACOSX
{
toolset-choices += nvcc-9.2 ;
}

echo "building for the following toolsets:" ;
for local t in $(toolset-choices)
{
Expand Down Expand Up @@ -100,3 +118,11 @@ link main_a_cpp.cpp liba_cpp ;
link stdlib_io_cpp.cpp ;
link stdlib_cpp.cpp ;
run hello_cpp.cpp ;

#compile a_cu.cu : <toolset>nvcc ;
#link main_cu.cu : <toolset>nvcc ;
#lib liba_cu : a_cu.cu a_cu.cuh : <toolset>nvcc ;
#link main_a_cu.cu liba_cu : <toolset>nvcc ;
#link stdlib_io_cu.cu : <toolset>nvcc ;
#link stdlib_cu.cu : <toolset>nvcc ;
#run hello_cu.cu : <toolset>nvcc ;
17 changes: 17 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,29 @@ following command.
link=static \
threading=single

To limit tests during development, narrow the properties as much as
possible to test as few variants as desired. For example, to minimize
the GPU architecture and GPU code, run the following command.

.. code:: sh

$ b2 --test-config=user-config.jam \
--hash \
toolset=nvcc \
gpu-architecture=compute_70 \
gpu-code=sm_70

Requirements
------------

* Boost.Build
* All desired compilers

NVIDIA nvcc
~~~~~~~~~~~

CUDA installed in the default location.

Adding Toolsets
---------------

Expand Down
9 changes: 9 additions & 0 deletions a_cu.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "a_cpp.cuh"

namespace acpp
{
void
acpp ()
{
}
}
10 changes: 10 additions & 0 deletions a_cu.cuh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef acpp_hpp_
#define acpp_hpp_

namespace acpp
{
void
acpp ();
}

#endif
9 changes: 9 additions & 0 deletions hello_cu.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <string>

int
main ()
{
std::string s ("Hello, world!\n");

return 0;
}
9 changes: 9 additions & 0 deletions main_a_cu.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "a_cpp.cuh"

int
main ()
{
acpp::acpp ();

return 0;
}
5 changes: 5 additions & 0 deletions main_cu.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
int
main ()
{
return 0;
}
16 changes: 16 additions & 0 deletions project-config.jam
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import os ;

path-constant boost-build-nvcc : ../boost-build-nvcc ;

# @todo HACK - add tools to the Boost.Build path
{
import modules ;

local boost-build-path = [ modules.peek : BOOST_BUILD_PATH ] ;
modules.poke : BOOST_BUILD_PATH : $(boost-build-nvcc) $(boost-build-path) ;
}

path-constant HOME : [ os.environ HOME ] ;

# Default toolsets
if [ os.name ] = NT
{
Expand All @@ -17,3 +29,7 @@ else if [ os.name ] = MACOSX
{
using darwin ;
}

# NVIDIA toolsets

using nvcc ;
9 changes: 9 additions & 0 deletions stdlib_cu.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <string>

int
main ()
{
std::string s ("Hello, world!\n");

return 0;
}
9 changes: 9 additions & 0 deletions stdlib_io_cu.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <iostream>

int
main ()
{
std::cout << "Hello, world!\n";

return 0;
}