Skip to content

Commit a6f60a2

Browse files
tee3tom-radar
authored andcommitted
Added nvcc to the list of toolsets to test.
This assumes that the nvcc toolset is in a directory named ../boost-build-nvcc.
1 parent 879ae00 commit a6f60a2

File tree

10 files changed

+119
-0
lines changed

10 files changed

+119
-0
lines changed

Jamroot

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ else if [ os.name ] = MACOSX
2222
toolset-choices += darwin ;
2323
}
2424

25+
# nvcc toolsets
26+
if [ os.name ] = NT
27+
{
28+
toolset-choices += nvcc-9.2 ;
29+
}
30+
else if [ os.name ] = CYGWIN
31+
{
32+
toolset-choices += nvcc-9.2 ;
33+
}
34+
else if [ os.name ] = LINUX
35+
{
36+
toolset-choices += nvcc-9.1 ;
37+
}
38+
else if [ os.name ] = MACOSX
39+
{
40+
toolset-choices += nvcc-9.2 ;
41+
}
42+
2543
echo "building for the following toolsets:" ;
2644
for local t in $(toolset-choices)
2745
{
@@ -100,3 +118,11 @@ link main_a_cpp.cpp liba_cpp ;
100118
link stdlib_io_cpp.cpp ;
101119
link stdlib_cpp.cpp ;
102120
run hello_cpp.cpp ;
121+
122+
#compile a_cu.cu : <toolset>nvcc ;
123+
#link main_cu.cu : <toolset>nvcc ;
124+
#lib liba_cu : a_cu.cu a_cu.cuh : <toolset>nvcc ;
125+
#link main_a_cu.cu liba_cu : <toolset>nvcc ;
126+
#link stdlib_io_cu.cu : <toolset>nvcc ;
127+
#link stdlib_cu.cu : <toolset>nvcc ;
128+
#run hello_cu.cu : <toolset>nvcc ;

README.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,29 @@ following command.
8080
link=static \
8181
threading=single
8282
83+
To limit tests during development, narrow the properties as much as
84+
possible to test as few variants as desired. For example, to minimize
85+
the GPU architecture and GPU code, run the following command.
86+
87+
.. code:: sh
88+
89+
$ b2 --test-config=user-config.jam \
90+
--hash \
91+
toolset=nvcc \
92+
gpu-architecture=compute_70 \
93+
gpu-code=sm_70
94+
8395
Requirements
8496
------------
8597

8698
* Boost.Build
8799
* All desired compilers
88100

101+
NVIDIA nvcc
102+
~~~~~~~~~~~
103+
104+
CUDA installed in the default location.
105+
89106
Adding Toolsets
90107
---------------
91108

a_cu.cu

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "a_cpp.cuh"
2+
3+
namespace acpp
4+
{
5+
void
6+
acpp ()
7+
{
8+
}
9+
}

a_cu.cuh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef acpp_hpp_
2+
#define acpp_hpp_
3+
4+
namespace acpp
5+
{
6+
void
7+
acpp ();
8+
}
9+
10+
#endif

hello_cu.cu

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <string>
2+
3+
int
4+
main ()
5+
{
6+
std::string s ("Hello, world!\n");
7+
8+
return 0;
9+
}

main_a_cu.cu

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "a_cpp.cuh"
2+
3+
int
4+
main ()
5+
{
6+
acpp::acpp ();
7+
8+
return 0;
9+
}

main_cu.cu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
int
2+
main ()
3+
{
4+
return 0;
5+
}

project-config.jam

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
import os ;
22

3+
path-constant boost-build-nvcc : ../boost-build-nvcc ;
4+
5+
# @todo HACK - add tools to the Boost.Build path
6+
{
7+
import modules ;
8+
9+
local boost-build-path = [ modules.peek : BOOST_BUILD_PATH ] ;
10+
modules.poke : BOOST_BUILD_PATH : $(boost-build-nvcc) $(boost-build-path) ;
11+
}
12+
13+
path-constant HOME : [ os.environ HOME ] ;
14+
315
# Default toolsets
416
if [ os.name ] = NT
517
{
@@ -17,3 +29,7 @@ else if [ os.name ] = MACOSX
1729
{
1830
using darwin ;
1931
}
32+
33+
# NVIDIA toolsets
34+
35+
using nvcc ;

stdlib_cu.cu

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <string>
2+
3+
int
4+
main ()
5+
{
6+
std::string s ("Hello, world!\n");
7+
8+
return 0;
9+
}

stdlib_io_cu.cu

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <iostream>
2+
3+
int
4+
main ()
5+
{
6+
std::cout << "Hello, world!\n";
7+
8+
return 0;
9+
}

0 commit comments

Comments
 (0)