Skip to content

Address jitify2 warnings under Visual Studio 2022#132

Merged
maddyscientist merged 1 commit into
NVIDIA:jitify2from
Robadob:jitify2-windows-werror
Feb 8, 2024
Merged

Address jitify2 warnings under Visual Studio 2022#132
maddyscientist merged 1 commit into
NVIDIA:jitify2from
Robadob:jitify2-windows-werror

Conversation

@Robadob

@Robadob Robadob commented Nov 17, 2023

Copy link
Copy Markdown
Contributor

The 3 warnings addressed are shown below.

1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\algorithm(3456): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
1>C:\Users\Robert\fgpu2\fgpu2\build\_deps\jitify-src\jitify/jitify2.hpp(2093): note: see reference to function template instantiation '_OutIt std::transform<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,jitify2::detail::is_true_value::<lambda_1c4b3a884b5a8315db7fcb8afefb2bc5>>(const _InIt,const _InIt,_OutIt,_Fn)' being compiled
1>        with
1>        [
1>            _OutIt=std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,
1>            _Elem=char,
1>            _InIt=std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,
1>            _Fn=jitify2::detail::is_true_value::<lambda_1c4b3a884b5a8315db7fcb8afefb2bc5>
1>        ]
1>C:\Users\Robert\fgpu2\fgpu2\build\_deps\jitify-src\jitify\jitify2.hpp(2973): warning C4701: potentially uninitialized local variable 'cc_major' used
1>C:\Users\Robert\fgpu2\fgpu2\build\_deps\jitify-src\jitify\jitify2.hpp(2973): warning C4701: potentially uninitialized local variable 'cc_minor' used

Haven't managed to resolve all issues on our CI yet, so may have further changes.

CUDA 11.0 x Visual Studio 2019 is unhappy with something related to the implementation of SafeFunction, but its a nasty template err related to std::function.

     1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\functional(822): error #304: no instance of function template "std::_Invoker_ret<_Rx, false>::_Call [with _Rx=CUresult]" matches the argument list [D:\a\FLAMEGPU2\FLAMEGPU2\build\FLAMEGPU\flamegpu.vcxproj]
                     argument types are: (std::decay_t<std::remove_reference_t<jitify2::detail::function_type<CUresult, int *> *&>>, int *)
                   detected during:
                     instantiation of "_Rx std::_Func_impl_no_alloc<_Callable, _Rx, _Types...>::_Do_call(_Types &&...) [with _Callable=std::decay_t<std::remove_reference_t<jitify2::detail::function_type<CUresult, int *> *&>>, _Rx=CUresult, _Types=<int *>]" 
         (798): here
                     instantiation of "std::_Func_impl_no_alloc<_Callable, _Rx, _Types...>::_Func_impl_no_alloc(_Other &&) [with _Callable=std::decay_t<std::remove_reference_t<jitify2::detail::function_type<CUresult, int *> *&>>, _Rx=CUresult, _Types=<int *>, _Other=std::remove_reference_t<jitify2::detail::function_type<CUresult, int *> *&>, <unnamed>=0]" 
         (916): here
                     instantiation of "void std::_Func_class<_Ret, _Types...>::_Reset(_Fx &&) [with _Ret=CUresult, _Types=<int *>, _Fx=std::remove_reference_t<jitify2::detail::function_type<CUresult, int *> *&>]" 
         (1042): here
                     instantiation of "std::function<_Fty>::function(_Fx) [with _Fty=CUresult (int *), _Fx=jitify2::detail::function_type<CUresult, int *> *, <unnamed>=int]" 
         D:\a\FLAMEGPU2\FLAMEGPU2\build\_deps\jitify-src\jitify/jitify2.hpp(1194): here
                     instantiation of "jitify2::detail::SafeFunction<ResultType, Args...> jitify2::detail::DynamicLibrary::function<ResultType,Args...>(const char *) const [with ResultType=CUresult, Args=<int *>]" 
         D:\a\FLAMEGPU2\FLAMEGPU2\build\_deps\jitify-src\jitify/jitify2.hpp(1240): here
(Resolved)

manylinux2014 is unhappy with the use of F_OFD_SETLKW.

Error: /__w/FLAMEGPU2/FLAMEGPU2/build/_deps/jitify-src/jitify/jitify2.hpp(6344): error: identifier "F_OFD_SETLKW" is undefined

In both of these cases, I'm assuming compiler/stdlib age is the issue. I'm told we still require support for manylinux2014 as several HPC systems are still running centos7, however we may be able to address that issue by switching to the less safe F_OFD flag under centos7.

@maddyscientist maddyscientist left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution (and sorry for the slow review)

@maddyscientist maddyscientist merged commit 0db41ba into NVIDIA:jitify2 Feb 8, 2024
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

Successfully merging this pull request may close these issues.

2 participants