Hello people,
this is avery simple problem, yet i havent found solution.
is it possible to compile a simple hello world with nvcc and include the <tr1/unordered_map> ??
The Code to test:
#include <cuda.h>
#include <tr1/unordered_map>
#include <iostream>
int main(){
std::cout << "hello cuda and hashmap" << std:endl;
}
when compiling:
nvcc test.cu
i get these errors :
/usr/include/c++/4.4/tr1_impl/type_traits(226): error: expected an identifier
/usr/include/c++/4.4/tr1_impl/type_traits(227): error: expected a ")"
/usr/include/c++/4.4/tr1_impl/type_traits(227): error: a template argument list is not allowed in a declaration of a primary template
/usr/include/c++/4.4/tr1_impl/type_traits(229): error: expected an identifier
/usr/include/c++/4.4/tr1_impl/type_traits(230): error: expected a ")"
/usr/include/c++/4.4/tr1_impl/type_traits(230): error: a template argument list is not allowed in a declaration of a primary template
/usr/include/c++/4.4/tr1_impl/type_traits(232): error: expected an identifier
/usr/include/c++/4.4/tr1_impl/type_traits(233): error: expected a ")"
/usr/include/c++/4.4/tr1_impl/type_traits(233): error: expected a ">"
/usr/include/c++/4.4/tr1_impl/type_traits(235): error: expected an identifier
/usr/include/c++/4.4/tr1_impl/type_traits(236): error: expected a ")"
/usr/include/c++/4.4/tr1_impl/type_traits(236): error: expected a ">"
/usr/include/c++/4.4/tr1_impl/type_traits(238): error: expected an identifier
/usr/include/c++/4.4/tr1_impl/type_traits(239): error: expected a ")"
/usr/include/c++/4.4/tr1_impl/type_traits(239): error: expected a ">"
/usr/include/c++/4.4/tr1_impl/type_traits(241): error: expected an identifier
/usr/include/c++/4.4/tr1_impl/type_traits(242): error: expected a ")"
/usr/include/c++/4.4/tr1_impl/type_traits(242): error: expected a ">"
/usr/include/c++/4.4/tr1_impl/type_traits(244): error: expected an identifier
/usr/include/c++/4.4/tr1_impl/type_traits(245): error: expected a ")"
/usr/include/c++/4.4/tr1_impl/type_traits(245): error: expected a ">"
/usr/include/c++/4.4/tr1_impl/type_traits(247): error: expected an identifier
/usr/include/c++/4.4/tr1_impl/type_traits(248): error: expected a ")"
/usr/include/c++/4.4/tr1_impl/type_traits(248): error: expected a ">"
test.cu(6): error: a namespace name is not allowed
test.cu(6): error: expected a ";"
26 errors detected in the compilation of "/tmp/tmpxft_00000cd0_00000000-4_test.cpp1.ii".
and if i name it to *.cc it works, however i cant put kernels or anything cuda related.
more information:
$ g++ --version
g++ (Ubuntu/Linaro 4.4.5-15ubuntu1) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2011 NVIDIA Corporation
Built on Sun_Mar_20_16:45:27_PDT_2011
Cuda compilation tools, release 4.0, V0.2.1221
what is the best way to fix this?
edit:
i already saw
and
and the solutions provided there didnt work