Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A compile error of k2/k2/csrc/cuda/ops_test.cu #96

Closed
Jarvan-Wang opened this issue Aug 28, 2020 · 5 comments
Closed

A compile error of k2/k2/csrc/cuda/ops_test.cu #96

Jarvan-Wang opened this issue Aug 28, 2020 · 5 comments

Comments

@Jarvan-Wang
Copy link
Contributor

OS version is Linux 3.10.0-957.el7.x86_64
nvcc is 10.2
gcc is 6.3.1

Error is here:
`

[ 94%] Building CUDA object k2/csrc/cuda/CMakeFiles/ops_test.dir/ops_test.cu.o
cd /search/odin/wangjiawen/k2/build/k2/csrc/cuda && /usr/local/cuda-10.2/bin/nvcc -forward-unknown-to-host-compiler -DGOOGLE_GLOG_DLL_DECL="" -DGOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS="" -I/search/odin/wangjiawen/k2 -I/search/odin/wangjiawen/k2/build/_deps/cub-src -I/search/odin/wangjiawen/k2/build/_deps/glog_glog-build -I/search/odin/wangjiawen/k2/build/_deps/glog_glog-src/src -I/search/odin/wangjiawen/k2/build/_deps/googletest-src/googlemock/include -isystem=/search/odin/wangjiawen/k2/build/_deps/googletest-src/googletest/include -isystem=/search/odin/wangjiawen/k2/build/_deps/googletest-src/googletest --expt-extended-lambda -gencode arch=compute_30,code=sm_30 --expt-extended-lambda -gencode arch=compute_32,code=sm_32 --expt-extended-lambda -gencode arch=compute_35,code=sm_35 --expt-extended-lambda -gencode arch=compute_50,code=sm_50 --expt-extended-lambda -gencode arch=compute_52,code=sm_52 --expt-extended-lambda -gencode arch=compute_53,code=sm_53 --expt-extended-lambda -gencode arch=compute_60,code=sm_60 --expt-extended-lambda -gencode arch=compute_61,code=sm_61 --expt-extended-lambda -gencode arch=compute_62,code=sm_62 --expt-extended-lambda -gencode arch=compute_70,code=sm_70 --expt-extended-lambda -gencode arch=compute_72,code=sm_72 -g -std=c++14 -x cu -c /search/odin/wangjiawen/k2/k2/csrc/cuda/ops_test.cu -o CMakeFiles/ops_test.dir/ops_test.cu.o
/search/odin/wangjiawen/k2/k2/csrc/cuda/ops.h(79): error: class "std::shared_ptr<k2::Context>" has no member "IsCompatible"
detected during instantiation of "void k2::GpuTransposeTest<T>(int32_t, int32_t, int32_t, __nv_bool) [with T=int32_t]"
/search/odin/wangjiawen/k2/k2/csrc/cuda/ops_test.cu(80): here

/search/odin/wangjiawen/k2/k2/csrc/cuda/ops.h(80): error: class "std::shared_ptr<k2::Context>" has no member "IsCompatible"
detected during instantiation of "void k2::GpuTransposeTest<T>(int32_t, int32_t, int32_t, __nv_bool) [with T=int32_t]"
/search/odin/wangjiawen/k2/k2/csrc/cuda/ops_test.cu(80): here

`

which cause by:
template <typename T> void Transpose(ContextPtr &c, const Array2<T> &src, Array2<T> *dest) { assert(c.IsCompatible(src.Context())); assert(c.IsCompatible(dest->Context())); //...
the c is get by std::make_shared
as i known, this syntax is supported by c++11 and above
and i passed -std=c++14 to nvcc, so, its weird..

@danpovey
Copy link
Collaborator

danpovey commented Aug 28, 2020 via email

@danpovey
Copy link
Collaborator

danpovey commented Aug 28, 2020 via email

Jarvan-Wang added a commit to Jarvan-Wang/k2 that referenced this issue Aug 28, 2020
* Fix syntax error of ops_test.cu

* Add a const version of k2::Array1::Context to fix quantifier error of array.h
@qindazhu
Copy link
Collaborator

It's weird that the code can be compiled successfully on my machine (gcc (GCC) 4.8.5 and nvcc release 10.0)..
@danpovey maybe we should update gcc version on Xiaomi cluster.

@danpovey
Copy link
Collaborator

danpovey commented Aug 28, 2020 via email

@qindazhu
Copy link
Collaborator

No, it has been instantiated in ops_test.cu..that's really strange. The current code in cuda_draft can be compiler and run successfully on Xiaomi cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants