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

Undefined variables in Debug build #36

Closed
jappa opened this issue Jul 17, 2018 · 4 comments
Closed

Undefined variables in Debug build #36

jappa opened this issue Jul 17, 2018 · 4 comments

Comments

@jappa
Copy link

jappa commented Jul 17, 2018

base/include/amgx_timer.h uses undefined variables (t1 and t2) in code that is activated during a Debug build.

m_time = std::max( 0ull, (duration_cast<nanoseconds>(t2 - t1)).count());

@marsaev
Copy link
Collaborator

marsaev commented Jul 26, 2018

What compiler do you use?

@jegerjensen
Copy link

I get this error too, with Visual Studio 2015. The C-compiler has this version string:

C:\Program Files (x86)\IntelSWTools>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

Here is the output from the compilation in Visual Studio:

1>  "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2/bin/nvcc.exe" D:/oyvindj/gits/AMGX/base/src/amg.cu -c -o D:/oyvindj/gits/AMGX/build_92/base/CMakeFiles/amgx_base.dir/src/Debug/amgx_base_generated_amg.cu.obj -ccbin "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin" -m64 -Xcompiler ,\"/DWIN32\",\"/D_WINDOWS\",\"/DNOMINMAX\",\"/W3\",\"/GR\",\"/EHsc\",\"/bigobj\",\"-openmp\",\"-DRAPIDJSON_DEFINED\",\"/D_DEBUG\",\"/Zl\",\"/Zi\",\"/Ob0\",\"/Od\",\"/RTC1\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -g -G -DPROFILE -DAMGX_USE_CPU_PROFILER --Werror cross-execution-space-call -DNVCC -ID:/oyvindj/gits/AMGX/../../thrust -ID:/oyvindj/gits/AMGX/base/include "-IC:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2/include" -ID:/oyvindj/gits/AMGX/external/rapidjson/include
1>D:\oyvindj\gits\AMGX\base\include\amgx_timer.h(88): error : identifier "t2" is undefined
1>
1>D:\oyvindj\gits\AMGX\base\include\amgx_timer.h(88): error : identifier "t1" is undefined
1>
1>D:\oyvindj\gits\AMGX\base\include\amgx_timer.h(127): error : no suitable user-defined conversion from "amgx::Times" to "std::vector<double, std::allocator<double>>" exists

An easy workaround is to undefine PROFILE and AMGX_USE_CPU_PROFILER.

cponder added a commit to cponder/AMGX that referenced this issue Dec 12, 2018
The DEBUG version couldn't be built due to problems with the PROFILE setting, reported in
NVIDIA#36
The profiling-build still has to be fixed. You can decide after that, whether profiling should be part of the debug configuration.
@cponder
Copy link
Contributor

cponder commented Dec 12, 2018

A fix for the debug-build is to remove the PROFILE options from the DEBUG build, see this pull-request:
#42
Arguably we didn't want the profiling there to begin with.
But, once the profiling support gets fixed, we could consider re-enabling it in the debug build.

@marsaev
Copy link
Collaborator

marsaev commented Dec 13, 2018

Hi Carl,

Sounds good. We will revisit profiling/ranging/debugging options at some point. Merged to unblock debug mode as of right now.

Thanks!

@marsaev marsaev closed this as completed May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants