From fd57f3d384dee7975571dd3070b7ff93e1f6d8d9 Mon Sep 17 00:00:00 2001 From: Thomas Brown Date: Sun, 22 Jul 2018 17:32:18 -0400 Subject: [PATCH] Added nvcc to the list of toolsets to test. This assumes that the nvcc toolset is in a directory named ../boost-build-nvcc. --- Jamroot | 26 ++++++++++++++++++++++++++ README.rst | 17 +++++++++++++++++ a_cu.cu | 9 +++++++++ a_cu.cuh | 10 ++++++++++ hello_cu.cu | 9 +++++++++ main_a_cu.cu | 9 +++++++++ main_cu.cu | 5 +++++ project-config.jam | 16 ++++++++++++++++ stdlib_cu.cu | 9 +++++++++ stdlib_io_cu.cu | 9 +++++++++ 10 files changed, 119 insertions(+) create mode 100644 a_cu.cu create mode 100644 a_cu.cuh create mode 100644 hello_cu.cu create mode 100644 main_a_cu.cu create mode 100644 main_cu.cu create mode 100644 stdlib_cu.cu create mode 100644 stdlib_io_cu.cu diff --git a/Jamroot b/Jamroot index 22fdf54..bf0b478 100644 --- a/Jamroot +++ b/Jamroot @@ -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) { @@ -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 : nvcc ; +#link main_cu.cu : nvcc ; +#lib liba_cu : a_cu.cu a_cu.cuh : nvcc ; +#link main_a_cu.cu liba_cu : nvcc ; +#link stdlib_io_cu.cu : nvcc ; +#link stdlib_cu.cu : nvcc ; +#run hello_cu.cu : nvcc ; diff --git a/README.rst b/README.rst index 760bb08..23f94ad 100644 --- a/README.rst +++ b/README.rst @@ -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 --------------- diff --git a/a_cu.cu b/a_cu.cu new file mode 100644 index 0000000..d8341c5 --- /dev/null +++ b/a_cu.cu @@ -0,0 +1,9 @@ +#include "a_cpp.cuh" + +namespace acpp +{ + void + acpp () + { + } +} diff --git a/a_cu.cuh b/a_cu.cuh new file mode 100644 index 0000000..a17bee9 --- /dev/null +++ b/a_cu.cuh @@ -0,0 +1,10 @@ +#ifndef acpp_hpp_ +#define acpp_hpp_ + +namespace acpp +{ + void + acpp (); +} + +#endif diff --git a/hello_cu.cu b/hello_cu.cu new file mode 100644 index 0000000..94bb4c1 --- /dev/null +++ b/hello_cu.cu @@ -0,0 +1,9 @@ +#include + +int +main () +{ + std::string s ("Hello, world!\n"); + + return 0; +} diff --git a/main_a_cu.cu b/main_a_cu.cu new file mode 100644 index 0000000..dde72e5 --- /dev/null +++ b/main_a_cu.cu @@ -0,0 +1,9 @@ +#include "a_cpp.cuh" + +int +main () +{ + acpp::acpp (); + + return 0; +} diff --git a/main_cu.cu b/main_cu.cu new file mode 100644 index 0000000..938ad05 --- /dev/null +++ b/main_cu.cu @@ -0,0 +1,5 @@ +int +main () +{ + return 0; +} diff --git a/project-config.jam b/project-config.jam index 08c0827..5824cf9 100644 --- a/project-config.jam +++ b/project-config.jam @@ -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 { @@ -17,3 +29,7 @@ else if [ os.name ] = MACOSX { using darwin ; } + +# NVIDIA toolsets + +using nvcc ; diff --git a/stdlib_cu.cu b/stdlib_cu.cu new file mode 100644 index 0000000..94bb4c1 --- /dev/null +++ b/stdlib_cu.cu @@ -0,0 +1,9 @@ +#include + +int +main () +{ + std::string s ("Hello, world!\n"); + + return 0; +} diff --git a/stdlib_io_cu.cu b/stdlib_io_cu.cu new file mode 100644 index 0000000..d7e260d --- /dev/null +++ b/stdlib_io_cu.cu @@ -0,0 +1,9 @@ +#include + +int +main () +{ + std::cout << "Hello, world!\n"; + + return 0; +}