Opened 7 years ago

Closed 5 years ago

#11822 closed Bugs (invalid)

nvcc can not compile BOOST_AUTO_TEST_CASE_TEMPLATE

Reported by: e.zenker@… Owned by: Gennadiy Rozental
Milestone: To Be Determined Component: test
Version: Boost 1.59.0 Severity: Problem
Keywords: nvcc test template Cc:

Description

Compiling a test suite for testing CUDA code with nvcc with CUDA 7.5 and gcc 4.9. and leads to the following error:

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/c++/bits/basic_string.h(444): error: identifier "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage" is undefined in device code

/usr/include/boost/test/tree/test_case_template.hpp(84): error: identifier "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_terminal" is undefined in device code

/usr/include/boost/test/tree/test_case_template.hpp(86): error: identifier "_ZTIi" is undefined

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/c++/bits/basic_string.h(444): error: identifier "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage" is undefined in device code

/usr/include/boost/test/tree/test_case_template.hpp(84): error: identifier "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_terminal" is undefined in device code

/usr/include/boost/test/tree/test_case_template.hpp(86): error: identifier "_ZTIl" is undefined

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/c++/bits/basic_string.h(444): error: identifier "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage" is undefined in device code

/usr/include/boost/test/tree/test_case_template.hpp(84): error: identifier "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_terminal" is undefined in device code

The test suite is more or less equal to the simple test in the boost.test documentation for templated tests. Here a snippet:

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE "Tests"

#include <boost/test/unit_test.hpp>
#include <boost/mpl/list.hpp>

typedef boost::mpl::list<int,long,unsigned char> test_types;

BOOST_AUTO_TEST_SUITE( template_test )

BOOST_AUTO_TEST_CASE_TEMPLATE( my_test, T, test_types )
{
    BOOST_CHECK_EQUAL( sizeof(T), (unsigned)4 );
}

BOOST_AUTO_TEST_SUITE_END()

Change History (5)

comment:1 by Raffi Enficiaud, 7 years ago

Hi,

Are you sure you are able to compile any C++ code? What is the command line that you use for compiling with nvcc?

comment:2 by anonymous, 7 years ago

I don't think we can avoid using std::string in Boost.Test. Is there a way to enable STL in cuda code?

comment:3 by Raffi Enficiaud, 6 years ago

It is not clear what you are trying to do and what the problem is. Please post a snippet/file with the command line for compilation, and the trace of the error you got.

Last edited 6 years ago by Raffi Enficiaud (previous) (diff)

comment:4 by Raffi Enficiaud, 5 years ago

Ay news?

comment:5 by Raffi Enficiaud, 5 years ago

Resolution: invalid
Status: newclosed

Closing, no news for 2 years.

Note: See TracTickets for help on using tickets.