-
Notifications
You must be signed in to change notification settings - Fork 13
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
compile error #9
Comments
Hi, This looks like a very specific compiler issue, can you tell me the version of the C++ compiler and you are using? It looks a bit like a compiler macro processing issue like this. Does it compile if you omit -DDOUBLE_UNSUPPORTED=1? Cheers, Paul |
I tried compiling with both devtoolset-7 and -9, with and without the |
Hi, can you try again with a new pull? I just committed a version where 0.0 is now explicitly listed as 0.0f with a double conversion in dba.hpp. This may fix whatever compiler weirdness is causing 0.0 to be interpreted as a const char * as revealed in the error messages you list. It won't necessarily fix the functional_hash.h issues, but it's a start. |
Thanks for looking into this. nvcc -DDEBUG=0 -DDOUBLE_UNSUPPORTED=1 -DHDF5_SUPPORTED=0 --expt-relaxed-constexpr -rdc=true -maxrregcount 26 --std=c++14 -c openDBA.cu -o openDBA.o
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/functional_hash.h: In member function ‘std::size_t std::hash<float>::operator()(float) const’:
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/functional_hash.h:237:22: error: expected ‘)’ before numeric constant
237 | return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0;
| ~ ^~~
| )
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/functional_hash.h:237:15: error: invalid operands of types ‘float’ and ‘double(const char*) throw ()’ {aka ‘double(const char*)’} to binary ‘operator!=’
237 | return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0;
| ~~~~~ ^~ ~~~~~~~
| | |
| float double(const char*) throw () {aka double(const char*)}
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/functional_hash.h:237:64: error: expected ‘)’ before ‘;’ token
237 | return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0;
| ~ ^
| )
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/functional_hash.h: In member function ‘std::size_t std::hash<double>::operator()(double) const’:
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/functional_hash.h:249:22: error: expected ‘)’ before numeric constant
249 | return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0;
| ~ ^~
| )
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/functional_hash.h:249:15: error: invalid operands of types ‘double’ and ‘double(const char*) throw ()’ {aka ‘double(const char*)’} to binary ‘operator!=’
249 | return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0;
| ~~~~~ ^~ ~~~~~~
| | |
| double double(const char*) throw () {aka double(const char*)}
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/functional_hash.h:249:63: error: expected ‘)’ before ‘;’ token
249 | return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0;
| ~ ^
| )
/opt/rh/devtoolset-9/root/usr/include/c++/9/limits: In static member function ‘static constexpr long double std::numeric_limits<long double>::denorm_min()’:
/opt/rh/devtoolset-9/root/usr/include/c++/9/limits:1865:65: error: expected ‘)’ before numeric constant
1865 | denorm_min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_DENORM_MIN__; }
| ~ ^~~
| )
/opt/rh/devtoolset-9/root/usr/include/c++/9/limits:1865:62: error: cannot convert ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to ‘long double’ in return
1865 | denorm_min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_DENORM_MIN__; }
| ^~~
| |
| double (*)(const char*) throw () {aka double (*)(const char*)}
dba.hpp: In function ‘double DBAUpdate(T*, size_t, T*, size_t, size_t, size_t*, size_t*, int, int, T*, cudaStream_t)’:
dba.hpp:514:33: error: expected ‘)’ before numeric constant
514 | double max_delta = (double) 0.0f;
| ~ ^~
| )
dba.hpp:514:38: error: expected ‘)’ before ‘;’ token
514 | double max_delta = (double) 0.0f;
| ~ ^
| )
dba.hpp: In function ‘void performDBA(T**, int, size_t*, char**, int, int, char*, T**, size_t*, int, cudaStream_t)’:
dba.hpp:614:33: error: expected ‘)’ before numeric constant
614 | double medoidAvg = (double) 0.0f;
| ~ ^~~
| )
dba.hpp:614:38: error: expected ‘)’ before ‘;’ token
614 | double medoidAvg = (double) 0.0f;
| ~ ^
| )
dba.hpp:615:36: error: expected ‘)’ before numeric constant
615 | double medoidStdDev = (double) 0.0f;
| ~ ^~~
| )
dba.hpp:615:41: error: expected ‘)’ before ‘;’ token
615 | double medoidStdDev = (double) 0.0f;
| ~ ^
| )
dba.hpp: In instantiation of ‘void performDBA(T**, int, size_t*, char**, int, int, char*, T**, size_t*, int, cudaStream_t) [with T = int; size_t = long unsigned int; cudaStream_t = CUstream_st*]’:
openDBA.cuh:93:16: required from ‘void setupAndRun(char*, char**, int, char*, int, int, int, int, int) [with T = int]’
openDBA.cu:89:159: required from here
dba.hpp:614:21: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
614 | double medoidAvg = (double) 0.0f;
| ~^~~~~~~~~~~~~~~
dba.hpp:615:24: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
615 | double medoidStdDev = (double) 0.0f;
| ~^~~~~~~~~~~~~~~
dba.hpp: In instantiation of ‘void performDBA(T**, int, size_t*, char**, int, int, char*, T**, size_t*, int, cudaStream_t) [with T = unsigned int; size_t = long unsigned int; cudaStream_t = CUstream_st*]’:
openDBA.cuh:93:16: required from ‘void setupAndRun(char*, char**, int, char*, int, int, int, int, int) [with T = unsigned int]’
openDBA.cu:92:164: required from here
dba.hpp:614:21: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
614 | double medoidAvg = (double) 0.0f;
| ~^~~~~~~~~~~~~~~
dba.hpp:615:24: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
615 | double medoidStdDev = (double) 0.0f;
| ~^~~~~~~~~~~~~~~
dba.hpp: In instantiation of ‘void performDBA(T**, int, size_t*, char**, int, int, char*, T**, size_t*, int, cudaStream_t) [with T = long long unsigned int; size_t = long unsigned int; cudaStream_t = CUstream_st*]’:
openDBA.cuh:93:16: required from ‘void setupAndRun(char*, char**, int, char*, int, int, int, int, int) [with T = long long unsigned int]’
openDBA.cu:95:174: required from here
dba.hpp:614:21: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
614 | double medoidAvg = (double) 0.0f;
| ~^~~~~~~~~~~~~~~
dba.hpp:615:24: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
615 | double medoidStdDev = (double) 0.0f;
| ~^~~~~~~~~~~~~~~
dba.hpp: In instantiation of ‘void performDBA(T**, int, size_t*, char**, int, int, char*, T**, size_t*, int, cudaStream_t) [with T = float; size_t = long unsigned int; cudaStream_t = CUstream_st*]’:
openDBA.cuh:93:16: required from ‘void setupAndRun(char*, char**, int, char*, int, int, int, int, int) [with T = float]’
openDBA.cu:98:161: required from here
dba.hpp:614:21: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
614 | double medoidAvg = (double) 0.0f;
| ~^~~~~~~~~~~~~~~
dba.hpp:615:24: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
615 | double medoidStdDev = (double) 0.0f;
| ~^~~~~~~~~~~~~~~
dba.hpp: In instantiation of ‘double DBAUpdate(T*, size_t, T*, size_t, size_t, size_t*, size_t*, int, int, T*, cudaStream_t) [with T = int; size_t = long unsigned int; cudaStream_t = CUstream_st*]’:
dba.hpp:604:25: required from ‘void performDBA(T**, int, size_t*, char**, int, int, char*, T**, size_t*, int, cudaStream_t) [with T = int; size_t = long unsigned int; cudaStream_t = CUstream_st*]’
openDBA.cuh:93:16: required from ‘void setupAndRun(char*, char**, int, char*, int, int, int, int, int) [with T = int]’
openDBA.cu:89:159: required from here
dba.hpp:514:21: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
514 | double max_delta = (double) 0.0f;
| ~^~~~~~~~~~~~~~
dba.hpp: In instantiation of ‘double DBAUpdate(T*, size_t, T*, size_t, size_t, size_t*, size_t*, int, int, T*, cudaStream_t) [with T = unsigned int; size_t = long unsigned int; cudaStream_t = CUstream_st*]’:
dba.hpp:604:25: required from ‘void performDBA(T**, int, size_t*, char**, int, int, char*, T**, size_t*, int, cudaStream_t) [with T = unsigned int; size_t = long unsigned int; cudaStream_t = CUstream_st*]’
openDBA.cuh:93:16: required from ‘void setupAndRun(char*, char**, int, char*, int, int, int, int, int) [with T = unsigned int]’
openDBA.cu:92:164: required from here
dba.hpp:514:21: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
dba.hpp: In instantiation of ‘double DBAUpdate(T*, size_t, T*, size_t, size_t, size_t*, size_t*, int, int, T*, cudaStream_t) [with T = long long unsigned int; size_t = long unsigned int; cudaStream_t = CUstream_st*]’:
dba.hpp:604:25: required from ‘void performDBA(T**, int, size_t*, char**, int, int, char*, T**, size_t*, int, cudaStream_t) [with T = long long unsigned int; size_t = long unsigned int; cudaStream_t = CUstream_st*]’
openDBA.cuh:93:16: required from ‘void setupAndRun(char*, char**, int, char*, int, int, int, int, int) [with T = long long unsigned int]’
openDBA.cu:95:174: required from here
dba.hpp:514:21: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
dba.hpp: In instantiation of ‘double DBAUpdate(T*, size_t, T*, size_t, size_t, size_t*, size_t*, int, int, T*, cudaStream_t) [with T = float; size_t = long unsigned int; cudaStream_t = CUstream_st*]’:
dba.hpp:604:25: required from ‘void performDBA(T**, int, size_t*, char**, int, int, char*, T**, size_t*, int, cudaStream_t) [with T = float; size_t = long unsigned int; cudaStream_t = CUstream_st*]’
openDBA.cuh:93:16: required from ‘void setupAndRun(char*, char**, int, char*, int, int, int, int, int) [with T = float]’
openDBA.cu:98:161: required from here
dba.hpp:514:21: error: invalid cast from type ‘double (*)(const char*) throw ()’ {aka ‘double (*)(const char*)’} to type ‘double’
make: *** [Makefile:36: openDBA.o] Error 1
|
After some googling, I think the error is due to a bug in
I will try this patch and let you know! |
Indeed, the problem was due to the bug in |
Hi!
Thanks for the releasing the repo.
When installing from the source I encountered the following error:
I am using CUDA11.0 and CentOS 7.
Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: