diff --git a/projects/hip/CMakeLists.txt b/projects/hip/CMakeLists.txt index e405d06ed6..baf3b49df1 100644 --- a/projects/hip/CMakeLists.txt +++ b/projects/hip/CMakeLists.txt @@ -361,6 +361,12 @@ if(POLICY CMP0037) cmake_policy(POP) endif() +############################# +# Code analysis +############################# +# Target: static_check +add_custom_target(static_check COMMAND cppcheck --force --quiet --enable=warning,performance,portability,information,missingInclude src include -I /opt/rocm/include/hcc -I /opt/rocm/include --suppress=*:/opt/rocm/include/hcc/hc.hpp WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + ############################# # Testing steps ############################# @@ -388,5 +394,4 @@ else() message(STATUS "Testing targets will not be available. To enable them please ensure that the HIP installation directory is writeable. Use -DCMAKE_INSTALL_PREFIX to specify a suitable location") endif() - # vim: ts=4:sw=4:expandtab:smartindent diff --git a/projects/hip/src/hip_fp16.cpp b/projects/hip/src/hip_fp16.cpp index 8e8f003f56..2d16a3717e 100644 --- a/projects/hip/src/hip_fp16.cpp +++ b/projects/hip/src/hip_fp16.cpp @@ -448,7 +448,7 @@ __device__ __half2 __lowhigh2highlow(const __half2 a) { __device__ __half2 __lows2half2(const __half2 a, const __half2 b) { __half2 c; - c.y = a.x; + c.x = a.x; c.y = b.x; return c; } diff --git a/projects/hip/src/macro_based_grid_launch.inl b/projects/hip/src/macro_based_grid_launch.inl index 5547d3a71a..1e36903c56 100644 --- a/projects/hip/src/macro_based_grid_launch.inl +++ b/projects/hip/src/macro_based_grid_launch.inl @@ -89,9 +89,8 @@ namespace hip_impl stream->lockclose_postKernelCommand(kernel_name, acc_v); delete static_cast(locked_stream); - locked_stream = nullptr; if(HIP_PROFILE_API) { MARKER_END(); } } -} \ No newline at end of file +}