Where is launch_calculator.h?

Trying to compile a library which uses CUSP and THRUST, I came across the following error

In file included from /usr/local/cuda/include/cusp/system/cuda/detail/multiply/coo_flat_spmv.h:21:0,
                 from /usr/local/cuda/include/cusp/system/cuda/detail/multiply.h:21,
                 from /usr/local/cuda/include/cusp/system/cuda/execution_policy.h:50,
                 from /usr/local/cuda/include/cusp/execution_policy.h:34,
                 from /usr/local/cuda/include/cusp/convert.h:25,
                 from /usr/local/cuda/include/cusp/detail/coo_matrix.inl:18,
                 from /usr/local/cuda/include/cusp/coo_matrix.h:605,
                 from lnInclude/cudaTypes.H:57,
                 from lnInclude/cudaSolver.H:42,
                 from cudaCG/cudaCG.H:43,
                 from cudaCG/cudaCG.C:26:
/usr/local/cuda/include/cusp/system/cuda/arch.h:24:10: fatal error: thrust/system/cuda/detail/detail/launch_calculator.h: No such file or directory
 #include <thrust/system/cuda/detail/detail/launch_calculator.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

In fact, there is no such file

root@orca:cudaSolvers# find /usr/local/cuda-9.1/include/ -name launch_calculator.h
root@orca:cudaSolvers#

More precisely, there is no /usr/local/cuda-9.1/include/thrust/system/cuda/detail/detail*

root@orca:cudaSolvers# ls /usr/local/cuda-9.1/include/thrust/system/cuda/detail/detail
ls: cannot access '/usr/local/cuda-9.1/include/thrust/system/cuda/detail/detail': No such file or directory

The arch.h says

#if THRUST_VERSION >= 100700
#include <thrust/system/cuda/detail/detail/launch_calculator.h>
#elif THRUST_VERSION >= 100600
#include <thrust/system/cuda/detail/arch.h>
#else
#include <thrust/detail/backend/cuda/arch.h>

Looking at the toolkit documentation [1], the version should be 1.7.0. So, I think something has been missed in the toolkit. I searched the web and found some pages that people have such problem with cuda-9 RC. So, the hope was that this problem would be fixed.

Any idea? I have stuck at this problem.

[1] http://docs.nvidia.com/cuda/thrust/index.html

The version of thrust included with CUDA 9.1 is 1.9.1:

grep “#define THRUST_VERSION” /usr/local/cuda/include/thrust/version.h
#define THRUST_VERSION 100901

You probably should update to the latest (develop) version of CUSP. The offending code looks different there:

https://github.com/cusplibrary/cusplibrary/blob/develop/cusp/system/cuda/arch.h#L23

The cuda9 branch of cusp has also been updated:

https://github.com/cusplibrary/cusplibrary/blob/cuda9/cusp/system/cuda/arch.h#L23

My guess is that the cusp version you are trying to use is just old/out-of-date.

OK. I used cuda9 branch. That error is solved but I get many warnings like this

In file included from /usr/local/cuda/include/host_defines.h:50:0,
                 from /usr/local/cuda/include/driver_types.h:53,
                 from /usr/local/cuda/include/cublas_api.h:72,
                 from /usr/local/cuda/include/cublas_v2.h:65,
                 from /usr/local/cuda/include/cusp/system/cuda/detail/cublas/execute_with_cublas.h:23,
                 from /usr/local/cuda/include/cusp/system/cuda/detail/par.h:21,
                 from /usr/local/cuda/include/cusp/iterator/detail/device_system_tag.h:23,
                 from /usr/local/cuda/include/cusp/iterator/iterator_traits.h:38,
                 from /usr/local/cuda/include/cusp/memory.h:25,
                 from /usr/local/cuda/include/cusp/array1d.h:26,
                 from /usr/local/cuda/include/cusp/coo_matrix.h:28,
                 from lnInclude/cudaTypes.H:57,
                 from lnInclude/cudaSolver.H:42,
                 from cudaCG/cudaCG.H:43,
                 from cudaCG/cudaCG.C:26:
/usr/local/cuda/include/crt/host_defines.h:188:0: warning: "__device__" redefined
 #define __device__ \

and errors like this

In file included from /usr/local/cuda/include/cusp/system/cuda/detail/execution_policy.h:29:0,
                 from /usr/local/cuda/include/cusp/system/cuda/detail/par.h:20,
                 from /usr/local/cuda/include/cusp/iterator/detail/device_system_tag.h:23,
                 from /usr/local/cuda/include/cusp/iterator/iterator_traits.h:38,
                 from /usr/local/cuda/include/cusp/memory.h:25,
                 from /usr/local/cuda/include/cusp/array1d.h:26,
                 from /usr/local/cuda/include/cusp/coo_matrix.h:28,
                 from cudaSolver/cudaTypes.H:57,
                 from cudaSolver/cudaSolver.H:42,
                 from cudaSolver/cudaSolver.C:26:
/usr/local/cuda/include/thrust/system/cuda/detail/par.h: At global scope:
/usr/local/cuda/include/thrust/system/cuda/detail/par.h:37:28: error: ‘cudaStream_t’ does not name a type; did you mean ‘ITstream_H’?
 __host__ __device__ inline cudaStream_t default_stream()
                            ^~~~~~~~~~~~
                            ITstream_H

Is that related to cusp? Although I used cuda9 branch, the developer branch is much newer than that. Should I try that?